34 int meshDimension = 2;
40 for (
unsigned int i = 0; i < 10; ++i) {
41 for (
unsigned int j = i; j < 10; ++j) {
42 inMesh->
createVertex(Eigen::Vector2d(
static_cast<double>(i),
static_cast<double>(j)));
43 outMesh->
createVertex(Eigen::Vector2d(
static_cast<double>(i),
static_cast<double>(j)));
46 double relativeOverlap = 0.3;
47 unsigned int verticesPerPartition = 10;
48 bool projectToInput =
false;
50 auto [averagePartitionRadius, centerCandidates] =
impl::createClustering(inMesh, outMesh, relativeOverlap, verticesPerPartition, projectToInput);
51 BOOST_TEST(averagePartitionRadius == 2.2360679774997898);
52 BOOST_TEST(centerCandidates.size() == 19);
56 projectToInput =
true;
57 auto [averagePartitionRadius, centerCandidates] =
impl::createClustering(inMesh, outMesh, relativeOverlap, verticesPerPartition, projectToInput);
58 BOOST_TEST(averagePartitionRadius == 2.2360679774997898);
59 BOOST_TEST(centerCandidates.size() == 25);
68 int meshDimension = 3;
74 for (
unsigned int i = 0; i < 10; ++i) {
75 for (
unsigned int j = i; j < 10; ++j) {
76 for (
unsigned int k = i; k < 10; ++k) {
77 inMesh->
createVertex(Eigen::Vector3d(
static_cast<double>(i),
static_cast<double>(j),
static_cast<double>(k)));
78 outMesh->
createVertex(Eigen::Vector3d(
static_cast<double>(i),
static_cast<double>(j),
static_cast<double>(k)));
82 double relativeOverlap = 0.15;
83 unsigned int verticesPerPartition = 10;
84 bool projectToInput =
false;
86 auto [averagePartitionRadius, centerCandidates] =
impl::createClustering(inMesh, outMesh, relativeOverlap, verticesPerPartition, projectToInput);
87 BOOST_TEST(averagePartitionRadius == 1.4142135623730951);
88 BOOST_TEST(centerCandidates.size() == 188);
92 projectToInput =
true;
93 auto [averagePartitionRadius, centerCandidates] =
impl::createClustering(inMesh, outMesh, relativeOverlap, verticesPerPartition, projectToInput);
94 BOOST_TEST(averagePartitionRadius == 1.4142135623730951);
95 BOOST_TEST(centerCandidates.size() == 222);
BOOST_AUTO_TEST_CASE(testIQNIMVJPPWithSubsteps)
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
#define PRECICE_TEST_SETUP(...)
Creates and attaches a TestSetup to a Boost test case.
Vertex & createVertex(const Eigen::Ref< const Eigen::VectorXd > &coords)
Creates and initializes a Vertex object.
std::tuple< double, Vertices > 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 rad...
contains data mapping from points to meshes.
provides Mesh, Data and primitives.
std::shared_ptr< Mesh > PtrMesh
contains the testing framework.
Main namespace of the precice library.