29 const int dimensions = 2;
34 dataScalar->requireDataGradient();
35 dataVector->requireDataGradient();
41 Eigen::VectorXd &valuesScalar = dataScalar->values();
42 Eigen::VectorXd &valuesVector = dataVector->values();
43 valuesScalar.setLinSpaced(1., 5.);
44 valuesVector.setLinSpaced(1., 5.);
47 Eigen::MatrixXd &gradientsScalar = dataScalar->gradients();
48 Eigen::MatrixXd &gradientsVector = dataVector->gradients();
49 gradientsScalar.setOnes();
50 gradientsVector.setOnes();
54 exportVTP.
doExport(filename, location, mesh);
60 const int dimensions = 3;
65 dataScalar->requireDataGradient();
66 dataVector->requireDataGradient();
72 Eigen::VectorXd &valuesScalar = dataScalar->values();
73 Eigen::VectorXd &valuesVector = dataVector->values();
75 valuesScalar.setLinSpaced(1., 5.);
76 valuesVector.setLinSpaced(1., 5.);
79 Eigen::MatrixXd &gradientsScalar = dataScalar->gradients();
80 Eigen::MatrixXd &gradientsVector = dataVector->gradients();
81 gradientsScalar.setOnes();
82 gradientsVector.setOnes();
86 exportVTP.
doExport(filename, location, mesh);
103 std::string filename =
"io-VTPExport-ExportPolygonalMesh";
105 exportVTP.
doExport(filename, location, mesh);
114 if (context.isRank(0)) {
123 }
else if (context.isRank(1)) {
125 }
else if (context.isRank(2)) {
133 }
else if (context.isRank(3)) {
138 std::string filename =
"io-ExportVTPTest-testExportPolygonalMesh";
140 exportVTP.
doExport(filename, location, mesh);
149 if (context.isRank(0)) {
160 }
else if (context.isRank(1)) {
162 }
else if (context.isRank(2)) {
171 }
else if (context.isRank(3)) {
176 std::string filename =
"io-ExportVTPTest-testExportTriangulatedMesh";
178 exportVTP.
doExport(filename, location, mesh);
188 if (context.isRank(0)) {
201 }
else if (context.isRank(1)) {
212 }
else if (context.isRank(2)) {
223 }
else if (context.isRank(3)) {
239 exportVTP.
doExport(filename, location, mesh);
BOOST_AUTO_TEST_CASE(ExportDataWithGradient2D)
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
#define PRECICE_TEST(...)
void doExport(const std::string &name, const std::string &location, const mesh::Mesh &mesh) override
Does export. Has to be implemented in subclass.
Linear edge of a mesh, defined by two Vertex objects.
Container and creator for meshes.
Triangle & createTriangle(Edge &edgeOne, Edge &edgeTwo, Edge &edgeThree)
Creates and initializes a Triangle object.
PtrData & createData(const std::string &name, int dimension, DataID id, int waveformDegree=time::Time::DEFAULT_WAVEFORM_DEGREE)
Create only data for vertex.
void setVertexOffsets(VertexOffsets vertexOffsets)
Only used for tests.
Edge & createEdge(Vertex &vertexOne, Vertex &vertexTwo)
Creates and initializes an Edge object.
Vertex & createVertex(const Eigen::VectorXd &coords)
Creates and initializes a Vertex object.
void allocateDataValues()
Allocates memory for the vertex data values and corresponding gradient values.
provides Mesh, Data and primitives.
Main namespace of the precice library.