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

Fix CellComplex::removeSubdomain iterator invalidating.

parent e425765e
Branches
Tags
No related merge requests found
...@@ -500,21 +500,16 @@ int CellComplex::reduceComplex(){ ...@@ -500,21 +500,16 @@ int CellComplex::reduceComplex(){
void CellComplex::removeSubdomain(){ void CellComplex::removeSubdomain(){
for(int i = 0; i < 4; i++){ for(int i = 0; i < 4; i++){
for(citer cit = firstCell(i); cit != lastCell(i); cit++){ for(citer cit = firstCell(i); cit != lastCell(i); ){
Cell* cell = *cit;
if(cell->inSubdomain()) {
removeCell(cell);
++cit;
}
}
for(citer cit = firstCell(i); cit != lastCell(i); cit++){
Cell* cell = *cit; Cell* cell = *cit;
if(cell->inSubdomain()) { if(cell->inSubdomain()) {
removeCell(cell); removeCell(cell);
cit = firstCell(i); cit++;
} }
else ++cit;
} }
} }
return; return;
} }
...@@ -526,7 +521,7 @@ int CellComplex::coreduceComplex(){ ...@@ -526,7 +521,7 @@ int CellComplex::coreduceComplex(){
int count = 0; int count = 0;
CellComplex::removeSubdomain(); removeSubdomain();
for(int dim = 0; dim < 4; dim++){ for(int dim = 0; dim < 4; dim++){
citer cit = firstCell(dim); citer cit = firstCell(dim);
......
// Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle // Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
// //
// See the LICENSE.txt file for license information. Please report all // See the LICENSE.txt file for license information. Please report all
...@@ -703,8 +704,8 @@ void Chain::createPView(){ ...@@ -703,8 +704,8 @@ void Chain::createPView(){
opt_mesh_pyramids(0, GMSH_SET, 0); opt_mesh_pyramids(0, GMSH_SET, 0);
// show post-processing normals, tangents and element boundaries // show post-processing normals, tangents and element boundaries
opt_view_normals(0, GMSH_SET, 20); //opt_view_normals(0, GMSH_SET, 20);
opt_view_tangents(0, GMSH_SET, 20); //opt_view_tangents(0, GMSH_SET, 20);
opt_view_show_element(0, GMSH_SET, 1); opt_view_show_element(0, GMSH_SET, 1);
if(!data.empty()){ if(!data.empty()){
......
...@@ -94,6 +94,7 @@ PView *GMSH_HomologyComputationPlugin::execute(PView *v) ...@@ -94,6 +94,7 @@ PView *GMSH_HomologyComputationPlugin::execute(PView *v)
else if(cuts != 1 && gens != 1 && betti == 1) homology->computeBettiNumbers(); else if(cuts != 1 && gens != 1 && betti == 1) homology->computeBettiNumbers();
else Msg::Error("Choose either generators, dual generators or Betti numbers to compute."); else Msg::Error("Choose either generators, dual generators or Betti numbers to compute.");
delete homology; delete homology;
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment