Skip to content
Snippets Groups Projects
Commit 2dd1a944 authored by Amaury Johnen's avatar Amaury Johnen
Browse files

fix bug extruded volume:

The parser wanted to create extruded volume begining systematically from 1. 
Thus, when there already existed volumes with number 1,2,3,etc, extruded volumes was created.
parent a3c2a6c9
No related branches found
No related tags found
No related merge requests found
...@@ -152,22 +152,6 @@ void AddToTemporaryBoundingBox(double x, double y, double z) ...@@ -152,22 +152,6 @@ void AddToTemporaryBoundingBox(double x, double y, double z)
for(int i = 0; i < 3; i++) CTX::instance()->cg[i] = temp_bb.center()[i]; for(int i = 0; i < 3; i++) CTX::instance()->cg[i] = temp_bb.center()[i];
} }
static void ComputeMaxEntityNum()
{
GModel::current()->getGEOInternals()->MaxPointNum =
std::max(GModel::current()->getGEOInternals()->MaxPointNum,
GModel::current()->getMaxElementaryNumber(0));
GModel::current()->getGEOInternals()->MaxLineNum =
std::max(GModel::current()->getGEOInternals()->MaxLineNum,
GModel::current()->getMaxElementaryNumber(1));
GModel::current()->getGEOInternals()->MaxSurfaceNum =
std::max(GModel::current()->getGEOInternals()->MaxSurfaceNum,
GModel::current()->getMaxElementaryNumber(2));
GModel::current()->getGEOInternals()->MaxVolumeNum =
std::max(GModel::current()->getGEOInternals()->MaxVolumeNum,
GModel::current()->getMaxElementaryNumber(3));
}
static std::vector<gmshFILE> openedFiles; static std::vector<gmshFILE> openedFiles;
int ParseFile(const std::string &fileName, bool close, bool warnIfMissing) int ParseFile(const std::string &fileName, bool close, bool warnIfMissing)
...@@ -484,7 +468,7 @@ int MergeFile(const std::string &fileName, bool warnIfMissing, bool setWindowTit ...@@ -484,7 +468,7 @@ int MergeFile(const std::string &fileName, bool warnIfMissing, bool setWindowTit
} }
} }
ComputeMaxEntityNum(); GModel::current()->getGEOInternals()->ComputeMaxEntityNum();
if(setBoundingBox) SetBoundingBox(); if(setBoundingBox) SetBoundingBox();
CTX::instance()->geom.draw = 1; CTX::instance()->geom.draw = 1;
CTX::instance()->mesh.changed = ENT_ALL; CTX::instance()->mesh.changed = ENT_ALL;
......
...@@ -4544,6 +4544,7 @@ void GEO_Internals::alloc_all() ...@@ -4544,6 +4544,7 @@ void GEO_Internals::alloc_all()
{ {
MaxPointNum = MaxLineNum = MaxLineLoopNum = MaxSurfaceNum = 0; MaxPointNum = MaxLineNum = MaxLineLoopNum = MaxSurfaceNum = 0;
MaxSurfaceLoopNum = MaxVolumeNum = MaxPhysicalNum = 0; MaxSurfaceLoopNum = MaxVolumeNum = MaxPhysicalNum = 0;
ComputeMaxEntityNum();
Points = Tree_Create(sizeof(Vertex *), compareVertex); Points = Tree_Create(sizeof(Vertex *), compareVertex);
Curves = Tree_Create(sizeof(Curve *), compareCurve); Curves = Tree_Create(sizeof(Curve *), compareCurve);
EdgeLoops = Tree_Create(sizeof(EdgeLoop *), compareEdgeLoop); EdgeLoops = Tree_Create(sizeof(EdgeLoop *), compareEdgeLoop);
...@@ -4574,6 +4575,18 @@ void GEO_Internals::reset_physicals() ...@@ -4574,6 +4575,18 @@ void GEO_Internals::reset_physicals()
List_Reset(PhysicalGroups); List_Reset(PhysicalGroups);
} }
void GEO_Internals::ComputeMaxEntityNum()
{
MaxPointNum =
std::max(MaxPointNum, GModel::current()->getMaxElementaryNumber(0));
MaxLineNum =
std::max(MaxLineNum, GModel::current()->getMaxElementaryNumber(1));
MaxSurfaceNum =
std::max(MaxSurfaceNum, GModel::current()->getMaxElementaryNumber(2));
MaxVolumeNum =
std::max(MaxVolumeNum, GModel::current()->getMaxElementaryNumber(3));
}
int select_contour(int type, int num, List_T * List) int select_contour(int type, int num, List_T * List)
{ {
int k = 0; int k = 0;
......
...@@ -297,6 +297,8 @@ class GEO_Internals{ ...@@ -297,6 +297,8 @@ class GEO_Internals{
void reset_physicals(); void reset_physicals();
std::map<int,int> periodicFaces; std::map<int,int> periodicFaces;
std::map<int,int> periodicEdges; std::map<int,int> periodicEdges;
void ComputeMaxEntityNum();
}; };
class Shape{ class Shape{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment