Commit 7b89c060 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[examples][python] use new mesh size setters

parent 1c29399f
Pipeline #2766 passed with stages
in 13 minutes and 14 seconds
......@@ -115,6 +115,7 @@ network = builder.build();
print("\n --- Writing .geo file ---\n")
from frackit.io import GmshWriter
writer = GmshWriter(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)
writer.write("network") # filename of the .geo files (will add extension .geo automatically)
print("\n --- Finished writing .geo file ---\n")
......@@ -148,6 +148,6 @@ network = builder.build();
print("\n --- Writing .geo file ---\n")
from frackit.io import GmshWriter
writer = GmshWriter(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)
writer.write("network") # filename of the .geo files (will add extension .geo automatically)
print("\n --- Finished writing .geo file ---\n")
......@@ -205,9 +205,9 @@ for setId in entitySets: builder.addSubDomainEntities(entitySets[setId], Id(2))
# now we can build and write out the network in Gmsh file format
from frackit.io import GmshWriter
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") # body of the filename to be used (will add .geo)
# we can also not confine the network to its sub-domain,
# simply by adding the sub-domains as non-confining
......@@ -219,7 +219,9 @@ builder.addSubDomain(solids[2], Id(3));
for setId in entitySets: builder.addSubDomainEntities(entitySets[setId], 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...
......@@ -229,7 +231,8 @@ uncontainedBuilder.addConfiningSubDomain(networkDomain, Id(2));
for setId in entitySets: uncontainedBuilder.addSubDomainEntities(entitySets[setId], 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
print("Building and writing uncontained, unconfined network")
......@@ -237,4 +240,5 @@ uncontainedBuilder.clear();
for setId in entitySets: uncontainedBuilder.addSubDomainEntities(entitySets[setId], Id(2))
gmshWriter = GmshWriter(uncontainedBuilder.build());
gmshWriter.write("uncontained_unconfined", 2.5);
gmshWriter.setMeshSize(GmshWriter.GeometryTag.entity, 2.5)
gmshWriter.write("uncontained_unconfined");
......@@ -363,7 +363,9 @@ for id in entitySets: builder.addSubDomainEntities(entitySets[id], Id(1))
# now we can build and write out the network in Gmsh file format
from frackit.io import GmshWriter
gmshWriter = GmshWriter(builder.build());
gmshWriter.write("network", 0.5, 5.0)
gmshWriter.setMeshSize(GmshWriter.GeometryTag.entity, 0.5)
gmshWriter.setMeshSize(GmshWriter.GeometryTag.subDomain, 5.0)
gmshWriter.write("network")
stopTime = process_time()
print("Overall CPU time was {:.2f} seconds.".format(stopTime-startTime))
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