Changeset 10400
- Timestamp:
- 11/01/11 11:12:50 (13 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
r10379 r10400 34 34 35 35 /*propagate ice shelf into connex areas of the ice sheet that potentially want to unground: */ 36 vertices_ungrounding=PropagateFloatingiceToGrounded (elements,nodes,vertices,parameters,vertices_potentially_ungrounding);36 vertices_ungrounding=PropagateFloatingiceToGroundedNeighbors(elements,nodes,vertices,parameters,vertices_potentially_ungrounding); 37 37 } 38 38 … … 110 110 } 111 111 /*}}}*/ 112 /*FUNCTION PropagateFloatingiceToGrounded {{{1*/113 double* PropagateFloatingiceToGrounded (Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding){112 /*FUNCTION PropagateFloatingiceToGroundedNeighbors {{{1*/ 113 double* PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding){ 114 114 115 115 int i,analysis_type; … … 117 117 int nflipped,local_nflipped; 118 118 double* nodes_on_floatingice = NULL; 119 double* elements_neighbo uring_floatingce = NULL;120 Vec vec_elements_neighbo uring_floatingice = NULL;119 double* elements_neighboring_floatingce = NULL; 120 Vec vec_elements_neighboring_floatingice = NULL; 121 121 Vec vec_nodes_on_floatingice = NULL; 122 122 Node* node = NULL; … … 136 136 137 137 /*Vector of size number of elements*/ 138 vec_elements_neighbo uring_floatingice=NewVec(elements->NumberOfElements(),true);138 vec_elements_neighboring_floatingice=NewVec(elements->NumberOfElements(),true); 139 139 140 140 /*Figure out if any of the nodes of the element will be floating -> elements neighbouting the floating ice*/ 141 141 for(i=0;i<elements->Size();i++){ 142 142 element=(Element*)elements->GetObjectByOffset(i); 143 VecSetValue(vec_elements_neighbo uring_floatingice,element->Sid(),element->IsNodeOnShelfFromFlags(nodes_on_floatingice)?1.0:0.0,INSERT_VALUES);143 VecSetValue(vec_elements_neighboring_floatingice,element->Sid(),element->IsNodeOnShelfFromFlags(nodes_on_floatingice)?1.0:0.0,INSERT_VALUES); 144 144 } 145 145 146 146 /*Assemble vector and serialize: */ 147 VecAssemblyBegin(vec_elements_neighbo uring_floatingice);148 VecAssemblyEnd(vec_elements_neighbo uring_floatingice);149 VecToMPISerial(&elements_neighbo uring_floatingce,vec_elements_neighbouring_floatingice);147 VecAssemblyBegin(vec_elements_neighboring_floatingice); 148 VecAssemblyEnd(vec_elements_neighboring_floatingice); 149 VecToMPISerial(&elements_neighboring_floatingce,vec_elements_neighboring_floatingice); 150 150 151 /*Go through elements_neighbo uring_floatingce, and update vector of the nodes that will start floating*/151 /*Go through elements_neighboring_floatingce, and update vector of the nodes that will start floating*/ 152 152 local_nflipped=0; 153 153 for(i=0;i<elements->Size();i++){ 154 154 element=(Element*)elements->GetObjectByOffset(i); 155 if(elements_neighbo uring_floatingce[element->Sid()]){155 if(elements_neighboring_floatingce[element->Sid()]){ 156 156 local_nflipped+=element->UpdatePotentialSheetUngrounding(vertices_potentially_ungrounding,vec_nodes_on_floatingice,nodes_on_floatingice); 157 157 } … … 164 164 165 165 /*Avoid leaks: */ 166 xfree((void**)&elements_neighbo uring_floatingce);166 xfree((void**)&elements_neighboring_floatingce); 167 167 xfree((void**)&nodes_on_floatingice); 168 168 169 169 /*Assemble and serialize:*/ 170 VecFree(&vec_elements_neighbo uring_floatingice);170 VecFree(&vec_elements_neighboring_floatingice); 171 171 VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_floatingice); 172 172 } … … 174 174 /*Free ressources:*/ 175 175 VecFree(&vec_nodes_on_floatingice); 176 xfree((void**)&elements_neighbo uring_floatingce);176 xfree((void**)&elements_neighboring_floatingce); 177 177 178 178 return nodes_on_floatingice; -
issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h
r10378 r10400 16 16 Vec CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type); 17 17 double* PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters); 18 double* PropagateFloatingiceToGrounded (Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding);18 double* PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding); 19 19 #endif /* _GROUNDINGLINEMIGRATIONX_H */ -
issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp
r9874 r10400 26 26 char *outputfilename = NULL; 27 27 char cpu_outputfilename[100]; //easier to convert an integer with sprintf 28 bool io_gather ,results_on_vertices;28 bool io_gather; 29 29 int solutiontype; 30 30 Results *results = NULL; 31 bool dakota_analysis 31 bool dakota_analysis = false; 32 32 33 33 #ifdef _SERIAL_ -
issm/trunk/src/c/objects/Elements/Penta.cpp
r10391 r10400 2038 2038 /*FUNCTION Penta::MigrateGroundingLine{{{1*/ 2039 2039 void Penta::MigrateGroundingLine(double* old_floating_ice,double* sheet_ungrounding){ 2040 _error_("not supported yet!"); 2040 2041 int i,migration_style,unground; 2042 bool elementonshelf = false; 2043 double bed_hydro,yts,gl_melting_rate; 2044 double rho_water,rho_ice,density; 2045 double melting[NUMVERTICES]; 2046 double h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES]; 2047 2048 /*Recover info at the vertices: */ 2049 parameters->FindParam(&migration_style,GroundinglineMigrationEnum); 2050 parameters->FindParam(&yts,ConstantsYtsEnum); 2051 GetInputListOnVertices(&h[0],ThicknessEnum); 2052 GetInputListOnVertices(&s[0],SurfaceEnum); 2053 GetInputListOnVertices(&b[0],BedEnum); 2054 GetInputListOnVertices(&ba[0],BathymetryEnum); 2055 rho_water=matpar->GetRhoWater(); 2056 rho_ice=matpar->GetRhoIce(); 2057 density=rho_ice/rho_water; 2058 2059 /*go through vertices, and update inputs, considering them to be PentaVertex type: */ 2060 for(i=0;i<NUMVERTICES;i++){ 2061 /*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */ 2062 if(old_floating_ice[nodes[i]->Sid()]){ 2063 if(b[i]<=ba[i]){ 2064 b[i]=ba[i]; 2065 s[i]=b[i]+h[i]; 2066 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,false)); 2067 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,true)); 2068 } 2069 } 2070 /*Ice sheet: if hydrostatic bed above bathymetry, ice sheet starts to unground, elso do nothing */ 2071 /*Change only if AgressiveMigration or if the ice sheet is in contact with the ocean*/ 2072 else{ 2073 bed_hydro=-density*h[i]; 2074 if (bed_hydro>ba[i]){ 2075 /*Unground only if the element is connected to the ice shelf*/ 2076 if(migration_style==AgressiveMigrationEnum){ 2077 s[i]=(1-density)*h[i]; 2078 b[i]=-density*h[i]; 2079 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true)); 2080 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false)); 2081 } 2082 else if(migration_style==SoftMigrationEnum && sheet_ungrounding[nodes[i]->Sid()]){ 2083 s[i]=(1-density)*h[i]; 2084 b[i]=-density*h[i]; 2085 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true)); 2086 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false)); 2087 } 2088 } 2089 } 2090 } 2091 2092 /*If at least one vertex is now floating, the element is now floating*/ 2093 for(i=0;i<NUMVERTICES;i++){ 2094 if(nodes[i]->IsFloating()){ 2095 elementonshelf=true; 2096 break; 2097 } 2098 } 2099 2100 /*Add basal melting rate if element just ungrounded*/ 2101 if(!this->IsFloating() && elementonshelf==true){ 2102 for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts; 2103 this->inputs->AddInput(new PentaVertexInput(BasalforcingsMeltingRateEnum,&melting[0])); 2104 } 2105 2106 /*Update inputs*/ 2107 this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf)); 2108 2109 /*Update inputs*/ 2110 this->inputs->AddInput(new PentaVertexInput(SurfaceEnum,&s[0])); 2111 this->inputs->AddInput(new PentaVertexInput(BedEnum,&b[0])); 2041 2112 } 2042 2113 /*}}}*/ … … 2100 2171 2101 2172 int i; 2102 int numrows = 0;2103 int numnodes = 0;2104 int temp_numnodes =0;2173 int numrows = 0; 2174 int numnodes = 0; 2175 int temp_numnodes = 0; 2105 2176 2106 2177 /*Go through all the results objects, and update the counters: */ -
issm/trunk/src/c/objects/Elements/Tria.cpp
r10381 r10400 2035 2035 2036 2036 int i; 2037 int numrows = 0;2038 int numnodes = 0;2039 int temp_numnodes 2037 int numrows = 0; 2038 int numnodes = 0; 2039 int temp_numnodes = 0; 2040 2040 2041 2041 /*Go through all the results objects, and update the counters: */ -
issm/trunk/src/c/objects/Patch.h
r6851 r10400 25 25 26 26 /*Headers:*/ 27 /*{{{1*/28 /*}}}*/29 30 27 class Patch{ 31 28 … … 47 44 48 45 }; 49 50 46 #endif //ifndef _PATCH_H_ -
issm/trunk/src/c/solutions/transient_core.cpp
r10300 r10400 97 97 98 98 if(isgroundingline){ 99 if(dim==3) _error_("Grounding line migration not implemented in 3d");99 // if(dim==3) _error_("Grounding line migration not implemented in 3d"); 100 100 _printf_(VerboseSolution()," computing new grounding line position\n"); 101 101 #ifdef _HAVE_GROUNDINGLINE_
Note:
See TracChangeset
for help on using the changeset viewer.