Changeset 18363
- Timestamp:
- 08/11/14 14:11:35 (11 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r18360 r18363 724 724 } 725 725 /*}}}*/ 726 void Element::GetInputLocalMinMaxOnNodes(IssmDouble* min,IssmDouble* max,int input_enum){/*{{{*/ 727 728 Input* input = GetInput(input_enum); 729 if(!input){ 730 _error_("Input "<<EnumToStringx(input_enum)<<" not found"); 731 } 732 726 void Element::GetInputLocalMinMaxOnNodes(IssmDouble* min,IssmDouble* max,IssmDouble* ug){/*{{{*/ 727 728 729 /*Get number of nodes for this element*/ 733 730 int numnodes = this->GetNumberOfNodes(); 734 IssmDouble input_min = input->Min(); 735 IssmDouble input_max = input->Max(); 731 732 /*Some checks to avoid segmentation faults*/ 733 _assert_(ug); 734 _assert_(numnodes>0); 735 _assert_(nodes); 736 737 /*Get element minimum/maximum*/ 738 IssmDouble input_min = ug[nodes[0]->GetDof(0,GsetEnum)]; 739 IssmDouble input_max = input_min; 740 for(int i=1;i<numnodes;i++){ 741 if(ug[nodes[i]->GetDof(0,GsetEnum)] < input_min) input_min = ug[nodes[i]->GetDof(0,GsetEnum)]; 742 if(ug[nodes[i]->GetDof(0,GsetEnum)] > input_max) input_max = ug[nodes[i]->GetDof(0,GsetEnum)]; 743 } 744 745 746 /*Second loop to reassign min and max with local extrema*/ 736 747 for(int i=0;i<numnodes;i++){ 737 748 if(min[nodes[i]->GetDof(0,GsetEnum)]>input_min) min[nodes[i]->GetDof(0,GsetEnum)] = input_min; -
issm/trunk-jpl/src/c/classes/Elements/Element.h
r18348 r18363 85 85 void GetInputListOnVertices(IssmDouble* pvalue,int enumtype); 86 86 void GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue); 87 void GetInputLocalMinMaxOnNodes(IssmDouble* min,IssmDouble* max, int input_enum);87 void GetInputLocalMinMaxOnNodes(IssmDouble* min,IssmDouble* max,IssmDouble* ug); 88 88 void GetInputValue(bool* pvalue,int enum_type); 89 89 void GetInputValue(int* pvalue,int enum_type); -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r18348 r18363 1125 1125 1126 1126 }/*}}}*/ 1127 void FemModel::GetInputLocalMinMaxOnNodesx(IssmDouble** pmin,IssmDouble** pmax, int input_enum){/*{{{*/1127 void FemModel::GetInputLocalMinMaxOnNodesx(IssmDouble** pmin,IssmDouble** pmax,IssmDouble* ug){/*{{{*/ 1128 1128 1129 1129 /*Get vector sizes for current configuration*/ … … 1144 1144 for(int i=0;i<this->elements->Size();i++){ 1145 1145 Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i)); 1146 element->GetInputLocalMinMaxOnNodes(uLmin_local,uLmax_local, input_enum);1146 element->GetInputLocalMinMaxOnNodes(uLmin_local,uLmax_local,ug); 1147 1147 } 1148 1148 -
issm/trunk-jpl/src/c/classes/FemModel.h
r18348 r18363 61 61 62 62 /*Modules*/ 63 void GetInputLocalMinMaxOnNodesx(IssmDouble** pmin,IssmDouble** pmax, int input_enum);63 void GetInputLocalMinMaxOnNodesx(IssmDouble** pmin,IssmDouble** pmax,IssmDouble* ug); 64 64 void MassFluxx(IssmDouble* presponse); 65 65 void MaxAbsVxx(IssmDouble* presponse); -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_fct.cpp
r18362 r18363 390 390 VecToMPISerial(&ml_serial ,Ml_petsc,IssmComm::GetComm()); 391 391 392 /*Push uL to elements*/393 InputUpdateFromSolutionx(femmodel,u_serial);394 395 392 /*Anti diffusive fluxes*/ 396 393 Vec Fbar = NULL; … … 399 396 IssmDouble *ulmin = NULL; 400 397 IssmDouble *ulmax = NULL; 401 femmodel->GetInputLocalMinMaxOnNodesx(&ulmin,&ulmax, ThicknessEnum);398 femmodel->GetInputLocalMinMaxOnNodesx(&ulmin,&ulmax,u_serial); 402 399 CreateRis(&Ri_plus_serial,&Ri_minus_serial,Mc_petsc,D_petsc,ml_serial,u,u_serial,udot_serial,ulmin,ulmax,deltat); 403 400 CreateFbar(&Fbar,Ri_plus_serial,Ri_minus_serial,Mc_petsc,D_petsc,udot_serial,u_serial,u);
Note:
See TracChangeset
for help on using the changeset viewer.