preCICE v3.2.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WatchIntegralTest.cpp
Go to the documentation of this file.
1#include <Eigen/Core>
2#include <algorithm>
3#include <istream>
4#include <iterator>
5#include <memory>
6#include <string>
7#include <vector>
9#include "mesh/Data.hpp"
10#include "mesh/Mesh.hpp"
14#include "testing/Testing.hpp"
15#include "utils/IntraComm.hpp"
16#include "utils/assertion.hpp"
17
18namespace precice::mesh {
19class Vertex;
20} // namespace precice::mesh
21
22using namespace precice;
23
24namespace {
25std::vector<double> readDoublesFromTXTFile(std::string const &filename, int skip = 0)
26{
27 std::ifstream is{filename};
28 if (skip > 0) {
30 while (skip--) {
31 is >> ignore;
32 }
33 }
35}
36} // namespace
37
38BOOST_AUTO_TEST_SUITE(PreciceTests)
39BOOST_AUTO_TEST_SUITE(WatchIntegral)
40
42BOOST_AUTO_TEST_CASE(ScalarDataNoConnectivity)
43{
45 using namespace mesh;
46 // Setup geometry
47 std::string name("rectangle");
48 int dimensions = 2;
49 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
50
51 mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
52 mesh->createVertex(Eigen::Vector2d(0.0, 1.0));
53 mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
54 mesh->createVertex(Eigen::Vector2d(1.0, 1.0));
55
56 PtrData doubleData = mesh->createData("DoubleData", 1, 0_dataID);
57 doubleData->emplaceSampleAtTime(0, {1., 2., 3., 4.});
58
59 std::string fileName("precice-WatchIntegralTest-scalarData-noConnectivity.log");
60
61 {
62 impl::WatchIntegral watchIntegral(mesh, fileName, true);
63 watchIntegral.initialize();
64
65 // Write output
66 watchIntegral.exportIntegralData(0.0);
67
68 // Change data (next timestep)
69 doubleData->emplaceSampleAtTime(1, {2., 3., 4., 5.});
70
71 // Write output again
72 watchIntegral.exportIntegralData(1.0);
73
74 doubleData->moveToNextWindow();
75
76 watchIntegral.exportIntegralData(2.0);
77 }
78 // File Format: Time DoubleData
79 BOOST_TEST_CONTEXT("Validating WatchIntegral ScalarData NoConnectivity")
80 {
81 auto result = readDoublesFromTXTFile(fileName, 2);
82 auto expected = std::vector<double>{
83 0.0, 10.0,
84 1.0, 14.0,
85 2.0, 14.0};
86 BOOST_TEST(result == expected, boost::test_tools::per_element());
87 }
88}
89
91BOOST_AUTO_TEST_CASE(VectorDataNoConnectivity)
92{
94 using namespace mesh;
95 // Setup geometry
96 std::string name("rectangle");
97 int dimensions = 2;
98 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
99
100 mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
101 mesh->createVertex(Eigen::Vector2d(0.0, 1.0));
102 mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
103 mesh->createVertex(Eigen::Vector2d(1.0, 1.0));
104
105 PtrData vectorData = mesh->createData("DoubleData", 2, 0_dataID);
106 vectorData->emplaceSampleAtTime(0, {1., 2., 3., 4., 5., 6., 7., 8.});
107
108 std::string fileName("precice-WatchIntegralTest-vectorData-noConnectivity.log");
109
110 {
111 impl::WatchIntegral watchIntegral(mesh, fileName, true);
112 watchIntegral.initialize();
113
114 // Write output
115 watchIntegral.exportIntegralData(0.0);
116
117 // Change data (next timestep)
118 vectorData->emplaceSampleAtTime(1, {2., 3., 4., 5., 6., 7., 8., 9.});
119
120 // Write output again
121 watchIntegral.exportIntegralData(1.0);
122
123 vectorData->moveToNextWindow();
124
125 watchIntegral.exportIntegralData(2.0);
126 }
127 // File Format: Time DoubleData0 DoubleData1
128 BOOST_TEST_CONTEXT("Validating WatchIntegral VectorData NoConnectivity")
129 {
130 auto result = readDoublesFromTXTFile(fileName, 3);
131 auto expected = std::vector<double>{
132 0.0, 16.0, 20.0,
133 1.0, 20.0, 24.0,
134 2.0, 20.0, 24.0};
135 BOOST_TEST(result == expected, boost::test_tools::per_element());
136 }
137}
138
139PRECICE_TEST_SETUP(1_rank)
140BOOST_AUTO_TEST_CASE(ScalarDataEdgeConnectivity)
141{
142 PRECICE_TEST();
143 using namespace mesh;
144 // Setup geometry
145 std::string name("rectangle");
146 int dimensions = 2;
147 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
148
149 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
150 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
151 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector2d(1.0, 2.0));
152
153 mesh->createEdge(v1, v2);
154 mesh->createEdge(v2, v3);
155
156 PtrData doubleData = mesh->createData("DoubleData", 1, 0_dataID);
157 doubleData->emplaceSampleAtTime(0, {1., 2., 3.});
158 std::string fileName("precice-WatchIntegralTest-scalarData-edgeConnectivity.log");
159
160 {
161 impl::WatchIntegral watchIntegral(mesh, fileName, true);
162 watchIntegral.initialize();
163
164 // Write output
165 watchIntegral.exportIntegralData(0.0);
166
167 // Change data (next timestep)
168 doubleData->emplaceSampleAtTime(1, {2., 3., 4.});
169
170 // Write output again
171 watchIntegral.exportIntegralData(1.0);
172
173 doubleData->moveToNextWindow();
174
175 watchIntegral.exportIntegralData(2.0);
176 }
177 // File Format: Time DoubleData SurfaceArea
178 BOOST_TEST_CONTEXT("Validating WatchIntegral ScalarData EdgeConnectivity")
179 {
180 auto result = readDoublesFromTXTFile(fileName, 3);
181 auto expected = std::vector<double>{
182 0.0, 6.5, 3.0,
183 1.0, 9.5, 3.0,
184 2.0, 9.5, 3.0};
185 BOOST_TEST(result == expected, boost::test_tools::per_element());
186 }
187}
188
189PRECICE_TEST_SETUP(1_rank)
190BOOST_AUTO_TEST_CASE(ScalarDataEdgeConnectivityNoScale)
191{
192 PRECICE_TEST();
193 using namespace mesh;
194 // Setup geometry
195 std::string name("rectangle");
196 int dimensions = 2;
197 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
198
199 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
200 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
201 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector2d(1.0, 2.0));
202
203 mesh->createEdge(v1, v2);
204 mesh->createEdge(v2, v3);
205
206 PtrData doubleData = mesh->createData("DoubleData", 1, 0_dataID);
207 doubleData->emplaceSampleAtTime(0, {1., 2., 3.});
208
209 std::string fileName("precice-WatchIntegralTest-scalarData-edgeConnectivity-noScale.log");
210
211 {
212 impl::WatchIntegral watchIntegral(mesh, fileName, false);
213 watchIntegral.initialize();
214
215 // Write output
216 watchIntegral.exportIntegralData(0.0);
217
218 // Change data (next timestep)
219 doubleData->emplaceSampleAtTime(1, {2., 3., 4.});
220
221 // Write output again
222 watchIntegral.exportIntegralData(1.0);
223
224 doubleData->moveToNextWindow();
225
226 watchIntegral.exportIntegralData(2.0);
227 }
228 // File Format: Time DoubleData SurfaceArea
229 BOOST_TEST_CONTEXT("Validating WatchIntegral ScalarData EdgeConnectivity NoScale")
230 {
231 auto result = readDoublesFromTXTFile(fileName, 3);
232 auto expected = std::vector<double>{
233 0.0, 6.0, 3.0,
234 1.0, 9.0, 3.0,
235 2.0, 9.0, 3.0};
236 BOOST_TEST(result == expected, boost::test_tools::per_element());
237 }
238}
239
240PRECICE_TEST_SETUP(1_rank)
241BOOST_AUTO_TEST_CASE(VectorDataEdgeConnectivity)
242{
243 PRECICE_TEST();
244 using namespace mesh;
245 // Setup geometry
246 std::string name("rectangle");
247 int dimensions = 2;
248 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
249
250 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
251 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
252 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector2d(1.0, 2.0));
253
254 mesh->createEdge(v1, v2);
255 mesh->createEdge(v2, v3);
256
257 PtrData vectorData = mesh->createData("DoubleData", 2, 0_dataID);
258 vectorData->emplaceSampleAtTime(0, {1., 2., 3., 4., 5., 6.});
259
260 std::string fileName("precice-WatchIntegralTest-scalarData-edgeConnectivity.log");
261
262 {
263 impl::WatchIntegral watchIntegral(mesh, fileName, true);
264 watchIntegral.initialize();
265
266 // Write output
267 watchIntegral.exportIntegralData(0.0);
268
269 // Change data (next timestep)
270 vectorData->emplaceSampleAtTime(1, {2., 3., 4., 5., 6., 7.});
271
272 // Write output again
273 watchIntegral.exportIntegralData(1.0);
274
275 vectorData->moveToNextWindow();
276
277 watchIntegral.exportIntegralData(2.0);
278 }
279 // File Format: Time DoubleData0 DoubleData1 SurfaceArea
280 BOOST_TEST_CONTEXT("Validating WatchIntegral VectorData EdgeConnectivity")
281 {
283 auto result = readDoublesFromTXTFile(fileName, 4);
284 auto expected = std::vector<double>{
285 0.0, 10.0, 13.0, 3.0,
286 1.0, 13.0, 56.0, 3.0,
287 2.0, 13.0, 56.0, 3.0};
288 BOOST_TEST(result == expected, boost::test_tools::per_element());
289 }
290 }
291}
292
293PRECICE_TEST_SETUP(1_rank)
294BOOST_AUTO_TEST_CASE(VectorDataEdgeConnectivityNoScale)
295{
296 PRECICE_TEST();
297 using namespace mesh;
298 // Setup geometry
299 std::string name("rectangle");
300 int dimensions = 2;
301 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
302
303 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
304 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
305 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector2d(1.0, 2.0));
306
307 mesh->createEdge(v1, v2);
308 mesh->createEdge(v2, v3);
309
310 PtrData vectorData = mesh->createData("DoubleData", 2, 0_dataID);
311 vectorData->emplaceSampleAtTime(0, {1., 2., 3., 4., 5., 6.});
312
313 std::string fileName("precice-WatchIntegralTest-scalarData-edgeConnectivity-noScale.log");
314
315 {
316 impl::WatchIntegral watchIntegral(mesh, fileName, false);
317 watchIntegral.initialize();
318
319 // Write output
320 watchIntegral.exportIntegralData(0.0);
321
322 // Change data (next timestep)
323 vectorData->emplaceSampleAtTime(1, {2., 3., 4., 5., 6., 7.});
324
325 // Write output again
326 watchIntegral.exportIntegralData(1.0);
327
328 vectorData->moveToNextWindow();
329
330 watchIntegral.exportIntegralData(2.0);
331 }
332 // File Format: Time DoubleData0 DoubleData1 SurfaceArea
333 BOOST_TEST_CONTEXT("Validating WatchIntegral VectorData EdgeConnectivity NoScale")
334 {
336 auto result = readDoublesFromTXTFile(fileName, 4);
337 auto expected = std::vector<double>{
338 0.0, 9.0, 12.0, 3.0,
339 1.0, 12.0, 15.0, 3.0,
340 2.0, 12.0, 15.0, 3.0};
341 BOOST_TEST(result == expected, boost::test_tools::per_element());
342 }
343 }
344}
345
346PRECICE_TEST_SETUP(1_rank)
347BOOST_AUTO_TEST_CASE(ScalarDataFaceConnectivity)
348{
349 PRECICE_TEST();
350 using namespace mesh;
351 // Setup geometry
352 std::string name("rectangle");
353 int dimensions = 3;
354 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
355
356 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
357 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector3d(3.0, 0.0, 0.0));
358 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
359 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector3d(0.0, 4.0, 0.0));
360
361 mesh::Edge &e1 = mesh->createEdge(v1, v2);
362 mesh::Edge &e2 = mesh->createEdge(v2, v3);
363 mesh::Edge &e3 = mesh->createEdge(v3, v4);
364 mesh::Edge &e4 = mesh->createEdge(v4, v1);
365 mesh::Edge &e5 = mesh->createEdge(v1, v3);
366
367 mesh->createTriangle(e1, e2, e5);
368 mesh->createTriangle(e3, e4, e5);
369
370 PtrData doubleData = mesh->createData("DoubleData", 1, 0_dataID);
371 doubleData->emplaceSampleAtTime(0, {1., 2., 3., 4.});
372
373 std::string fileName("precice-WatchIntegralTest-scalarData-faceConnectivity.log");
374
375 {
376 impl::WatchIntegral watchIntegral(mesh, fileName, true);
377 watchIntegral.initialize();
378
379 // Write output
380 watchIntegral.exportIntegralData(0.0);
381
382 // Change data (next timestep)
383 doubleData->emplaceSampleAtTime(1, {2., 3., 4., 5.});
384
385 // Write output again
386 watchIntegral.exportIntegralData(1.0);
387
388 doubleData->moveToNextWindow();
389
390 watchIntegral.exportIntegralData(2.0);
391 }
392 // File Format: Time DoubleData SurfaceArea
393 BOOST_TEST_CONTEXT("Validating WatchIntegral ScalarData FaceConnectivity")
394 {
395 auto result = readDoublesFromTXTFile(fileName, 3);
396 auto expected = std::vector<double>{
397 0.0, 28.0, 12.0,
398 1.0, 40.0, 12.0,
399 2.0, 40.0, 12.0};
400 BOOST_TEST(result == expected, boost::test_tools::per_element());
401 }
402}
403
404PRECICE_TEST_SETUP(1_rank)
405BOOST_AUTO_TEST_CASE(ScalarDataFaceConnectivityNoScale)
406{
407 PRECICE_TEST();
408 using namespace mesh;
409 // Setup geometry
410 std::string name("rectangle");
411 int dimensions = 3;
412 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
413
414 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
415 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector3d(3.0, 0.0, 0.0));
416 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
417 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector3d(0.0, 4.0, 0.0));
418
419 mesh::Edge &e1 = mesh->createEdge(v1, v2);
420 mesh::Edge &e2 = mesh->createEdge(v2, v3);
421 mesh::Edge &e3 = mesh->createEdge(v3, v4);
422 mesh::Edge &e4 = mesh->createEdge(v4, v1);
423 mesh::Edge &e5 = mesh->createEdge(v1, v3);
424
425 mesh->createTriangle(e1, e2, e5);
426 mesh->createTriangle(e3, e4, e5);
427
428 PtrData doubleData = mesh->createData("DoubleData", 1, 0_dataID);
429 doubleData->emplaceSampleAtTime(0, {1., 2., 3., 4.});
430
431 std::string fileName("precice-WatchIntegralTest-scalarData-faceConnectivity-noScale.log");
432
433 {
434 impl::WatchIntegral watchIntegral(mesh, fileName, false);
435 watchIntegral.initialize();
436
437 // Write output
438 watchIntegral.exportIntegralData(0.0);
439
440 // Change data (next timestep)
441 doubleData->emplaceSampleAtTime(1, {2., 3., 4., 5.});
442
443 // Write output again
444 watchIntegral.exportIntegralData(1.0);
445
446 doubleData->moveToNextWindow();
447
448 watchIntegral.exportIntegralData(2.0);
449 }
450 // File Format: Time DoubleData SurfaceArea
451 BOOST_TEST_CONTEXT("Validating WatchIntegral ScalarData FaceConnectivity NoScale")
452 {
453 auto result = readDoublesFromTXTFile(fileName, 3);
454 auto expected = std::vector<double>{
455 0.0, 10.0, 12.0,
456 1.0, 14.0, 12.0,
457 2.0, 14.0, 12.0};
458 BOOST_TEST(result == expected, boost::test_tools::per_element());
459 }
460}
461
462PRECICE_TEST_SETUP(1_rank)
463BOOST_AUTO_TEST_CASE(VectorDataFaceConnectivity)
464{
465 PRECICE_TEST();
466 using namespace mesh;
467 // Setup geometry
468 std::string name("rectangle");
469 int dimensions = 3;
470 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
471
472 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
473 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector3d(3.0, 0.0, 0.0));
474 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
475 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector3d(0.0, 4.0, 0.0));
476
477 mesh::Edge &e1 = mesh->createEdge(v1, v2);
478 mesh::Edge &e2 = mesh->createEdge(v2, v3);
479 mesh::Edge &e3 = mesh->createEdge(v3, v4);
480 mesh::Edge &e4 = mesh->createEdge(v4, v1);
481 mesh::Edge &e5 = mesh->createEdge(v1, v3);
482
483 mesh->createTriangle(e1, e2, e5);
484 mesh->createTriangle(e3, e4, e5);
485
486 PtrData vectorData = mesh->createData("DoubleData", 2, 0_dataID);
487 vectorData->emplaceSampleAtTime(0, {1., 2., 3., 4., 5., 6., 7., 8.});
488
489 std::string fileName("precice-WatchIntegralTest-vectorData-faceConnectivity.log");
490
491 {
492 impl::WatchIntegral watchIntegral(mesh, fileName, true);
493 watchIntegral.initialize();
494
495 // Write output
496 watchIntegral.exportIntegralData(0.0);
497
498 // Change data (next timestep)
499 vectorData->emplaceSampleAtTime(1, {2., 3., 4., 5., 6., 7., 8., 9.});
500
501 // Write output again
502 watchIntegral.exportIntegralData(1.0);
503
504 vectorData->moveToNextWindow();
505
506 watchIntegral.exportIntegralData(2.0);
507 }
508 // File Format: Time DoubleData0 DoubleData1 SurfaceArea
509 BOOST_TEST_CONTEXT("Validating WatchIntegral VectorData FaceConnectivity")
510 {
511 auto result = readDoublesFromTXTFile(fileName, 4);
512 auto expected = std::vector<double>{
513 0.0, 44.0, 56.0, 12.0,
514 1.0, 56.0, 68.0, 12.0,
515 2.0, 56.0, 68.0, 12.0};
516 BOOST_TEST(result == expected, boost::test_tools::per_element());
517 }
518}
519
520PRECICE_TEST_SETUP(1_rank)
521BOOST_AUTO_TEST_CASE(VectorDataFaceConnectivityNoScale)
522{
523 PRECICE_TEST();
524 using namespace mesh;
525 // Setup geometry
526 std::string name("rectangle");
527 int dimensions = 3;
528 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
529
530 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
531 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector3d(3.0, 0.0, 0.0));
532 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
533 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector3d(0.0, 4.0, 0.0));
534
535 mesh::Edge &e1 = mesh->createEdge(v1, v2);
536 mesh::Edge &e2 = mesh->createEdge(v2, v3);
537 mesh::Edge &e3 = mesh->createEdge(v3, v4);
538 mesh::Edge &e4 = mesh->createEdge(v4, v1);
539 mesh::Edge &e5 = mesh->createEdge(v1, v3);
540
541 mesh->createTriangle(e1, e2, e5);
542 mesh->createTriangle(e3, e4, e5);
543
544 PtrData vectorData = mesh->createData("DoubleData", 2, 0_dataID);
545 vectorData->emplaceSampleAtTime(0, {1., 2., 3., 4., 5., 6., 7., 8.});
546
547 std::string fileName("precice-WatchIntegralTest-vectorData-faceConnectivity-noScale.log");
548
549 {
550 impl::WatchIntegral watchIntegral(mesh, fileName, false);
551 watchIntegral.initialize();
552
553 // Write output
554 watchIntegral.exportIntegralData(0.0);
555
556 // Change data (next timestep)
557 vectorData->emplaceSampleAtTime(1, {2., 3., 4., 5., 6., 7., 8., 9.});
558
559 // Write output again
560 watchIntegral.exportIntegralData(1.0);
561
562 vectorData->moveToNextWindow();
563
564 watchIntegral.exportIntegralData(2.0);
565 }
566 // File Format: Time DoubleData0 DoubleData1 SurfaceArea
567 BOOST_TEST_CONTEXT("Validating WatchIntegral VectorData FaceConnectivity NoScale")
568 {
569 auto result = readDoublesFromTXTFile(fileName, 4);
570 auto expected = std::vector<double>{
571 0.0, 16.0, 20.0, 12.0,
572 1.0, 20.0, 24.0, 12.0,
573 2.0, 20.0, 24.0, 12.0};
574 BOOST_TEST(result == expected, boost::test_tools::per_element());
575 }
576}
577
578PRECICE_TEST_SETUP(1_rank)
579BOOST_AUTO_TEST_CASE(MeshChangeFaceConnectivity)
580{
581 PRECICE_TEST();
582 using namespace mesh;
583 // Setup geometry
584 std::string name("rectangle");
585 int dimensions = 3;
586 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
587
588 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
589 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector3d(3.0, 0.0, 0.0));
590 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
591 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector3d(0.0, 4.0, 0.0));
592
593 mesh::Edge &e1 = mesh->createEdge(v1, v2);
594 mesh::Edge &e2 = mesh->createEdge(v2, v3);
595 mesh::Edge &e3 = mesh->createEdge(v3, v4);
596 mesh::Edge &e4 = mesh->createEdge(v4, v1);
597 mesh::Edge &e5 = mesh->createEdge(v1, v3);
598
599 mesh->createTriangle(e1, e2, e5);
600 mesh->createTriangle(e3, e4, e5);
601
602 PtrData doubleData = mesh->createData("DoubleData", 1, 0_dataID);
603 doubleData->emplaceSampleAtTime(0, {1., 2., 3., 4.});
604
605 std::string fileName("precice-WatchIntegralTest-meshChange-faceConnectivity.log");
606
607 {
608 impl::WatchIntegral watchIntegral(mesh, fileName, true);
609 watchIntegral.initialize();
610
611 // Write output
612 watchIntegral.exportIntegralData(0.0);
613
614 // Change data (next timestep)
615 v2.setCoords(Eigen::Vector3d(3.0, -4.0, 0.0));
616
617 // Write output again
618 watchIntegral.exportIntegralData(1.0);
619
620 doubleData->moveToNextWindow();
621
622 watchIntegral.exportIntegralData(2.0);
623 }
624 // File Format: Time DoubleData SurfaceArea
625 BOOST_TEST_CONTEXT("Validating WatchIntegral MeshChange FaceConnectivity")
626 {
627 auto result = readDoublesFromTXTFile(fileName, 3);
628 auto expected = std::vector<double>{
629 0.0, 28.0, 12.0,
630 1.0, 40.0, 18.0,
631 2.0, 40.0, 18.0};
632 BOOST_TEST(result == expected, boost::test_tools::per_element());
633 }
634}
635
636PRECICE_TEST_SETUP(""_on(4_ranks).setupIntraComm())
637BOOST_AUTO_TEST_CASE(ScalarDataNoConnectivityParallel)
638{
639 PRECICE_TEST();
640 using namespace mesh;
641 // Setup geometry
642 std::string name("rectangle");
643 int dimensions = 2;
644 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
645 PtrData doubleData = mesh->createData("DoubleData", 1, 0_dataID);
646
648 mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
649 mesh->createVertex(Eigen::Vector2d(0.0, 1.0));
650 } else if (context.isRank(1)) {
651 mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
652 mesh->createVertex(Eigen::Vector2d(1.0, 1.0));
653 } else if (context.isRank(2)) {
654 mesh->createVertex(Eigen::Vector2d(2.0, 0.0));
655 mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
656 } else if (context.isRank(3)) {
657 mesh->createVertex(Eigen::Vector2d(3.0, 0.0));
658 mesh->createVertex(Eigen::Vector2d(0.0, 1.0));
659 }
660
662 doubleData->emplaceSampleAtTime(0, {1.0, 2.0});
663 } else if (context.isRank(1)) {
664 doubleData->emplaceSampleAtTime(0, {3.0, 4.0});
665 } else if (context.isRank(2)) {
666 doubleData->emplaceSampleAtTime(0, {5.0, 6.0});
667 } else if (context.isRank(3)) {
668 doubleData->emplaceSampleAtTime(0, {7.0, 8.0});
669 }
670
671 std::string fileName("precice-WatchIntegralTest-scalarData-noConnectivity-parallel.log");
672
673 {
674 impl::WatchIntegral watchIntegral(mesh, fileName, true);
675 watchIntegral.initialize();
676
677 // Write output
678 watchIntegral.exportIntegralData(0.0);
679
680 // Change data (next timestep)
682 doubleData->emplaceSampleAtTime(1, {2.0, 3.0});
683 } else if (context.isRank(1)) {
684 doubleData->emplaceSampleAtTime(1, {4.0, 5.0});
685 } else if (context.isRank(2)) {
686 doubleData->emplaceSampleAtTime(1, {6.0, 7.0});
687 } else if (context.isRank(3)) {
688 doubleData->emplaceSampleAtTime(1, {8.0, 9.0});
689 }
690
691 // Write output again
692 watchIntegral.exportIntegralData(1.0);
693
694 doubleData->moveToNextWindow();
695
696 watchIntegral.exportIntegralData(2.0);
697 }
698 // File Format: Time DoubleData
699 BOOST_TEST_CONTEXT("Validating WatchIntegral ScalarData NoConnectivity Parallel")
700 {
702 auto result = readDoublesFromTXTFile(fileName, 2);
703 auto expected = std::vector<double>{
704 0.0, 36.0,
705 1.0, 44.0,
706 2.0, 44.0};
707 BOOST_TEST(result == expected, boost::test_tools::per_element());
708 }
709 }
710}
711
712PRECICE_TEST_SETUP(""_on(4_ranks).setupIntraComm())
713BOOST_AUTO_TEST_CASE(VectorDataNoConnectivityParallel)
714{
715 PRECICE_TEST();
716 using namespace mesh;
717 // Setup geometry
718 std::string name("rectangle");
719 int dimensions = 2;
720 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
721 PtrData vectorData = mesh->createData("DoubleData", 2, 0_dataID);
722
724 mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
725 mesh->createVertex(Eigen::Vector2d(0.0, 1.0));
726 } else if (context.isRank(1)) {
727 mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
728 mesh->createVertex(Eigen::Vector2d(1.0, 1.0));
729 } else if (context.isRank(2)) {
730 mesh->createVertex(Eigen::Vector2d(2.0, 0.0));
731 mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
732 } else if (context.isRank(3)) {
733 mesh->createVertex(Eigen::Vector2d(3.0, 0.0));
734 mesh->createVertex(Eigen::Vector2d(0.0, 1.0));
735 }
736
738 vectorData->emplaceSampleAtTime(0, {1.0, 2.0, 3.0, 4.0});
739 } else if (context.isRank(1)) {
740 vectorData->emplaceSampleAtTime(0, {5.0, 6.0, 7.0, 8.0});
741 } else if (context.isRank(2)) {
742 vectorData->emplaceSampleAtTime(0, {9.0, 10.0, 11.0, 12.0});
743 } else if (context.isRank(3)) {
744 vectorData->emplaceSampleAtTime(0, {13.0, 14.0, 15.0, 16.0});
745 }
746
747 std::string fileName("precice-WatchIntegralTest-vectorData-noConnectivity-parallel.log");
748
749 {
750 impl::WatchIntegral watchIntegral(mesh, fileName, true);
751 watchIntegral.initialize();
752
753 // Write output
754 watchIntegral.exportIntegralData(0.0);
755
756 // Change data (next timestep)
758 vectorData->emplaceSampleAtTime(1, {2.0, 3.0, 4.0, 5.0});
759 } else if (context.isRank(1)) {
760 vectorData->emplaceSampleAtTime(1, {6.0, 7.0, 8.0, 9.0});
761 } else if (context.isRank(2)) {
762 vectorData->emplaceSampleAtTime(1, {10.0, 11.0, 12.0, 13.0});
763 } else if (context.isRank(3)) {
764 vectorData->emplaceSampleAtTime(1, {14.0, 15.0, 16.0, 17.0});
765 }
766
767 // Write output again
768 watchIntegral.exportIntegralData(1.0);
769
770 vectorData->moveToNextWindow();
771
772 watchIntegral.exportIntegralData(2.0);
773 }
774 // File Format: Time DoubleData
775 BOOST_TEST_CONTEXT("Validating WatchIntegral VectorData NoConnectivity Parallel")
776 {
778 auto result = readDoublesFromTXTFile(fileName, 3);
779 auto expected = std::vector<double>{
780 0.0, 64.0, 72.0,
781 1.0, 72.0, 80.0,
782 2.0, 72.0, 80.0};
783 BOOST_TEST(result == expected, boost::test_tools::per_element());
784 }
785 }
786}
787
788PRECICE_TEST_SETUP(""_on(4_ranks).setupIntraComm())
789BOOST_AUTO_TEST_CASE(ScalarDataEdgeConnectivityParallel)
790{
791 PRECICE_TEST();
792 using namespace mesh;
793 // Setup geometry
794 std::string name("rectangle");
795 int dimensions = 2;
796 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
797
799 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
800 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
801 mesh->createEdge(v1, v2);
802 }
803 if (context.isRank(1)) {
804 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector2d(1.0, 1.0));
805 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector2d(1.0, 2.0));
806 mesh->createEdge(v3, v4);
807 }
808 if (context.isRank(2)) {
809 mesh::Vertex &v5 = mesh->createVertex(Eigen::Vector2d(2.0, 1.0));
810 mesh::Vertex &v6 = mesh->createVertex(Eigen::Vector2d(2.0, 2.0));
811 mesh->createEdge(v5, v6);
812 }
813 if (context.isRank(3)) {
814 mesh::Vertex &v7 = mesh->createVertex(Eigen::Vector2d(3.0, 1.0));
815 mesh::Vertex &v8 = mesh->createVertex(Eigen::Vector2d(3.0, 3.0));
816 mesh->createEdge(v7, v8);
817 }
818
819 PtrData doubleData = mesh->createData("DoubleData", 1, 0_dataID);
820
822 doubleData->emplaceSampleAtTime(0, {1.0, 2.0});
823 }
824 if (context.isRank(1)) {
825 doubleData->emplaceSampleAtTime(0, {3.0, 4.0});
826 }
827 if (context.isRank(2)) {
828 doubleData->emplaceSampleAtTime(0, {5.0, 6.0});
829 }
830 if (context.isRank(3)) {
831 doubleData->emplaceSampleAtTime(0, {7.0, 8.0});
832 }
833
834 std::string fileName("precice-WatchIntegralTest-scalarData-edgeConnectivity-parallel.log");
835
836 {
837 impl::WatchIntegral watchIntegral(mesh, fileName, true);
838 watchIntegral.initialize();
839
840 // Write output
841 watchIntegral.exportIntegralData(0.0);
842
843 // Change data (next timestep)
845 doubleData->emplaceSampleAtTime(1, {2.0, 3.0});
846 }
847 if (context.isRank(1)) {
848 doubleData->emplaceSampleAtTime(1, {4.0, 5.0});
849 }
850 if (context.isRank(2)) {
851 doubleData->emplaceSampleAtTime(1, {6.0, 7.0});
852 }
853 if (context.isRank(3)) {
854 doubleData->emplaceSampleAtTime(1, {8.0, 9.0});
855 }
856
857 // Write output again
858 watchIntegral.exportIntegralData(1.0);
859
860 doubleData->moveToNextWindow();
861
862 watchIntegral.exportIntegralData(2.0);
863 }
864 // File Format: Time DoubleData SurfaceArea
865 BOOST_TEST_CONTEXT("Validating WatchIntegral ScalarData EdgeConnectivity Parallel")
866 {
868 auto result = readDoublesFromTXTFile(fileName, 3);
869 auto expected = std::vector<double>{
870 0.0, 25.5, 5.0,
871 1.0, 30.5, 5.0,
872 2.0, 30.5, 5.0};
873 BOOST_TEST(result == expected, boost::test_tools::per_element());
874 }
875 }
876}
877
878PRECICE_TEST_SETUP(""_on(4_ranks).setupIntraComm())
879BOOST_AUTO_TEST_CASE(VectorDataEdgeConnectivityParallel)
880{
881 PRECICE_TEST();
882 using namespace mesh;
883 // Setup geometry
884 std::string name("rectangle");
885 int dimensions = 2;
886 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
887
889 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
890 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
891 mesh->createEdge(v1, v2);
892 }
893 if (context.isRank(1)) {
894 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector2d(1.0, 1.0));
895 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector2d(1.0, 2.0));
896 mesh->createEdge(v3, v4);
897 }
898 if (context.isRank(2)) {
899 mesh::Vertex &v5 = mesh->createVertex(Eigen::Vector2d(2.0, 1.0));
900 mesh::Vertex &v6 = mesh->createVertex(Eigen::Vector2d(2.0, 2.0));
901 mesh->createEdge(v5, v6);
902 }
903 if (context.isRank(3)) {
904 mesh::Vertex &v7 = mesh->createVertex(Eigen::Vector2d(3.0, 1.0));
905 mesh::Vertex &v8 = mesh->createVertex(Eigen::Vector2d(3.0, 3.0));
906 mesh->createEdge(v7, v8);
907 }
908
909 PtrData vectorData = mesh->createData("DoubleData", 2, 0_dataID);
910
912 vectorData->emplaceSampleAtTime(0, {1.0, 2.0, 3.0, 4.0});
913 }
914 if (context.isRank(1)) {
915 vectorData->emplaceSampleAtTime(0, {5.0, 6.0, 7.0, 8.0});
916 }
917 if (context.isRank(2)) {
918 vectorData->emplaceSampleAtTime(0, {9.0, 10.0, 11.0, 12.0});
919 }
920 if (context.isRank(3)) {
921 vectorData->emplaceSampleAtTime(0, {13.0, 14.0, 15.0, 16.0});
922 }
923
924 std::string fileName("precice-WatchIntegralTest-scalarData-edgeConnectivity-parallel.log");
925
926 {
927 impl::WatchIntegral watchIntegral(mesh, fileName, true);
928 watchIntegral.initialize();
929
930 // Write output
931 watchIntegral.exportIntegralData(0.0);
932
933 // Change data (next timestep)
935 vectorData->emplaceSampleAtTime(1, {2.0, 3.0, 4.0, 5.0});
936 }
937 if (context.isRank(1)) {
938 vectorData->emplaceSampleAtTime(1, {6.0, 7.0, 8.0, 9.0});
939 }
940 if (context.isRank(2)) {
941 vectorData->emplaceSampleAtTime(1, {10.0, 11.0, 12.0, 13.0});
942 }
943 if (context.isRank(3)) {
944 vectorData->emplaceSampleAtTime(1, {14.0, 15.0, 16.0, 17.0});
945 }
946
947 // Write output again
948 watchIntegral.exportIntegralData(1.0);
949
950 vectorData->moveToNextWindow();
951
952 watchIntegral.exportIntegralData(2.0);
953 }
954 // File Format: Time DoubleData0 DoubleData1 SurfaceArea
955 BOOST_TEST_CONTEXT("Validating WatchIntegral VectorData EdgeConnectivity Parallel")
956 {
958 auto result = readDoublesFromTXTFile(fileName, 4);
959 auto expected = std::vector<double>{
960 0.0, 46.0, 51.0, 5.0,
961 1.0, 51.0, 56.0, 5.0,
962 2.0, 51.0, 56.0, 5.0};
963 BOOST_TEST(result == expected, boost::test_tools::per_element());
964 }
965 }
966}
967
968PRECICE_TEST_SETUP(""_on(4_ranks).setupIntraComm())
969BOOST_AUTO_TEST_CASE(ScalarDataFaceConnectivityParallel)
970{
971 PRECICE_TEST();
972 using namespace mesh;
973 // Setup geometry
974 std::string name("rectangle");
975 int dimensions = 3;
976 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
977
979 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
980 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector3d(3.0, 0.0, 0.0));
981 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
982 mesh::Edge &e1 = mesh->createEdge(v1, v2);
983 mesh::Edge &e2 = mesh->createEdge(v2, v3);
984 mesh::Edge &e5 = mesh->createEdge(v1, v3);
985 mesh->createTriangle(e1, e2, e5);
986 }
987 if (context.isRank(1)) {
988 }
989 if (context.isRank(2)) {
990 }
991 if (context.isRank(3)) {
992 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
993 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
994 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector3d(0.0, 4.0, 0.0));
995 mesh::Edge &e3 = mesh->createEdge(v3, v4);
996 mesh::Edge &e4 = mesh->createEdge(v4, v1);
997 mesh::Edge &e5 = mesh->createEdge(v1, v3);
998 mesh->createTriangle(e3, e4, e5);
999 }
1000
1001 PtrData doubleData = mesh->createData("DoubleData", 1, 0_dataID);
1002
1004 doubleData->emplaceSampleAtTime(0, {1.0, 2.0, 3.0});
1005 }
1006 if (context.isRank(1)) {
1007 doubleData->emplaceSampleAtTime(0);
1008 }
1009 if (context.isRank(2)) {
1010 doubleData->emplaceSampleAtTime(0);
1011 }
1012 if (context.isRank(3)) {
1013 doubleData->emplaceSampleAtTime(0, {1.0, 3.0, 4.0});
1014 }
1015
1016 std::string fileName("precice-WatchIntegralTest-scalarData-faceConnectivity-parallel.log");
1017
1018 {
1019 impl::WatchIntegral watchIntegral(mesh, fileName, true);
1020 watchIntegral.initialize();
1021
1022 // Write output
1023 watchIntegral.exportIntegralData(0.0);
1024
1025 // Change data (next timestep)
1027 doubleData->emplaceSampleAtTime(1, {2.0, 3.0, 4.0});
1028 }
1029 if (context.isRank(1)) {
1030 doubleData->emplaceSampleAtTime(1);
1031 }
1032 if (context.isRank(2)) {
1033 doubleData->emplaceSampleAtTime(1);
1034 }
1035 if (context.isRank(3)) {
1036 doubleData->emplaceSampleAtTime(1, {2.0, 4.0, 5.0});
1037 }
1038
1039 // Write output again
1040 watchIntegral.exportIntegralData(1.0);
1041
1042 doubleData->moveToNextWindow();
1043
1044 watchIntegral.exportIntegralData(2.0);
1045 }
1046 // File Format: Time DoubleData SurfaceArea
1047 BOOST_TEST_CONTEXT("Validating WatchIntegral ScalarData FaceConnectivity Parallel")
1048 {
1050 auto result = readDoublesFromTXTFile(fileName, 3);
1051 auto expected = std::vector<double>{
1052 0.0, 28.0, 12.0,
1053 1.0, 40.0, 12.0,
1054 2.0, 40.0, 12.0};
1055 BOOST_TEST(result == expected, boost::test_tools::per_element());
1056 }
1057 }
1058}
1059
1060PRECICE_TEST_SETUP(""_on(4_ranks).setupIntraComm())
1061BOOST_AUTO_TEST_CASE(VectorDataFaceConnectivityParallel)
1062{
1063 PRECICE_TEST();
1064 using namespace mesh;
1065 // Setup geometry
1066 std::string name("rectangle");
1067 int dimensions = 3;
1068 PtrMesh mesh(new Mesh(name, dimensions, testing::nextMeshID()));
1069
1071 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
1072 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector3d(3.0, 0.0, 0.0));
1073 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
1074 mesh::Edge &e1 = mesh->createEdge(v1, v2);
1075 mesh::Edge &e2 = mesh->createEdge(v2, v3);
1076 mesh::Edge &e5 = mesh->createEdge(v1, v3);
1077 mesh->createTriangle(e1, e2, e5);
1078 }
1079 if (context.isRank(1)) {
1080 }
1081 if (context.isRank(2)) {
1082 }
1083 if (context.isRank(3)) {
1084 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
1085 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
1086 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector3d(0.0, 4.0, 0.0));
1087 mesh::Edge &e3 = mesh->createEdge(v3, v4);
1088 mesh::Edge &e4 = mesh->createEdge(v4, v1);
1089 mesh::Edge &e5 = mesh->createEdge(v1, v3);
1090 mesh->createTriangle(e3, e4, e5);
1091 }
1092
1093 PtrData doubleData = mesh->createData("DoubleData", 3, 0_dataID);
1094
1096 doubleData->emplaceSampleAtTime(0, {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0});
1097 }
1098 if (context.isRank(1)) {
1099 doubleData->emplaceSampleAtTime(0);
1100 }
1101 if (context.isRank(2)) {
1102 doubleData->emplaceSampleAtTime(0);
1103 }
1104 if (context.isRank(3)) {
1105 doubleData->emplaceSampleAtTime(0, {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0});
1106 }
1107
1108 std::string fileName("precice-WatchIntegralTest-vectorData-faceConnectivity-parallel.log");
1109
1110 {
1111 impl::WatchIntegral watchIntegral(mesh, fileName, true);
1112 watchIntegral.initialize();
1113
1114 // Write output
1115 watchIntegral.exportIntegralData(0.0);
1116
1117 // Change data (next timestep)
1119 doubleData->emplaceSampleAtTime(1, {2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0});
1120 }
1121 if (context.isRank(1)) {
1122 doubleData->emplaceSampleAtTime(1);
1123 }
1124 if (context.isRank(2)) {
1125 doubleData->emplaceSampleAtTime(1);
1126 }
1127 if (context.isRank(3)) {
1128 doubleData->emplaceSampleAtTime(1, {2.0, 3.0, 6.0, 7.0, 8.0, 9.0, 8.0, 9.0, 10.0});
1129 }
1130
1131 // Write output again
1132 watchIntegral.exportIntegralData(1.0);
1133
1134 doubleData->moveToNextWindow();
1135
1136 watchIntegral.exportIntegralData(2.0);
1137 }
1138 // File Format: Time DoubleData SurfaceArea
1139 BOOST_TEST_CONTEXT("Validating WatchIntegral VectorData FaceConnectivity Parallel")
1140 {
1142 auto result = readDoublesFromTXTFile(fileName, 5);
1143 auto expected = std::vector<double>{
1144 0.0, 48.0, 60.0, 72.0, 12.0,
1145 1.0, 64.0, 76.0, 92.0, 12.0,
1146 2.0, 64.0, 76.0, 92.0, 12.0};
1147 BOOST_TEST(result == expected, boost::test_tools::per_element());
1148 }
1149 }
1150}
1151
1153BOOST_AUTO_TEST_SUITE_END() // Precice
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
std::string name
#define PRECICE_TEST()
Definition Testing.hpp:39
#define PRECICE_TEST_SETUP(...)
Creates and attaches a TestSetup to a Boost test case.
Definition Testing.hpp:29
BOOST_AUTO_TEST_CASE(ScalarDataNoConnectivity)
Track and output transient integral data on a mesh.
void initialize()
Adds surface area information based on mesh connectivity.
void exportIntegralData(double time)
Writes one line with data of the integral over the mesh into the output file.
Linear edge of a mesh, defined by two Vertex objects.
Definition Edge.hpp:15
Vertex of a mesh.
Definition Vertex.hpp:16
void setCoords(const VECTOR_T &coordinates)
Sets the coordinates of the vertex.
Definition Vertex.hpp:101
static bool isPrimary()
True if this process is running the primary rank.
Definition IntraComm.cpp:52
provides Mesh, Data and primitives.
std::shared_ptr< Data > PtrData
std::shared_ptr< Mesh > PtrMesh
void ignore(Arguments &&...)
Definition ignore.hpp:10
Main namespace of the precice library.