Commit 66410b32 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[examples] avoid compiler warning

parent 77984220
......@@ -147,8 +147,8 @@ This network can then be written to disk, for example in [Gmsh][1] (.geo) file f
```cpp
GmshWriter writer(network);
writer.write("network", // filename of the .geo files (will add extension .geo automatically)
0.1); // element size to be used on the network entities
writer.setMeshSize(GmshWriter::GeometryTag::entity, 0.1); // mesh size at entities
writer.write("network"); // filename of the .geo files (will add extension .geo automatically)
```
Note that with the `EntityNetworkBuilder` class we have created a network that
......
......@@ -133,8 +133,8 @@ int main(int argc, char** argv)
// meshed by a two-dimensional surface mesh
std::cout << "\n --- Writing .geo file ---\n" << std::endl;
GmshWriter writer(network);
writer.write("network", // filename of the .geo files (will add extension .geo automatically)
0.1); // element size to be used
writer.setMeshSize(GmshWriter::GeometryTag::entity, 0.1); // mesh size at entities
writer.write("network"); // filename of the .geo files (will add extension .geo automatically)
std::cout << "\n --- Finished writing .geo file ---\n" << std::endl;
return 0;
......
......@@ -143,9 +143,9 @@ which we can also pass to the `GmshWriter`:
```cpp
GmshWriter writer(network);
writer.write("network", // filename of the .geo files (will add extension .geo automatically)
0.1, // element size to be used on the quadrilaterals
0.2); // element size to be used in the domain away from the quadrilaterals
writer.setMeshSize(GmshWriter::GeometryTag::entity, 0.1); // mesh size at entities
writer.setMeshSize(GmshWriter::GeometryTag::subDomain, 0.2); // mesh size in the domain away from entities
writer.write("network"); // filename of the .geo files (will add extension .geo automatically)
```
As you can see, one can specify different mesh sizes to be used on the fracture
......
......@@ -133,9 +133,9 @@ int main(int argc, char** argv)
// to the two-dimensional quadrilaterals
std::cout << "\n --- Writing .geo file ---\n" << std::endl;
GmshWriter writer(network);
writer.write("network", // filename of the .geo files (will add extension .geo automatically)
0.1, // element size to be used on the quadrilaterals
0.2); // element size to be used in the domain away from the quadrilaterals
writer.setMeshSize(GmshWriter::GeometryTag::entity, 0.1); // mesh size at entities
writer.setMeshSize(GmshWriter::GeometryTag::subDomain, 0.2); // mesh size in the domain away from entities
writer.write("network"); // filename of the .geo files (will add extension .geo automatically)
std::cout << "\n --- Finished writing .geo file ---\n" << std::endl;
return 0;
......
......@@ -235,9 +235,9 @@ int main(int argc, char** argv)
// now we can build and write out the network in Gmsh file format
GmshWriter gmshWriter(builder.build());
gmshWriter.write("contained_confined", // body of the filename to be used (will add .geo)
2.5, // mesh size to be used on entities
5.0); // mesh size to be used on domain boundaries
gmshWriter.setMeshSize(GmshWriter::GeometryTag::entity, 2.5);
gmshWriter.setMeshSize(GmshWriter::GeometryTag::subDomain, 5.0);
gmshWriter.write("contained_confined");
// we can also not confine the network to its sub-domain,
// simply by adding the sub-domains as non-confining
......@@ -249,7 +249,9 @@ int main(int argc, char** argv)
entitySets.exportEntitySets(builder, Id(2));
gmshWriter = GmshWriter(builder.build());
gmshWriter.write("contained_unconfined", 2.5, 5.0);
gmshWriter.setMeshSize(GmshWriter::GeometryTag::entity, 2.5);
gmshWriter.setMeshSize(GmshWriter::GeometryTag::subDomain, 5.0);
gmshWriter.write("contained_unconfined");
// We could also only write out the network, without the domain
// For example, confining the network to the sub-domain...
......@@ -258,14 +260,16 @@ int main(int argc, char** argv)
uncontainedBuilder.addConfiningSubDomain(networkDomain, Id(2));
entitySets.exportEntitySets(uncontainedBuilder, Id(2));
gmshWriter = GmshWriter(uncontainedBuilder.build());
gmshWriter.write("uncontained_confined", 2.5);
gmshWriter.setMeshSize(GmshWriter::GeometryTag::entity, 2.5);
gmshWriter.write("uncontained_confined");
// ... or not confining it
std::cout << "Building and writing uncontained, unconfined network" << std::endl;
uncontainedBuilder.clear();
entitySets.exportEntitySets(uncontainedBuilder);
gmshWriter = GmshWriter(uncontainedBuilder.build());
gmshWriter.write("uncontained_unconfined", 2.5);
gmshWriter.setMeshSize(GmshWriter::GeometryTag::entity, 2.5);
gmshWriter.write("uncontained_unconfined");
return 0;
}
......@@ -262,6 +262,7 @@ Gmsh file format:
```cpp
// now we can build and write out the network in Gmsh file format
GmshWriter gmshWriter(builder.build());
gmshWriter.write("network", /*sizeAtEntities*/0.5, /*sizeInDomain*/5.0);
gmshWriter.setMeshSize(GmshWriter::GeometryTag::entity, 0.5);
gmshWriter.setMeshSize(GmshWriter::GeometryTag::subDomain, 5.0);
gmshWriter.write("network");
```
......@@ -439,7 +439,9 @@ int main(int argc, char** argv)
// now we can build and write out the network in Gmsh file format
GmshWriter gmshWriter(builder.build());
gmshWriter.write("network", /*sizeAtEntities*/0.5, /*sizeInDomain*/5.0);
gmshWriter.setMeshSize(GmshWriter::GeometryTag::entity, 0.5);
gmshWriter.setMeshSize(GmshWriter::GeometryTag::subDomain, 5.0);
gmshWriter.write("network");
// print time it took to generate the network
const auto end = std::chrono::steady_clock::now();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment