Changeset 21562


Ignore:
Timestamp:
02/10/17 15:37:23 (8 years ago)
Author:
tsantos
Message:

CHG: changes in AMR methods. Inserting refinement process in transiente_core. (NOTE: AMR not working yet)

Location:
issm/trunk-jpl/src/c
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/AdaptiveMeshRefinement.cpp

    r21540 r21562  
    1313/*Constructor, copy, clean up and destructor*/
    1414AdaptiveMeshRefinement::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();
    2216}
    2317/*}}}*/
    2418AdaptiveMeshRefinement::AdaptiveMeshRefinement(const AdaptiveMeshRefinement &cp){/*{{{*/
    25     this->operator =(cp);
     19   this->Initialize();
     20        this->operator =(cp);
    2621}
    2722/*}}}*/
    2823AdaptiveMeshRefinement & AdaptiveMeshRefinement::operator =(const AdaptiveMeshRefinement &cp){/*{{{*/
    2924
    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;
    4034
    4135}
    4236/*}}}*/
    4337AdaptiveMeshRefinement::~AdaptiveMeshRefinement(){/*{{{*/
    44     this->CleanUp();
     38        this->CleanUp();
     39        gRefDBase.clear();
    4540}
    4641/*}}}*/
     
    4843
    4944    /*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/*}}}*/
     51void AdaptiveMeshRefinement::Initialize(){/*{{{*/
     52
     53        /*Set pointers to NULL*/
     54        this->fathermesh    = NULL;
     55        this->previousmesh  = NULL;
     56        this->hmax          = -1;
     57        this->elementswidth = -1;
    5558}
    5659/*}}}*/
  • issm/trunk-jpl/src/c/classes/AdaptiveMeshRefinement.h

    r21528 r21562  
    5757        /*General methods*/
    5858        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
    6061   void SetElementWidth(int &width);                                       // Define elements width
    6162        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  
    15821582                                name==FrictionQEnum ||
    15831583                                name==LoadingforceXEnum ||
    1584                                 name==LoadingforceYEnum
     1584                                name==LoadingforceYEnum ||
     1585                                name==VelEnum ||
     1586                                name==VxPicardEnum ||
     1587                                name==VyPicardEnum
    15851588
    15861589                                ) {
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r21540 r21562  
    8282        #ifdef _HAVE_NEOPZ_
    8383        this->InitializeAdaptiveRefinement();
    84         FemModel *Test=this->ReMesh();//itapopo: just to test!;;
    85         //if(IssmComm::GetRank()==0) Test->elements->DeepEcho();
    8684        #endif
    8785
     
    29422940   if(my_rank==0){
    29432941                this->amr = new AdaptiveMeshRefinement();
    2944                 int hmax         = 3; //itapopo: it must be defined by interface. Using 2 just to test
     2942                int hmax         = 0; //itapopo: it must be defined by interface. Using 2 just to test
    29452943                this->amr->SetHMax(hmax); //Set max level of refinement
    29462944                this->amr->CreateInitialMesh(numberofvertices,numberofelements,numberofsegments,elementswidth,x,y,z,elements,NULL);
     
    29942992                output->loads=new Loads();
    29952993        }
    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
    30003002        /*Create vertices*/
    30013003        output->vertices=new Vertices();
     
    30163018       
    30173019        int nodecounter=0;
    3018        
    30193020        for(int i=0;i<output->nummodels;i++){//create nodes for each analysis in analysis_type_list
    30203021       
  • issm/trunk-jpl/src/c/cores/transient_core.cpp

    r21549 r21562  
    167167                        femmodel->CheckPoint();
    168168                }
     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       
    169180        }
    170 
     181       
    171182        femmodel->RequestedDependentsx();
    172183
Note: See TracChangeset for help on using the changeset viewer.