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

A fix.

parent d38b6ffa
No related branches found
No related tags found
No related merge requests found
...@@ -894,6 +894,7 @@ void Chain::createPView(){ ...@@ -894,6 +894,7 @@ void Chain::createPView(){
int entityNum = *std::max_element(max,max+4) + 1; int entityNum = *std::max_element(max,max+4) + 1;
for(int i = 0; i < 4; i++) max[i] = _model->getMaxPhysicalNumber(i); for(int i = 0; i < 4; i++) max[i] = _model->getMaxPhysicalNumber(i);
int physicalNum = *std::max_element(max,max+4) + 1; int physicalNum = *std::max_element(max,max+4) + 1;
setNum(physicalNum);
std::map<int, std::vector<MElement*> > entityMap; std::map<int, std::vector<MElement*> > entityMap;
//int entityNum = _model->getMaxElementaryNumber(getDim())+1; //int entityNum = _model->getMaxElementaryNumber(getDim())+1;
...@@ -904,11 +905,13 @@ void Chain::createPView(){ ...@@ -904,11 +905,13 @@ void Chain::createPView(){
physicalInfo[physicalNum]=getName(); physicalInfo[physicalNum]=getName();
physicalMap[entityNum] = physicalInfo; physicalMap[entityNum] = physicalInfo;
_model->storeChain(getDim(), entityMap, physicalMap); if(!data.empty()){
_model->setPhysicalName(getName(), getDim(), physicalNum); _model->storeChain(getDim(), entityMap, physicalMap);
_model->setPhysicalName(getName(), getDim(), physicalNum);
// only for visualization
if(!data.empty()) PView *chain = new PView(getName(), "ElementData", getGModel(), data, 0, 1); // only for visualization
PView *chain = new PView(getName(), "ElementData", getGModel(), data, 0, 1);
}
return; return;
} }
......
...@@ -139,6 +139,8 @@ class Chain{ ...@@ -139,6 +139,8 @@ class Chain{
std::map< Cell*, int, Less_Cell > _cells; std::map< Cell*, int, Less_Cell > _cells;
// name of the chain (optional) // name of the chain (optional)
std::string _name; std::string _name;
// physical group number of the chain
int _num;
// cell complex this chain belongs to // cell complex this chain belongs to
CellComplex* _cellComplex; CellComplex* _cellComplex;
GModel* _model; GModel* _model;
...@@ -261,7 +263,10 @@ class Chain{ ...@@ -261,7 +263,10 @@ class Chain{
// get/set chain name // get/set chain name
std::string getName() { return _name; } std::string getName() { return _name; }
void setName(std::string name) { _name=name; } void setName(std::string name) { _name=name; }
// get/set physical group number
int getNum() { return _num; }
void setNum(int num) { _num=num; }
// make local deformations to the chain to make it smoother and smaller // make local deformations to the chain to make it smoother and smaller
// (for primary complex chains only, not for dual chains represented by primary cells (yet).) // (for primary complex chains only, not for dual chains represented by primary cells (yet).)
void smoothenChain(); void smoothenChain();
......
...@@ -46,6 +46,7 @@ class Homology ...@@ -46,6 +46,7 @@ class Homology
for(int i = 0; i < 4; i++) { for(int i = 0; i < 4; i++) {
for(int j = 0; j < _generators[i].size(); j++){ for(int j = 0; j < _generators[i].size(); j++){
Chain* chain = _generators[i].at(j); Chain* chain = _generators[i].at(j);
//_model->deletePhysicalGroup(chain->getDim(), chain->getNum());
delete chain; delete chain;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment