19 #if defined(HAVE_KBIPACK)
21 std::vector<int> vecN0(
int n);
31 std::vector<int> _domain;
32 std::vector<int> _subdomain;
33 std::vector<int> _nondomain;
34 std::vector<int> _nonsubdomain;
35 std::vector<int> _imdomain;
37 std::vector<GEntity *> _domainEntities;
38 std::vector<GEntity *> _subdomainEntities;
39 std::vector<GEntity *> _nondomainEntities;
40 std::vector<GEntity *> _nonsubdomainEntities;
41 std::vector<GEntity *> _immuneEntities;
56 std::string _fileName;
62 bool _homologyComputed[4];
63 bool _cohomologyComputed[4];
67 std::vector<Chain<int> *> _chains[4];
68 std::vector<Chain<int> *> _cochains[4];
70 typedef std::map<Cell *, int, CellPtrLessThan>::iterator citer;
72 void _getEntities(
const std::vector<int> &physicalGroups,
73 std::vector<GEntity *> &entities);
74 void _getElements(
const std::vector<GEntity *> &entities,
75 std::vector<MElement *> &elements);
78 std::string _getDomainString(
const std::vector<int> &domain,
79 const std::vector<int> &subdomain)
const;
82 void _createCellComplex();
85 void _createChain(std::map<Cell *, int, CellPtrLessThan> &preChain,
86 const std::string &name,
bool co);
88 void _deleteChains(std::vector<int> dim = vecN0(4));
89 void _deleteCochains(std::vector<int> dim = vecN0(4));
91 std::vector<int> _addToModel(
int dim,
bool co,
bool post,
92 int physicalNumRequest)
const;
96 Homology(
GModel *model,
const std::vector<int> &physicalDomain,
97 const std::vector<int> &physicalSubdomain,
98 const std::vector<int> &physicalIm,
bool saveOrig =
true,
99 int combine = 3,
bool omit =
true,
bool smoothen =
true,
103 GModel *getModel()
const {
return _model; }
104 void setFileName(
const std::string &fileName) { _fileName = fileName; }
106 void getDomain(std::vector<int> &domain)
const { domain = _domain; }
107 void getSubdomain(std::vector<int> &subdomain)
const
109 subdomain = _subdomain;
115 void findHomologyBasis(std::vector<int> dim = vecN0(4));
116 void findCohomologyBasis(std::vector<int> dim = vecN0(4));
123 void findCompatibleBasisPair(
int master = 0, std::vector<int> dim = vecN0(4));
127 bool isHomologyComputed(std::vector<int> dim = vecN0(4))
const;
128 bool isCohomologyComputed(std::vector<int> dim = vecN0(4))
const;
135 std::vector<int> addChainsToModel(
int dim = -1,
bool post =
true,
136 int physicalNumRequest = -1)
const;
137 std::vector<int> addCochainsToModel(
int dim = -1,
bool post =
true,
138 int physicalNumRequest = -1)
const;
141 void getHomologyBasis(
int dim, std::vector<Chain<int> > &hom);
142 void getCohomologyBasis(
int dim, std::vector<Chain<int> > &coh);
146 void findBettiNumbers();
149 bool isBettiComputed()
const;
155 int eulerCharacteristic();
158 bool writeBasisMSH(
bool binary =
false);
162 void storeCells(
CellComplex *cellComplex,
int dim);