preCICE v3.1.2
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
RadialBasisFctMappingTest.cpp File Reference
#include <Eigen/Core>
#include <algorithm>
#include <memory>
#include <ostream>
#include <string>
#include <utility>
#include <vector>
#include "logging/Logger.hpp"
#include "mapping/Mapping.hpp"
#include "mapping/RadialBasisFctMapping.hpp"
#include "mapping/RadialBasisFctSolver.hpp"
#include "mapping/config/MappingConfiguration.hpp"
#include "mapping/impl/BasisFunctions.hpp"
#include "mapping/tests/RadialBasisFctHelper.hpp"
#include "mesh/Data.hpp"
#include "mesh/Mesh.hpp"
#include "mesh/SharedPointer.hpp"
#include "mesh/Utils.hpp"
#include "mesh/Vertex.hpp"
#include "testing/TestContext.hpp"
#include "testing/Testing.hpp"
Include dependency graph for RadialBasisFctMappingTest.cpp:

Go to the source code of this file.

Classes

struct  VertexSpecification
 Holds rank, owner, position and value of a single vertex. More...
 
struct  MeshSpecification
 

Macros

#define doLocalCode(Type, function, polynomial)
 

Typedefs

using ReferenceSpecification = std::vector<std::pair<int, std::vector<double>>>
 Contains which values are expected on which rank: rank -> vector of data.
 

Functions

mesh::PtrMesh getDistributedMesh (const TestContext &context, MeshSpecification &meshSpec, int globalIndexOffset=0, bool meshIsSmaller=false)
 
Eigen::VectorXd getDistributedData (const TestContext &context, MeshSpecification const &meshSpec)
 
void testDistributed (const TestContext &context, Mapping &mapping, MeshSpecification inMeshSpec, MeshSpecification outMeshSpec, ReferenceSpecification referenceSpec, int inGlobalIndexOffset=0, bool meshIsSmaller=false)
 
 BOOST_AUTO_TEST_CASE (DistributedConsistent2DV1)
 Test with a homogeneous distribution of mesh among ranks.
 
 BOOST_AUTO_TEST_CASE (DistributedConsistent2DV1Vector)
 
 BOOST_AUTO_TEST_CASE (DistributedConsistent2DV2)
 Using a more heterogeneous distributon of vertices and owner.
 
 BOOST_AUTO_TEST_CASE (DistributedConsistent2DV3)
 Test with a very heterogeneous distributed and non-continuous ownership.
 
 BOOST_AUTO_TEST_CASE (DistributedConsistent2DV3Vector)
 Test with a very heterogeneous distributed and non-continuous ownership.
 
 BOOST_AUTO_TEST_CASE (DistributedConsistent2DV4)
 Some ranks are empty, does not converge.
 
 BOOST_AUTO_TEST_CASE (DistributedConsistent2DV5)
 
 BOOST_AUTO_TEST_CASE (DistributedConsistent2DV6, *boost::unit_test::tolerance(1e-7))
 same as 2DV4, but strictly linear input values, converges and gives correct results
 
 BOOST_AUTO_TEST_CASE (DistributedConservative2DV1)
 Test with a homogeneous distribution of mesh among ranks.
 
 BOOST_AUTO_TEST_CASE (DistributedConservative2DV1Vector)
 Test with a homogeneous distribution of mesh among ranks.
 
 BOOST_AUTO_TEST_CASE (DistributedConservative2DV2)
 Using a more heterogeneous distribution of vertices and owner.
 
 BOOST_AUTO_TEST_CASE (DistributedConservative2DV3)
 Using meshes of different sizes, inMesh is smaller then outMesh.
 
 BOOST_AUTO_TEST_CASE (DistributedConservative2DV4, *boost::unit_test::tolerance(1e-6))
 Using meshes of different sizes, outMesh is smaller then inMesh.
 
 BOOST_AUTO_TEST_CASE (testDistributedConservative2DV5)
 Tests a non-contigous owner distributed at the outMesh.
 
 BOOST_AUTO_TEST_CASE (testDistributedConservative2DV5Vector)
 Tests a non-contigous owner distributed at the outMesh.
 
