source:
issm/oecreview/Archive/22819-23185/ISSM-23034-23035.diff
Last change on this file was 23186, checked in by , 7 years ago | |
---|---|
File size: 20.7 KB |
-
TabularUnified ../trunk-jpl/src/c/classes/Elements/Penta.h
65 65 void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz); 66 66 int FiniteElement(void); 67 67 IssmDouble FloatingArea(bool scaled); 68 void FSContactMigration(Vector<IssmDouble>* vertex grounded,Vector<IssmDouble>* vertexfloating);68 void FSContactMigration(Vector<IssmDouble>* vertex_sigmann,Vector<IssmDouble>* vertex_waterpressure); 69 69 IssmDouble GetArea3D(void){_error_("not implemented yet!");}; 70 70 IssmDouble GetAreaSpherical(void){_error_("not implemented yet!");}; 71 71 void GetAreaCoordinates(IssmDouble *area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints); -
TabularUnified ../trunk-jpl/src/c/classes/Elements/Element.h
212 212 virtual void ElementSizes(IssmDouble* phx,IssmDouble* phy,IssmDouble* phz)=0; 213 213 virtual int FiniteElement(void)=0; 214 214 virtual IssmDouble FloatingArea(bool scaled)=0; 215 virtual void FSContactMigration(Vector<IssmDouble>* vertex grounded,Vector<IssmDouble>* vertexfloating)=0;215 virtual void FSContactMigration(Vector<IssmDouble>* vertex_sigmann,Vector<IssmDouble>* vertex_waterpressure)=0; 216 216 virtual Element* GetBasalElement(void)=0; 217 217 virtual int GetElementType(void)=0; 218 218 virtual IssmDouble GetHorizontalSurfaceArea(void){_error_("not implemented");}; -
TabularUnified ../trunk-jpl/src/c/classes/Elements/Tria.cpp
1041 1041 return floatingarea; 1042 1042 } 1043 1043 /*}}}*/ 1044 void Tria::FSContactMigration(Vector<IssmDouble>* vertex grounded,Vector<IssmDouble>* vertexfloating){/*{{{*/1044 void Tria::FSContactMigration(Vector<IssmDouble>* vertex_sigmann,Vector<IssmDouble>* vertex_waterpressure){/*{{{*/ 1045 1045 1046 1046 if(!IsOnBase()) return; 1047 1047 … … 1049 1049 inputs->GetInputValue(&approximation,ApproximationEnum); 1050 1050 1051 1051 if(approximation==HOApproximationEnum || approximation==SSAApproximationEnum || approximation==SSAHOApproximationEnum){ 1052 for(int i=0;i<NUMVERTICES;i++){ 1053 vertexgrounded->SetValue(vertices[i]->Pid(),+9999.,INS_VAL); 1054 vertexfloating->SetValue(vertices[i]->Pid(),+9999.,INS_VAL); 1055 } 1052 _error_(" contact contiditon only works for FS elements"); 1056 1053 } 1057 else{ 1058 /*Intermediaries*/ 1059 IssmDouble* xyz_list = NULL; 1060 IssmDouble* xyz_list_base = NULL; 1061 IssmDouble pressure,water_pressure,sigma_nn,viscosity,bed,base; 1062 IssmDouble bed_normal[2]; 1063 IssmDouble epsilon[3]; /* epsilon=[exx,eyy,exy];*/ 1064 IssmDouble surface=0,value=0; 1065 bool grounded; 1054 /*Intermediaries*/ 1055 IssmDouble* xyz_list = NULL; 1056 IssmDouble bed_normal[2],base[NUMVERTICES],bed[NUMVERTICES],surface[NUMVERTICES],phi[NUMVERTICES]; 1057 IssmDouble water_pressure[NUMVERTICES],pressureice[NUMVERTICES],pressure[NUMVERTICES]; 1058 IssmDouble sigmaxx[NUMVERTICES],sigmayy[NUMVERTICES],sigmaxy[NUMVERTICES],sigma_nn[NUMVERTICES]; 1059 IssmDouble viscosity,epsilon[NUMVERTICES]; 1060 GetInputListOnVertices(&base[0],BaseEnum); 1061 GetInputListOnVertices(&bed[0],BedEnum); 1062 GetInputListOnVertices(&surface[0],SurfaceEnum); 1063 GetInputListOnVertices(&pressure[0],PressureEnum); 1064 GetInputListOnVertices(&phi[0],MaskGroundediceLevelsetEnum); 1065 IssmDouble rho_ice = matpar->GetMaterialParameter(MaterialsRhoIceEnum); 1066 IssmDouble rho_water = matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum); 1067 IssmDouble gravity = matpar->GetMaterialParameter(ConstantsGEnum); 1066 1068 1067 /* Get node coordinates and dof list: */ 1068 GetVerticesCoordinates(&xyz_list); 1069 GetVerticesCoordinatesBase(&xyz_list_base); 1069 /* Get node coordinates and dof list: */ 1070 GetVerticesCoordinates(&xyz_list); 1071 /*Retrieve all inputs we will be needing: */ 1072 Input* vx_input = inputs->GetInput(VxEnum); _assert_(vx_input); 1073 Input* vy_input = inputs->GetInput(VyEnum); _assert_(vy_input); 1070 1074 1071 /*Retrieve all inputs we will be needing: */ 1072 Input* pressure_input = inputs->GetInput(PressureEnum); _assert_(pressure_input); 1073 Input* base_input = inputs->GetInput(BaseEnum); _assert_(base_input); 1074 Input* bed_input = inputs->GetInput(BedEnum); _assert_(bed_input); 1075 Input* vx_input = inputs->GetInput(VxEnum); _assert_(vx_input); 1076 Input* vy_input = inputs->GetInput(VyEnum); _assert_(vy_input); 1075 /*1. Recover stresses at the base*/ 1076 GaussTria* gauss=new GaussTria(); 1077 for (int iv=0;iv<NUMVERTICES;iv++){ 1078 gauss->GaussVertex(iv); 1077 1079 1078 /*Create gauss point in the middle of the basal edge*/ 1079 Gauss* gauss=NewGaussBase(1); 1080 gauss->GaussPoint(0); 1080 /*Compute strain rate viscosity and pressure: */ 1081 this->StrainRateSSA(&epsilon[0],xyz_list,gauss,vx_input,vy_input); 1082 this->material->ViscosityFS(&viscosity,2,xyz_list,gauss,vx_input,vy_input,NULL); 1083 /*FIXME: this is for Hongju only*/ 1084 // pressureice[iv]=gravity*rho_ice*(surface[iv]-base[iv]); 1085 // if (pressure[iv]/pressureice[iv]>1) pressure[iv]=pressureice[iv]; 1081 1086 1082 if(!IsFloating()){ 1083 /*Check for basal force only if grounded and touching GL*/ 1084 // if(this->inputs->Min(MaskGroundediceLevelsetEnum)==0.){ 1085 this->StrainRateSSA(&epsilon[0],xyz_list,gauss,vx_input,vy_input); 1086 this->material->ViscosityFS(&viscosity,2,xyz_list,gauss,vx_input,vy_input,NULL); 1087 pressure_input->GetInputValue(&pressure, gauss); 1088 base_input->GetInputValue(&base, gauss); 1087 /*Compute Stress*/ 1088 sigmaxx[iv]=2*viscosity*epsilon[0]-pressure[iv]; 1089 sigmayy[iv]=2*viscosity*epsilon[1]-pressure[iv]; 1090 sigmaxy[iv]=2*viscosity*epsilon[2]; 1091 } 1089 1092 1090 /*Compute Stress*/ 1091 IssmDouble sigma_xx=2.*viscosity*epsilon[0]-pressure; 1092 IssmDouble sigma_yy=2.*viscosity*epsilon[1]-pressure; 1093 IssmDouble sigma_xy=2.*viscosity*epsilon[2]; 1094 1095 /*Get normal vector to the bed */ 1096 NormalBase(&bed_normal[0],xyz_list_base); 1097 1098 /*basalforce*/ 1099 sigma_nn = sigma_xx*bed_normal[0]*bed_normal[0] + sigma_yy*bed_normal[1]*bed_normal[1] + 2.*sigma_xy*bed_normal[0]*bed_normal[1]; 1100 1101 /*Compute water pressure*/ 1102 IssmDouble rho_ice = matpar->GetMaterialParameter(MaterialsRhoIceEnum); 1103 IssmDouble rho_water = matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum); 1104 IssmDouble gravity = matpar->GetMaterialParameter(ConstantsGEnum); 1105 water_pressure=gravity*rho_water*base; 1106 1107 /*Compare basal stress to water pressure and determine whether it should ground*/ 1108 if (sigma_nn<water_pressure) grounded=true; 1109 else grounded=false; 1093 /*2. compute contact condition*/ 1094 for(int i=0;i<NUMVERTICES;i++){ 1095 /*If was grounded*/ 1096 if (phi[i]>=0.){ 1097 NormalBase(&bed_normal[0],xyz_list); 1098 sigma_nn[i]=-1*(sigmaxx[i]*bed_normal[0]*bed_normal[0] + sigmayy[i]*bed_normal[1]*bed_normal[1]+2*sigmaxy[i]*bed_normal[0]*bed_normal[1]); 1099 water_pressure[i]=-gravity*rho_water*base[i]; 1100 vertex_sigmann->SetValue(vertices[i]->Pid(),sigma_nn[i],ADD_VAL); 1101 vertex_waterpressure->SetValue(vertices[i]->Pid(),water_pressure[i],ADD_VAL); 1110 1102 } 1111 else{ 1112 /*Check for basal elevation if floating*/ 1113 base_input->GetInputValue(&base, gauss); 1114 bed_input->GetInputValue(&bed, gauss); 1115 if(base<bed) grounded=true; 1116 else grounded=false; 1103 /*If was floating*/ 1104 else{ 1105 /*Tricky part: 1106 * 1. if base is now touching, we put 1 for sigma_nn and leave water pressure at 0 so that the rest of the module will reground this vertex 1107 * 2. if base is still above bed, water pressure is set as 1, sigma_nn is left as 0, so the GL module will keep it afloat*/ 1108 if(base[i]<bed[i]) vertex_sigmann->SetValue(vertices[i]->Pid(),+1.,ADD_VAL); 1109 vertex_waterpressure->SetValue(vertices[i]->Pid(),+1.,ADD_VAL); 1117 1110 } 1118 for(int i=0;i<NUMVERTICES;i++){ 1119 if(grounded) vertexgrounded->SetValue(vertices[i]->Pid(),+1.,INS_VAL); 1120 else vertexfloating->SetValue(vertices[i]->Pid(),+1.,INS_VAL); 1121 } 1111 } 1122 1112 1123 /*clean up*/ 1124 delete gauss; 1125 xDelete<IssmDouble>(xyz_list); 1126 xDelete<IssmDouble>(xyz_list_base); 1127 } 1113 /*clean up*/ 1114 delete gauss; 1115 xDelete<IssmDouble>(xyz_list); 1128 1116 } 1129 1117 /*}}}*/ 1130 1118 IssmDouble Tria::GetArea(void){/*{{{*/ -
TabularUnified ../trunk-jpl/src/c/classes/Elements/Tria.h
74 74 void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz); 75 75 int FiniteElement(void); 76 76 IssmDouble FloatingArea(bool scaled); 77 void FSContactMigration(Vector<IssmDouble>* vertex grounded,Vector<IssmDouble>* vertexfloating);77 void FSContactMigration(Vector<IssmDouble>* vertex_sigmann,Vector<IssmDouble>* vertex_waterpressure); 78 78 Element* GetBasalElement(void){_error_("not implemented yet");}; 79 79 void GetLevelsetPositivePart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlynegative,IssmDouble* levelsetvalues); 80 80 void GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating); -
TabularUnified ../trunk-jpl/src/c/classes/Elements/Penta.cpp
740 740 return floatingarea; 741 741 } 742 742 /*}}}*/ 743 void Penta::FSContactMigration(Vector<IssmDouble>* vertex grounded,Vector<IssmDouble>* vertexfloating){/*{{{*/743 void Penta::FSContactMigration(Vector<IssmDouble>* vertex_sigmann,Vector<IssmDouble>* vertex_waterpressure){/*{{{*/ 744 744 745 745 if(!IsOnBase()) return; 746 746 747 747 int approximation; 748 748 inputs->GetInputValue(&approximation,ApproximationEnum); 749 if(approximation==HOApproximationEnum || approximation==SSAApproximationEnum || approximation==SSAHOApproximationEnum){ 750 for(int i=0;i<NUMVERTICES;i++){ 751 vertexgrounded->SetValue(vertices[i]->Pid(),+9999.,INS_VAL); 752 vertexfloating->SetValue(vertices[i]->Pid(),+9999.,INS_VAL); 753 } 749 if(approximation==HOApproximationEnum || approximation==SSAApproximationEnum || approximation==SSAHOApproximationEnum || approximation==HOFSApproximationEnum){ 750 _error_("Cannot compute contact condition for non FS elements"); 754 751 } 755 else {756 /*Intermediaries*/757 IssmDouble* xyz_list = NULL;758 IssmDouble pressure,water_pressure,sigma_nn,viscosity,bed,base;759 IssmDouble bed_normal[3];760 IssmDouble epsilon[6]; /* epsilon=[exx eyy ezz exy exz eyz];*/761 IssmDouble surface=0,value=0;762 bool grounded;763 752 764 /* Get node coordinates and dof list: */ 765 GetVerticesCoordinates(&xyz_list); 753 /*Intermediaries*/ 754 IssmDouble* xyz_list = NULL; 755 IssmDouble bed_normal[3],base[NUMVERTICES],bed[NUMVERTICES],surface[NUMVERTICES],phi[NUMVERTICES]; 756 IssmDouble water_pressure[NUMVERTICES],pressureice[NUMVERTICES],pressure[NUMVERTICES]; 757 IssmDouble sigmaxx[NUMVERTICES],sigmayy[NUMVERTICES],sigmazz[NUMVERTICES],sigmaxy[NUMVERTICES]; 758 IssmDouble sigmayz[NUMVERTICES],sigmaxz[NUMVERTICES],sigma_nn[NUMVERTICES]; 759 IssmDouble viscosity,epsilon[NUMVERTICES]; 760 GetInputListOnVertices(&base[0],BaseEnum); 761 GetInputListOnVertices(&bed[0],BedEnum); 762 GetInputListOnVertices(&surface[0],SurfaceEnum); 763 GetInputListOnVertices(&pressure[0],PressureEnum); 764 GetInputListOnVertices(&phi[0],MaskGroundediceLevelsetEnum); 765 IssmDouble rho_ice = matpar->GetMaterialParameter(MaterialsRhoIceEnum); 766 IssmDouble rho_water = matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum); 767 IssmDouble gravity = matpar->GetMaterialParameter(ConstantsGEnum); 766 768 767 /*Retrieve all inputs we will be needing: */ 768 Input* pressure_input = inputs->GetInput(PressureEnum); _assert_(pressure_input); 769 Input* base_input = inputs->GetInput(BaseEnum); _assert_(base_input); 770 Input* bed_input = inputs->GetInput(BedEnum); _assert_(bed_input); 771 Input* vx_input = inputs->GetInput(VxEnum); _assert_(vx_input); 772 Input* vy_input = inputs->GetInput(VyEnum); _assert_(vy_input); 773 Input* vz_input = inputs->GetInput(VzEnum); _assert_(vz_input); 769 /* Get node coordinates and dof list: */ 770 GetVerticesCoordinates(&xyz_list); 774 771 775 /*Create gauss point in the middle of the basal edge*/ 776 Gauss* gauss=NewGaussBase(1); 777 gauss->GaussPoint(0); 772 /*Retrieve all inputs we will be needing: */ 773 Input* vx_input = inputs->GetInput(VxEnum); _assert_(vx_input); 774 Input* vy_input = inputs->GetInput(VyEnum); _assert_(vy_input); 775 Input* vz_input = inputs->GetInput(VzEnum); _assert_(vz_input); 778 776 779 if(!IsFloating()){ 780 /*Check for basal force only if grounded and touching GL*/ 781 this->StrainRateFS(&epsilon[0],xyz_list,gauss,vx_input,vy_input,vz_input); 782 this->material->ViscosityFS(&viscosity,3,xyz_list,gauss,vx_input,vy_input,vz_input); 783 pressure_input->GetInputValue(&pressure, gauss); 784 base_input->GetInputValue(&base, gauss); _assert_(base<0.); 777 /*1. Recover stresses at the base*/ 778 GaussPenta* gauss=new GaussPenta(); 779 for (int iv=0;iv<NUMVERTICES;iv++){ 780 gauss->GaussVertex(iv); 785 781 786 /*Compute Stress*/ 787 IssmDouble sigma_xx=2.*viscosity*epsilon[0]-pressure; 788 IssmDouble sigma_yy=2.*viscosity*epsilon[1]-pressure; 789 IssmDouble sigma_zz=2.*viscosity*epsilon[2]-pressure; 790 IssmDouble sigma_xy=2.*viscosity*epsilon[3]; 791 IssmDouble sigma_xz=2.*viscosity*epsilon[4]; 792 IssmDouble sigma_yz=2.*viscosity*epsilon[5]; 782 /*Compute strain rate viscosity and pressure: */ 783 this->StrainRateFS(&epsilon[0],xyz_list,gauss,vx_input,vy_input,vz_input); 784 this->material->ViscosityFS(&viscosity,3,xyz_list,gauss,vx_input,vy_input,vz_input); 785 /*FIXME: this is for Hongju only*/ 786 //pressureice[iv]=gravity*rho_ice*(surface[iv]-base[iv]); 787 //if (pressure[iv]/pressureice[iv]>1) pressure[iv]=pressureice[iv]; 793 788 794 /*Get normal vector to the bed */ 795 NormalBase(&bed_normal[0],xyz_list); 789 /*Compute Stress*/ 790 sigmaxx[iv]=2*viscosity*epsilon[0]-pressure[iv]; // sigma = nu eps - pressure 791 sigmayy[iv]=2*viscosity*epsilon[1]-pressure[iv]; 792 sigmazz[iv]=2*viscosity*epsilon[2]-pressure[iv]; 793 sigmaxy[iv]=2*viscosity*epsilon[3]; 794 sigmaxz[iv]=2*viscosity*epsilon[4]; 795 sigmayz[iv]=2*viscosity*epsilon[5]; 796 } 796 797 797 /*basalforce*/ 798 sigma_nn = sigma_xx*bed_normal[0]*bed_normal[0] + sigma_yy*bed_normal[1]*bed_normal[1] + sigma_zz*bed_normal[2]*bed_normal[2] 799 + 2.*sigma_xy*bed_normal[0]*bed_normal[1] + 2.*sigma_xz*bed_normal[0]*bed_normal[2] + 2.*sigma_yz*bed_normal[1]*bed_normal[2]; 798 /*2. compute contact condition*/ 799 for(int i=0;i<NUMVERTICES;i++){ 800 800 801 /*Compute water pressure*/ 802 IssmDouble rho_ice = matpar->GetMaterialParameter(MaterialsRhoIceEnum); 803 IssmDouble rho_water = matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum); 804 IssmDouble gravity = matpar->GetMaterialParameter(ConstantsGEnum); 805 water_pressure=gravity*rho_water*base; 801 /*If was grounded*/ 802 if (phi[i]>=0.){ 803 NormalBase(&bed_normal[0],xyz_list); 804 sigma_nn[i]=-1*(sigmaxx[i]*bed_normal[0]*bed_normal[0] + sigmayy[i]*bed_normal[1]*bed_normal[1] + sigmazz[i]*bed_normal[2]*bed_normal[2]+2*sigmaxy[i]*bed_normal[0]*bed_normal[1]+2*sigmaxz[i]*bed_normal[0]*bed_normal[2]+2*sigmayz[i]*bed_normal[1]*bed_normal[2]); 805 water_pressure[i]=-gravity*rho_water*base[i]; 806 vertex_sigmann->SetValue(vertices[i]->Pid(),sigma_nn[i],ADD_VAL); 807 vertex_waterpressure->SetValue(vertices[i]->Pid(),water_pressure[i],ADD_VAL); 808 } 806 809 807 /*Compare basal stress to water pressure and determine whether it should ground*/ 808 if (sigma_nn<water_pressure) grounded=true; 809 else grounded=false; 810 } 810 /*If was floating*/ 811 811 else{ 812 /* Check for basal elevation if floating*/813 base_input->GetInputValue(&base, gauss);814 bed_input->GetInputValue(&bed, gauss);815 if(base <bed) grounded=true;816 else grounded=false;812 /*Tricky part: 813 * 1. if base is now touching, we put 1 for sigma_nn and leave water pressure at 0 so that the rest of the module will reground this vertex 814 * 2. if base is still above bed, water pressure is set as 1, sigma_nn is left as 0, so the GL module will keep it afloat*/ 815 if(base[i]<bed[i]) vertex_sigmann->SetValue(vertices[i]->Pid(),+1.,ADD_VAL); 816 else vertex_waterpressure->SetValue(vertices[i]->Pid(),+1.,ADD_VAL); 817 817 } 818 for(int i=0;i<NUMVERTICES;i++){ 819 if(grounded) vertexgrounded->SetValue(vertices[i]->Pid(),+1.,INS_VAL); 820 else vertexfloating->SetValue(vertices[i]->Pid(),+1.,INS_VAL); 821 } 818 } 822 819 823 /*clean up*/ 824 delete gauss; 825 xDelete<IssmDouble>(xyz_list); 826 } 820 /*clean up*/ 821 delete gauss; 822 xDelete<IssmDouble>(xyz_list); 827 823 } 828 824 /*}}}*/ 829 825 void Penta::GetAreaCoordinates(IssmDouble* area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints){/*{{{*/ -
TabularUnified ../trunk-jpl/src/c/classes/Elements/Element.cpp
2005 2005 else shelf=false; 2006 2006 } 2007 2007 else if(migration_style==ContactEnum){ 2008 if(this->inputs->M ax(MaskGroundediceLevelsetEnum) > 0.) shelf=false;2009 else shelf= true;2008 if(this->inputs->Min(MaskGroundediceLevelsetEnum) < 0.) shelf=true; 2009 else shelf=false; 2010 2010 } 2011 2011 else if(migration_style==NoneEnum || migration_style==AggressiveMigrationEnum || migration_style==SoftMigrationEnum || migration_style==GroundingOnlyEnum){ //Floating if all nodes are floating 2012 2012 if(this->inputs->Min(MaskGroundediceLevelsetEnum) > 0.) shelf=false; … … 2319 2319 /*go through vertices, and update inputs, considering them to be TriaVertex type: */ 2320 2320 for(i=0;i<numvertices;i++){ 2321 2321 /* Contact FS*/ 2322 if(migration_style == ContactEnum && phi_ungrounding[vertices[i]->Pid()]<10){2322 if(migration_style == ContactEnum){ 2323 2323 phi[i]=phi_ungrounding[vertices[i]->Pid()]; 2324 2324 if(phi[i]>=0.) b[i]=r[i]; 2325 2325 } -
TabularUnified ../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
58 58 59 59 IssmDouble* ContactFSLevelset(Elements* elements,Vertices* vertices){ /*{{{*/ 60 60 61 Vector<IssmDouble>* vertex grounded= NULL;62 Vector<IssmDouble>* vertex floating= NULL;63 IssmDouble* serial_vertex grounded= NULL;64 IssmDouble* serial_vertex floating= NULL;61 Vector<IssmDouble>* vertex_sigmann = NULL; 62 Vector<IssmDouble>* vertex_waterpressure = NULL; 63 IssmDouble* serial_vertex_sigmann = NULL; 64 IssmDouble* serial_vertex_waterpressure = NULL; 65 65 IssmDouble* phi = NULL; 66 66 67 67 /*Initialize vector with number of vertices*/ 68 68 int numberofvertices = vertices->NumberOfVertices(); 69 vertex grounded= new Vector<IssmDouble>(numberofvertices);70 vertex floating= new Vector<IssmDouble>(numberofvertices);69 vertex_sigmann = new Vector<IssmDouble>(numberofvertices); 70 vertex_waterpressure = new Vector<IssmDouble>(numberofvertices); 71 71 phi = xNew<IssmDouble>(numberofvertices); 72 72 73 73 /*Fill vector vertices_potentially_floating: */ 74 74 for(int i=0;i<elements->Size();i++){ 75 75 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 76 element->FSContactMigration(vertex grounded,vertexfloating);76 element->FSContactMigration(vertex_sigmann,vertex_waterpressure); 77 77 } 78 /*Assemble vector and serialize */ 79 vertex_sigmann->Assemble(); 80 vertex_waterpressure->Assemble(); 81 serial_vertex_sigmann=vertex_sigmann->ToMPISerial(); 82 serial_vertex_waterpressure=vertex_waterpressure->ToMPISerial(); 78 83 79 /*Assemble vector and serialize */80 vertexgrounded->Assemble();81 vertexfloating->Assemble();82 serial_vertexgrounded=vertexgrounded->ToMPISerial();83 serial_vertexfloating=vertexfloating->ToMPISerial();84 84 for(int i=0;i<numberofvertices;i++){ 85 if (serial_vertexgrounded[i]==1. && serial_vertexfloating[i]==1.) phi[i]=0.; 86 else if (serial_vertexgrounded[i]==1) phi[i]=1; 87 else if (serial_vertexfloating[i]==1) phi[i]=-1; 88 else if (serial_vertexgrounded[i]>10) phi[i]=9999; 89 else phi[i]=-9999; 85 if (serial_vertex_waterpressure[i] > serial_vertex_sigmann[i]) phi[i]=-1; 86 else phi[i]=1; 90 87 } 91 88 92 89 /*free ressouces and return: */ 93 delete vertex grounded;94 delete vertex floating;95 xDelete<IssmDouble>(serial_vertex grounded);96 xDelete<IssmDouble>(serial_vertex floating);90 delete vertex_sigmann; 91 delete vertex_waterpressure; 92 xDelete<IssmDouble>(serial_vertex_sigmann); 93 xDelete<IssmDouble>(serial_vertex_waterpressure); 97 94 98 95 return phi; 99 96 }
Note:
See TracBrowser
for help on using the repository browser.