Skip to content
Snippets Groups Projects
Commit 2cc1ac29 authored by Matti Pellika's avatar Matti Pellika
Browse files

Update demo

parent 87cd1c13
No related branches found
No related tags found
No related merge requests found
/********************************************************************* /*********************************************************************
* *
* Gmsh tutorial 10 * Gmsh tutorial
* *
* Homology computation * Homology and cohomology computation
* *
*********************************************************************/ *********************************************************************/
// Homology computation in Gmsh finds representative chains of // Homology computation in Gmsh finds representative chains of
// (relative) homology spaces using a mesh of a model. Those // (relative) (co)homology space bases using a mesh of a model.
// representatives generate the (relative) homology spaces of the // The representative basis chains are stored in the mesh as
// model. Alternatively, Gmsh can only look for the ranks of the // physical groups of Gmsh, one for each chain.
// (relative) homology spaces, the Betti numbers of the model.
// The generators chains are stored in a given .msh-file as physical
// groups, whose mesh elements are oriented such that their
// coefficients are 1 in the generator chain.
// Create an example geometry // Create an example geometry
...@@ -134,27 +129,40 @@ Physical Surface(74) = {46, 18, 20, 52, 22, 50, 24, 48, 66, 63, 60, 58, 56, 54}; ...@@ -134,27 +129,40 @@ Physical Surface(74) = {46, 18, 20, 52, 22, 50, 24, 48, 66, 63, 60, 58, 56, 54};
Physical Surface(75) = {46, 63, 66, 52, 50, 48, 54, 60, 58, 56}; Physical Surface(75) = {46, 63, 66, 52, 50, 48, 54, 60, 58, 56};
// Create a mesh of the model // Find bases for relative homology spaces of
Mesh 3; // the domain modulo the four terminals.
Homology {{69}, {70, 71, 72, 73}};
// Find generators of relative homology spaces of the domain modulo the
// four terminals.
// Save the generator chains to t10_hom.msh.
HomGen("t10_hom.msh") = {{69}, {70, 71, 72, 73}};
// Find the corresponding thin cuts, // Find homology space bases isomorphic to the previous bases:
// generators of relative homology spaces modulo the // homology spaces modulo the non-terminal domain surface,
// non-terminal domain surface. // a.k.a the thin cuts.
// Save the cut chains to t10_hom.msh. Homology {{69}, {75}};
HomGen("t10_hom.msh") = {{69}, {75}};
// Find the corresponding thick cuts. // Find cohomology space bases isomorphic to the previous bases:
// Save the cut chains to t10_hom.msh. // cohomology spaces of the domain modulo the four terminals,
HomCut("t10_hom.msh") = {{69}, {70, 71, 72, 73}}; // a.k.a the thick cuts.
Cohomology {{69}, {70, 71, 72, 73}};
// More examples (uncomment): // More examples (uncomment):
// HomGen("t10_hom.msh") = {{69}, {}}; // Homology = {{69}, {}};
// HomGen("t10_hom.msh") = {{}, {}}; // Homology {{69}, {74}};
// HomGen("t10_hom.msh") = {{69}, {74}}; // Homology {{74}, {70, 71, 72, 73}};
// HomGen("t10_hom.msh") = {{}, {74}};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment