- Timestamp:
- 11/16/12 08:10:16 (12 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:mergeinfo changed
/issm/trunk-jpl merged: 13397-13398,13401,13407-13582,13584-13974
- Property svn:mergeinfo changed
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
r13395 r13975 19 19 Vector<IssmDouble>* vec_old_floatingice = NULL; 20 20 Element* element = NULL; 21 21 22 22 if(VerboseModule()) _pprintLine_(" Migrating grounding line"); 23 23 24 24 /*retrieve parameters: */ 25 25 parameters->FindParam(&migration_style,GroundinglineMigrationEnum); … … 43 43 /*Migrate grounding line : */ 44 44 for(i=0;i<elements->Size();i++){ 45 element= (Element*)elements->GetObjectByOffset(i);45 element=dynamic_cast<Element*>(elements->GetObjectByOffset(i)); 46 46 element->MigrateGroundingLine(old_floatingice,vertices_ungrounding); 47 47 } … … 95 95 /*Fill vector vertices_potentially_floating: */ 96 96 for(i=0;i<elements->Size();i++){ 97 element= (Element*)elements->GetObjectByOffset(i);97 element=dynamic_cast<Element*>(elements->GetObjectByOffset(i)); 98 98 element->PotentialSheetUngrounding(vec_vertices_potentially_ungrounding); 99 99 } … … 121 121 Element* element = NULL; 122 122 123 124 123 /*recover parameters: */ 125 124 parameters->FindParam(&analysis_type,AnalysisTypeEnum); … … 132 131 nflipped=1; //bootstrap 133 132 while(nflipped){ 134 133 135 134 /*Vector of size number of elements*/ 136 135 vec_elements_neighboring_floatingice=new Vector<IssmDouble>(elements->NumberOfElements(),true); … … 138 137 /*Figure out if any of the nodes of the element will be floating -> elements neighbouting the floating ice*/ 139 138 for(i=0;i<elements->Size();i++){ 140 element= (Element*)elements->GetObjectByOffset(i);139 element=dynamic_cast<Element*>(elements->GetObjectByOffset(i)); 141 140 vec_elements_neighboring_floatingice->SetValue(element->Sid(),element->IsNodeOnShelfFromFlags(nodes_on_floatingice)?1.0:0.0,INS_VAL); 142 141 } … … 149 148 local_nflipped=0; 150 149 for(i=0;i<elements->Size();i++){ 151 element= (Element*)elements->GetObjectByOffset(i);150 element=dynamic_cast<Element*>(elements->GetObjectByOffset(i)); 152 151 if(reCast<int,IssmDouble>(elements_neighboring_floatingce[element->Sid()])){ 153 152 local_nflipped+=element->UpdatePotentialSheetUngrounding(vertices_potentially_ungrounding,vec_nodes_on_floatingice,nodes_on_floatingice); … … 155 154 } 156 155 vec_nodes_on_floatingice->Assemble(); 157 156 158 157 #ifdef _HAVE_MPI_ 159 MPI_Allreduce(&local_nflipped,&nflipped,1,MPI_INT,MPI_SUM, MPI_COMM_WORLD);158 MPI_Allreduce(&local_nflipped,&nflipped,1,MPI_INT,MPI_SUM,IssmComm::GetComm()); 160 159 if(VerboseConvergence()) _pprintLine_(" Additional number of vertices allowed to unground: " << nflipped); 161 160 #else
Note:
See TracChangeset
for help on using the changeset viewer.