void testTagging (const TestContext &context, MeshSpecification inMeshSpec, MeshSpecification outMeshSpec, MeshSpecification shouldTagFirstRound, MeshSpecification shouldTagSecondRound, bool consistent)
 
 BOOST_AUTO_TEST_CASE (testTagFirstRound)
 
 BOOST_AUTO_TEST_CASE (MapThinPlateSplines)
 
 BOOST_AUTO_TEST_CASE (MapMultiquadrics)
 
 BOOST_AUTO_TEST_CASE (MapInverseMultiquadrics)
 
 BOOST_AUTO_TEST_CASE (MapVolumeSplines)
 
 BOOST_AUTO_TEST_CASE (MapGaussian)
 
 BOOST_AUTO_TEST_CASE (MapCompactThinPlateSplinesC2)
 
 BOOST_AUTO_TEST_CASE (MapCompactPolynomialC0)
 
 BOOST_AUTO_TEST_CASE (MapCompactPolynomialC2)
 
 BOOST_AUTO_TEST_CASE (MapCompactPolynomialC4)
 
 BOOST_AUTO_TEST_CASE (MapCompactPolynomialC6)
 
 BOOST_AUTO_TEST_CASE (MapCompactPolynomialC8)
 
void testDeadAxis2d (Polynomial polynomial, Mapping::Constraint constraint)
 
void testDeadAxis3d (Polynomial polynomial, Mapping::Constraint constraint)
 
 BOOST_AUTO_TEST_CASE (DeadAxis2Consistent)
 
 BOOST_AUTO_TEST_CASE (DeadAxis3DConsistent)
 
 BOOST_AUTO_TEST_CASE (DeadAxis2Conservative)
 
 BOOST_AUTO_TEST_CASE (DeadAxis3DConervative)
 

Variables

constexpr int meshDims2D {2}
 

Macro Definition Documentation

◆ doLocalCode

#define doLocalCode ( Type,
function,
polynomial )
Value:
{ \
RadialBasisFctMapping<RadialBasisFctSolver<Type>> consistentMap2D(Mapping::CONSISTENT, 2, function, {{false, false, false}}, polynomial); \
perform2DTestConsistentMapping(consistentMap2D); \
RadialBasisFctMapping<RadialBasisFctSolver<Type>> consistentMap2DVector(Mapping::CONSISTENT, 2, function, {{false, false, false}}, polynomial); \
perform2DTestConsistentMappingVector(consistentMap2DVector); \
RadialBasisFctMapping<RadialBasisFctSolver<Type>> consistentMap3D(Mapping::CONSISTENT, 3, function, {{false, false, false}}, polynomial); \
perform3DTestConsistentMapping(consistentMap3D); \
RadialBasisFctMapping<RadialBasisFctSolver<Type>> scaledConsistentMap2D(Mapping::SCALED_CONSISTENT_SURFACE, 2, function, {{false, false, false}}, polynomial); \
perform2DTestScaledConsistentMapping(scaledConsistentMap2D); \
RadialBasisFctMapping<RadialBasisFctSolver<Type>> scaledConsistentMap3D(Mapping::SCALED_CONSISTENT_SURFACE, 3, function, {{false, false, false}}, polynomial); \
perform3DTestScaledConsistentMapping(scaledConsistentMap3D); \
RadialBasisFctMapping<RadialBasisFctSolver<Type>> conservativeMap2D(Mapping::CONSERVATIVE, 2, function, {{false, false, false}}, polynomial); \
perform2DTestConservativeMapping(conservativeMap2D); \
RadialBasisFctMapping<RadialBasisFctSolver<Type>> conservativeMap2DVector(Mapping::CONSERVATIVE, 2, function, {{false, false, false}}, polynomial); \
perform2DTestConservativeMappingVector(conservativeMap2DVector); \
RadialBasisFctMapping<RadialBasisFctSolver<Type>> conservativeMap3D(Mapping::CONSERVATIVE, 3, function, {{false, false, false}}, polynomial); \
perform3DTestConservativeMapping(conservativeMap3D); \
}
Mapping with radial basis functions.

