source:
issm/oecreview/Archive/21724-22754/ISSM-21930-21931.diff
Last change on this file was 22755, checked in by , 7 years ago | |
---|---|
File size: 32.2 KB |
-
../trunk-jpl/src/c/bamg/GeomEdge.h
26 26 27 27 //Methods 28 28 R2 F(double theta) const ; // parametrization of the curve edge 29 double R1tg(double theta,R2 &t) const ; // 1/radius of curvature + tangente30 29 int Cracked() const; 31 30 int TgA() const; 32 31 int TgB() const; -
../trunk-jpl/src/c/bamg/GeomEdge.cpp
62 62 int GeomEdge::Mark() const {/*{{{*/ 63 63 return type &16; 64 64 }/*}}}*/ 65 double GeomEdge::R1tg(double theta,R2 & t) const{/*{{{*/66 /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/R1tg)*/67 // 1/R of radius of cuvature68 69 R2 A=v[0]->r,B=v[1]->r;70 double dca,dcb,dcta,dctb;71 double ddca,ddcb,ddcta,ddctb;72 double tt = theta*theta;73 74 //check theta75 _assert_(theta>=0 && theta<=1);76 77 if (TgA()){78 if (TgB()){79 // Tangent A and B provided:80 // interpolation d'hermite81 dcb = 6*theta*(1-theta);82 ddcb = 6*(1-2*theta);83 dca = -dcb;84 ddca = -ddcb;85 dcta = (3*theta - 4)*theta + 1;86 ddcta=6*theta-4;87 dctb = 3*tt - 2*theta;88 ddctb = 6*theta-2;89 }90 else {91 //Tangent A provided but tangent B not provided92 // 1-t*t, t-t*t, t*t93 double t = theta;94 dcb = 2*t;95 ddcb = 2;96 dca = -dcb;97 ddca = -2;98 dcta = 1-dcb;99 ddcta = -ddcb;100 dctb=0;101 ddctb=0;102 }103 }104 else{105 if (TgB()){106 //Tangent B provided but tangent A not provided107 double t = 1-theta;108 dca = -2*t;109 ddca = 2;110 dcb = -dca;111 ddcb = -2;112 dctb = 1+dca;113 ddctb= ddca;114 dcta =0;115 ddcta =0;116 }117 else {118 //Neither thangent A nor tangent B provided119 // lagrange P1120 t=B-A;121 return 0;122 }123 }124 R2 d = A*dca + B*dcb + tg[0]* dcta + tg[1] * dctb;125 R2 dd = A*ddca + B*ddcb + tg[0]* ddcta + tg[1] * ddctb;126 double d2=(d,d);127 double sd2 = sqrt(d2);128 t=d;129 if(d2>1.0e-20){130 t/=sd2;131 return Abs(Det(d,dd))/(d2*sd2);132 }133 else return 0;134 }135 /*}}}*/136 65 int GeomEdge::Required() {/*{{{*/ 137 66 return type &64; 138 67 }/*}}}*/ -
../trunk-jpl/src/c/bamg/Mesh.cpp
1593 1593 long i0 = GetId(triangles[it][VerticesOfTriangularEdge[j][0]]); 1594 1594 long i1 = GetId(triangles[it][VerticesOfTriangularEdge[j][1]]); 1595 1595 k = edge4->SortAndFind(i0,i1); 1596 _assert_(k>=0); 1596 if(k<0){ 1597 delete [] colorV; 1598 _error_("This should not happen"); 1599 } 1597 1600 subdomains[i].direction = (vertices + i0 == edges[k].v[0]) ? 1 : -1; 1598 1601 subdomains[i].edge = edges+k; 1599 1602 Gh.subdomains[i].edge = Gh.edges + k; … … 2053 2056 if (xy==0) dd=dxdx; 2054 2057 else if (xy==1) dd=dxdy; 2055 2058 else if (xy==2) dd=dydy; 2056 else _error_("not supported yet"); 2059 else{ 2060 delete [] detT; 2061 delete [] Mmass; 2062 delete [] workT; 2063 delete [] workV; 2064 delete [] Mmassxx; 2065 delete [] OnBoundary; 2066 _error_("not supported yet"); 2067 } 2057 2068 // do leat 2 iteration for boundary problem 2058 2069 for (int ijacobi=0;ijacobi<Max(NbJacobi,2);ijacobi++){ 2059 2070 for (i=0;i<nbt;i++) … … 2102 2113 delete [] dxdx; 2103 2114 delete [] dxdy; 2104 2115 delete [] dydy; 2105 delete [] 2116 delete [] workT; 2106 2117 delete [] workV; 2107 2118 delete [] Mmassxx; 2108 delete [] 2119 delete [] OnBoundary; 2109 2120 2110 2121 } 2111 2122 /*}}}*/ … … 2393 2404 it++;} // end while (it<nbt) 2394 2405 if (nbt == nbtout || !NbSubDomTot) { 2395 2406 delete [] HeapArete; 2407 delete [] HeapTriangle; 2396 2408 _error_("The boundary is not close: all triangles are outside"); 2397 2409 } 2398 2410 … … 2882 2894 if(kk<10) _printf_("BUG: the geometrical edge " << i << " is on no edge curve\n"); 2883 2895 } 2884 2896 } 2885 if(kk) _error_("See above"); 2897 if(kk){ 2898 delete [] e; 2899 _error_("See above"); 2900 } 2886 2901 2887 2902 return e; 2888 2903 } … … 4397 4412 for (i=0;i<Gh.nbv;i++) if (Gh[i].Required()) NbVerticesOnGeomVertex++; 4398 4413 printf("\n"); 4399 4414 if(NbVerticesOnGeomVertex >= maxnbv){ 4415 delete [] bcurve; 4400 4416 _error_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv); 4401 4417 } 4402 4418 -
../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
984 984 GiaIvinsAnalysisEnum, 985 985 EsaSolutionEnum, 986 986 EsaAnalysisEnum, 987 MeshdeformationAnalysisEnum,988 987 LevelsetAnalysisEnum, 989 988 ExtrapolationAnalysisEnum, 990 989 /*}}}*/ -
../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
952 952 case GiaIvinsAnalysisEnum : return "GiaIvinsAnalysis"; 953 953 case EsaSolutionEnum : return "EsaSolution"; 954 954 case EsaAnalysisEnum : return "EsaAnalysis"; 955 case MeshdeformationAnalysisEnum : return "MeshdeformationAnalysis";956 955 case LevelsetAnalysisEnum : return "LevelsetAnalysis"; 957 956 case ExtrapolationAnalysisEnum : return "ExtrapolationAnalysis"; 958 957 case ApproximationEnum : return "Approximation"; -
../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
973 973 else if (strcmp(name,"GiaIvinsAnalysis")==0) return GiaIvinsAnalysisEnum; 974 974 else if (strcmp(name,"EsaSolution")==0) return EsaSolutionEnum; 975 975 else if (strcmp(name,"EsaAnalysis")==0) return EsaAnalysisEnum; 976 else if (strcmp(name,"MeshdeformationAnalysis")==0) return MeshdeformationAnalysisEnum;977 976 else if (strcmp(name,"LevelsetAnalysis")==0) return LevelsetAnalysisEnum; 978 977 else if (strcmp(name,"ExtrapolationAnalysis")==0) return ExtrapolationAnalysisEnum; 979 978 else if (strcmp(name,"Approximation")==0) return ApproximationEnum; … … 997 996 else if (strcmp(name,"NearestInterp")==0) return NearestInterpEnum; 998 997 else if (strcmp(name,"MinVel")==0) return MinVelEnum; 999 998 else if (strcmp(name,"MaxVel")==0) return MaxVelEnum; 999 else if (strcmp(name,"MinVx")==0) return MinVxEnum; 1000 1000 else stage=9; 1001 1001 } 1002 1002 if(stage==9){ 1003 if (strcmp(name,"MinVx")==0) return MinVxEnum; 1004 else if (strcmp(name,"MaxVx")==0) return MaxVxEnum; 1003 if (strcmp(name,"MaxVx")==0) return MaxVxEnum; 1005 1004 else if (strcmp(name,"MaxAbsVx")==0) return MaxAbsVxEnum; 1006 1005 else if (strcmp(name,"MinVy")==0) return MinVyEnum; 1007 1006 else if (strcmp(name,"MaxVy")==0) return MaxVyEnum; -
../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp
1690 1690 xDelete<IssmPDouble>(work); 1691 1691 1692 1692 }/*}}}*/ 1693 1694 /*Element Gauss points TO BE REMOVED*/1695 void gaussQuad( IssmPDouble** pxgaus, IssmPDouble** pxwgt, IssmPDouble** pegaus, IssmPDouble** pewgt, int nigaus, int njgaus ) {/*{{{*/1696 /*Gauss quadrature points for the quadrilaterial.*/1697 1698 /*get the gauss points using the product of two line rules */1699 GaussLegendreLinear(pxgaus, pxwgt, nigaus);1700 GaussLegendreLinear(pegaus, pewgt, njgaus);1701 }/*}}}*/1702 void gaussHexa( IssmPDouble** pxgaus, IssmPDouble** pxwgt, IssmPDouble** pegaus, IssmPDouble** pewgt, IssmPDouble** pzgaus, IssmPDouble ** pzwgt, int nigaus, int njgaus, int nkgaus ) {/*{{{*/1703 /*Gauss quadrature points for the hexahedron.*/1704 1705 /* get the gauss points using the product of three line rules */1706 GaussLegendreLinear(pxgaus, pxwgt, nigaus);1707 GaussLegendreLinear(pegaus, pewgt, njgaus);1708 GaussLegendreLinear(pzgaus, pzwgt, nkgaus);1709 }/*}}}*/ -
../trunk-jpl/src/c/shared/Numerics/GaussPoints.h
17 17 #define MAX_GAUS_ITER 30 18 18 void GaussRecur(IssmPDouble* zero, IssmPDouble* weight, int n, IssmPDouble* alpha, IssmPDouble* beta); 19 19 20 void gaussQuad(IssmPDouble** pxgaus, IssmPDouble** pxwgt, IssmPDouble** pegaus, IssmPDouble** pewgt, int nigaus, int njgaus);21 void gaussHexa(IssmPDouble** pxgaus, IssmPDouble** pxwgt, IssmPDouble** pegaus, IssmPDouble** pewgt, IssmPDouble** pzgaus, IssmPDouble ** pzwgt, int nigaus, int njgaus, int nkgaus);22 23 20 #endif -
../trunk-jpl/src/c/modules/ExpToLevelSetx/ExpToLevelSetxt.cpp
67 67 } 68 68 69 69 } 70 double ddistance(double x1,double y1,double x2,double y2){ 71 return sqrt(pow(x2-x1,2)+pow(y2-y1,2)); 72 } 73 double ddot(double x1, double y1, double x2, double y2){ 74 return x1*x2+y1*y2; 75 } 76 77 bool isPointLeftOfRay(double x, double y, double raySx, double raySy, double rayEx, double rayEy) { 78 return (y-raySy)*(rayEx-raySx) 79 > (x-raySx)*(rayEy-raySy); 80 } 81 70 double ddistance(double x1,double y1,double x2,double y2){ return sqrt(pow(x2-x1,2)+pow(y2-y1,2)); } 71 double ddot(double x1, double y1, double x2, double y2){ return x1*x2+y1*y2; } 82 72 double minimum_distance(double x1, double y1, double x2, double y2, double x0, double y0){ 83 73 84 74 // Return minimum distance between line segment [(x1,y1) (x2,y2)] and point (x0,y0) (v=(x1,y1), w=(x2,y2) and p=(x0,y0) -
../trunk-jpl/src/c/Makefile.am
293 293 ./cores/dummy_core.cpp\ 294 294 ./cores/surfaceslope_core.cpp\ 295 295 ./cores/bedslope_core.cpp\ 296 ./cores/meshdeformation_core.cpp\297 296 ./cores/damage_core.cpp\ 298 297 ./cores/levelsetfunctionslope_core.cpp\ 299 298 ./cores/movingfront_core.cpp\ … … 447 446 if SMOOTH 448 447 issm_sources += ./analyses/SmoothAnalysis.cpp 449 448 endif 450 if MESHDEFORMATION451 issm_sources += ./analyses/MeshdeformationAnalysis.cpp452 endif453 449 if LEVELSET 454 450 issm_sources += ./analyses/LevelsetAnalysis.cpp 455 451 issm_sources += ./modules/Calvingx/Calvingx.cpp -
../trunk-jpl/src/c/cores/meshdeformation_core.cpp
1 /*!\file: meshdeformation_core.cpp2 * \brief: core of the slope solution3 */4 5 #include "./cores.h"6 #include "../toolkits/toolkits.h"7 #include "../classes/classes.h"8 #include "../shared/shared.h"9 #include "../solutionsequences/solutionsequences.h"10 #include "../modules/modules.h"11 12 void meshdeformation_core(FemModel* femmodel){13 14 /*parameters: */15 bool save_results;16 17 /*Recover some parameters: */18 femmodel->parameters->FindParam(&save_results,SaveResultsEnum);19 20 if(VerboseSolution()) _printf0_("computing mesh deformation (elasticity)...\n");21 22 /*Call on core computations: */23 femmodel->SetCurrentConfiguration(MeshdeformationAnalysisEnum);24 solutionsequence_linear(femmodel);25 26 if(save_results){27 if(VerboseSolution()) _printf0_("saving results:\n");28 }29 30 } -
../trunk-jpl/src/c/classes/Elements/Penta.cpp
1221 1221 return base*(surface - bed + min( rho_water/rho_ice * bathymetry, 0.) ); 1222 1222 } 1223 1223 /*}}}*/ 1224 void Penta::InputControlUpdate(IssmDouble scalar,bool save_parameter){/*{{{*/1225 1226 /*Intermediary*/1227 int num_controls;1228 int* control_type=NULL;1229 Input* input=NULL;1230 1231 /*retrieve some parameters: */1232 this->parameters->FindParam(&num_controls,InversionNumControlParametersEnum);1233 this->parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);1234 1235 for(int i=0;i<num_controls;i++){1236 1237 if(control_type[i]==MaterialsRheologyBbarEnum){1238 if (!IsOnBase()) goto cleanup_and_return;1239 input=(Input*)this->inputs->GetInput(MaterialsRheologyBEnum); _assert_(input);1240 }1241 else if(control_type[i]==DamageDbarEnum){1242 if (!IsOnBase()) goto cleanup_and_return;1243 input=(Input*)this->inputs->GetInput(DamageDEnum); _assert_(input);1244 }1245 else{1246 input=(Input*)this->inputs->GetInput(control_type[i]); _assert_(input);1247 }1248 if(input->ObjectEnum()!=ControlInputEnum) _error_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput");1249 1250 ((ControlInput*)input)->UpdateValue(scalar);1251 ((ControlInput*)input)->Constrain();1252 if (save_parameter) ((ControlInput*)input)->SaveValue();1253 1254 if(control_type[i]==MaterialsRheologyBbarEnum){1255 this->InputExtrude(MaterialsRheologyBEnum,-1);1256 }1257 else if(control_type[i]==DamageDbarEnum){1258 this->InputExtrude(DamageDEnum,-1);1259 }1260 }1261 1262 /*Clean up and return*/1263 cleanup_and_return:1264 xDelete<int>(control_type);1265 }1266 /*}}}*/1267 1224 void Penta::InputDepthAverageAtBase(int original_enum,int average_enum){/*{{{*/ 1268 1225 1269 1226 IssmDouble Jdet,value; … … 1367 1324 } 1368 1325 } 1369 1326 /*}}}*/ 1370 void Penta::InputScale(int enum_type,IssmDouble scale_factor){/*{{{*/1371 1372 Input* input=NULL;1373 1374 /*Make a copy of the original input: */1375 input=(Input*)this->inputs->GetInput(enum_type);1376 if(!input)_error_("could not find old input with enum: " << EnumToStringx(enum_type));1377 1378 /*Scale: */1379 input->Scale(scale_factor);1380 }1381 /*}}}*/1382 1327 void Penta::InputUpdateFromIoModel(int index,IoModel* iomodel){ /*{{{*/ 1383 1328 1384 1329 /*Intermediaries*/ -
../trunk-jpl/src/c/classes/Elements/Penta.h
90 90 IssmDouble GroundedArea(void); 91 91 IssmDouble IceVolume(void); 92 92 IssmDouble IceVolumeAboveFloatation(void); 93 void InputControlUpdate(IssmDouble scalar,bool save_parameter);94 93 void InputDepthAverageAtBase(int enum_type,int average_enum_type); 95 94 void InputExtrude(int enum_type,int start); 96 void InputScale(int enum_type,IssmDouble scale_factor);97 95 void InputUpdateFromIoModel(int index, IoModel* iomodel); 98 96 void InputUpdateFromSolutionOneDof(IssmDouble* solutiong,int enum_type); 99 97 void InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solutiong,int enum_type); -
../trunk-jpl/src/c/classes/Elements/Seg.h
78 78 IssmDouble GroundedArea(void){_error_("not implemented yet");}; 79 79 IssmDouble IceVolume(void){_error_("not implemented yet");}; 80 80 IssmDouble IceVolumeAboveFloatation(void){_error_("not implemented yet");}; 81 void InputControlUpdate(IssmDouble scalar,bool save_parameter){_error_("not implemented yet");};82 81 void InputDepthAverageAtBase(int enum_type,int average_enum_type){_error_("not implemented yet");}; 83 82 void InputExtrude(int enum_type,int start){_error_("not implemented"); /*For penta only*/}; 84 void InputScale(int enum_type,IssmDouble scale_factor){_error_("not implemented yet");};85 83 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");}; 86 84 void InputUpdateFromSolutionOneDof(IssmDouble* solution,int inputenum){_error_("not implemented yet");}; 87 85 void InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solution,int inputenum){_error_("not implemented yet");}; -
../trunk-jpl/src/c/classes/Elements/Tetra.h
92 92 bool IsOnBase(); 93 93 bool IsOnSurface(); 94 94 bool IsZeroLevelset(int levelset_enum){_error_("not implemented");}; 95 void InputControlUpdate(IssmDouble scalar,bool save_parameter){_error_("not implemented yet");};96 95 void InputDepthAverageAtBase(int enum_type,int average_enum_type){_error_("not implemented yet");}; 97 96 void InputExtrude(int enum_type,int start){_error_("not implemented"); /*For penta only*/}; 98 void InputScale(int enum_type,IssmDouble scale_factor){_error_("not implemented yet");};99 97 void InputUpdateFromIoModel(int index, IoModel* iomodel); 100 98 void InputUpdateFromSolutionOneDof(IssmDouble* solution,int inputenum); 101 99 void InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solution,int inputenum){_error_("not implemented yet");}; -
../trunk-jpl/src/c/classes/Elements/Element.h
221 221 virtual IssmDouble GroundedArea(void)=0; 222 222 virtual IssmDouble IceVolume(void)=0; 223 223 virtual IssmDouble IceVolumeAboveFloatation(void)=0; 224 virtual void InputControlUpdate(IssmDouble scalar,bool save_parameter)=0;225 224 virtual void InputDepthAverageAtBase(int enum_type,int average_enum_type)=0; 226 225 virtual void InputExtrude(int input_enum,int start)=0; 227 virtual void InputScale(int enum_type,IssmDouble scale_factor)=0;228 226 virtual void InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solution,int inputenum)=0; 229 227 virtual void InputUpdateFromSolutionOneDof(IssmDouble* solution,int inputenum)=0; 230 228 virtual bool IsFaceOnBoundary(void)=0; -
../trunk-jpl/src/c/classes/Elements/Tria.cpp
1366 1366 /*Computeportion of the element that has a positive levelset*/ 1367 1367 1368 1368 bool negative=true; 1369 int point ;1369 int point=0; 1370 1370 const IssmPDouble epsilon= 1.e-15; 1371 1371 IssmDouble f1,f2; 1372 1372 … … 1404 1404 f1=gl[1]/(gl[1]-gl[2]); 1405 1405 f2=gl[1]/(gl[1]-gl[0]); 1406 1406 } 1407 else{ 1408 _error_("This case should NOT be happening"); 1409 } 1407 1410 } 1408 1411 *point1=point; 1409 1412 *fraction1=f1; … … 1660 1663 return base*(surface-bed+min(rho_water/rho_ice*bathymetry,0.)); 1661 1664 } 1662 1665 /*}}}*/ 1663 void Tria::InputControlUpdate(IssmDouble scalar,bool save_parameter){/*{{{*/1664 1665 /*Intermediary*/1666 int num_controls;1667 int* control_type=NULL;1668 Input* input=NULL;1669 1670 /*retrieve some parameters: */1671 this->parameters->FindParam(&num_controls,InversionNumControlParametersEnum);1672 this->parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);1673 1674 for(int i=0;i<num_controls;i++){1675 input=(Input*)this->inputs->GetInput(control_type[i]); _assert_(input);1676 if (input->ObjectEnum()!=ControlInputEnum){1677 _error_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput");1678 }1679 1680 ((ControlInput*)input)->UpdateValue(scalar);1681 ((ControlInput*)input)->Constrain();1682 if (save_parameter) ((ControlInput*)input)->SaveValue();1683 1684 }1685 1686 /*Clean up and return*/1687 xDelete<int>(control_type);1688 }1689 /*}}}*/1690 1666 void Tria::InputDepthAverageAtBase(int enum_type,int average_enum_type){/*{{{*/ 1691 1667 1692 1668 /*New input*/ … … 1705 1681 this->inputs->AddInput((Input*)newinput); 1706 1682 } 1707 1683 /*}}}*/ 1708 void Tria::InputScale(int enum_type,IssmDouble scale_factor){/*{{{*/1709 1710 Input* input=NULL;1711 1712 /*Make a copy of the original input: */1713 input=(Input*)this->inputs->GetInput(enum_type);1714 if(!input)_error_("could not find old input with enum: " << EnumToStringx(enum_type));1715 1716 /*Scale: */1717 input->Scale(scale_factor);1718 }1719 /*}}}*/1720 1684 void Tria::InputUpdateFromIoModel(int index, IoModel* iomodel){ //i is the element index/*{{{*/ 1721 1685 1722 1686 /*Intermediaries*/ -
../trunk-jpl/src/c/classes/Elements/Tria.h
90 90 bool HasEdgeOnSurface(); 91 91 IssmDouble IceVolume(void); 92 92 IssmDouble IceVolumeAboveFloatation(void); 93 void InputControlUpdate(IssmDouble scalar,bool save_parameter);94 93 void InputDepthAverageAtBase(int enum_type,int average_enum_type); 95 94 void InputExtrude(int enum_type,int start){_error_("not implemented"); /*For penta only*/}; 96 void InputScale(int enum_type,IssmDouble scale_factor);97 95 bool IsFaceOnBoundary(void); 98 96 bool IsIcefront(void); 99 97 bool IsNodeOnShelfFromFlags(IssmDouble* flags); -
../trunk-jpl/src/c/classes/Inputs/ControlInput.h
80 80 void ResultToPatch(IssmDouble* values,int nodesperelement,int sid){_error_("not supported yet");}; 81 81 void SaveValue(void); 82 82 void Scale(IssmDouble scale_factor){_error_("not implemented yet");}; 83 void ScaleGradient(IssmDouble scale);84 83 void Set(IssmDouble setvalue){_error_("Set not implemented yet");}; 85 84 void SetGradient(Input* gradient_in); 86 85 void SetInput(Input* in_input); -
../trunk-jpl/src/c/classes/Inputs/DatasetInput.h
76 76 void ResultToPatch(IssmDouble* values,int nodesperelement,int sid){_error_("not supported yet");}; 77 77 void SaveValue(void){_error_("not implemented yet");}; 78 78 void Scale(IssmDouble scale_factor){_error_("not implemented yet");}; 79 void ScaleGradient(IssmDouble scale){_error_("not implemented yet");};80 79 void Set(IssmDouble setvalue){_error_("Set not implemented yet");}; 81 80 void SetGradient(Input* gradient_in){_error_("not implemented yet");}; 82 81 void UpdateValue(IssmDouble scalar){_error_("not implemented yet");}; -
../trunk-jpl/src/c/classes/Inputs/ControlInput.cpp
235 235 if(savedvalues) delete this->savedvalues; 236 236 this->savedvalues=xDynamicCast<Input*>(this->values->copy()); 237 237 }/*}}}*/ 238 void ControlInput::ScaleGradient(IssmDouble scaling_factor){/*{{{*/239 if(!gradient) _error_("Gradient of ControlInput " << EnumToStringx(enum_type) << " not found");240 gradient->Scale(scaling_factor);241 }/*}}}*/242 238 void ControlInput::SetGradient(Input* gradient_in){/*{{{*/ 243 239 244 240 /*Get enum for current gradient*/ -
../trunk-jpl/src/c/analyses/MeshdeformationAnalysis.cpp
1 #include "./MeshdeformationAnalysis.h"2 #include "../toolkits/toolkits.h"3 #include "../classes/classes.h"4 #include "../shared/shared.h"5 #include "../modules/modules.h"6 7 /*Model processing*/8 void MeshdeformationAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/9 _error_("not implemented yet");10 }/*}}}*/11 void MeshdeformationAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/12 _error_("not implemented yet");13 }/*}}}*/14 void MeshdeformationAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/15 _error_("not implemented yet");16 }/*}}}*/17 int MeshdeformationAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/18 _error_("not implemented");19 }/*}}}*/20 void MeshdeformationAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/21 _error_("not implemented yet");22 }/*}}}*/23 void MeshdeformationAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/24 _error_("not implemented yet");25 }/*}}}*/26 27 /*Finite Element Analysis*/28 void MeshdeformationAnalysis::Core(FemModel* femmodel){/*{{{*/29 _error_("not implemented");30 }/*}}}*/31 ElementVector* MeshdeformationAnalysis::CreateDVector(Element* element){/*{{{*/32 /*Default, return NULL*/33 return NULL;34 }/*}}}*/35 ElementMatrix* MeshdeformationAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/36 _error_("Not implemented");37 }/*}}}*/38 ElementMatrix* MeshdeformationAnalysis::CreateKMatrix(Element* element){/*{{{*/39 _error_("not implemented yet");40 }/*}}}*/41 ElementVector* MeshdeformationAnalysis::CreatePVector(Element* element){/*{{{*/42 _error_("not implemented yet");43 }/*}}}*/44 void MeshdeformationAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/45 _error_("not implemented yet");46 }/*}}}*/47 void MeshdeformationAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/48 _error_("Not implemented yet");49 }/*}}}*/50 void MeshdeformationAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/51 _error_("not implemented yet");52 }/*}}}*/53 void MeshdeformationAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/54 /*Default, do nothing*/55 return;56 }/*}}}*/ -
../trunk-jpl/src/c/analyses/MeshdeformationAnalysis.h
1 /*! \file MeshdeformationAnalysis.h2 * \brief: header file for generic external result object3 */4 5 #ifndef _MeshdeformationAnalysis_6 #define _MeshdeformationAnalysis_7 8 /*Headers*/9 #include "./Analysis.h"10 11 class MeshdeformationAnalysis: public Analysis{12 13 public:14 /*Model processing*/15 void CreateConstraints(Constraints* constraints,IoModel* iomodel);16 void CreateLoads(Loads* loads, IoModel* iomodel);17 void CreateNodes(Nodes* nodes,IoModel* iomodel);18 int DofsPerNode(int** doflist,int domaintype,int approximation);19 void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);20 void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);21 22 /*Finite element Analysis*/23 void Core(FemModel* femmodel);24 ElementVector* CreateDVector(Element* element);25 ElementMatrix* CreateJacobianMatrix(Element* element);26 ElementMatrix* CreateKMatrix(Element* element);27 ElementVector* CreatePVector(Element* element);28 void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);29 void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);30 void InputUpdateFromSolution(IssmDouble* solution,Element* element);31 void UpdateConstraints(FemModel* femmodel);32 };33 #endif -
../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
551 551 default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet"); 552 552 } 553 553 }/*}}}*/ 554 void LevelsetAnalysis::SetDistanceOnIntersectedElements(FemModel* femmodel){/*{{{*/555 556 /* Intermediaries */557 int i,k;558 IssmDouble dmaxp=0.,dmaxm=0,val=0.;559 560 /*Initialize vector with number of vertices*/561 int numvertices=femmodel->vertices->NumberOfVertices();562 Element* element;563 564 Vector<IssmDouble>* vec_dist_zerolevelset = NULL;565 GetVectorFromInputsx(&vec_dist_zerolevelset, femmodel, MaskIceLevelsetEnum, VertexPIdEnum);566 567 /* set NaN on elements intersected by zero levelset */568 for(i=0;i<femmodel->elements->Size();i++){569 element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));570 if(element->IsZeroLevelset(MaskIceLevelsetEnum))571 for(k=0;k<element->GetNumberOfVertices();k++)572 vec_dist_zerolevelset->SetValue(element->vertices[k]->Sid(),NAN,INS_VAL);573 }574 575 /* set distance on elements intersected by zero levelset */576 for(i=0;i<femmodel->elements->Size();i++){577 element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));578 if(element->IsZeroLevelset(MaskIceLevelsetEnum)){579 SetDistanceToZeroLevelsetElement(vec_dist_zerolevelset, element);580 581 /* Get maximum distance to interface along vertices */582 for(k=0;k<element->GetNumberOfVertices();k++){583 vec_dist_zerolevelset->GetValue(&val,element->vertices[k]->Sid());584 if((val>0.) && (val>dmaxp))585 dmaxp=val;586 else if((val<0.) && (val<dmaxm))587 dmaxm=val;588 }589 }590 }591 592 /* set all none intersected vertices to max/min distance */593 for(i=0;i<numvertices;i++){594 vec_dist_zerolevelset->GetValue(&val,i);595 if(val==1.) //FIXME: improve check596 vec_dist_zerolevelset->SetValue(i,3.*dmaxp,INS_VAL);597 else if(val==-1.)598 vec_dist_zerolevelset->SetValue(i,3.*dmaxm,INS_VAL);599 }600 601 /*Assemble vector and serialize */602 vec_dist_zerolevelset->Assemble();603 IssmDouble* dist_zerolevelset=vec_dist_zerolevelset->ToMPISerial();604 InputUpdateFromVectorx(femmodel,dist_zerolevelset,MaskIceLevelsetEnum,VertexSIdEnum);605 606 /*Clean up and return*/607 delete vec_dist_zerolevelset;608 delete dist_zerolevelset;609 }/*}}}*/610 554 void LevelsetAnalysis::SetDistanceToZeroLevelsetElement(Vector<IssmDouble>* vec_signed_dist, Element* element){/*{{{*/ 611 555 612 556 if(!element->IsZeroLevelset(MaskIceLevelsetEnum)) -
../trunk-jpl/src/c/analyses/analyses.h
33 33 #include "./SmbAnalysis.h" 34 34 #include "./SealevelriseAnalysis.h" 35 35 #include "./MeltingAnalysis.h" 36 #include "./MeshdeformationAnalysis.h"37 36 #include "./SmoothAnalysis.h" 38 37 #include "./StressbalanceAnalysis.h" 39 38 #include "./StressbalanceSIAAnalysis.h" -
../trunk-jpl/src/c/analyses/LevelsetAnalysis.h
31 31 void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element); 32 32 void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index); 33 33 void InputUpdateFromSolution(IssmDouble* solution,Element* element); 34 void SetDistanceOnIntersectedElements(FemModel* femmodel);35 34 void SetDistanceToZeroLevelsetElement(Vector<IssmDouble>* vec_signed_dist, Element* element); 36 35 void UpdateConstraints(FemModel* femmodel); 37 36 }; -
../trunk-jpl/src/c/analyses/EnumToAnalysis.cpp
109 109 #ifdef _HAVE_ESA_ 110 110 case EsaAnalysisEnum : return new EsaAnalysis(); 111 111 #endif 112 #ifdef _HAVE_MESHDEFORMATION_113 case MeshdeformationAnalysisEnum : return new MeshdeformationAnalysis();114 #endif115 112 #ifdef _HAVE_LEVELSET_ 116 113 case LevelsetAnalysisEnum : return new LevelsetAnalysis(); 117 114 #endif
Note:
See TracBrowser
for help on using the repository browser.