source: issm/oecreview/Archive/24307-24683/ISSM-24483-24484.diff@ 24684

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

CHG: added new review

File size: 2.4 KB
RevLine 
[24684]1Index: ../trunk-jpl/src/c/classes/FemModel.cpp
2===================================================================
3--- ../trunk-jpl/src/c/classes/FemModel.cpp (revision 24483)
4+++ ../trunk-jpl/src/c/classes/FemModel.cpp (revision 24484)
5@@ -5338,10 +5338,10 @@
6 hmaxvertices_serial=xNew<IssmDouble>(numberofvertices);
7 for(int i=0;i<numberofvertices;i++) hmaxvertices_serial[i]=NAN;
8 /*Fill hmaxvertices*/
9+ if(this->amrbamg->thicknesserror_threshold>0) this->GethmaxVerticesFromEstimators(hmaxvertices_serial,ThicknessErrorEstimatorEnum);
10+ if(this->amrbamg->deviatoricerror_threshold>0) this->GethmaxVerticesFromEstimators(hmaxvertices_serial,DeviatoricStressErrorEstimatorEnum);
11 if(this->amrbamg->groundingline_distance>0) this->GethmaxVerticesFromZeroLevelSetDistance(hmaxvertices_serial,MaskGroundediceLevelsetEnum);
12 if(this->amrbamg->icefront_distance>0) this->GethmaxVerticesFromZeroLevelSetDistance(hmaxvertices_serial,MaskIceLevelsetEnum);
13- if(this->amrbamg->thicknesserror_threshold>0) this->GethmaxVerticesFromEstimators(hmaxvertices_serial,ThicknessErrorEstimatorEnum);
14- if(this->amrbamg->deviatoricerror_threshold>0) this->GethmaxVerticesFromEstimators(hmaxvertices_serial,DeviatoricStressErrorEstimatorEnum);
15 }
16
17 if(my_rank==0){
18@@ -5521,6 +5521,7 @@
19 IssmDouble L1,L2,L3;
20 int vid,v1,v2,v3;
21 bool refine;
22+
23
24 /*Fill variables*/
25 switch(errorestimator_type){
26@@ -5542,6 +5543,13 @@
27 }
28 if(!error_elements) _error_("error_elements is NULL!\n");
29 if(groupthreshold<DBL_EPSILON) _error_("group threshold is too small!");
30+
31+ /*Get mesh*/
32+ this->GetMesh(&index,&x,&y,&numberofvertices,&numberofelements);
33+ if(numberofelements<0) _error_("number of elements is negative!\n");
34+ if(numberofvertices<0) _error_("number of vertices is negative!\n");
35+ maxlength = xNew<IssmDouble>(numberofelements);
36+ error_vertices = xNewZeroInit<IssmDouble>(numberofvertices);
37
38 /*Find the max of the estimators if it was not provided*/
39 if(maxerror<DBL_EPSILON){
40@@ -5552,11 +5560,6 @@
41 }
42 }
43
44- /*Get mesh*/
45- this->GetMesh(&index,&x,&y,&numberofvertices,&numberofelements);
46- maxlength = xNew<IssmDouble>(numberofelements);
47- error_vertices = xNewZeroInit<IssmDouble>(numberofvertices);
48-
49 /*Fill error_vertices (this is the sum of all elements connected to the vertex)*/
50 for(int i=0;i<numberofelements;i++){
51 v1=index[i*elementswidth+0]-1;//Matlab to C indexing
Note: See TracBrowser for help on using the repository browser.