Revision 13672f6d45a9c0e149f6b5b41bfffecf007e3706 authored by Dmitry Yu. Naumov on 13 March 2021, 10:23:49 UTC, committed by Dmitry Yu. Naumov on 13 March 2021, 10:23:49 UTC
[CL] Update of solid/liquid ratio of the medium due to evolving parameters linked to reactions See merge request ogs/ogs!3490
TestWeightedPoint.cpp
/**
* \file
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*/
#include "gtest/gtest.h"
#include "MathLib/TemplateWeightedPoint.h"
TEST(MathLib, WeightedPoint1D)
{
std::array<double, 1> pnt;
pnt[0] = 0.5;
double w = 100.0;
MathLib::WeightedPoint1D wpnt_1d(pnt, w);
ASSERT_NEAR(pnt[0], wpnt_1d[0], std::numeric_limits<double>::epsilon());
ASSERT_NEAR(w, wpnt_1d.getWeight(), std::numeric_limits<double>::epsilon());
}
TEST(MathLib, WeightedPoint2D)
{
std::array<double, 2> pnt;
pnt[0] = 0.1;
pnt[1] = 0.2;
double w = 200.0;
MathLib::WeightedPoint2D wpnt_2d(pnt, w);
ASSERT_NEAR(pnt[0], wpnt_2d[0], std::numeric_limits<double>::epsilon());
ASSERT_NEAR(pnt[1], wpnt_2d[1], std::numeric_limits<double>::epsilon());
ASSERT_NEAR(w, wpnt_2d.getWeight(), std::numeric_limits<double>::epsilon());
}
TEST(MathLib, WeightedPoint3D)
{
std::array<double, 3> pnt;
pnt[0] = 0.1;
pnt[1] = 0.2;
pnt[2] = 0.3;
double w = 300.0;
MathLib::WeightedPoint3D wpnt_3d(pnt, w);
ASSERT_NEAR(pnt[0], wpnt_3d[0], std::numeric_limits<double>::epsilon());
ASSERT_NEAR(pnt[1], wpnt_3d[1], std::numeric_limits<double>::epsilon());
ASSERT_NEAR(pnt[2], wpnt_3d[2], std::numeric_limits<double>::epsilon());
ASSERT_NEAR(w, wpnt_3d.getWeight(), std::numeric_limits<double>::epsilon());
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...