Changeset 22116


Ignore:
Timestamp:
09/20/17 06:29:26 (8 years ago)
Author:
tsantos
Message:

CHG: changed threshold limit for the error estimators (AMR with Bamg)

File:
1 edited

Legend:

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

    r22100 r22116  
    46014601        /*Intermediaries*/
    46024602        int numberofelements                            = this->elements->NumberOfElements();
    4603         int numberofvertices                            = this->vertices->NumberOfVertices();
    46044603        IssmDouble* error_elements              = NULL;
    4605         IssmDouble* error_vertices              = NULL;
    46064604        IssmDouble *x                                           = NULL;
    46074605        IssmDouble *y                                           = NULL;
     
    46094607        int *index                                                      = NULL;
    46104608        IssmDouble maxerror,threshold,resolution;
     4609        int vid;
    46114610       
    46124611        switch(errorestimator_type){
     
    46294628        this->GetMesh(this->vertices,this->elements,&x,&y,&z,&index);
    46304629
    4631         /*Sum the estimators over the vertices*/
    4632         error_vertices=xNewZeroInit<IssmDouble>(numberofvertices);
    4633         for(int i=0;i<numberofelements;i++){
    4634                 for(int j=0;j<this->GetElementsWidth();j++){
    4635                         int vid=index[i*this->GetElementsWidth()+j]-1;//Matlab to C indexing
    4636                         error_vertices[vid]+=error_elements[i];
    4637                 }
    4638         }
    4639 
    46404630        /*Find the max of the estimators (use error_elements)*/
    46414631        maxerror=error_elements[0];
     
    46434633       
    46444634        /*Fill hmaxvertices*/
    4645         for(int i=0;i<numberofvertices;i++){
    4646                 if(error_vertices[i]>threshold*maxerror){
    4647                         if(xIsNan<IssmDouble>(hmaxvertices[i])) hmaxvertices[i]=resolution;
    4648                         else  hmaxvertices[i]=min(resolution,hmaxvertices[i]);
     4635        for(int i=0;i<numberofelements;i++){
     4636                if(error_elements[i]>threshold*maxerror){
     4637                        /*ok, fill the hmaxvertices using the element vertices*/
     4638                        for(int j=0;j<this->GetElementsWidth();j++){
     4639                                vid=index[i*this->GetElementsWidth()+j]-1;//Matlab to C indexing
     4640                                if(xIsNan<IssmDouble>(hmaxvertices[vid])) hmaxvertices[vid]=resolution;
     4641                                else hmaxvertices[vid]=min(resolution,hmaxvertices[vid]);
     4642                        }
    46494643                }
    46504644        }
     
    46564650        xDelete<int>(index);
    46574651   xDelete<IssmDouble>(error_elements);
    4658    xDelete<IssmDouble>(error_vertices);
    46594652}
    46604653/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.