source: issm/trunk-jpl/src/c/classes/AmrNeopz.h@ 25454

Last change on this file since 25454 was 25454, checked in by Mathieu Morlighem, 5 years ago

CHG: renaming AdaptiveMeshRefinement AmrNeopz

File size: 3.7 KB
RevLine 
[25454]1#ifndef AMRNEOPZ
2#define AMRNEOPZ
[21484]3
[21491]4/*Includes*/
5/*{{{*/
[21487]6/*NeoPZ includes*/
7#include <pzgmesh.h>
[24496]8/*ISSM includes*/
[21919]9#include "../shared/shared.h"
[21487]10/*}}}*/
[21484]11
[25454]12class AmrNeopz{
[21484]13
14public:
[22100]15 /*Public attributes{{{*/
[22276]16 /*
[22100]17 * to refine:
[22276]18 * distance_h = initial_distance * gradation ^ (level_max-h)
19 * to unrefine:
20 * distance_h = lag * initial_distance * gradation ^ (level_max-h)
[22100]21 */
[22241]22 int refinement_type; //0 uniform (faster); 1 refpattern
[22100]23 int level_max; //max level of refinement
24 double gradation; //geometric progression ratio to calculate radius of level h
25 double lag; //lag used in the unrefine process
26 /*Target and estimators*/
[22276]27 double groundingline_distance; //all elements with distance from grounding line <= groundingline_distance will be refined
28 double icefront_distance; //all elements with distance from ice front <= icefront_distance will be refined
[22100]29 double thicknesserror_threshold; //if ==0, it will not be used
[22294]30 double thicknesserror_groupthreshold;//group threshold
[22276]31 double thicknesserror_maximum; //max value of the error estimator; in general, it is defined in the first time step. Attention with restart
[22100]32 double deviatoricerror_threshold; //if ==0, it will not be used
[22294]33 double deviatoricerror_groupthreshold;//group threshold
[22276]34 double deviatoricerror_maximum; //max value of the error estimator; in general, it is defined in the first time step. Attention with restart
[22100]35 /*}}}*/
36 /*Public methods{{{*/
[21484]37 /* Constructor, destructor etc*/
[25454]38 AmrNeopz();
39 AmrNeopz(const AmrNeopz &cp);
40 AmrNeopz & operator= (const AmrNeopz &cp);
41 virtual ~AmrNeopz();
[21484]42 /*General methods*/
[21806]43 void CleanUp();
44 void Initialize();
[23065]45 void ExecuteRefinement(double* gl_distance,double* if_distance,double* deviatoricerror,double* thicknesserror,int** pdatalist,double** pxy,int** pelementslist);
[23501]46 void SetMesh(int** elementslist_in,IssmDouble** x_in,IssmDouble** y_in,int* numberofvertices,int* numberofelements);
47 void GetMesh(int** elementslist_out,IssmDouble** x_out,IssmDouble** y_out,int* numberofvertices,int* numberofelements);
[23065]48 void CheckMesh(int** pdata,double** pxy,int** pelements);
[23471]49 void ReadMesh();
50 void WriteMesh();
[22100]51 /*}}}*/
[21484]52private:
[22100]53 /*Private attributes{{{*/
[22241]54 std::vector<int> sid2index; // Vector that keeps index of PZGeoMesh elements used in the ISSM mesh (sid)
55 std::vector<int> index2sid; // Vector that keeps sid of issm mesh elements used in the neopz mesh (index)
56 std::vector<int> specialelementsindex; // Vector that keeps index of the special elements (created to avoid haning nodes)
57 TPZGeoMesh *fathermesh; // Entire mesh without refinement if refinement_type==1; refined with hanging nodes if efinement_type==0
58 TPZGeoMesh *previousmesh; // Refined mesh without hanging nodes (it is always refpattern type), used to generate ISSM mesh
[23501]59 IssmDouble* x; // Entire mesh
60 IssmDouble* y;
61 int* elementslist;
62 int numberofvertices;
63 int numberofelements;
[22100]64 /*}}}*/
65 /*Private methods{{{*/
[22241]66 void RefineMeshOneLevel(bool &verbose,double* gl_distance,double* if_distance,double* deviatoricerror,double* thicknesserror);
67 void RefineMeshWithSmoothing(bool &verbose,TPZGeoMesh* gmesh);
68 void RefineMeshToAvoidHangingNodes(bool &verbose,TPZGeoMesh* gmesh);
[22100]69 void DeleteSpecialElements(bool &verbose,TPZGeoMesh* gmesh);
[23065]70 void GetMesh(TPZGeoMesh* gmesh,int** pdata,double** pxy,int** pelements);
[22100]71 TPZGeoMesh* CreateRefPatternMesh(TPZGeoMesh* gmesh);
72 inline int GetElemMaterialID(){return 1;}
73 inline int GetNumberOfNodes(){return 3;}
74 void PrintGMeshVTK(TPZGeoMesh *gmesh,std::ofstream &file,bool matColor=true);
75 int GetVTK_ElType(TPZGeoEl* gel);
[23469]76 int VerifyRefinementType(TPZGeoEl* geoel,TPZGeoMesh* gmesh);
[22100]77 /*}}}*/
[21484]78};
79
[21487]80#endif
Note: See TracBrowser for help on using the repository browser.