Select Git revision
gmsh_io.cpp
Homology.h 5.43 KiB
// Gmsh - Copyright (C) 1997-2019 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
//
// Contributed by Matti Pellikka <matti.pellikka@gmail.com>.
#ifndef HOMOLOGY_H
#define HOMOLOGY_H
#include <sstream>
#include "CellComplex.h"
#include "ChainComplex.h"
#include "Chain.h"
#include "OS.h"
#include "GModel.h"
#include "Options.h"
#if defined(HAVE_KBIPACK)
std::vector<int> vecN0(int n);
// Interface class for homology computation in Gmsh
class Homology {
private:
// the Gmsh model for homology computation
GModel *_model;
// domain and the relative subdomain of the homology computation
// physical group IDs
std::vector<int> _domain;
std::vector<int> _subdomain;
std::vector<int> _nondomain;
std::vector<int> _nonsubdomain;
std::vector<int> _imdomain;
// corresponding geometrical entities
std::vector<GEntity *> _domainEntities;
std::vector<GEntity *> _subdomainEntities;
std::vector<GEntity *> _nondomainEntities;
std::vector<GEntity *> _nonsubdomainEntities;
std::vector<GEntity *> _immuneEntities;
// save original cell complex
bool _saveOrig;
// use cell combining
int _combine;
// use cell omit
bool _omit;
// use chain smoothning
bool _smoothen;
// corecution heuristic
int _heuristic;
// file name to store the results
std::string _fileName;
// cell complex of the domain
CellComplex *_cellComplex;
// whether representatives of (co)homology bases are available
bool _homologyComputed[4];
bool _cohomologyComputed[4];
// resulting betti numbers and chains
int _betti[4];
std::vector<Chain<int> *> _chains[4];
std::vector<Chain<int> *> _cochains[4];
typedef std::map<Cell *, int, Less_Cell>::iterator citer;