preCICE
Loading...
Searching...
No Matches
PartitionOfUnityMappingTest.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/PartitionOfUnityMapping.hpp"
#include "mapping/impl/BasisFunctions.hpp"
#include "mapping/impl/MappingDataCache.hpp"
#include "mesh/Data.hpp"
#include "mesh/Mesh.hpp"
#include "mesh/SharedPointer.hpp"
#include "mesh/Utils.hpp"
#include "mesh/Vertex.hpp"
#include "mesh/config/MeshConfiguration.hpp"
#include "testing/TestContext.hpp"
#include "testing/Testing.hpp"
Include dependency graph for PartitionOfUnityMappingTest.cpp:

Go to the source code of this file.

Classes

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

Macros

#define PERFORM_REFERENCE_TEST(EXECUTOR, type, function, dim)
#define TEST_CPU_REFERENCE_FOR_SPD_RBFS(EXECUTOR)
#define TEST_EXECUTOR_UNIT(EXECUTOR)

Typedefs

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

Functions

void addGlobalIndex (mesh::PtrMesh &mesh, int offset=0)
double sumComponentWise (const Eigen::VectorXd &vec, int component, int dataDimension)
void perform2DTestConsistentMapping (Mapping &mapping)
void perform2DTestConsistentMappingVector (Mapping &mapping)
void performTestConsistentMapDeadAxis (Mapping &mapping, int dim)
void perform2DTestConservativeMapping (Mapping &mapping)
void perform2DTestConservativeMappingVector (Mapping &mapping)
void perform3DTestConsistentMapping (Mapping &mapping)
void perform3DTestJustInTimeMappingWithPolynomial (Mapping &mapping)
void perform2DTestJustInTimeMappingNoPolynomial (Mapping &mapping)
void perform3DTestConsistentMappingVector (Mapping &mapping)
void perform3DTestConservativeMapping (Mapping &mapping)
void perform3DTestJustInTimeMappingConservative (Mapping &mapping)
void perform2DTestJustInTimeMappingConservative (Mapping &mapping)
void perform3DTestConservativeMappingVector (Mapping &mapping)
void performReferenceTesting (Mapping &testMapping, Mapping &referenceMapping, int dim, int nComponents)
 BOOST_AUTO_TEST_CASE (PartitionOfUnityMappingTests)
 BOOST_AUTO_TEST_CASE (JustInTimeMapping)
 BOOST_AUTO_TEST_CASE (TestSingleClusterPartitionOfUnity)
void getDistributedMesh (const TestContext &context, MeshSpecification const &vertices, mesh::PtrMesh &mesh, mesh::PtrData &data, int globalIndexOffset=0, bool meshIsSmaller=false)
void testDistributed (const TestContext &context, Mapping &mapping, MeshSpecification inMeshSpec, MeshSpecification outMeshSpec, ReferenceSpecification referenceSpec, int inGlobalIndexOffset=0, bool meshIsSmaller=false)
 PRECICE_TEST_SETUP (""_on(4_ranks).setupIntraComm()) BOOST_AUTO_TEST_CASE(DistributedConsistent2D)
 PRECICE_TEST_SETUP (""_on(2_ranks).setupIntraComm()) BOOST_AUTO_TEST_CASE(DistributedConservative2DTwoRanks)
void testTagging (const TestContext &context, MeshSpecification inMeshSpec, MeshSpecification outMeshSpec, MeshSpecification shouldTagFirstRound, MeshSpecification shouldTagSecondRound, bool consistent)

Macro Definition Documentation

◆ PERFORM_REFERENCE_TEST

#define PERFORM_REFERENCE_TEST ( EXECUTOR,
type,
function,
dim )
Value:
{ \
gpm.executor = EXECUTOR; \
gpm.deviceId = 0; \
gpm.nThreads = 2; \
int scalar = 1; \
int vector = dim; \
mapping::PartitionOfUnityMapping<type> testOff(Mapping::CONSISTENT, dim, function, Polynomial::OFF, 25, 0.15, false, gpm, true); \
mapping::PartitionOfUnityMapping<type> testOn(Mapping::CONSISTENT, dim, function, Polynomial::OFF, 25, 0.15, false, gpm, false); \
mapping::PartitionOfUnityMapping<type> ref(Mapping::CONSISTENT, dim, function, Polynomial::OFF, 25, 0.15, false); \
performReferenceTesting(testOff, ref, dim, scalar); \
performReferenceTesting(testOn, ref, dim, scalar); \
performReferenceTesting(testOff, ref, dim, vector); \
performReferenceTesting(testOn, ref, dim, vector); \
mapping::PartitionOfUnityMapping<type> testPolyOff(Mapping::CONSISTENT, dim, function, Polynomial::SEPARATE, 25, 0.15, false, gpm, true); \
mapping::PartitionOfUnityMapping<type> testPolyOn(Mapping::CONSISTENT, dim, function, Polynomial::SEPARATE, 25, 0.15, false, gpm, false); \
mapping::PartitionOfUnityMapping<type> refPoly(Mapping::CONSISTENT, dim, function, Polynomial::SEPARATE, 25, 0.15, false); \
performReferenceTesting(testPolyOff, refPoly, dim, scalar); \
performReferenceTesting(testPolyOn, refPoly, dim, scalar); \
performReferenceTesting(testPolyOff, refPoly, dim, vector); \
performReferenceTesting(testPolyOn, refPoly, dim, vector); \
}
STL class.

Definition at line 2052 of file PartitionOfUnityMappingTest.cpp.

