44 Eigen::Vector2d coordOneA{0.0, 0.0};
45 Eigen::Vector2d coordOneB{1.0, 0.0};
54 if (context.isNamed(
"SolverA")) {
55 Participant cplInterface(
"SolverA", configFile, context.rank, context.size);
56 auto meshName =
"MeshA";
57 auto dataABID =
"DataAB";
58 auto dataBAID =
"DataBA";
60 if (context.isPrimary()) {
61 int vertex1 = cplInterface.
setMeshVertex(meshName, coordOneA);
69 cplInterface.
writeData(meshName, dataABID, {&vertex1, 1}, {&valueA1, 1});
79 cplInterface.
readData(meshName, dataBAID, {&vertex1, 1}, maxDt, {&valueRead, 1});
82 BOOST_TEST(valueRead == valueB1);
87 int vertex2 = cplInterface.
setMeshVertex(meshName, coordOneB);
95 cplInterface.
writeData(meshName, dataABID, {&vertex2, 1}, {&valueA2, 1});
105 cplInterface.
readData(meshName, dataBAID, {&vertex2, 1}, maxDt, {&valueRead, 1});
108 BOOST_TEST(valueRead == valueB2);
113 }
else if (context.isNamed(
"SolverB")) {
114 Participant cplInterface(
"SolverB", configFile, 0, 1);
115 auto meshName1 =
"MeshB1";
116 auto meshName2 =
"MeshB2";
117 int vertex1 = cplInterface.
setMeshVertex(meshName1, coordOneA);
118 int vertex2 = cplInterface.
setMeshVertex(meshName1, coordOneB);
119 int vertex3 = cplInterface.
setMeshVertex(meshName2, coordOneA);
120 int vertex4 = cplInterface.
setMeshVertex(meshName2, coordOneB);
122 auto dataABID =
"DataAB";
123 auto dataBAID =
"DataBA";
124 auto dataCBID =
"DataCB";
125 auto dataBCID =
"DataBC";
129 double valueReadA1, valueReadA2, valueReadC1, valueReadC2;
133 cplInterface.
writeData(meshName1, dataBAID, {&vertex1, 1}, {&valueB1, 1});
134 cplInterface.
writeData(meshName1, dataBAID, {&vertex2, 1}, {&valueB2, 1});
135 cplInterface.
writeData(meshName2, dataBCID, {&vertex3, 1}, {&valueB1, 1});
136 cplInterface.
writeData(meshName2, dataBCID, {&vertex4, 1}, {&valueB2, 1});
146 cplInterface.
readData(meshName1, dataABID, {&vertex1, 1}, maxDt, {&valueReadA1, 1});
147 cplInterface.
readData(meshName1, dataABID, {&vertex2, 1}, maxDt, {&valueReadA2, 1});
148 cplInterface.
readData(meshName2, dataCBID, {&vertex1, 1}, maxDt, {&valueReadC1, 1});
149 cplInterface.
readData(meshName2, dataCBID, {&vertex2, 1}, maxDt, {&valueReadC2, 1});
152 BOOST_TEST(valueReadA1 == valueA1);
153 BOOST_TEST(valueReadA2 == valueA2);
154 BOOST_TEST(valueReadC1 == valueC1);
155 BOOST_TEST(valueReadC2 == valueC2);
160 Participant cplInterface(
"SolverC", configFile, 0, 1);
161 auto meshName =
"MeshC";
162 int vertex1 = cplInterface.
setMeshVertex(meshName, coordOneA);
163 int vertex2 = cplInterface.
setMeshVertex(meshName, coordOneB);
164 auto dataCBID =
"DataCB";
165 auto dataBCID =
"DataBC";
169 double valueRead1, valueRead2;
174 cplInterface.
writeData(meshName, dataCBID, {&vertex1, 1}, {&valueC1, 1});
175 cplInterface.
writeData(meshName, dataCBID, {&vertex2, 1}, {&valueC2, 1});
185 cplInterface.
readData(meshName, dataBCID, {&vertex1, 1}, maxDt, {&valueRead1, 1});
186 cplInterface.
readData(meshName, dataBCID, {&vertex2, 1}, maxDt, {&valueRead2, 1});
189 BOOST_TEST(valueRead1 == valueB1);
190 BOOST_TEST(valueRead2 == valueB2);