Changeset 21487
- Timestamp:
- 01/12/17 14:34:05 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/AdaptiveMeshRefinement.h
r21484 r21487 2 2 #define ADAPTIVEMESHREFINEMENT 3 3 4 /*Common includes*/ 5 /*{{{*/ 4 6 #include <iostream> 5 7 #include <fstream> 6 8 #include <string> 7 9 8 #include "pzsave.h" 9 #include "pzgmesh.h" 10 #include "pzreal.h" 11 #include "pzvec.h" 12 #include "pzeltype.h" 10 /*NeoPZ includes*/ 11 #include <pzsave.h> 12 #include <pzgmesh.h> 13 #include <pzreal.h> 14 #include <pzvec.h> 15 #include <pzeltype.h> 13 16 14 #include "TPZRefPatternTools.h"15 #include "TPZRefPatternDataBase.h"16 #include "TPZRefPattern.h"17 #include <TPZRefPatternTools.h> 18 #include <TPZRefPatternDataBase.h> 19 #include <TPZRefPattern.h> 17 20 18 #include "tpzchangeel.h"19 #include "TPZGeoElement.h"20 #include "pzreftriangle.h"21 #include "tpzgeoelrefpattern.h"22 #include "TPZRefPattern.h" 21 #include <tpzchangeel.h> 22 #include <TPZGeoElement.h> 23 #include <pzreftriangle.h> 24 #include <tpzgeoelrefpattern.h> 25 /*}}}*/ 23 26 24 27 class AdaptiveMeshRefinement : public TPZSaveable { … … 28 31 /*Public methods*/ 29 32 /* Constructor, destructor etc*/ 30 AdaptiveMeshRefinement(); // Default constructor31 AdaptiveMeshRefinement(const AdaptiveMeshRefinement &cp); 32 AdaptiveMeshRefinement & operator= (const AdaptiveMeshRefinement &cp); 33 AdaptiveMeshRefinement(); // Default constructor 34 AdaptiveMeshRefinement(const AdaptiveMeshRefinement &cp); // Copy constructor 35 AdaptiveMeshRefinement & operator= (const AdaptiveMeshRefinement &cp); // Operator of copy 33 36 virtual ~AdaptiveMeshRefinement(); // Destructor 34 37 35 38 /*Savable methods*/ 36 virtual int ClassId() const;// ClassId to save the class37 virtual void Read(TPZStream &buf, void *context);// Read this class38 virtual void Write(TPZStream &buf, int withclassid);// Write this class, using ClassId to identify39 virtual int ClassId() const; // ClassId to save the class 40 virtual void Read(TPZStream &buf, void *context); // Read this class 41 virtual void Write(TPZStream &buf, int withclassid); // Write this class, using ClassId to identify 39 42 40 43 /*General methods*/ 41 void CleanUp(); //Clean all attributes42 void SetHMax(int &h);//Define the max level of refinement43 void SetElementWidth(int &width);//Define elements width44 void ExecuteRefinement(int &type_process,double *vx, double *vy, double *masklevelset, long &nvertices, long &nelements, long &nsegments, double** x, double** y, double** z, long*** elements, long*** segments=NULL); 44 void CleanUp(); //Clean all attributes 45 void SetHMax(int &h); //Define the max level of refinement 46 void SetElementWidth(int &width); //Define elements width 47 void ExecuteRefinement(int &type_process,double *vx, double *vy, double *masklevelset, long &nvertices, long &nelements, long &nsegments, double** x, double** y, double** z, long*** elements, long*** segments=NULL); //A new mesh will be created and refined. This returns the new mesh 45 48 void CreateInitialMesh(long &nvertices, long &nelements, long &nsegments, int &width, double* x, double* y, double* z, long** elements, long** segments=NULL); //Create a NeoPZ geometric mesh by coords and elements 46 49 void CheckMesh(long &nvertices, long &nelements, long &nsegments, int &width, double* x, double* y, double* z, long** elements, long** segments=NULL); //Check the consistency of the mesh 47 50 48 51 private: 49 52 50 53 /*Private attributes*/ 51 int elementswidth;// geometric nodes for element: 3 == Tria, 4 == Tetra, 6 == Penta52 int hmax;// max level of refinement53 TPZGeoMesh *fathermesh; // Father Mesh is the entire mesh without refinement54 TPZGeoMesh *previousmesh; // Previous mesh is a refined mesh of last step54 int elementswidth; // geometric nodes for element: 3 == Tria, 4 == Tetra, 6 == Penta 55 int hmax; // max level of refinement 56 TPZGeoMesh *fathermesh; // Father Mesh is the entire mesh without refinement 57 TPZGeoMesh *previousmesh; // Previous mesh is a refined mesh of last step 55 58 56 59 /*Private methods*/ 57 void RefinementProcess(TPZGeoMesh *gmesh,std::vector<TPZVec<REAL> > &GLvec);// Start the refinement process60 void RefinementProcess(TPZGeoMesh *gmesh,std::vector<TPZVec<REAL> > &GLvec); // Start the refinement process 58 61 void RefineMesh(TPZGeoMesh *gmesh, std::vector<long> &ElemVec); // Refine the elements in ElemVec 59 void RefineMeshToAvoidHangingNodes(TPZGeoMesh *gmesh);// Refine the elements to avoid hanging nodes62 void RefineMeshToAvoidHangingNodes(TPZGeoMesh *gmesh); // Refine the elements to avoid hanging nodes 60 63 void SetElementsToRefine(TPZGeoMesh *gmesh,std::vector<TPZVec<REAL> > &GLvec,int &hlevel, std::vector<long> &ElemVec); //Define wich elements will be refined 61 void TagAllElements(TPZGeoMesh *gmesh,std::vector<long> &ElemVec);// This tag all elements to be refined, that is, refine all elements62 63 void CalcGroundingLinePosition(double *masklevelset,std::vector<TPZVec<REAL> > &GLvec);// calculate the grounding line position using previous mesh64 void TagAllElements(TPZGeoMesh *gmesh,std::vector<long> &ElemVec); // This tag all elements to be refined, that is, refine all elements 65 void TagElementsNearGroundingLine(TPZGeoMesh *gmesh,std::vector<TPZVec<REAL> > &GLvec,int &hlevel,std::vector<long> &ElemVec); //This tag elements near the grounding line 66 void CalcGroundingLinePosition(double *masklevelset,std::vector<TPZVec<REAL> > &GLvec); // calculate the grounding line position using previous mesh 64 67 void GetMesh(TPZGeoMesh *gmesh, long &nvertices, long &nelements, long &nsegments, double** meshX, double** meshY, double** meshZ, long*** elements, long*** segments=NULL); //Return coords and elements in ISSM data structure 65 inline int GetElemMaterialID(){return 1;}// Return element material ID66 inline int GetBoundaryMaterialID(){return 2;}// Return segment (2D boundary) material ID68 inline int GetElemMaterialID(){return 1;} // Return element material ID 69 inline int GetBoundaryMaterialID(){return 2;} // Return segment (2D boundary) material ID 67 70 68 71 };
Note:
See TracChangeset
for help on using the changeset viewer.