diff --git a/Geo/GEntity.h b/Geo/GEntity.h index e4cf9ff4c41c4faf4cae757289d3bfe5a3de6ede..f557f89ac968c66f9aa84bccf5bec49361c36b1e 100644 --- a/Geo/GEntity.h +++ b/Geo/GEntity.h @@ -55,8 +55,17 @@ class GEntity { // The color of the entity (ignored if set to transparent blue) unsigned int _color; - public: + public: // these will become protected at some point + // The mesh vertices uniquely owned by the entity + std::vector<MVertex*> mesh_vertices; + + // The physical entitites (if any) that contain this entity + std::vector<int> physicals; + + // Vertex arrays to draw the mesh efficiently + VertexArray *va_lines, *va_triangles; + public: // All known native model types enum ModelType { UnknownModel, @@ -243,14 +252,11 @@ class GEntity { bool getAllElementsVisible(){ return _allElementsVisible ? true : false; } void setAllElementsVisible(bool val){ _allElementsVisible = val ? 1 : 0; } - // The mesh vertices uniquely owned by the entity - std::vector<MVertex*> mesh_vertices; - - // The physical entitites (if any) that contain this entity - std::vector<int> physicals; + // Gets the number of mesh vertices in the entity + unsigned int getNumMeshVertices() { return mesh_vertices.size(); } - // Vertex arrays to draw the mesh efficiently - VertexArray *va_lines, *va_triangles; + // Gets the mesh vertex at the given index + MVertex *getMeshVertex(unsigned int index) { return mesh_vertices[index]; } }; class GEntityLessThan { diff --git a/contrib/Netgen/nglib_addon.cpp b/contrib/Netgen/nglib_addon.cpp index 80c62b7ec047e9be77e6db8b673d43740bf8bb45..ad01859d3b88de4f8c4db0b353753b57df309d51 100644 --- a/contrib/Netgen/nglib_addon.cpp +++ b/contrib/Netgen/nglib_addon.cpp @@ -69,12 +69,15 @@ void NgAddOn_Init() Ng_Result NgAddOn_GenerateVolumeMesh(Ng_Mesh *mesh, double maxh) { Mesh *m = (Mesh*)mesh; + MeshingParameters mparam; + mparam.uselocalh = 1; mparam.maxh = maxh; + m->CalcLocalH(); MeshVolume(mparam, *m); //RemoveIllegalElements(*m); - //OptimizeVolume (mparam, *m); + //OptimizeVolume(mparam, *m); return NG_OK; } @@ -82,10 +85,13 @@ Ng_Result NgAddOn_GenerateVolumeMesh(Ng_Mesh *mesh, double maxh) Ng_Result NgAddOn_OptimizeVolumeMesh(Ng_Mesh *mesh, double maxh) { Mesh *m = (Mesh*)mesh; + MeshingParameters mparam; + mparam.uselocalh = 1; mparam.maxh = maxh; + m->CalcLocalH(); - //MeshVolume (mparam, *m); + //MeshVolume(mparam, *m); RemoveIllegalElements(*m); OptimizeVolume(mparam, *m); return NG_OK;