preCICE v3.1.2
No Matches
Namespaces | Typedefs | Functions
CreateClustering.hpp File Reference
#include <Eigen/Core>
#include <algorithm>
#include "math/math.hpp"
#include "mesh/Mesh.hpp"
#include "precice/impl/Types.hpp"
#include "query/Index.hpp"
#include "mapping/RadialBasisFctSolver.hpp"
Include dependency graph for CreateClustering.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


namespace  precice
 Main namespace of the precice library.
namespace  precice::mapping
 contains data mapping from points to meshes.
namespace  precice::mapping::impl


using precice::mapping::impl::Vertices = std::vector<mesh::Vertex>


double precice::mapping::impl::estimateClusterRadius (unsigned int verticesPerCluster, mesh::PtrMesh inMesh, const mesh::BoundingBox &bb)
 Computes an estimate for the cluster radius, which results in approximately verticesPerCluster vertices inside of each cluster. The algorithm generates random samples in the domain and queries the verticesPerCluster nearest-neighbors from the mesh index tree. The cluster radius is then estimated through the distance between the center vertex (random sample) and the vertex the furthest away from the center (being on the edge of the cluster).
std::tuple< double, Verticesprecice::mapping::impl::createClustering (mesh::PtrMesh inMesh, mesh::PtrMesh outMesh, double relativeOverlap, unsigned int verticesPerCluster, bool projectClustersToInput)
 Creates a clustering as a collection of Vertices (representing the cluster centers) and a cluster radius, as required for the partition of unity mapping. The algorithm estimates a cluster radius based on the input parameter verticesPerCluster (see also estimateClusterRadius above, which is directly used by the function). Afterwards, the algorithm creates a cartesian-like grid of center vertices, where the distance of the centers is defined through the relativeOverlap and the cluster radius. The parameter projectClustersToInput moves the cartesian center vertices to the closest vertex from the input mesh, which is useful in case of very irregular meshes or shell-shaped meshes. The algorithm also removes potentially empty cluster, i.e., clusters which would have either no vertex from the inMesh or from the outMesh . See also tagEmptyClusters.