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

Update homolgy api demo

parent 9cad0a30
No related branches found
No related tags found
No related merge requests found
// Gmsh - Copyright (C) 1997-2012 C. Geuzaine, J.-F. Remacle
//
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
//
//
// Contributed by Matti Pellikka <matti.pellikka@tut.fi>.
//
//
#include <stdio.h>
#include <sstream>
......@@ -18,17 +18,17 @@ int main(int argc, char **argv)
{
GmshInitialize(argc, argv);
GModel *m = new GModel();
m->readGEO("model.geo");
m->mesh(3);
// OR
// m->readMSH("model.msh");
// List of physical regions as domain for homology computation
// (relative to subdomain).
std::vector<int> domain;
std::vector<int> subdomain;
// initialize
Homology* homology = new Homology(m, domain, subdomain);
......@@ -38,20 +38,20 @@ int main(int argc, char **argv)
// construct cell complex of the meshed domain
CellComplex cc = homology->createCellComplex();
// find homology generator chains
homology->findGenerators(cc);
// find homology basis elements
homology->findHomologyBasis(cc);
// restore cell complex for a new run
cc->restoreComplex();
cc->restoreComplex();
// find thick cuts
homology->findDualGenerators(cc);
// find cohomology basis elements
homology->findCohomologyBasis(cc);
delete cc;
delete homology;
delete m;
GmshFinalize();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment