- Timestamp:
- 08/28/18 09:45:51 (7 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:mergeinfo changed
/issm/trunk-jpl merged: 22823-22871,22873-22887,22894-22903,22905-23090,23092-23185,23187
- Property svn:mergeinfo changed
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
r19105 r23189 15 15 Element *element = NULL; 16 16 17 18 17 /*retrieve parameters: */ 19 18 parameters->FindParam(&migration_style,GroundinglineMigrationEnum); … … 21 20 22 21 if(migration_style==NoneEnum) return; 23 22 24 23 if(VerboseModule()) _printf0_(" Migrating grounding line\n"); 25 24 … … 37 36 phi_ungrounding=ContactFSLevelset(elements,vertices); 38 37 break; 38 case SubelementMigrationEnum: 39 39 case AggressiveMigrationEnum: 40 case SubelementMigrationEnum:41 case SubelementMigration2Enum:42 40 case GroundingOnlyEnum: 43 41 /*Nothing additional to do here, MigrateGroundingLine takes care of everything*/ … … 60 58 IssmDouble* ContactFSLevelset(Elements* elements,Vertices* vertices){ /*{{{*/ 61 59 62 Vector<IssmDouble>* vertex grounded= NULL;63 Vector<IssmDouble>* vertex floating= NULL;64 IssmDouble* serial_vertex grounded= NULL;65 IssmDouble* serial_vertex floating= NULL;60 Vector<IssmDouble>* vertex_sigmann = NULL; 61 Vector<IssmDouble>* vertex_waterpressure = NULL; 62 IssmDouble* serial_vertex_sigmann = NULL; 63 IssmDouble* serial_vertex_waterpressure = NULL; 66 64 IssmDouble* phi = NULL; 67 65 68 66 /*Initialize vector with number of vertices*/ 69 67 int numberofvertices = vertices->NumberOfVertices(); 70 vertex grounded= new Vector<IssmDouble>(numberofvertices);71 vertex floating= new Vector<IssmDouble>(numberofvertices);68 vertex_sigmann = new Vector<IssmDouble>(numberofvertices); 69 vertex_waterpressure = new Vector<IssmDouble>(numberofvertices); 72 70 phi = xNew<IssmDouble>(numberofvertices); 73 71 … … 75 73 for(int i=0;i<elements->Size();i++){ 76 74 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 77 element->FSContactMigration(vertex grounded,vertexfloating);75 element->FSContactMigration(vertex_sigmann,vertex_waterpressure); 78 76 } 77 /*Assemble vector and serialize */ 78 vertex_sigmann->Assemble(); 79 vertex_waterpressure->Assemble(); 80 serial_vertex_sigmann=vertex_sigmann->ToMPISerial(); 81 serial_vertex_waterpressure=vertex_waterpressure->ToMPISerial(); 79 82 80 /*Assemble vector and serialize */81 vertexgrounded->Assemble();82 vertexfloating->Assemble();83 serial_vertexgrounded=vertexgrounded->ToMPISerial();84 serial_vertexfloating=vertexfloating->ToMPISerial();85 83 for(int i=0;i<numberofvertices;i++){ 86 if (serial_vertexgrounded[i]==1. && serial_vertexfloating[i]==1.) phi[i]=0.; 87 else if (serial_vertexgrounded[i]==1) phi[i]=1; 88 else if (serial_vertexfloating[i]==1) phi[i]=-1; 89 else if (serial_vertexgrounded[i]>10) phi[i]=9999; 90 else phi[i]=-9999; 84 if (serial_vertex_waterpressure[i] > serial_vertex_sigmann[i]) phi[i]=-1; 85 else phi[i]=1; 91 86 } 92 87 93 88 /*free ressouces and return: */ 94 delete vertex grounded;95 delete vertex floating;96 xDelete<IssmDouble>(serial_vertex grounded);97 xDelete<IssmDouble>(serial_vertex floating);89 delete vertex_sigmann; 90 delete vertex_waterpressure; 91 xDelete<IssmDouble>(serial_vertex_sigmann); 92 xDelete<IssmDouble>(serial_vertex_waterpressure); 98 93 99 94 return phi;
Note:
See TracChangeset
for help on using the changeset viewer.