Skip to content
Snippets Groups Projects
Commit 7524e746 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

better handling of "negative" physical groups
parent 49e8937e
No related branches found
No related tags found
No related merge requests found
// $Id: Visibility.cpp,v 1.25 2006-11-30 01:06:07 geuzaine Exp $
// $Id: Visibility.cpp,v 1.26 2006-12-12 18:16:41 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
......@@ -260,22 +260,22 @@ void VisibilityManager::setVisibilityByNumber(int type, int num, char val, bool
case 6: // physical point
for(GModel::viter it = GMODEL->firstVertex(); it != GMODEL->lastVertex(); it++)
for(unsigned int i = 0; i < (*it)->physicals.size(); i++)
if (all || (*it)->physicals[i] == num) (*it)->setVisibility(val, recursive);
if (all || std::abs((*it)->physicals[i]) == num) (*it)->setVisibility(val, recursive);
break;
case 7: // physical line
for(GModel::eiter it = GMODEL->firstEdge(); it != GMODEL->lastEdge(); it++)
for(unsigned int i = 0; i < (*it)->physicals.size(); i++)
if (all || (*it)->physicals[i] == num) (*it)->setVisibility(val, recursive);
if (all || std::abs((*it)->physicals[i]) == num) (*it)->setVisibility(val, recursive);
break;
case 8: // physical surface
for(GModel::fiter it = GMODEL->firstFace(); it != GMODEL->lastFace(); it++)
for(unsigned int i = 0; i < (*it)->physicals.size(); i++)
if (all || (*it)->physicals[i] == num) (*it)->setVisibility(val, recursive);
if (all || std::abs((*it)->physicals[i]) == num) (*it)->setVisibility(val, recursive);
break;
case 9: // physical volume
for(GModel::riter it = GMODEL->firstRegion(); it != GMODEL->lastRegion(); it++)
for(unsigned int i = 0; i < (*it)->physicals.size(); i++)
if (all || (*it)->physicals[i] == num) (*it)->setVisibility(val, recursive);
if (all || std::abs((*it)->physicals[i]) == num) (*it)->setVisibility(val, recursive);
break;
}
}
......
// $Id: GModel.cpp,v 1.24 2006-11-29 16:57:00 remacle Exp $
// $Id: GModel.cpp,v 1.25 2006-12-12 18:16:41 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
......@@ -153,7 +153,9 @@ bool GModel::noPhysicalGroups()
static void addInGroup(GEntity* ge, std::map<int, std::vector<GEntity*> > &group)
{
for(unsigned int i = 0; i < ge->physicals.size(); i++){
int p = ge->physicals[i];
// phyicals can be stored with negative signs when the entity
// should be "reversed"
int p = std::abs(ge->physicals[i]);
if(std::find(group[p].begin(), group[p].end(), ge) == group[p].end())
group[p].push_back(ge);
}
......@@ -188,16 +190,16 @@ int GModel::maxPhysicalNumber()
int num = 0;
for(viter it = firstVertex(); it != lastVertex(); ++it)
for(unsigned int i = 0; i < (*it)->physicals.size(); i++)
num = std::max(num, (*it)->physicals[i]);
num = std::max(num, std::abs((*it)->physicals[i]));
for(eiter it = firstEdge(); it != lastEdge(); ++it)
for(unsigned int i = 0; i < (*it)->physicals.size(); i++)
num = std::max(num, (*it)->physicals[i]);
num = std::max(num, std::abs((*it)->physicals[i]));
for(fiter it = firstFace(); it != lastFace(); ++it)
for(unsigned int i = 0; i < (*it)->physicals.size(); i++)
num = std::max(num, (*it)->physicals[i]);
num = std::max(num, std::abs((*it)->physicals[i]));
for(riter it = firstRegion(); it != lastRegion(); ++it)
for(unsigned int i = 0; i < (*it)->physicals.size(); i++)
num = std::max(num, (*it)->physicals[i]);
num = std::max(num, std::abs((*it)->physicals[i]));
return num;
}
......
// $Id: meshGFace.cpp,v 1.40 2006-12-12 01:39:15 geuzaine Exp $
// $Id: meshGFace.cpp,v 1.41 2006-12-12 18:16:41 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
......@@ -1424,6 +1424,10 @@ bool shouldRevert(MEdge &reference, std::vector<T*> &elements)
void orientMeshGFace::operator()(GFace *gf)
{
// in old versions we did not reorient transfinite surface meshes;
// we could add the following to provide backward compatibility:
// if(gf->meshAttributes.Method == TRANSFINI) return;
// orients the mesh to match the orientation of the first edge
std::list<GEdge*> edges = gf->edges();
std::list<int> ori = gf->orientations();
......
View[0].RangeType = 2 ; // custom
View[0].CustomMin = View[0].Min ;
View[0].CustomMax = View[0].Max ;
View[1].OffsetX = 1.5 * View[0].MaxX ;
View[1].RangeType = 2 ; // custom
View[1].Min = View[0].Min ;
View[1].Max = View[0].Max ;
View[1].CustomMin = View[0].Min ;
View[1].CustomMax = View[0].Max ;
View[1].ShowScale = 0 ;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment