Revision df71b2ad6e2a40403115b75d28b8bd2f39123c59 authored by Dmitry Yu. Naumov on 29 March 2021, 12:21:04 UTC, committed by Dmitry Yu. Naumov on 29 March 2021, 12:21:04 UTC
Allows HM process to use Gas or AqueousLiquid for fluid phase. See merge request ogs/ogs!3542
TestDividedByPlane.cpp
/**
* \file
* \author Karsten Rink
* \date 2014-02-26
*
* \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/GeometricBasics.h"
#include "MathLib/Point3d.h"
TEST(MathLib, TestDividedByPlane)
{
// xy plane
MathLib::Point3d a(std::array<double,3>{{0, 0, 0}});
MathLib::Point3d b(std::array<double,3>{{1, 0, 0}});
MathLib::Point3d c(std::array<double,3>{{0, 1, 0}});
MathLib::Point3d d(std::array<double,3>{{1, 1, 0}});
bool result = MathLib::dividedByPlane(a, d, b, c);
ASSERT_TRUE(result);
result = MathLib::dividedByPlane(b, c, a, d);
ASSERT_TRUE(result);
d = MathLib::Point3d(std::array<double,3>{{0.1, 0.1, 0}});
result = MathLib::dividedByPlane(b, c, a, d);
ASSERT_FALSE(result);
// xz plane
c = MathLib::Point3d(std::array<double,3>{{0, 0, 1}});
d = MathLib::Point3d(std::array<double,3>{{1, 0, 1}});
result = MathLib::dividedByPlane(a, d, b, c);
ASSERT_TRUE(result);
// yz plane
b = MathLib::Point3d(std::array<double,3>{{0, 1, 0}});
d = MathLib::Point3d(std::array<double,3>{{0, 1, 1}});
result = MathLib::dividedByPlane(a, d, b, c);
ASSERT_TRUE(result);
}
Computing file changes ...