Skip to content
Snippets Groups Projects
Select Git revision
  • 43c92df9a5fd19bb2212e7952dfc51d15761daaf
  • master default protected
  • devel
  • MC/hide_eigen_sol
  • compare_at_gauss_points
  • mixed_interface_fix
  • detect-gmsh-api-version
  • MC/mpi_support
  • MC/volsrcs
  • fix-gmsh-master
  • find-gmsh
  • MC/hipify
  • v0.3.0
  • v0.2.0
  • v0.1.0
15 results

gmsh_io.cpp

Blame
  • 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;