Ignore:
Timestamp:
11/08/17 05:07:49 (7 years ago)
Author:
tsantos
Message:

CHG: Updated AMR methods for NeoPZ and Bamg, insert option to restart a simulation using error estimators and Bamg, deleted some non-used methods.

File:
1 edited

Legend:

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

    r22100 r22241  
    1717
    1818/*Constructor, copy, clean up and destructor*/
    19 AmrBamg::AmrBamg(IssmDouble hmin,IssmDouble hmax,int fieldenum_in,IssmDouble err_in,int keepmetric_in,IssmDouble gradation_in,
    20                                                 IssmDouble groundingline_resolution_in,IssmDouble groundingline_distance_in,
    21                                                 IssmDouble icefront_resolution_in,IssmDouble icefront_distance_in,
    22                                                 IssmDouble thicknesserror_resolution_in,IssmDouble thicknesserror_threshold_in,
    23                                                 IssmDouble deviatoricerror_resolution_in,IssmDouble deviatoricerror_threshold_in){/*{{{*/
     19AmrBamg::AmrBamg(){/*{{{*/
    2420
    25         this->fieldenum                                         = fieldenum_in;
    26         this->keepmetric                                        = keepmetric_in;
    27         this->groundingline_resolution  = groundingline_resolution_in;
    28         this->groundingline_distance            = groundingline_distance_in;
    29         this->icefront_resolution                       = icefront_resolution_in;
    30         this->icefront_distance                         = icefront_distance_in;
    31         this->thicknesserror_resolution         = thicknesserror_resolution_in;
    32         this->thicknesserror_threshold  = thicknesserror_threshold_in;
    33         this->deviatoricerror_resolution = deviatoricerror_resolution_in;
    34         this->deviatoricerror_threshold  = deviatoricerror_threshold_in;
     21        /*These attributes MUST be setup by FemModel*/
     22        this->fieldenum                                         = -1;//fieldenum_in;
     23        this->keepmetric                                        = -1;//keepmetric_in;
     24        this->groundingline_resolution  = -1;//groundingline_resolution_in;
     25        this->groundingline_distance            = -1;//groundingline_distance_in;
     26        this->icefront_resolution                       = -1;//icefront_resolution_in;
     27        this->icefront_distance                         = -1;//icefront_distance_in;
     28        this->thicknesserror_resolution         = -1;//thicknesserror_resolution_in;
     29        this->thicknesserror_threshold  = -1;//thicknesserror_threshold_in;
     30        this->thicknesserror_maximum            = -1;
     31        this->deviatoricerror_resolution = -1;//deviatoricerror_resolution_in;
     32        this->deviatoricerror_threshold  = -1;//deviatoricerror_threshold_in;
     33        this->deviatoricerror_maximum           = -1;
     34       
     35        /*Geometry and mesh as NULL*/
    3536        this->geometry                                          = NULL;
    3637        this->fathermesh                                        = NULL;
     
    4344        this->options->coeff             = 1;
    4445        this->options->errg              = 0.1;
    45         this->options->gradation         = gradation_in;
     46        this->options->gradation         = -1; //MUST be setup by the FemModel
    4647        this->options->Hessiantype       = 0;
    4748        this->options->maxnbv            = 1e6;
     
    5455        this->options->verbose           = 0;
    5556        this->options->Crack             = 0;
    56         this->options->KeepVertices      = 1; /*!!!!! VERY IMPORTANT !!!!!*/
     57        this->options->KeepVertices      = 1; /*!!!!! VERY IMPORTANT !!!!! This avoid numerical errors when remeshing*/
    5758        this->options->splitcorners      = 1;
    58         this->options->hmin              = hmin;
    59         this->options->hmax              = hmax;
    60 
    61         this->options->err=xNew<IssmDouble>(1);
    62         this->options->errSize[0]=1;
    63         this->options->errSize[1]=1;
    64         this->options->err[0] = err_in;
     59        this->options->hmin              = -1;/*MUST be setup by the FemModel*/
     60        this->options->hmax              = -1;/*MUST be setup by the FemModel*/
     61        this->options->err                                      = xNew<IssmDouble>(1);
     62        this->options->err[0]                           = -1;/*MUST be setup by the FemModel*/
     63        this->options->errSize[0]                       = 1;
     64        this->options->errSize[1]                       = 1;
    6565}
    6666/*}}}*/
     
    174174        *pelementslist = elementslist;
    175175}/*}}}*/
     176void AmrBamg::SetBamgOpts(IssmDouble hmin_in,IssmDouble hmax_in,IssmDouble err_in,IssmDouble gradation_in){/*{{{*/
     177
     178        if(!this->options) _error_("AmrBamg->options is NULL!");
     179       
     180        this->options->hmin     = hmin_in;
     181        this->options->hmax     = hmax_in;
     182        this->options->err[0]   = err_in;
     183        this->options->gradation= gradation_in;
     184}/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.