Changeset 15353
- Timestamp:
- 06/28/13 17:08:54 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r15352 r15353 336 336 _error_("Element type " << EnumToStringx(GetElementType()) << " not supported yet"); 337 337 } 338 339 338 } 340 339 /*}}}*/ … … 1485 1484 #ifdef _HAVE_HYDROLOGY_ 1486 1485 case HydrologyShreveAnalysisEnum: 1487 GetSolutionFromInputs HydrologyShreve(solution);1486 GetSolutionFromInputsOneDof(solution,WatercolumnEnum); 1488 1487 break; 1489 1488 case HydrologyDCInefficientAnalysisEnum: 1490 GetSolutionFromInputs HydrologyDCInefficient(solution);1489 GetSolutionFromInputsOneDof(solution,SedimentHeadEnum); 1491 1490 break; 1492 1491 case HydrologyDCEfficientAnalysisEnum: 1493 GetSolutionFromInputs HydrologyDCEfficient(solution);1492 GetSolutionFromInputsOneDof(solution,EplHeadEnum); 1494 1493 break; 1495 1494 #endif … … 6339 6338 } 6340 6339 /*}}}*/ 6341 /*FUNCTION Tria::GetSolutionFromInputsHydrologyShreve{{{*/ 6342 void Tria::GetSolutionFromInputsHydrologyShreve(Vector<IssmDouble>* solution){ 6340 /*FUNCTION Tria::GetSolutionFromInputsOneDof{{{*/ 6341 void Tria::GetSolutionFromInputsOneDof(Vector<IssmDouble>* solution, int enum_type){ 6342 6343 6343 const int numdof=NDOF1*NUMVERTICES; 6344 6344 6345 6345 int i; 6346 6346 int *doflist = NULL; 6347 IssmDouble watercolumn;6347 IssmDouble enum_value; 6348 6348 IssmDouble values[numdof]; 6349 6349 GaussTria *gauss = NULL; … … 6353 6353 6354 6354 /*Get inputs*/ 6355 Input* watercolumn_input=inputs->GetInput(WatercolumnEnum); _assert_(watercolumn_input);6356 6357 /*Ok, we have watercolumn values, fill in watercolumnarray: */6355 Input* enum_input=inputs->GetInput(enum_type); _assert_(enum_input); 6356 6357 /*Ok, we have the values, fill in the array: */ 6358 6358 /*P1 element only for now*/ 6359 6359 gauss=new GaussTria(); … … 6362 6362 gauss->GaussVertex(i); 6363 6363 6364 /*Recover watercolumn*/ 6365 watercolumn_input->GetInputValue(&watercolumn,gauss); 6366 values[i]=watercolumn; 6367 } 6368 6369 solution->SetValues(numdof,doflist,values,INS_VAL); 6370 6371 /*Free ressources:*/ 6372 delete gauss; 6373 xDelete<int>(doflist); 6374 } 6375 /*}}}*/ 6376 /*FUNCTION Tria::GetSolutionFromInputsHydrologyDCInefficient{{{*/ 6377 void Tria::GetSolutionFromInputsHydrologyDCInefficient(Vector<IssmDouble>* solution){ 6378 6379 const int numdof=NDOF1*NUMVERTICES; 6380 6381 int i; 6382 int *doflist = NULL; 6383 IssmDouble sedimenthead; 6384 IssmDouble values[numdof]; 6385 GaussTria *gauss = NULL; 6386 6387 /*Get dof list: */ 6388 GetDofList(&doflist,NoneApproximationEnum,GsetEnum); 6389 6390 /*Get inputs*/ 6391 Input* sedimenthead_input=inputs->GetInput(SedimentHeadEnum); _assert_(sedimenthead_input); 6392 6393 /*P1 element only for now*/ 6394 gauss=new GaussTria(); 6395 for(i=0;i<NUMVERTICES;i++){ 6396 6397 gauss->GaussVertex(i); 6398 sedimenthead_input->GetInputValue(&sedimenthead,gauss); 6399 values[i]=sedimenthead; 6400 } 6401 6402 solution->SetValues(numdof,doflist,values,INS_VAL); 6403 6404 /*Free ressources:*/ 6405 delete gauss; 6406 xDelete<int>(doflist); 6407 } 6408 /*}}}*/ 6409 /*FUNCTION Tria::GetSolutionFromInputsHydrologyDCEfficient{{{*/ 6410 void Tria::GetSolutionFromInputsHydrologyDCEfficient(Vector<IssmDouble>* solution){ 6411 6412 const int numdof=NDOF1*NUMVERTICES; 6413 6414 int i; 6415 int *doflist = NULL; 6416 IssmDouble eplhead; 6417 IssmDouble values[numdof]; 6418 GaussTria *gauss = NULL; 6419 6420 /*Get dof list: */ 6421 GetDofList(&doflist,NoneApproximationEnum,GsetEnum); 6422 6423 /*Get inputs*/ 6424 Input* eplhead_input=inputs->GetInput(EplHeadEnum); _assert_(eplhead_input); 6425 6426 /*P1 element only for now*/ 6427 gauss=new GaussTria(); 6428 for(i=0;i<NUMVERTICES;i++){ 6429 gauss->GaussVertex(i); 6430 eplhead_input->GetInputValue(&eplhead,gauss); 6431 values[i]=eplhead; 6364 /*Recover dof values*/ 6365 enum_input->GetInputValue(&enum_value,gauss); 6366 values[i]=enum_value; 6432 6367 } 6433 6368 -
issm/trunk-jpl/src/c/classes/Elements/Tria.h
r15339 r15353 246 246 ElementVector* CreatePVectorHydrologyDCInefficient(void); 247 247 ElementVector* CreatePVectorHydrologyDCEfficient(void); 248 void GetSolutionFromInputsHydrologyShreve(Vector<IssmDouble>* solution); 249 void GetSolutionFromInputsHydrologyDCInefficient(Vector<IssmDouble>* solution); 250 void GetSolutionFromInputsHydrologyDCEfficient(Vector<IssmDouble>* solution); 248 void GetSolutionFromInputsOneDof(Vector<IssmDouble>* solution,int enum_type); 251 249 void CreateHydrologyWaterVelocityInput(void); 252 250 void UpdateConstraints(void);
Note:
See TracChangeset
for help on using the changeset viewer.