Changeset 15387
- Timestamp:
- 07/02/13 08:01:44 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Element.h ¶
r15386 r15387 84 84 85 85 #ifdef _HAVE_RESPONSES_ 86 virtual void AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part)=0; 86 87 virtual void MinVel(IssmDouble* pminvel)=0; 87 88 virtual void MaxVel(IssmDouble* pmaxvel)=0; … … 140 141 #endif 141 142 142 #ifdef _HAVE_WRAPPERS_143 virtual void AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part)=0;144 #endif145 146 143 }; 147 144 #endif -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.cpp ¶
r15386 r15387 3121 3121 3122 3122 #ifdef _HAVE_RESPONSES_ 3123 /*FUNCTION Penta::AverageOntoPartition {{{*/ 3124 void Penta::AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){ 3125 _error_("Not supported yet!"); 3126 } 3127 /*}}}*/ 3123 3128 /*FUNCTION Penta::IceVolume {{{*/ 3124 3129 IssmDouble Penta::IceVolume(void){ … … 9110 9115 /*}}}*/ 9111 9116 #endif 9117 9112 9118 #ifdef _HAVE_BALANCED_ 9113 9119 /*FUNCTION Penta::CreateKMatrixBalancethickness {{{*/ … … 9159 9165 /*}}}*/ 9160 9166 #endif 9167 9161 9168 #ifdef _HAVE_HYDROLOGY_ 9162 9163 9169 /*FUNCTION Penta::CreateKMatrixHydrologyDCInefficient {{{*/ 9164 9170 ElementMatrix* Penta::CreateKMatrixHydrologyDCInefficient(void){ … … 9465 9471 } 9466 9472 /*}}}*/ 9467 #endif9468 9469 #ifdef _HAVE_WRAPPERS_9470 9473 /*FUNCTION Penta::PotentialUngrounding{{{*/ 9471 9474 void Penta::PotentialUngrounding(Vector<IssmDouble>* potential_ungrounding){ … … 9496 9499 } 9497 9500 /*}}}*/ 9498 /*FUNCTION Penta::AverageOntoPartition {{{*/9499 void Penta::AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){9500 _error_("Not supported yet!");9501 }9502 /*}}}*/9503 9501 /*FUNCTION Penta::UpdatePotentialUngrounding{{{*/ 9504 9502 int Penta::UpdatePotentialUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.h ¶
r15386 r15387 120 120 121 121 #ifdef _HAVE_RESPONSES_ 122 void AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part); 122 123 IssmDouble IceVolume(void); 123 124 IssmDouble TotalSmb(void); … … 174 175 void PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding); 175 176 int UpdatePotentialUngrounding(IssmDouble* potential_sheet_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf); 176 #endif177 178 #ifdef _HAVE_WRAPPERS_179 void AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);180 177 #endif 181 178 -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.cpp ¶
r15386 r15387 2316 2316 2317 2317 #ifdef _HAVE_RESPONSES_ 2318 /*FUNCTION Tria::AverageOntoPartition {{{*/ 2319 void Tria::AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){ 2320 2321 bool already = false; 2322 int i,j; 2323 int partition[NUMVERTICES]; 2324 int offsetsid[NUMVERTICES]; 2325 int offsetdof[NUMVERTICES]; 2326 IssmDouble area; 2327 IssmDouble mean; 2328 2329 /*First, get the area: */ 2330 area=this->GetArea(); 2331 2332 /*Figure out the average for this element: */ 2333 this->GetVertexSidList(&offsetsid[0]); 2334 this->GetVertexPidList(&offsetdof[0]); 2335 mean=0; 2336 for(i=0;i<NUMVERTICES;i++){ 2337 partition[i]=reCast<int>(qmu_part[offsetsid[i]]); 2338 mean=mean+1.0/NUMVERTICES*vertex_response[offsetdof[i]]; 2339 } 2340 2341 /*Add contribution: */ 2342 for(i=0;i<NUMVERTICES;i++){ 2343 already=false; 2344 for(j=0;j<i;j++){ 2345 if (partition[i]==partition[j]){ 2346 already=true; 2347 break; 2348 } 2349 } 2350 if(!already){ 2351 partition_contributions->SetValue(partition[i],mean*area,ADD_VAL); 2352 partition_areas->SetValue(partition[i],area,ADD_VAL); 2353 }; 2354 } 2355 } 2356 /*}}}*/ 2318 2357 /*FUNCTION Tria::IceVolume {{{*/ 2319 2358 IssmDouble Tria::IceVolume(void){ … … 7028 7067 /*}}}*/ 7029 7068 #endif 7030 7031 #ifdef _HAVE_WRAPPERS_7032 /*FUNCTION Tria::AverageOntoPartition {{{*/7033 void Tria::AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){7034 7035 bool already = false;7036 int i,j;7037 int partition[NUMVERTICES];7038 int offsetsid[NUMVERTICES];7039 int offsetdof[NUMVERTICES];7040 IssmDouble area;7041 IssmDouble mean;7042 7043 /*First, get the area: */7044 area=this->GetArea();7045 7046 /*Figure out the average for this element: */7047 this->GetVertexSidList(&offsetsid[0]);7048 this->GetVertexPidList(&offsetdof[0]);7049 mean=0;7050 for(i=0;i<NUMVERTICES;i++){7051 partition[i]=reCast<int>(qmu_part[offsetsid[i]]);7052 mean=mean+1.0/NUMVERTICES*vertex_response[offsetdof[i]];7053 }7054 7055 /*Add contribution: */7056 for(i=0;i<NUMVERTICES;i++){7057 already=false;7058 for(j=0;j<i;j++){7059 if (partition[i]==partition[j]){7060 already=true;7061 break;7062 }7063 }7064 if(!already){7065 partition_contributions->SetValue(partition[i],mean*area,ADD_VAL);7066 partition_areas->SetValue(partition[i],area,ADD_VAL);7067 };7068 }7069 }7070 /*}}}*/7071 #endif -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.h ¶
r15386 r15387 118 118 119 119 #ifdef _HAVE_RESPONSES_ 120 void AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part); 120 121 IssmDouble IceVolume(void); 121 122 IssmDouble TotalSmb(void); … … 176 177 void MigrateGroundingLine(IssmDouble* oldfloating,IssmDouble* sheet_ungrounding); 177 178 int UpdatePotentialUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf); 178 #endif179 180 #ifdef _HAVE_WRAPPERS_181 void AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);182 179 #endif 183 180
Note:
See TracChangeset
for help on using the changeset viewer.