Changeset 10376
- Timestamp:
- 10/31/11 13:15:50 (13 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
r10369 r10376 30 30 31 31 /*propagate ice shelf into connex areas of the ice sheet that potentially want to unground: */ 32 vertices_ungrounding=Propagate ShelfIntoConnexIceSheet(elements,nodes,vertices,parameters,vertices_potentially_ungrounding);32 vertices_ungrounding=PropagateFloatingiceToGrounded(elements,nodes,vertices,parameters,vertices_potentially_ungrounding); 33 33 } 34 34 … … 36 36 for(i=0;i<elements->Size();i++){ 37 37 element=(Element*)elements->GetObjectByOffset(i); 38 element->Migrat ion(vertices_ungrounding);38 element->MigrateGroundingLine(vertices_ungrounding); 39 39 } 40 40 … … 79 79 } 80 80 /*}}}*/ 81 /*FUNCTION Propagate ShelfIntoConnexIceSheet{{{1*/82 double* Propagate ShelfIntoConnexIceSheet(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding){81 /*FUNCTION PropagateFloatingiceToGrounded {{{1*/ 82 double* PropagateFloatingiceToGrounded(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding){ 83 83 84 84 int i,analysis_type; 85 85 int numberofvertices; 86 86 int nflipped,local_nflipped; 87 double* nodes_on_ iceshelf= NULL;88 double* elements_ touching_iceshelf= NULL;89 Vec vec_element _touching_iceshelf= NULL;90 Vec vec_nodes_on_ iceshelf= NULL;91 Node* node = NULL;92 Element* element = NULL;87 double* nodes_on_floatingice = NULL; 88 double* elements_neighbouring_floatingce = NULL; 89 Vec vec_elements_neighbouring_floatingice = NULL; 90 Vec vec_nodes_on_floatingice = NULL; 91 Node* node = NULL; 92 Element* element = NULL; 93 93 94 94 … … 97 97 numberofvertices=vertices->NumberOfVertices(); 98 98 99 /*recover vec_nodes_on_ iceshelf*/100 vec_nodes_on_ iceshelf=NewVec(numberofvertices);99 /*recover vec_nodes_on_floatingice*/ 100 vec_nodes_on_floatingice=NewVec(numberofvertices); 101 101 102 /*Loop through nodes, and fill nodes_on_ iceshelf: */102 /*Loop through nodes, and fill nodes_on_floatingice: */ 103 103 for(i=0;i<nodes->Size();i++){ 104 104 node=(Node*)nodes->GetObjectByOffset(i); 105 105 if(node->InAnalysis(analysis_type)){ 106 106 if(node->IsFloating()){ 107 VecSetValue(vec_nodes_on_ iceshelf,node->Sid(),1.0,INSERT_VALUES);107 VecSetValue(vec_nodes_on_floatingice,node->Sid(),1.0,INSERT_VALUES); 108 108 } 109 109 } … … 111 111 112 112 /*Assemble vector and serialize: */ 113 VecAssemblyBegin(vec_nodes_on_ iceshelf);114 VecAssemblyEnd(vec_nodes_on_ iceshelf);115 VecToMPISerial(&nodes_on_ iceshelf,vec_nodes_on_iceshelf);113 VecAssemblyBegin(vec_nodes_on_floatingice); 114 VecAssemblyEnd(vec_nodes_on_floatingice); 115 VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_floatingice); 116 116 117 117 nflipped=1; //bootstrap … … 119 119 120 120 /*Vector of size number of elements*/ 121 vec_element _touching_iceshelf=NewVec(elements->NumberOfElements(),true);121 vec_elements_neighbouring_floatingice=NewVec(elements->NumberOfElements(),true); 122 122 123 123 /*Figure out if any of the nodes of the element will be floating -> elements neighbouting the floating ice*/ 124 124 for(i=0;i<elements->Size();i++){ 125 125 element=(Element*)elements->GetObjectByOffset(i); 126 VecSetValue(vec_element _touching_iceshelf,element->Sid(),element->IsNodeOnShelfFromFlags(nodes_on_iceshelf)?1.0:0.0,INSERT_VALUES);126 VecSetValue(vec_elements_neighbouring_floatingice,element->Sid(),element->IsNodeOnShelfFromFlags(nodes_on_floatingice)?1.0:0.0,INSERT_VALUES); 127 127 } 128 128 129 129 /*Assemble vector and serialize: */ 130 VecAssemblyBegin(vec_element _touching_iceshelf);131 VecAssemblyEnd(vec_element _touching_iceshelf);132 VecToMPISerial(&elements_ touching_iceshelf,vec_element_touching_iceshelf);130 VecAssemblyBegin(vec_elements_neighbouring_floatingice); 131 VecAssemblyEnd(vec_elements_neighbouring_floatingice); 132 VecToMPISerial(&elements_neighbouring_floatingce,vec_elements_neighbouring_floatingice); 133 133 134 /*Go through elements_ touching_iceshelf, and flag their nodes that can unground inside potential_sheet_ungrounding*/134 /*Go through elements_neighbouring_floatingce, and update vector of the nodes that will start floating*/ 135 135 local_nflipped=0; 136 136 for(i=0;i<elements->Size();i++){ 137 137 element=(Element*)elements->GetObjectByOffset(i); 138 if(elements_ touching_iceshelf[element->Sid()]){139 local_nflipped+=element->UpdatePotentialSheetUngrounding(vertices_potentially_ungrounding,vec_nodes_on_ iceshelf,nodes_on_iceshelf);138 if(elements_neighbouring_floatingce[element->Sid()]){ 139 local_nflipped+=element->UpdatePotentialSheetUngrounding(vertices_potentially_ungrounding,vec_nodes_on_floatingice,nodes_on_floatingice); 140 140 } 141 141 } 142 VecAssemblyBegin(vec_nodes_on_floatingice); 143 VecAssemblyEnd(vec_nodes_on_floatingice); 142 144 143 145 MPI_Allreduce(&local_nflipped,&nflipped,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD); … … 145 147 146 148 /*Avoid leaks: */ 147 xfree((void**)&elements_ touching_iceshelf);148 xfree((void**)&nodes_on_ iceshelf);149 xfree((void**)&elements_neighbouring_floatingce); 150 xfree((void**)&nodes_on_floatingice); 149 151 150 152 /*Assemble and serialize:*/ 151 VecFree(&vec_element_touching_iceshelf); 152 VecAssemblyBegin(vec_nodes_on_iceshelf); 153 VecAssemblyEnd(vec_nodes_on_iceshelf); 154 VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf); 153 VecFree(&vec_elements_neighbouring_floatingice); 154 VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_floatingice); 155 155 } 156 156 157 157 /*Free ressources:*/ 158 VecFree(&vec_nodes_on_ iceshelf);159 xfree((void**)&elements_ touching_iceshelf);158 VecFree(&vec_nodes_on_floatingice); 159 xfree((void**)&elements_neighbouring_floatingce); 160 160 161 return nodes_on_ iceshelf;161 return nodes_on_floatingice; 162 162 } 163 163 /*}}}*/ -
issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h
r10369 r10376 14 14 void GroundinglineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters); 15 15 double* PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters); 16 double* Propagate ShelfIntoConnexIceSheet(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding);16 double* PropagateFloatingiceToGrounded(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding); 17 17 #endif /* _GROUNDINGLINEMIGRATIONX_H */ -
issm/trunk/src/c/objects/Elements/Element.h
r10373 r10376 65 65 virtual int* GetHorizontalNeighboorSids(void)=0; 66 66 virtual double TimeAdapt()=0; 67 virtual void Migrat ion(double* sheet_ungrounding)=0;67 virtual void MigrateGroundingLine(double* sheet_ungrounding)=0; 68 68 virtual void ShelfSync()=0; 69 69 virtual void PotentialSheetUngrounding(Vec potential_sheet_ungrounding)=0; -
issm/trunk/src/c/objects/Elements/Penta.cpp
r10375 r10376 304 304 void Penta::AverageOntoPartition(Vec partition_contributions,Vec partition_areas,double* vertex_response,double* qmu_part){ 305 305 _error_("Not supported yet!"); 306 }307 /*}}}*/308 /*FUNCTION Penta::Migration{{{1*/309 void Penta::Migration(double* sheet_ungrounding){310 _error_("not supported yet!");311 306 } 312 307 /*}}}*/ … … 2046 2041 2047 2042 }/*}}}*/ 2043 /*FUNCTION Penta::MigrateGroundingLine{{{1*/ 2044 void Penta::MigrateGroundingLine(double* sheet_ungrounding){ 2045 _error_("not supported yet!"); 2046 } 2047 /*}}}*/ 2048 2048 /*FUNCTION Penta::MinEdgeLength{{{1*/ 2049 2049 double Penta::MinEdgeLength(double xyz_list[6][3]){ -
issm/trunk/src/c/objects/Elements/Penta.h
r10375 r10376 103 103 104 104 void InputToResult(int enum_type,int step,double time); 105 void Migrat ion(double* sheet_ungrounding);105 void MigrateGroundingLine(double* sheet_ungrounding); 106 106 void PotentialSheetUngrounding(Vec potential_sheet_ungrounding); 107 107 void ShelfSync(); -
issm/trunk/src/c/objects/Elements/Tria.cpp
r10373 r10376 1922 1922 1923 1923 }/*}}}*/ 1924 /*FUNCTION Tria::Migrat ion{{{1*/1925 void Tria::Migrat ion(double* sheet_ungrounding){1924 /*FUNCTION Tria::MigrateGroundingLine{{{1*/ 1925 void Tria::MigrateGroundingLine(double* sheet_ungrounding){ 1926 1926 1927 1927 int i,migration_style,unground; -
issm/trunk/src/c/objects/Elements/Tria.h
r10375 r10376 102 102 void DeleteResults(void); 103 103 void MaterialUpdateFromTemperature(void){_error_("not implemented yet");}; 104 void Migrat ion(double* sheet_ungrounding);104 void MigrateGroundingLine(double* sheet_ungrounding); 105 105 void ShelfSync(); 106 106 void PotentialSheetUngrounding(Vec potential_sheet_ungrounding);
Note:
See TracChangeset
for help on using the changeset viewer.