Skip to content
Snippets Groups Projects
Commit 3b24fbfc authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

work on tutorials

parent 44c0ffb0
No related branches found
No related tags found
No related merge requests found
4.5.6 (Work-in-progress): small bug fixes. 4.5.6 (Work-in-progress): API tutorials; small bug fixes.
4.5.5 (March 21, 2020): tooltips in GUI to help discovery of scripting options; 4.5.5 (March 21, 2020): tooltips in GUI to help discovery of scripting options;
fixed MED IO of high-order elements; fixed OCC attribute search by bounding box; fixed MED IO of high-order elements; fixed OCC attribute search by bounding box;
...@@ -6,7 +6,7 @@ fix parsing of mac-encoded scripts; new RecombineMesh command; added support for ...@@ -6,7 +6,7 @@ fix parsing of mac-encoded scripts; new RecombineMesh command; added support for
extrusion of mixed-dimension entities with OCC; small bug fixes. extrusion of mixed-dimension entities with OCC; small bug fixes.
4.5.4 (February 29, 2020): periodic mesh optimization now ensures that the 4.5.4 (February 29, 2020): periodic mesh optimization now ensures that the
master mesh is not modified; code cleanup; API tutorials; small bug fixes. master mesh is not modified; code cleanup; small bug fixes.
4.5.3 (February 22, 2020): improved positioning of corresponding nodes on 4.5.3 (February 22, 2020): improved positioning of corresponding nodes on
periodic entities; improved LaTeX output; improved curve splitting in periodic entities; improved LaTeX output; improved curve splitting in
......
...@@ -11,7 +11,7 @@ int main(int argc, char **argv) ...@@ -11,7 +11,7 @@ int main(int argc, char **argv)
gmsh::initialize(); gmsh::initialize();
gmsh::option::setNumber("General.Terminal", 1); gmsh::option::setNumber("General.Terminal", 1);
model::add("t7"); model::add("t8");
// Copied from t1.cpp... // Copied from t1.cpp...
double lc = 1e-2; double lc = 1e-2;
...@@ -35,6 +35,7 @@ int main(int argc, char **argv) ...@@ -35,6 +35,7 @@ int main(int argc, char **argv)
} }
catch(...) { catch(...) {
gmsh::logger::write("Could not load post-processing views: bye!"); gmsh::logger::write("Could not load post-processing views: bye!");
gmsh::finalize();
return 0; return 0;
} }
......
# This file reimplements gmsh/tutorial/t14.geo in Python. # This file reimplements gmsh/tutorial/t14.geo in Python.
# /*********************************************************************
# *
# * Gmsh tutorial 14
# *
# * Homology and cohomology computation
# *
# *********************************************************************/
# Homology computation in Gmsh finds representative chains of (relative) # Homology computation in Gmsh finds representative chains of (relative)
# (co)homology space bases using a mesh of a model. The representative basis # (co)homology space bases using a mesh of a model. The representative basis
# chains are stored in the mesh as physical groups of Gmsh, one for each chain. # chains are stored in the mesh as physical groups of Gmsh, one for each chain.
...@@ -90,32 +82,44 @@ for tag in terminal_tags: ...@@ -90,32 +82,44 @@ for tag in terminal_tags:
# Whole domain surface # Whole domain surface
boundary_physical_tag = 2002 boundary_physical_tag = 2002
gmsh.model.addPhysicalGroup(dim=2, tags=boundary_tags, tag=boundary_physical_tag) gmsh.model.addPhysicalGroup(dim=2, tags=boundary_tags,
gmsh.model.setPhysicalName(dim=2, tag=boundary_physical_tag, name="Boundary") tag=boundary_physical_tag)
gmsh.model.setPhysicalName(dim=2, tag=boundary_physical_tag,
name="Boundary")
# Complement of the domain surface respect to the four terminals # Complement of the domain surface respect to the four terminals
complement_physical_tag = 2003 complement_physical_tag = 2003
gmsh.model.addPhysicalGroup(dim=2, tags=complement_tags, tag=complement_physical_tag) gmsh.model.addPhysicalGroup(dim=2, tags=complement_tags,
gmsh.model.setPhysicalName(dim=2, tag=complement_physical_tag, name="Complement") tag=complement_physical_tag)
gmsh.model.setPhysicalName(dim=2, tag=complement_physical_tag,
name="Complement")
gmsh.model.geo.synchronize() gmsh.model.geo.synchronize()
# Find bases for relative homology spaces of the domain modulo the four # Find bases for relative homology spaces of the domain modulo the four
# terminals. # terminals.
gmsh.model.mesh.computeHomology(domainTags=[domain_physical_tag], subdomainTags=[terminals_physical_tag], dims=[0,1,2,3]) gmsh.model.mesh.computeHomology(domainTags=[domain_physical_tag],
subdomainTags=[terminals_physical_tag],
dims=[0,1,2,3])
# Find homology space bases isomorphic to the previous bases: homology spaces # Find homology space bases isomorphic to the previous bases: homology spaces
# modulo the non-terminal domain surface, a.k.a the thin cuts. # modulo the non-terminal domain surface, a.k.a the thin cuts.
gmsh.model.mesh.computeHomology(domainTags=[domain_physical_tag], subdomainTags=[complement_physical_tag], dims=[0,1,2,3]) gmsh.model.mesh.computeHomology(domainTags=[domain_physical_tag],
subdomainTags=[complement_physical_tag],
dims=[0,1,2,3])
# Find cohomology space bases isomorphic to the previous bases: cohomology # Find cohomology space bases isomorphic to the previous bases: cohomology
# spaces of the domain modulo the four terminals, a.k.a the thick cuts. # spaces of the domain modulo the four terminals, a.k.a the thick cuts.
gmsh.model.mesh.computeCohomology(domainTags=[domain_physical_tag], subdomainTags=[terminals_physical_tag], dims=[0,1,2,3]) gmsh.model.mesh.computeCohomology(domainTags=[domain_physical_tag],
subdomainTags=[terminals_physical_tag],
dims=[0,1,2,3])
# more examples # more examples
#gmsh.model.mesh.computeHomology() # gmsh.model.mesh.computeHomology()
#gmsh.model.mesh.computeHomology(domainTags=[domain_physical_tag]) # gmsh.model.mesh.computeHomology(domainTags=[domain_physical_tag])
#gmsh.model.mesh.computeHomology(domainTags=[domain_physical_tag], subdomainTags=[boundary_physical_tag], dims=[0,1,2,3]) # gmsh.model.mesh.computeHomology(domainTags=[domain_physical_tag],
# subdomainTags=[boundary_physical_tag],
# dims=[0,1,2,3])
# Generate the mesh and perform the requested homology computations # Generate the mesh and perform the requested homology computations
gmsh.model.mesh.generate(3) gmsh.model.mesh.generate(3)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment