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

pp

parent 5fd2aaec
Branches
Tags
No related merge requests found
...@@ -55,10 +55,17 @@ void GEO_Internals::_freeAll() ...@@ -55,10 +55,17 @@ void GEO_Internals::_freeAll()
List_Action(PhysicalGroups, Free_PhysicalGroup); List_Delete(PhysicalGroups); List_Action(PhysicalGroups, Free_PhysicalGroup); List_Delete(PhysicalGroups);
} }
void GEO_Internals::resetPhysicalGroups() int GEO_Internals::getMaxTag(int dim) const
{ {
List_Action(PhysicalGroups, Free_PhysicalGroup); switch(dim){
List_Reset(PhysicalGroups); case 0: return MaxPointNum;
case 1: return MaxLineNum;
case -1: return MaxLineLoopNum;
case 2: return MaxSurfaceNum;
case -2: return MaxSurfaceLoopNum;
case 3: return MaxVolumeNum;
default: return 0;
}
} }
void GEO_Internals::addVertex(int num, double x, double y, double z, double lc) void GEO_Internals::addVertex(int num, double x, double y, double z, double lc)
...@@ -379,6 +386,12 @@ void GEO_Internals::addCompoundVolume(int num, std::vector<int> regionTags) ...@@ -379,6 +386,12 @@ void GEO_Internals::addCompoundVolume(int num, std::vector<int> regionTags)
Tree_Add(Volumes, &v); Tree_Add(Volumes, &v);
} }
void GEO_Internals::resetPhysicalGroups()
{
List_Action(PhysicalGroups, Free_PhysicalGroup);
List_Reset(PhysicalGroups);
}
void GEO_Internals::setCompoundMesh(int dim, std::vector<int> tags) void GEO_Internals::setCompoundMesh(int dim, std::vector<int> tags)
{ {
meshCompounds.insert(std::make_pair(dim, tags)); meshCompounds.insert(std::make_pair(dim, tags));
......
...@@ -12,58 +12,13 @@ class GEO_Internals{ ...@@ -12,58 +12,13 @@ class GEO_Internals{
private: private:
void _allocateAll(); void _allocateAll();
void _freeAll(); void _freeAll();
public:
// FIXME: all this must (will) become private ; and all the direct calls in
// Gmsh.y should (will) go through an integer-based API similar to the one in
// OCC_Internals
Tree_T *Points;
Tree_T *Curves;
Tree_T *Surfaces;
Tree_T *Volumes;
Tree_T *SurfaceLoops;
Tree_T *EdgeLoops;
Tree_T *LevelSets;
List_T *PhysicalGroups;
int MaxPointNum, MaxLineNum, MaxLineLoopNum, MaxSurfaceNum;
int MaxSurfaceLoopNum, MaxVolumeNum, MaxPhysicalNum;
std::multimap<int, std::vector<int> > meshCompounds;
struct MasterEdge {
int tag; // signed
std::vector<double> affineTransform;
};
std::map<int, MasterEdge> periodicEdges;
struct MasterFace {
int tag;
// map from slave to master edges
std::map<int, int> edgeCounterparts;
std::vector<double> affineTransform;
};
std::map<int, MasterFace> periodicFaces;
gmshSurface *newGeometrySphere(int num, int centerTag, int pointTag);
gmshSurface *newGeometryPolarSphere(int num, int centerTag, int pointTag);
public: public:
GEO_Internals(){ _allocateAll(); } GEO_Internals(){ _allocateAll(); }
~GEO_Internals(){ _freeAll(); } ~GEO_Internals(){ _freeAll(); }
void destroy(){ _freeAll(); _allocateAll(); } void destroy(){ _freeAll(); _allocateAll(); }
void resetPhysicalGroups();
// get maximum tag number for each dimension // get maximum tag number for each dimension
int getMaxTag(int dim) const int getMaxTag(int dim) const;
{
switch(dim){
case 0: return MaxPointNum;
case 1: return MaxLineNum;
case -1: return MaxLineLoopNum;
case 2: return MaxSurfaceNum;
case -2: return MaxSurfaceLoopNum;
case 3: return MaxVolumeNum;
default: return 0;
}
}
// add shapes // add shapes
void addVertex(int num, double x, double y, double z, double lc); void addVertex(int num, double x, double y, double z, double lc);
...@@ -88,13 +43,40 @@ class GEO_Internals{ ...@@ -88,13 +43,40 @@ class GEO_Internals{
void addVolume(int num, std::vector<int> shellTags); void addVolume(int num, std::vector<int> shellTags);
void addCompoundVolume(int num, std::vector<int> regionTags); void addCompoundVolume(int num, std::vector<int> regionTags);
// add physical groups // manipulate physical groups (this will eventually move directly to GModel)
void resetPhysicalGroups();
// set meshing constraints // set meshing constraints
void setCompoundMesh(int dim, std::vector<int> tags); void setCompoundMesh(int dim, std::vector<int> tags);
// synchronize internal CAD data with the given GModel // synchronize internal CAD data with the given GModel
void synchronize(GModel *model); void synchronize(GModel *model);
// create coordinate systems
gmshSurface *newGeometrySphere(int num, int centerTag, int pointTag);
gmshSurface *newGeometryPolarSphere(int num, int centerTag, int pointTag);
public:
// FIXME: all of this will become private once the refactoring of the old code
// is complete
Tree_T *Points, *Curves, *EdgeLoops, *Surfaces, *SurfaceLoops, *Volumes;
Tree_T *LevelSets;
List_T *PhysicalGroups;
int MaxPointNum, MaxLineNum, MaxLineLoopNum, MaxSurfaceNum;
int MaxSurfaceLoopNum, MaxVolumeNum, MaxPhysicalNum;
std::multimap<int, std::vector<int> > meshCompounds;
struct MasterEdge {
int tag; // signed
std::vector<double> affineTransform;
};
std::map<int, MasterEdge> periodicEdges;
struct MasterFace {
int tag;
// map from slave to master edges
std::map<int, int> edgeCounterparts;
std::vector<double> affineTransform;
};
std::map<int, MasterFace> periodicFaces;
}; };
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment