Changeset 21562
- Timestamp:
- 02/10/17 15:37:23 (8 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/AdaptiveMeshRefinement.cpp
r21540 r21562 13 13 /*Constructor, copy, clean up and destructor*/ 14 14 AdaptiveMeshRefinement::AdaptiveMeshRefinement(){/*{{{*/ 15 16 /*Set pointers to NULL*/ 17 this->fathermesh = NULL; 18 this->previousmesh = NULL; 19 this->hmax = -1; 20 this->elementswidth = -1; 21 15 this->Initialize(); 22 16 } 23 17 /*}}}*/ 24 18 AdaptiveMeshRefinement::AdaptiveMeshRefinement(const AdaptiveMeshRefinement &cp){/*{{{*/ 25 this->operator =(cp); 19 this->Initialize(); 20 this->operator =(cp); 26 21 } 27 22 /*}}}*/ 28 23 AdaptiveMeshRefinement & AdaptiveMeshRefinement::operator =(const AdaptiveMeshRefinement &cp){/*{{{*/ 29 24 30 /*Clean all attributes*/ 31 this->CleanUp(); 32 33 /*Copy all data*/ 34 this->fathermesh = cp.fathermesh; 35 this->previousmesh = cp.previousmesh; 36 this->hmax = cp.hmax; 37 this->elementswidth = cp.elementswidth; 38 39 return *this; 25 /*Clean all attributes*/ 26 this->CleanUp(); 27 28 /*Copy all data*/ 29 this->fathermesh = new TPZGeoMesh(*cp.fathermesh); 30 this->previousmesh = new TPZGeoMesh(*cp.previousmesh); 31 this->hmax = cp.hmax; 32 this->elementswidth = cp.elementswidth; 33 return *this; 40 34 41 35 } 42 36 /*}}}*/ 43 37 AdaptiveMeshRefinement::~AdaptiveMeshRefinement(){/*{{{*/ 44 this->CleanUp(); 38 this->CleanUp(); 39 gRefDBase.clear(); 45 40 } 46 41 /*}}}*/ … … 48 43 49 44 /*Verify and delete all data*/ 50 if(this->fathermesh) delete this->fathermesh; 51 if(this->previousmesh) delete this->previousmesh; 52 this->hmax=-1; 53 this->elementswidth=-1; 54 gRefDBase.clear(); 45 if(this->fathermesh) delete this->fathermesh; 46 if(this->previousmesh) delete this->previousmesh; 47 this->hmax=-1; 48 this->elementswidth=-1; 49 } 50 /*}}}*/ 51 void AdaptiveMeshRefinement::Initialize(){/*{{{*/ 52 53 /*Set pointers to NULL*/ 54 this->fathermesh = NULL; 55 this->previousmesh = NULL; 56 this->hmax = -1; 57 this->elementswidth = -1; 55 58 } 56 59 /*}}}*/ -
issm/trunk-jpl/src/c/classes/AdaptiveMeshRefinement.h
r21528 r21562 57 57 /*General methods*/ 58 58 void CleanUp(); // Clean all attributes 59 void SetHMax(int &h); // Define the max level of refinement 59 void Initialize(); // Initialize the attributes with NULL and values out of usually range 60 void SetHMax(int &h); // Define the max level of refinement 60 61 void SetElementWidth(int &width); // Define elements width 61 62 void ExecuteRefinement(int &type_process,double *vx,double *vy,double *masklevelset,int &nvertices,int &nelements,int &nsegments,double** px,double** py,double** pz,int** pelements,int** psegments=NULL); // A new mesh will be created and refined. This returns the new mesh -
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r21561 r21562 1582 1582 name==FrictionQEnum || 1583 1583 name==LoadingforceXEnum || 1584 name==LoadingforceYEnum 1584 name==LoadingforceYEnum || 1585 name==VelEnum || 1586 name==VxPicardEnum || 1587 name==VyPicardEnum 1585 1588 1586 1589 ) { -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r21540 r21562 82 82 #ifdef _HAVE_NEOPZ_ 83 83 this->InitializeAdaptiveRefinement(); 84 FemModel *Test=this->ReMesh();//itapopo: just to test!;;85 //if(IssmComm::GetRank()==0) Test->elements->DeepEcho();86 84 #endif 87 85 … … 2942 2940 if(my_rank==0){ 2943 2941 this->amr = new AdaptiveMeshRefinement(); 2944 int hmax = 3; //itapopo: it must be defined by interface. Using 2 just to test2942 int hmax = 0; //itapopo: it must be defined by interface. Using 2 just to test 2945 2943 this->amr->SetHMax(hmax); //Set max level of refinement 2946 2944 this->amr->CreateInitialMesh(numberofvertices,numberofelements,numberofsegments,elementswidth,x,y,z,elements,NULL); … … 2994 2992 output->loads=new Loads(); 2995 2993 } 2996 2997 //itapopo 2998 // output->results=static_cast<Results*>(this->results->Copy()); 2999 2994 output->results=new Results(); 2995 output->amr = NULL; 2996 if(IssmComm::GetRank()==0){ 2997 if(!this->amr) _error_("this->amr is NULL!"); 2998 output->amr = new AdaptiveMeshRefinement(*this->amr); 2999 if(!output->amr) _error_("output->amr is NULL!"); 3000 } 3001 3000 3002 /*Create vertices*/ 3001 3003 output->vertices=new Vertices(); … … 3016 3018 3017 3019 int nodecounter=0; 3018 3019 3020 for(int i=0;i<output->nummodels;i++){//create nodes for each analysis in analysis_type_list 3020 3021 -
issm/trunk-jpl/src/c/cores/transient_core.cpp
r21549 r21562 167 167 femmodel->CheckPoint(); 168 168 } 169 170 /*Adaptive mesh refinement*/ 171 #ifdef _HAVE_NEOPZ_ 172 int isamr=true; 173 if(isamr){ 174 FemModel* newfemmodel = femmodel->ReMesh(); 175 delete femmodel; 176 femmodel = newfemmodel; 177 } 178 #endif 179 169 180 } 170 181 171 182 femmodel->RequestedDependentsx(); 172 183
Note:
See TracChangeset
for help on using the changeset viewer.