Definition at line 1285 of file RadialBasisFctMappingTest.cpp.

Typedef Documentation

◆ ReferenceSpecification

Contains which values are expected on which rank: rank -> vector of data.

Definition at line 65 of file RadialBasisFctMappingTest.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/31]

BOOST_AUTO_TEST_CASE ( DeadAxis2Conservative )

Definition at line 1544 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/31]

BOOST_AUTO_TEST_CASE ( DeadAxis2Consistent )

Definition at line 1528 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [3/31]

BOOST_AUTO_TEST_CASE ( DeadAxis3DConervative )

Definition at line 1552 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [4/31]

BOOST_AUTO_TEST_CASE ( DeadAxis3DConsistent )

Definition at line 1536 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [5/31]

BOOST_AUTO_TEST_CASE ( DistributedConservative2DV1 )

Test with a homogeneous distribution of mesh among ranks.

Definition at line 658 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [6/31]

BOOST_AUTO_TEST_CASE ( DistributedConservative2DV1Vector )

Test with a homogeneous distribution of mesh among ranks.

Definition at line 733 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [7/31]

BOOST_AUTO_TEST_CASE ( DistributedConservative2DV2 )

Using a more heterogeneous distribution of vertices and owner.

Definition at line 806 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [8/31]

BOOST_AUTO_TEST_CASE ( DistributedConservative2DV3 )

Using meshes of different sizes, inMesh is smaller then outMesh.

Definition at line 883 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [9/31]

BOOST_AUTO_TEST_CASE ( DistributedConservative2DV4 ,
* boost::unit_test::tolerance1e-6 )

Using meshes of different sizes, outMesh is smaller then inMesh.

Definition at line 958 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [10/31]

BOOST_AUTO_TEST_CASE ( DistributedConsistent2DV1 )

Test with a homogeneous distribution of mesh among ranks.

Definition at line 158 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [11/31]

BOOST_AUTO_TEST_CASE ( DistributedConsistent2DV1Vector )

Definition at line 210 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [12/31]

BOOST_AUTO_TEST_CASE ( DistributedConsistent2DV2 )

Using a more heterogeneous distributon of vertices and owner.

Definition at line 261 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [13/31]

BOOST_AUTO_TEST_CASE ( DistributedConsistent2DV3 )

Test with a very heterogeneous distributed and non-continuous ownership.

Definition at line 312 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [14/31]

BOOST_AUTO_TEST_CASE ( DistributedConsistent2DV3Vector )

Test with a very heterogeneous distributed and non-continuous ownership.

Definition at line 380 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [15/31]

BOOST_AUTO_TEST_CASE ( DistributedConsistent2DV4 )

Some ranks are empty, does not converge.

Definition at line 448 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [16/31]

BOOST_AUTO_TEST_CASE ( DistributedConsistent2DV5 )

Definition at line 514 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [17/31]

BOOST_AUTO_TEST_CASE ( DistributedConsistent2DV6 ,
* boost::unit_test::tolerance1e-7 )

same as 2DV4, but strictly linear input values, converges and gives correct results

Definition at line 592 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [18/31]

BOOST_AUTO_TEST_CASE ( MapCompactPolynomialC0 )

Definition at line 1351 of file RadialBasisFctMappingTest.cpp.

◆ BOOST_AUTO_TEST_CASE() [19/31]

BOOST_AUTO_TEST_CASE ( MapCompactPolynomialC2 )

Definition at line 1359 of file RadialBasisFctMappingTest.cpp.

◆ BOOST_AUTO_TEST_CASE() [20/31]

BOOST_AUTO_TEST_CASE ( MapCompactPolynomialC4 )

