diff --git a/Mesh/Field.h b/Mesh/Field.h index e4eaf0001b67d4595fc330121bebc1b5239b00e9..6b11213e77dc3b028c86bd088ca1fb5f6cf5a7da 100644 --- a/Mesh/Field.h +++ b/Mesh/Field.h @@ -65,10 +65,11 @@ class Field { virtual ~Field() {} int id; std::map<std::string, FieldOption *> options; + virtual bool isotropic () const { return true; } + // isotropic virtual double operator() (double x, double y, double z, GEntity *ge=0) = 0; - // start of the anisotropic field implementation - virtual void operator() (double x, double y, double z, SMetric3 &, GEntity *ge=0){throw;} - virtual bool isotropic () const {return true;} + // anisotropic + virtual void operator() (double x, double y, double z, SMetric3 &, GEntity *ge=0){} bool update_needed; virtual const char *getName() = 0; #if defined(HAVE_POST) diff --git a/Mesh/meshGEdge.cpp b/Mesh/meshGEdge.cpp index 34601dc6e6be4595cadcc229a55a050551a465a9..c3345d1eefc12ca59716add9d64fa17801969ea9 100644 --- a/Mesh/meshGEdge.cpp +++ b/Mesh/meshGEdge.cpp @@ -130,7 +130,6 @@ static double F_Lc_aniso(GEdge *ge, double t) return sqrt(lSquared); } - static double F_Transfinite(GEdge *ge, double t_) { double length = ge->length(); @@ -289,19 +288,18 @@ void deMeshGEdge::operator() (GEdge *ge) ge->meshStatistics.status = GEdge::PENDING; } -void printFandPrimitive(int tag, std::vector<IntPoint> &Points ){ +static void printFandPrimitive(int tag, std::vector<IntPoint> &Points) +{ char name[256]; - sprintf(name,"line%d.dat",tag); - FILE *f = fopen (name,"w"); - for (int i=0;i<Points.size();i++){ + sprintf(name, "line%d.dat", tag); + FILE *f = fopen(name, "w"); + for (unsigned int i = 0; i < Points.size(); i++){ const IntPoint &P = Points[i]; - fprintf(f,"%g %g %g\n",P.t,1./P.lc,P.p); + fprintf(f, "%g %g %g\n", P.t, 1./P.lc, P.p); } fclose(f); - } - void meshGEdge::operator() (GEdge *ge) { ge->model()->setCurrentMeshEntity(ge); diff --git a/Mesh/meshGEdge.h b/Mesh/meshGEdge.h index a07a0d1f50d31c8c2ac940e90468dc3bb3610e45..36082ab4e309a4f52bb08fd11c1a04cbd94bd901 100644 --- a/Mesh/meshGEdge.h +++ b/Mesh/meshGEdge.h @@ -11,16 +11,15 @@ class GEdge; // Create the mesh of the edge class meshGEdge { public : - meshGEdge () {} - void operator () ( GEdge * ); + meshGEdge() {} + void operator () (GEdge *); }; // destroy the mesh of the edge class deMeshGEdge { - bool _STL; public : - deMeshGEdge () {} - void operator () ( GEdge * ); + deMeshGEdge() {} + void operator () (GEdge *); }; int MeshExtrudedCurve(GEdge *ge); diff --git a/Mesh/meshGFaceLloyd.h b/Mesh/meshGFaceLloyd.h index a03fff0f9df6278696420c4f9913f1c10944dc61..b560f44870dfecf19704c8d30c99f1d3f5e0be85 100644 --- a/Mesh/meshGFaceLloyd.h +++ b/Mesh/meshGFaceLloyd.h @@ -12,7 +12,8 @@ class lloydAlgorithm { int ITER_MAX; bool infiniteNorm ; public : - lloydAlgorithm (int itermax, bool infnorm = false): ITER_MAX(itermax), infiniteNorm(infnorm) {} + lloydAlgorithm (int itermax, bool infnorm = false) + : ITER_MAX(itermax), infiniteNorm(infnorm) {} void operator () (GFace *); }; diff --git a/Mesh/meshGRegion.h b/Mesh/meshGRegion.h index 912975d351aa3b57d8d9d6e735f77fa943476892..034891e50f63ef3370aae3a4a1880af2e1133f1d 100644 --- a/Mesh/meshGRegion.h +++ b/Mesh/meshGRegion.h @@ -48,22 +48,23 @@ class deMeshGRegion { void operator () (GRegion *); }; - void MeshDelaunayVolume(std::vector<GRegion*> &delaunay); int MeshTransfiniteVolume(GRegion *gr); int SubdivideExtrudedMesh(GModel *m); void carveHole(GRegion *gr, int num, double distance, std::vector<int> &surfaces); -typedef std::multimap<MVertex*,std::pair<MTriangle*,GFace*> > fs_cont ; -typedef std::multimap<MVertex*,std::pair<MLine*,GEdge*> > es_cont ; -GFace* findInFaceSearchStructure ( MVertex *p1,MVertex *p2,MVertex *p3, const fs_cont&search ); -GEdge* findInEdgeSearchStructure ( MVertex *p1,MVertex *p2, const es_cont&search ); -bool buildFaceSearchStructure ( GModel *model , fs_cont&search ); -bool buildEdgeSearchStructure ( GModel *model , es_cont&search ); +typedef std::multimap<MVertex*, std::pair<MTriangle*, GFace*> > fs_cont ; +typedef std::multimap<MVertex*, std::pair<MLine*, GEdge*> > es_cont ; +GFace* findInFaceSearchStructure(MVertex *p1, MVertex *p2, MVertex *p3, + const fs_cont &search); +GEdge* findInEdgeSearchStructure(MVertex *p1, MVertex *p2, const es_cont &search); +bool buildFaceSearchStructure(GModel *model, fs_cont &search); +bool buildEdgeSearchStructure(GModel *model, es_cont &search); // adapt the mesh of a region class adaptMeshGRegion { - es_cont *_es; fs_cont *_fs; + es_cont *_es; + fs_cont *_fs; public : void operator () (GRegion *); }; diff --git a/Mesh/meshPartition.h b/Mesh/meshPartition.h index 787d6218e329e5fb17fdd426187b6ef76c050970..928b5ea020ca19c278fe1e04c95dc3d0e91238c6 100644 --- a/Mesh/meshPartition.h +++ b/Mesh/meshPartition.h @@ -27,12 +27,14 @@ int RenumberGraph(Graph &graph, meshPartitionOptions &options); int PartitionMesh(GModel *const model, meshPartitionOptions &options); int RenumberMesh(GModel *const model, meshPartitionOptions &options); int PartitionMeshFace(std::list<GFace*> &cFaces, meshPartitionOptions &options); -int PartitionMeshElements(std::vector<MElement*> &elements, meshPartitionOptions &options); +int PartitionMeshElements(std::vector<MElement*> &elements, + meshPartitionOptions &options); bool PartitionZeroGenus(std::list<GFace*> &cFaces, int &nbParts); int CreatePartitionBoundaries(GModel *model, bool createGhostCells); -void splitBoundaryEdges(GModel *model, std::set<partitionEdge*, Less_partitionEdge> &newEdges); -void createPartitionFaces(GModel *model, GFaceCompound * gf, int num_parts, +void splitBoundaryEdges(GModel *model, + std::set<partitionEdge*, Less_partitionEdge> &newEdges); +void createPartitionFaces(GModel *model, GFaceCompound *gf, int num_parts, std::vector<discreteFace*> &pFaces); #endif