◆ TEST_CPU_REFERENCE_FOR_SPD_RBFS

#define TEST_CPU_REFERENCE_FOR_SPD_RBFS ( EXECUTOR)

Definition at line 2076 of file PartitionOfUnityMappingTest.cpp.

◆ TEST_EXECUTOR_UNIT

#define TEST_EXECUTOR_UNIT ( EXECUTOR)
Value:
PRECICE_TEST_SETUP(1_rank, Require::Ginkgo) \
BOOST_AUTO_TEST_CASE(UnitTests) \
{ \
PRECICE_TEST(); \
gpm.executor = EXECUTOR; \
gpm.deviceId = 0; \
mapping::PartitionOfUnityMapping<CompactPolynomialC0> consistentMap2D(Mapping::CONSISTENT, 2, function, Polynomial::SEPARATE, 5, 0.4, false, gpm); \
perform2DTestConsistentMapping(consistentMap2D); \
mapping::PartitionOfUnityMapping<CompactPolynomialC6> consistentMap2DDeadAxis(Mapping::CONSISTENT, 2, mapping::CompactPolynomialC6(6), Polynomial::SEPARATE, 5, 0.4, false, gpm); \
performTestConsistentMapDeadAxis(consistentMap2DDeadAxis, 2); \
}
#define PRECICE_TEST_SETUP(...)
Creates and attaches a TestSetup to a Boost test case.
Definition Testing.hpp:29
Wendland radial basis function with compact support.
Wendland radial basis function with compact support.

Definition at line 2135 of file PartitionOfUnityMappingTest.cpp.

Typedef Documentation

◆ MeshSpecification

using MeshSpecification = std::vector<VertexSpecification>

Definition at line 2218 of file PartitionOfUnityMappingTest.cpp.

◆ ReferenceSpecification

using ReferenceSpecification = std::vector<std::pair<int, std::vector<double>>>

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

Definition at line 2221 of file PartitionOfUnityMappingTest.cpp.

Function Documentation

◆ addGlobalIndex()

void addGlobalIndex ( mesh::PtrMesh & mesh,
int offset = 0 )

Definition at line 31 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [1/3]

BOOST_AUTO_TEST_CASE ( JustInTimeMapping )

Definition at line 1903 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/3]

BOOST_AUTO_TEST_CASE ( PartitionOfUnityMappingTests )

Definition at line 1876 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [3/3]

BOOST_AUTO_TEST_CASE ( TestSingleClusterPartitionOfUnity )

Definition at line 1927 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ getDistributedMesh()

void getDistributedMesh ( const TestContext & context,
MeshSpecification const & vertices,
mesh::PtrMesh & mesh,
mesh::PtrData & data,
int globalIndexOffset = 0,
bool meshIsSmaller = false )

Definition at line 2223 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ perform2DTestConservativeMapping()

void perform2DTestConservativeMapping ( Mapping & mapping)

Definition at line 381 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ perform2DTestConservativeMappingVector()

void perform2DTestConservativeMappingVector ( Mapping & mapping)

Definition at line 478 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ perform2DTestConsistentMapping()

void perform2DTestConsistentMapping ( Mapping & mapping)

Definition at line 50 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ perform2DTestConsistentMappingVector()

void perform2DTestConsistentMappingVector ( Mapping & mapping)

Definition at line 182 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ perform2DTestJustInTimeMappingConservative()

void perform2DTestJustInTimeMappingConservative ( Mapping & mapping)

Definition at line 1494 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ perform2DTestJustInTimeMappingNoPolynomial()

void perform2DTestJustInTimeMappingNoPolynomial ( Mapping & mapping)

Definition at line 939 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ perform3DTestConservativeMapping()

void perform3DTestConservativeMapping ( Mapping & mapping)

Definition at line 1198 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ perform3DTestConservativeMappingVector()

void perform3DTestConservativeMappingVector ( Mapping & mapping)

Definition at line 1640 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ perform3DTestConsistentMapping()

void perform3DTestConsistentMapping ( Mapping & mapping)

Definition at line 625 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ perform3DTestConsistentMappingVector()

void perform3DTestConsistentMappingVector ( Mapping & mapping)

Definition at line 1102 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ perform3DTestJustInTimeMappingConservative()

void perform3DTestJustInTimeMappingConservative ( Mapping & mapping)

Definition at line 1311 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ perform3DTestJustInTimeMappingWithPolynomial()

void perform3DTestJustInTimeMappingWithPolynomial ( Mapping & mapping)

Definition at line 772 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ performReferenceTesting()

void performReferenceTesting ( Mapping & testMapping,
Mapping & referenceMapping,
int dim,
int nComponents )

Definition at line 1779 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ performTestConsistentMapDeadAxis()

void performTestConsistentMapDeadAxis ( Mapping & mapping,
int dim )

Definition at line 319 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ PRECICE_TEST_SETUP() [1/2]

PRECICE_TEST_SETUP ( "" _on2_ranks).setupIntraComm()

Definition at line 2527 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ PRECICE_TEST_SETUP() [2/2]

PRECICE_TEST_SETUP ( "" _on4_ranks).setupIntraComm()

Definition at line 2309 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function:

◆ sumComponentWise()

double sumComponentWise ( const Eigen::VectorXd & vec,
int component,
int dataDimension )

Definition at line 38 of file PartitionOfUnityMappingTest.cpp.

◆ testDistributed()

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

Definition at line 2266 of file PartitionOfUnityMappingTest.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 2574 of file PartitionOfUnityMappingTest.cpp.

Here is the call graph for this function: