preCICE v3.2.0
|
#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 | computeCacheData (const Eigen::Ref< const Eigen::MatrixXd > &globalIn, Eigen::MatrixXd &polyOut, Eigen::MatrixXd &coefficientsOut) const |
Computes and saves the RBF coefficients. | |
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. | |
void | evaluateConservativeCache (Eigen::MatrixXd &epsilon, const Eigen::MatrixXd &Au, Eigen::Ref< Eigen::MatrixXd > out) |
double | computeWeight (const mesh::Vertex &v) const |
Compute the weight for a given vertex. | |
Eigen::VectorXd | interpolateAt (const mesh::Vertex &v, const Eigen::MatrixXd &poly, const Eigen::MatrixXd &coeffs, const mesh::Mesh &inMesh) const |
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 |
void | addWriteDataToCache (const mesh::Vertex &v, const Eigen::VectorXd &load, Eigen::MatrixXd &epsilon, Eigen::MatrixXd &Au, const mesh::Mesh &inMesh) |
void | initializeCacheData (Eigen::MatrixXd &polynomial, Eigen::MatrixXd &coeffs, const int nComponents) |
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. | |
RADIAL_BASIS_FUNCTION_T | _function |
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 33 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 139 of file SphericalVertexCluster.hpp.
void precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::addWriteDataToCache | ( | const mesh::Vertex & | v, |
const Eigen::VectorXd & | load, | ||
Eigen::MatrixXd & | epsilon, | ||
Eigen::MatrixXd & | Au, | ||
const mesh::Mesh & | inMesh ) |
Definition at line 278 of file SphericalVertexCluster.hpp.
void precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::clear | ( | ) |
Invalidates and erases data structures the cluster holds.
Definition at line 362 of file SphericalVertexCluster.hpp.
void precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::computeCacheData | ( | const Eigen::Ref< const Eigen::MatrixXd > & | globalIn, |
Eigen::MatrixXd & | polyOut, | ||
Eigen::MatrixXd & | coefficientsOut ) const |
Computes and saves the RBF coefficients.
Definition at line 255 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 335 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 356 of file SphericalVertexCluster.hpp.
void precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::evaluateConservativeCache | ( | Eigen::MatrixXd & | epsilon, |
const Eigen::MatrixXd & | Au, | ||
Eigen::Ref< Eigen::MatrixXd > | out ) |
Definition at line 242 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 350 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 344 of file SphericalVertexCluster.hpp.
void precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::initializeCacheData | ( | Eigen::MatrixXd & | polynomial, |
Eigen::MatrixXd & | coeffs, | ||
const int | nComponents ) |
Definition at line 287 of file SphericalVertexCluster.hpp.
Eigen::VectorXd precice::mapping::SphericalVertexCluster< RADIAL_BASIS_FUNCTION_T >::interpolateAt | ( | const mesh::Vertex & | v, |
const Eigen::MatrixXd & | poly, | ||
const Eigen::MatrixXd & | coeffs, | ||
const mesh::Mesh & | inMesh ) const |
Definition at line 271 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 202 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 296 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 185 of file SphericalVertexCluster.hpp.
|
private |
center vertex of the cluster
Definition at line 101 of file SphericalVertexCluster.hpp.
|
private |
Definition at line 127 of file SphericalVertexCluster.hpp.
|
private |
Boolean switch in order to indicate that a mapping was computed.
Definition at line 133 of file SphericalVertexCluster.hpp.
|
private |
Global VertexIDs associated to the input mesh (see constructor)
Definition at line 115 of file SphericalVertexCluster.hpp.
|
mutableprivate |
logger, as usual
Definition at line 98 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 122 of file SphericalVertexCluster.hpp.
|
private |
Global VertexIDs associated to the output mesh (see constructor)
Definition at line 118 of file SphericalVertexCluster.hpp.
|
private |
Polynomial treatment in the RBF solver.
Definition at line 125 of file SphericalVertexCluster.hpp.
|
private |
radius of the vertex cluster
Definition at line 104 of file SphericalVertexCluster.hpp.
|
private |
The RBF solver.
Definition at line 107 of file SphericalVertexCluster.hpp.
|
private |
The weighting function.
Definition at line 130 of file SphericalVertexCluster.hpp.