preCICE v3.1.1
Loading...
Searching...
No Matches
CompositionalCouplingSchemeTest.cpp
Go to the documentation of this file.
1#include <Eigen/Core>
2#include <algorithm>
3#include <cmath>
4#include <memory>
5#include <string>
6#include <vector>
8#include "../Constants.hpp"
13#include "m2n/M2N.hpp"
14#include "m2n/SharedPointer.hpp"
16#include "mesh/Data.hpp"
17#include "mesh/Mesh.hpp"
23#include "testing/Testing.hpp"
24#include "xml/XMLTag.hpp"
25
26using namespace precice;
27using namespace precice::cplscheme;
28
29#ifndef PRECICE_NO_MPI
30
31BOOST_AUTO_TEST_SUITE(CplSchemeTests)
32
33struct CompositionalCouplingSchemeFixture : m2n::WhiteboxAccessor {
35
37 {
38 _pathToTests = testing::getPathToSources() + "/cplscheme/tests/";
39 }
40
42 {
43 using namespace mesh;
44
45 std::string nameParticipant0("Participant0");
46 std::string nameParticipant1("Participant1");
47 std::string nameParticipant2("Participant2");
48
50 PtrDataConfiguration dataConfig(new DataConfiguration(root));
51 PtrMeshConfiguration meshConfig(new MeshConfiguration(root, dataConfig));
54 CouplingSchemeConfiguration cplSchemeConfig(root, meshConfig, m2nConfig, participantConfig);
55
56 const xml::ConfigurationContext ccontext{context.name, 0, 1};
57 xml::configure(root, ccontext, configFilename);
58
59 // some dummy mesh
60 meshConfig->meshes().at(0)->createVertex(Eigen::Vector3d(1.0, 1.0, 1.0));
61 meshConfig->meshes().at(0)->createVertex(Eigen::Vector3d(2.0, 1.0, -1.0));
62 meshConfig->meshes().at(0)->createVertex(Eigen::Vector3d(3.0, 1.0, 1.0));
63 meshConfig->meshes().at(0)->createVertex(Eigen::Vector3d(4.0, 1.0, -1.0));
64
65 m2n::PtrM2N m2n0 = m2nConfig->getM2N(nameParticipant0, nameParticipant1);
66 m2n::PtrM2N m2n1 = m2nConfig->getM2N(nameParticipant1, nameParticipant2);
67
68 if (context.isNamed(nameParticipant0)) {
69 connect(nameParticipant0, nameParticipant1, context.name, m2n0);
70 } else if (context.isNamed(nameParticipant1)) {
71 connect(nameParticipant0, nameParticipant1, context.name, m2n0);
72 connect(nameParticipant1, nameParticipant2, context.name, m2n1);
73 } else {
74 connect(nameParticipant1, nameParticipant2, context.name, m2n1);
75 }
76
77 runThreeSolverCoupling(cplSchemeConfig.getCouplingScheme(context.name),
78 context.name, meshConfig);
79 }
80
82 PtrCouplingScheme cplScheme,
83 const std::string & participantName,
85 {
86 BOOST_TEST(meshConfig->meshes().size() == 1);
87 mesh::PtrMesh mesh = meshConfig->meshes().at(0);
88 BOOST_TEST(mesh->data().size() == 3);
89 BOOST_TEST(mesh->nVertices() > 0);
90
91 double computedTime = 0.0;
92 int computedTimesteps = 0;
93
94 if (participantName == std::string("Participant0")) {
95 mesh->data(0)->setSampleAtTime(0, time::Sample{1, mesh->data(0)->values()});
96 cplScheme->initialize(0.0, 1);
97 BOOST_TEST(not cplScheme->hasDataBeenReceived());
98 BOOST_TEST(not cplScheme->isTimeWindowComplete());
99 BOOST_TEST(cplScheme->isCouplingOngoing());
100 while (cplScheme->isCouplingOngoing()) {
101 BOOST_REQUIRE(computedTime < 1.1);
102 BOOST_TEST(testing::equals(0.1, cplScheme->getNextTimeStepMaxSize()));
103 if (cplScheme->isActionRequired(CouplingScheme::Action::WriteCheckpoint)) {
104 cplScheme->markActionFulfilled(CouplingScheme::Action::WriteCheckpoint);
105 }
106 double stepSize = cplScheme->getNextTimeStepMaxSize();
107 mesh->data(0)->setSampleAtTime(computedTime + stepSize, time::Sample{1, mesh->data(0)->values()});
108 BOOST_TEST(cplScheme->getTime() == computedTime);
109 cplScheme->addComputedTime(stepSize);
110 BOOST_TEST(cplScheme->getTime() == computedTime + stepSize); // ensure that time is correctly updated, even if iterating. See https://github.com/precice/precice/pull/1792.
111 cplScheme->firstSynchronization({});
112 cplScheme->firstExchange();
113 cplScheme->secondSynchronization();
114 cplScheme->secondExchange();
115 if (cplScheme->isActionRequired(CouplingScheme::Action::ReadCheckpoint)) {
116 cplScheme->markActionFulfilled(CouplingScheme::Action::ReadCheckpoint);
117 } else {
118 BOOST_TEST(cplScheme->isTimeWindowComplete());
119 computedTime += stepSize;
120 computedTimesteps++;
121 }
122 BOOST_TEST(testing::equals(computedTime, cplScheme->getTime()));
123 BOOST_TEST(computedTimesteps == cplScheme->getTimeWindows() - 1);
124 BOOST_TEST(cplScheme->hasDataBeenReceived());
125 }
126 cplScheme->finalize();
127 BOOST_TEST(computedTimesteps == 10);
128 BOOST_TEST(cplScheme->isTimeWindowComplete());
129 BOOST_TEST(not cplScheme->isCouplingOngoing());
130 BOOST_TEST(cplScheme->getNextTimeStepMaxSize() == 0.0);
131 } else if (participantName == std::string("Participant1")) {
132 auto ddims = mesh->data(1)->getDimensions();
133 mesh->data(1)->setSampleAtTime(0, time::Sample{ddims, mesh->data(1)->values()});
134 cplScheme->initialize(0.0, 1);
135 BOOST_TEST(cplScheme->hasDataBeenReceived());
136 BOOST_TEST(not cplScheme->isTimeWindowComplete());
137 BOOST_TEST(cplScheme->isCouplingOngoing());
138 while (cplScheme->isCouplingOngoing()) {
139 BOOST_REQUIRE(computedTime < 1.1);
140 BOOST_TEST(testing::equals(0.1, cplScheme->getNextTimeStepMaxSize()));
141 if (cplScheme->isActionRequired(CouplingScheme::Action::WriteCheckpoint)) {
142 cplScheme->markActionFulfilled(CouplingScheme::Action::WriteCheckpoint);
143 }
144 double stepSize = cplScheme->getNextTimeStepMaxSize();
145 mesh->data(1)->setSampleAtTime(computedTime + stepSize, time::Sample{ddims, mesh->data(1)->values()});
146 BOOST_TEST(cplScheme->getTime() == computedTime);
147 cplScheme->addComputedTime(stepSize);
148 BOOST_TEST(cplScheme->getTime() == computedTime + stepSize); // ensure that time is correctly updated, even if iterating. See https://github.com/precice/precice/pull/1792.
149 cplScheme->firstSynchronization({});
150 cplScheme->firstExchange();
151 cplScheme->secondSynchronization();
152 cplScheme->secondExchange();
153 if (cplScheme->isActionRequired(CouplingScheme::Action::ReadCheckpoint)) {
154 cplScheme->markActionFulfilled(CouplingScheme::Action::ReadCheckpoint);
155 } else {
156 BOOST_TEST(cplScheme->isTimeWindowComplete());
157 computedTime += stepSize;
158 computedTimesteps++;
159 }
160 BOOST_TEST(testing::equals(computedTime, cplScheme->getTime()));
161 BOOST_TEST(computedTimesteps == cplScheme->getTimeWindows() - 1);
162 BOOST_TEST(cplScheme->hasDataBeenReceived());
163 }
164 cplScheme->finalize();
165 BOOST_TEST(computedTimesteps == 10);
166 BOOST_TEST(cplScheme->isTimeWindowComplete());
167 BOOST_TEST(not cplScheme->isCouplingOngoing());
168 BOOST_TEST(cplScheme->getNextTimeStepMaxSize() == 0.0);
169 } else {
170 auto ddims = mesh->data(2)->getDimensions();
171 BOOST_TEST(participantName == std::string("Participant2"), participantName);
172 mesh->data(2)->setSampleAtTime(0, time::Sample{ddims, mesh->data(2)->values()});
173 cplScheme->initialize(0.0, 1);
174 BOOST_TEST(cplScheme->hasDataBeenReceived());
175 BOOST_TEST(not cplScheme->isTimeWindowComplete());
176 BOOST_TEST(cplScheme->isCouplingOngoing());
177 while (cplScheme->isCouplingOngoing()) {
178 BOOST_REQUIRE(computedTime < 1.1);
179 BOOST_TEST(testing::equals(0.1, cplScheme->getNextTimeStepMaxSize()));
180 if (cplScheme->isActionRequired(CouplingScheme::Action::WriteCheckpoint)) {
181 cplScheme->markActionFulfilled(CouplingScheme::Action::WriteCheckpoint);
182 }
183 double stepSize = cplScheme->getNextTimeStepMaxSize();
184 mesh->data(2)->setSampleAtTime(cplScheme->getNextTimeStepMaxSize(), time::Sample{ddims, mesh->data(2)->values()});
185 BOOST_TEST(cplScheme->getTime() == computedTime);
186 cplScheme->addComputedTime(stepSize);
187 BOOST_TEST(cplScheme->getTime() == computedTime + stepSize); // ensure that time is correctly updated, even if iterating. See https://github.com/precice/precice/pull/1792.
188 cplScheme->firstSynchronization({});
189 cplScheme->firstExchange();
190 cplScheme->secondSynchronization();
191 cplScheme->secondExchange();
192 if (cplScheme->isActionRequired(CouplingScheme::Action::ReadCheckpoint)) {
193 cplScheme->markActionFulfilled(CouplingScheme::Action::ReadCheckpoint);
194 } else {
195 BOOST_TEST(cplScheme->isTimeWindowComplete());
196 computedTime += stepSize;
197 computedTimesteps++;
198 }
199 BOOST_TEST(testing::equals(computedTime, cplScheme->getTime()));
200 BOOST_TEST(computedTimesteps == cplScheme->getTimeWindows() - 1);
201 if (cplScheme->isCouplingOngoing())
202 BOOST_TEST(cplScheme->hasDataBeenReceived());
203 }
204 cplScheme->finalize();
205 BOOST_TEST(computedTimesteps == 10);
206 BOOST_TEST(cplScheme->isTimeWindowComplete());
207 BOOST_TEST(not cplScheme->isCouplingOngoing());
208 BOOST_TEST(cplScheme->getNextTimeStepMaxSize() == 0.0);
209 }
210 }
211
212 void connect(const std::string &participant0,
213 const std::string &participant1,
214 const std::string &localParticipant,
215 m2n::PtrM2N communication) const
216 {
217 BOOST_TEST(communication);
218 BOOST_TEST(not communication->isConnected());
219 useOnlyPrimaryCom(communication) = true;
220 if (participant0 == localParticipant) {
221 communication->requestPrimaryRankConnection(participant1, participant0);
222 } else {
223 BOOST_TEST(participant1 == localParticipant);
224 communication->acceptPrimaryRankConnection(participant1, participant0);
225 }
226 }
227};
228
229BOOST_AUTO_TEST_SUITE(DummySchemeCompositionTests)
230
231// Test two explicit dummy coupling schemes
232BOOST_AUTO_TEST_CASE(testDummySchemeCompositionExplicit2)
233{
234 PRECICE_TEST(1_rank, Require::Events);
235 int numberIterations = 1;
236 int maxTimeWindows = 10;
237 PtrCouplingScheme scheme1(new tests::DummyCouplingScheme(numberIterations, maxTimeWindows));
238 PtrCouplingScheme scheme2(new tests::DummyCouplingScheme(numberIterations, maxTimeWindows));
239 CompositionalCouplingScheme composition;
240 composition.addCouplingScheme(scheme1);
241 composition.addCouplingScheme(scheme2);
242 composition.initialize(0.0, 1);
243 int advances = 0;
244 while (composition.isCouplingOngoing()) {
245 composition.firstSynchronization({});
246 composition.firstExchange();
247 composition.secondSynchronization();
248 composition.secondExchange();
249 advances++;
250 }
251 composition.finalize();
252 BOOST_TEST(advances == 10);
253 BOOST_TEST(scheme1->getTimeWindows() - 1 == 10);
254 BOOST_TEST(scheme2->getTimeWindows() - 1 == 10);
255}
256
257// Test three explicit dummy coupling schemes
258BOOST_AUTO_TEST_CASE(testDummySchemeCompositionExplicit3)
259{
260 PRECICE_TEST(1_rank, Require::Events);
261 int numberIterations = 1;
262 int maxTimeWindows = 10;
263 PtrCouplingScheme scheme1(
264 new tests::DummyCouplingScheme(numberIterations, maxTimeWindows));
265 PtrCouplingScheme scheme2(
266 new tests::DummyCouplingScheme(numberIterations, maxTimeWindows));
267 PtrCouplingScheme scheme3(
268 new tests::DummyCouplingScheme(numberIterations, maxTimeWindows));
269 CompositionalCouplingScheme composition;
270 composition.addCouplingScheme(scheme1);
271 composition.addCouplingScheme(scheme2);
272 composition.addCouplingScheme(scheme3);
273 composition.initialize(0.0, 1);
274 int advances = 0;
275 while (composition.isCouplingOngoing()) {
276 composition.firstSynchronization({});
277 composition.firstExchange();
278 composition.secondSynchronization();
279 composition.secondExchange();
280 advances++;
281 }
282 composition.finalize();
283 BOOST_TEST(advances == 10);
284 BOOST_TEST(scheme1->getTimeWindows() - 1 == 10);
285 BOOST_TEST(scheme2->getTimeWindows() - 1 == 10);
286 BOOST_TEST(scheme3->getTimeWindows() - 1 == 10);
287}
288
289// Test E, I(2)
290BOOST_AUTO_TEST_CASE(testDummySchemeCompositionExplicit1Implicit2)
291{
292 PRECICE_TEST(1_rank, Require::Events);
293 int numberIterations = 1;
294 int maxTimeWindows = 10;
295 PtrCouplingScheme scheme1(new tests::DummyCouplingScheme(numberIterations, maxTimeWindows));
296 numberIterations = 2;
297 PtrCouplingScheme scheme2(new tests::DummyCouplingScheme(numberIterations, maxTimeWindows));
298 CompositionalCouplingScheme composition;
299 composition.addCouplingScheme(scheme1);
300 composition.addCouplingScheme(scheme2);
301 composition.initialize(0.0, 1);
302 int advances = 0;
303 BOOST_TEST_MESSAGE("Init Expl " << scheme1->getTimeWindows());
304 BOOST_TEST_MESSAGE("Init Impl " << scheme2->getTimeWindows());
305 while (composition.isCouplingOngoing()) {
306 composition.firstSynchronization({});
307 composition.firstExchange();
308 composition.secondSynchronization();
309 composition.secondExchange();
310 advances++;
311 // a 1, e 2, i 2
312 BOOST_TEST_CONTEXT("Advance Nr " << advances)
313 {
314 BOOST_TEST_MESSAGE("Expl " << scheme1->getTimeWindows());
315 BOOST_TEST_MESSAGE("Impl " << scheme2->getTimeWindows());
316 if (advances % 2 == 0) {
317 BOOST_TEST(scheme2->isActionRequired(CouplingScheme::Action::WriteCheckpoint));
318 BOOST_TEST(scheme1->getTimeWindows() - 1 == advances / 2);
319 } else {
320 BOOST_TEST(scheme2->isActionRequired(CouplingScheme::Action::ReadCheckpoint));
321 BOOST_TEST(scheme1->getTimeWindows() - 1 == (advances + 1) / 2);
322 }
323 }
324 }
325 composition.finalize();
326 BOOST_TEST(advances == 20);
327 BOOST_TEST(scheme1->getTimeWindows() - 1 == 10);
328 BOOST_TEST(scheme2->getTimeWindows() - 1 == 10);
329}
330
331// Test I(2), E
332BOOST_AUTO_TEST_CASE(testDummySchemeCompositionImplicit2Explicit1)
333{
334 PRECICE_TEST(1_rank, Require::Events);
335 int numberIterations = 2;
336 int maxTimeWindows = 10;
337 PtrCouplingScheme scheme1(new tests::DummyCouplingScheme(numberIterations, maxTimeWindows));
338 numberIterations = 1;
339 PtrCouplingScheme scheme2(new tests::DummyCouplingScheme(numberIterations, maxTimeWindows));
340 CompositionalCouplingScheme composition;
341 composition.addCouplingScheme(scheme1);
342 composition.addCouplingScheme(scheme2);
343 composition.initialize(0.0, 1);
344 int advances = 0;
345 while (composition.isCouplingOngoing()) {
346 composition.firstSynchronization({});
347 composition.firstExchange();
348 composition.secondSynchronization();
349 composition.secondExchange();
350 advances++;
351 if (advances % 2 == 0) {
352 BOOST_TEST(scheme1->isActionRequired(CouplingScheme::Action::WriteCheckpoint));
353 BOOST_TEST(scheme1->getTimeWindows() - 1 == advances / 2);
354 } else {
355 BOOST_TEST(scheme1->isActionRequired(CouplingScheme::Action::ReadCheckpoint));
356 BOOST_TEST(scheme1->getTimeWindows() - 1 == (advances - 1) / 2);
357 }
358 }
359 composition.finalize();
360 BOOST_TEST(advances == 20);
361 BOOST_TEST(scheme1->getTimeWindows() - 1 == 10);
362 BOOST_TEST(scheme2->getTimeWindows() - 1 == 10);
363}
364
365// Test E, I(3)
366BOOST_AUTO_TEST_CASE(testDummySchemeCompositionExplicit1Implicit3)
367{
368 PRECICE_TEST(1_rank, Require::Events);
369 int numberIterations = 1;
370 int maxTimeWindows = 10;
371 PtrCouplingScheme scheme1(
372 new tests::DummyCouplingScheme(numberIterations, maxTimeWindows));
373 numberIterations = 3;
374 PtrCouplingScheme scheme2(
375 new tests::DummyCouplingScheme(numberIterations, maxTimeWindows));
376 CompositionalCouplingScheme composition;
377 composition.addCouplingScheme(scheme1);
378 composition.addCouplingScheme(scheme2);
379 composition.initialize(0.0, 1);
380 int advances = 0;
381 while (composition.isCouplingOngoing()) {
382 composition.firstSynchronization({});
383 composition.firstExchange();
384 composition.secondSynchronization();
385 composition.secondExchange();
386 advances++;
387 if (advances % 3 == 0) {
388 BOOST_TEST(scheme2->isActionRequired(CouplingScheme::Action::WriteCheckpoint));
389 BOOST_TEST(scheme1->getTimeWindows() - 1 == advances / 3);
390 } else {
391 BOOST_TEST(scheme2->isActionRequired(CouplingScheme::Action::ReadCheckpoint));
392 BOOST_TEST(scheme1->getTimeWindows() - 1 == (advances + (3 - advances % 3)) / 3);
393 }
394 }
395 composition.finalize();
396 BOOST_TEST(advances == 30);
397 BOOST_TEST(scheme1->getTimeWindows() - 1 == 10);
398 BOOST_TEST(scheme2->getTimeWindows() - 1 == 10);
399}
400
401// Test I(3), E
402BOOST_AUTO_TEST_CASE(testDummySchemeCompositionImplicit3Explicit1)
403{
404 PRECICE_TEST(1_rank, Require::Events);
405 int numberIterations = 3;
406 int maxTimeWindows = 10;
407 PtrCouplingScheme scheme1(new tests::DummyCouplingScheme(numberIterations, maxTimeWindows));
408 numberIterations = 1;
409 PtrCouplingScheme scheme2(new tests::DummyCouplingScheme(numberIterations, maxTimeWindows));
410 CompositionalCouplingScheme composition;
411 composition.addCouplingScheme(scheme1);
412 composition.addCouplingScheme(scheme2);
413 composition.initialize(0.0, 1);
414 int advances = 0;
415 while (composition.isCouplingOngoing()) {
416 composition.firstSynchronization({});
417 composition.firstExchange();
418 composition.secondSynchronization();
419 composition.secondExchange();
420 advances++;
421 if (advances % 3 == 0) {
422 BOOST_TEST(scheme1->isActionRequired(CouplingScheme::Action::WriteCheckpoint));
423 BOOST_TEST(scheme1->getTimeWindows() - 1 == advances / 3);
424 } else {
425 BOOST_TEST(scheme1->isActionRequired(CouplingScheme::Action::ReadCheckpoint));
426 BOOST_TEST(scheme1->getTimeWindows() - 1 == (advances - (advances % 3)) / 3);
427 }
428 }
429 composition.finalize();
430 BOOST_TEST(advances == 30);
431 BOOST_TEST(scheme1->getTimeWindows() - 1 == 10);
432 BOOST_TEST(scheme2->getTimeWindows() - 1 == 10);
433}
434
436
437BOOST_FIXTURE_TEST_SUITE(CompositionalCouplingSchemeTests, CompositionalCouplingSchemeFixture)
438
440BOOST_AUTO_TEST_CASE(testExplicitSchemeComposition1)
441{
442 PRECICE_TEST("Participant0"_on(1_rank), "Participant1"_on(1_rank), "Participant2"_on(1_rank), Require::Events);
443
444 std::string configPath(_pathToTests + "multi-solver-coupling-1.xml");
445 setupAndRunThreeSolverCoupling(configPath, context);
446}
447
449BOOST_AUTO_TEST_CASE(testImplicitExplicitSchemeComposition)
450{
451 PRECICE_TEST("Participant0"_on(1_rank), "Participant1"_on(1_rank), "Participant2"_on(1_rank), Require::Events);
452
453 std::string configPath(_pathToTests + "multi-solver-coupling-3.xml");
454 setupAndRunThreeSolverCoupling(configPath, context);
455}
456
458BOOST_AUTO_TEST_CASE(testExplicitImplicitSchemeComposition)
459{
460 PRECICE_TEST("Participant0"_on(1_rank), "Participant1"_on(1_rank), "Participant2"_on(1_rank), Require::Events);
461
462 std::string configPath(_pathToTests + "multi-solver-coupling-4.xml");
463 setupAndRunThreeSolverCoupling(configPath, context);
464}
465
468
469#endif // not PRECICE_NO_MPI
BOOST_AUTO_TEST_CASE(testDummySchemeCompositionExplicit2)
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
#define PRECICE_TEST(...)
Definition Testing.hpp:27
Performs XML configuration of a participant.
Acts as one coupling scheme, but consists of several composed ones.
void initialize(double startTime, int startTimeWindow) final override
Initializes the coupling scheme and establishes a communication connection to the coupling partner.
void finalize() final override
Finalizes the coupling and disconnects communication.
bool isCouplingOngoing() const final override
Returns true, when the coupled simulation is still ongoing.
void addCouplingScheme(const PtrCouplingScheme &scheme)
Adds another coupling scheme in parallel to this scheme.
ChangedMeshes firstSynchronization(const ChangedMeshes &changes) override
Exchanges data and updates the state of the coupling scheme.
const PtrCouplingScheme & getCouplingScheme(const std::string &participantName) const
Returns the configured coupling scheme.
virtual ChangedMeshes firstSynchronization(const ChangedMeshes &changes)=0
virtual bool addComputedTime(double timeToAdd)=0
Adds newly computed time. Has to be called before every advance.
virtual double getTime() const =0
Returns the currently computed time of the coupling scheme.
virtual void initialize(double startTime, int startTimeWindow)=0
Initializes the coupling scheme and establishes a communication connection to the coupling partner....
virtual ChangedMeshes secondSynchronization()=0
virtual void markActionFulfilled(Action action)=0
Tells the coupling scheme that the accessor has performed the given action.
virtual double getNextTimeStepMaxSize() const =0
Returns the maximal size of the next time step to be computed.
virtual bool isTimeWindowComplete() const =0
Returns true, when the accessor can advance to the next time window.
virtual void finalize()=0
Finalizes the coupling and disconnects communication.
virtual bool isCouplingOngoing() const =0
Returns true, when the coupled simulation is still ongoing.
virtual int getTimeWindows() const =0
Returns the currently computed time windows of the coupling scheme.
virtual bool isActionRequired(Action action) const =0
Returns true, if the given action has to be performed by the accessor.
virtual bool hasDataBeenReceived() const =0
Returns true, if data has been exchanged in last call of advance().
Used to test CompositionalCouplingScheme.
Configuration for communication channels between solvers.
bool isNamed(const std::string &name) const
Check whether this context has a given name.
std::string name
the name of the current participant
Represents an XML tag to be configured automatically.
Definition XMLTag.hpp:31
contains implementations of coupling schemes for coupled simulations.
boost::test_tools::predicate_result equals(const std::vector< float > &VectorA, const std::vector< float > &VectorB, float tolerance)
equals to be used in tests. Compares two std::vectors using a given tolerance. Prints both operands o...
Definition Testing.cpp:65
std::string getPathToSources()
Returns the base path to the sources.
Definition Testing.cpp:31
XMLTag getRootTag()
Returns an XMLTag::Listener that does nothing on callbacks.
Definition XMLTag.cpp:389
void configure(XMLTag &tag, const precice::xml::ConfigurationContext &context, std::string_view configurationFilename)
Configures the given configuration from file configurationFilename.
Definition XMLTag.cpp:395
Main namespace of the precice library.
void runThreeSolverCoupling(PtrCouplingScheme cplScheme, const std::string &participantName, mesh::PtrMeshConfiguration meshConfig)
void connect(const std::string &participant0, const std::string &participant1, const std::string &localParticipant, m2n::PtrM2N communication) const
void setupAndRunThreeSolverCoupling(const std::string &configFilename, const precice::testing::TestContext &context)
Tightly coupled to the parameters of Participant()
Definition XMLTag.hpp:24