preCICE v3.1.2
|
#include <SphericalVertexCluster.hpp>
Public Member Functions | |
SphericalVertexCluster (mesh::Vertex center, double radius, RADIAL_BASIS_FUNCTION_T function, Polynomial polynomial, mesh::PtrMesh inputMesh, mesh::PtrMesh outputMesh) | |
void | mapConservative (const time::Sample &inData, Eigen::VectorXd &outData) const |
Evaluates a conservative mapping and agglomerates the result in the given output data. | |
void | mapConsistent (const time::Sample &inData, Eigen::VectorXd &outData) const |
Evaluates a consistent mapping and agglomerates the result in the given output data. | |
void | setNormalizedWeight (double normalizedWeight, VertexID vertexID) |
Set the normalized weight for the given vertexID in the outputMesh. | |
double | computeWeight (const mesh::Vertex &v) const |
Compute the weight for a given vertex. | |
unsigned int | getNumberOfInputVertices () const |
Number of input vertices this partition operates on. | |
std::array< double, 3 > | getCenterCoords () const |
The center coordinate of this cluster. | |
void | clear () |
Invalidates and erases data structures the cluster holds. | |
bool | empty () const |
Private Attributes | |
precice::logging::Logger | _log {"mapping::SphericalVertexCluster"} |
logger, as usual | |
mesh::Vertex | _center |
center vertex of the cluster | |
const double | _radius |
radius of the vertex cluster | |
RadialBasisFctSolver< RADIAL_BASIS_FUNCTION_T > | _rbfSolver |
The RBF solver. | |
boost::container::flat_set< VertexID > | _inputIDs |
Global VertexIDs associated to the input mesh (see constructor) | |
boost::container::flat_set< VertexID > | _outputIDs |
Global VertexIDs associated to the output mesh (see constructor) | |
Eigen::VectorXd | _normalizedWeights |
Polynomial | _polynomial |
Polynomial treatment in the RBF solver. | |
CompactPolynomialC2 | _weightingFunction |
The weighting function. | |
bool | _hasComputedMapping = false |
Boolean switch in order to indicate that a mapping was computed. | |
The SphericalVertexCluster represents a single partition in the partition of unity mapping. Hence, the PartitionOfUnity mapping class owns a vector of SphericalVertexClusters in order to compute the mapping. In its core, the class consists of a geometric center vertex and a radius representing the spherical shape of the partition. In order to compute an RBF interpolant, the class stores VertexIDs of the input mesh and the output mesh lying within the sphere and a RadialBasisFctSolver to assemble and solve mapping matrices. The solver class here is exactly the same class used in the plain RBF mapping. Since each cluster maps data within its domain, the class is required to have similar functions as the mapping classes in preCICE, i.e., mapConsistent and mapConservative for the mapping execution as well as clear for the reset. These functions are always called from the corresponding PartitionOfUnity mapping class, i.e., PartitionOfUnityMapping::mapConsistent calls the mapConsistent function of the (all elements in the cluster vector) cluster here.
Definition at line 35 of file SphericalVertexCluster.hpp.
precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::SphericalVertexCluster | ( | mesh::Vertex | center, |
double | radius, | ||
RADIAL_BASIS_FUNCTION_T | function, | ||
Polynomial | polynomial, | ||
mesh::PtrMesh | inputMesh, | ||
mesh::PtrMesh | outputMesh ) |
The constructor uses the index RTree of the input mesh and output mesh in order to collect the vertexIDs of the input mesh and the output mesh lying within the spherical domain of the cluster. Note that the index trees of the meshes are constructed in case they are empty. If there are no input vertices or output verices in the given domain ( center
and radius
), the cluster is considered empty ( see also empty() ) and the constructor returns immediately. If the cluster is non-empty, an RBF solver is constructed. The RBF solver assembles the mapping matrices and computes the matrix decomposition directly.
[in] | center | Spatial center of the vertex cluster |
[in] | radius | Spatial radius of the cluster associated to the center |
[in] | function | Radial basis function type used in interpolation |
[in] | polynomial | The polynomial treatment in the RBF system. |
[in] | inputMesh | mesh where the interpolants are build on, i.e., the input mesh for consistent mappings and the output mesh for conservative mappings |
[in] | outputMesh | mesh where we evaluate the interpolants, i.e., the output mesh consistent mappings and the input mesh for conservative mappings |
Definition at line 128 of file SphericalVertexCluster.hpp.
void precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::clear | ( | ) |
Invalidates and erases data structures the cluster holds.
Definition at line 297 of file SphericalVertexCluster.hpp.
double precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::computeWeight | ( | const mesh::Vertex & | v | ) | const |
Compute the weight for a given vertex.
Definition at line 270 of file SphericalVertexCluster.hpp.
bool precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::empty | ( | ) | const |
Returns, whether the current cluster is empty or not, where empty means that there are either no input vertices or output vertices.
Definition at line 291 of file SphericalVertexCluster.hpp.
std::array< double, 3 > precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::getCenterCoords | ( | ) | const |
The center coordinate of this cluster.
Definition at line 285 of file SphericalVertexCluster.hpp.
unsigned int precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::getNumberOfInputVertices | ( | ) | const |
Number of input vertices this partition operates on.
Definition at line 279 of file SphericalVertexCluster.hpp.
void precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::mapConservative | ( | const time::Sample & | inData, |
Eigen::VectorXd & | outData ) const |
Evaluates a conservative mapping and agglomerates the result in the given output data.
Definition at line 191 of file SphericalVertexCluster.hpp.
void precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::mapConsistent | ( | const time::Sample & | inData, |
Eigen::VectorXd & | outData ) const |
Evaluates a consistent mapping and agglomerates the result in the given output data.
Definition at line 231 of file SphericalVertexCluster.hpp.
void precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::setNormalizedWeight | ( | double | normalizedWeight, |
VertexID | vertexID ) |
Set the normalized weight for the given vertexID
in the outputMesh.
Definition at line 174 of file SphericalVertexCluster.hpp.
|
private |
center vertex of the cluster
Definition at line 92 of file SphericalVertexCluster.hpp.
|
private |
Boolean switch in order to indicate that a mapping was computed.
Definition at line 122 of file SphericalVertexCluster.hpp.
|
private |
Global VertexIDs associated to the input mesh (see constructor)
Definition at line 106 of file SphericalVertexCluster.hpp.
|
private |
logger, as usual
Definition at line 89 of file SphericalVertexCluster.hpp.
|
private |
Vector containing the normalized weights used for the output mesh data (consistent mapping) or input mesh data (conservative data)
Definition at line 113 of file SphericalVertexCluster.hpp.
|
private |
Global VertexIDs associated to the output mesh (see constructor)
Definition at line 109 of file SphericalVertexCluster.hpp.
|
private |
Polynomial treatment in the RBF solver.
Definition at line 116 of file SphericalVertexCluster.hpp.
|
private |
radius of the vertex cluster
Definition at line 95 of file SphericalVertexCluster.hpp.
|
private |
The RBF solver.
Definition at line 98 of file SphericalVertexCluster.hpp.
|
private |
The weighting function.
Definition at line 119 of file SphericalVertexCluster.hpp.