Definition at line 1367 of file RadialBasisFctMappingTest.cpp.

◆ BOOST_AUTO_TEST_CASE() [21/31]

BOOST_AUTO_TEST_CASE ( MapCompactPolynomialC6 )

Definition at line 1375 of file RadialBasisFctMappingTest.cpp.

◆ BOOST_AUTO_TEST_CASE() [22/31]

BOOST_AUTO_TEST_CASE ( MapCompactPolynomialC8 )

Definition at line 1383 of file RadialBasisFctMappingTest.cpp.

◆ BOOST_AUTO_TEST_CASE() [23/31]

BOOST_AUTO_TEST_CASE ( MapCompactThinPlateSplinesC2 )

Definition at line 1343 of file RadialBasisFctMappingTest.cpp.

◆ BOOST_AUTO_TEST_CASE() [24/31]

BOOST_AUTO_TEST_CASE ( MapGaussian )

Definition at line 1336 of file RadialBasisFctMappingTest.cpp.

◆ BOOST_AUTO_TEST_CASE() [25/31]

BOOST_AUTO_TEST_CASE ( MapInverseMultiquadrics )

Definition at line 1321 of file RadialBasisFctMappingTest.cpp.

◆ BOOST_AUTO_TEST_CASE() [26/31]

BOOST_AUTO_TEST_CASE ( MapMultiquadrics )

Definition at line 1313 of file RadialBasisFctMappingTest.cpp.

◆ BOOST_AUTO_TEST_CASE() [27/31]

BOOST_AUTO_TEST_CASE ( MapThinPlateSplines )

Definition at line 1305 of file RadialBasisFctMappingTest.cpp.

◆ BOOST_AUTO_TEST_CASE() [28/31]

BOOST_AUTO_TEST_CASE ( MapVolumeSplines )

Definition at line 1328 of file RadialBasisFctMappingTest.cpp.

◆ BOOST_AUTO_TEST_CASE() [29/31]

BOOST_AUTO_TEST_CASE ( testDistributedConservative2DV5 )

Tests a non-contigous owner distributed at the outMesh.

Definition at line 1026 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [30/31]

BOOST_AUTO_TEST_CASE ( testDistributedConservative2DV5Vector )

Tests a non-contigous owner distributed at the outMesh.

Definition at line 1100 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [31/31]

BOOST_AUTO_TEST_CASE ( testTagFirstRound )

Definition at line 1231 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ getDistributedData()

Eigen::VectorXd getDistributedData ( const TestContext & context,
MeshSpecification const & meshSpec )

Definition at line 99 of file RadialBasisFctMappingTest.cpp.

◆ getDistributedMesh()

mesh::PtrMesh getDistributedMesh ( const TestContext & context,
MeshSpecification & meshSpec,
int globalIndexOffset = 0,
bool meshIsSmaller = false )

Definition at line 67 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ testDeadAxis2d()

void testDeadAxis2d ( Polynomial polynomial,
Mapping::Constraint constraint )

Definition at line 1392 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ testDeadAxis3d()

void testDeadAxis3d ( Polynomial polynomial,
Mapping::Constraint constraint )

Definition at line 1454 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ testDistributed()

void testDistributed ( const TestContext & context,
Mapping & mapping,
MeshSpecification inMeshSpec,
MeshSpecification outMeshSpec,
ReferenceSpecification referenceSpec,
int inGlobalIndexOffset = 0,
bool meshIsSmaller = false )

Definition at line 119 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

◆ testTagging()

void testTagging ( const TestContext & context,
MeshSpecification inMeshSpec,
MeshSpecification outMeshSpec,
MeshSpecification shouldTagFirstRound,
MeshSpecification shouldTagSecondRound,
bool consistent )

Definition at line 1173 of file RadialBasisFctMappingTest.cpp.

Here is the call graph for this function:

Variable Documentation

◆ meshDims2D

constexpr int meshDims2D {2}
constexpr

Definition at line 155 of file RadialBasisFctMappingTest.cpp.