source:
issm/oecreview/Archive/16554-17801/ISSM-17244-17245.diff@
17802
Last change on this file since 17802 was 17802, checked in by , 11 years ago | |
---|---|
File size: 2.3 KB |
-
../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
483 483 } 484 484 else{ 485 485 IoModelToConstraintsx(constraints,iomodel,StressbalanceSpcvxEnum,StressbalanceAnalysisEnum,finiteelement,1); 486 if(iomodel->meshtype ==Mesh3DEnum){486 if(iomodel->meshtype!=Mesh2DverticalEnum){ 487 487 IoModelToConstraintsx(constraints,iomodel,StressbalanceSpcvyEnum,StressbalanceAnalysisEnum,finiteelement,2); 488 488 } 489 489 } … … 962 962 void StressbalanceAnalysis::GetSolutionFromInputsHoriz(Vector<IssmDouble>* solution,Element* element){/*{{{*/ 963 963 964 964 IssmDouble vx,vy; 965 int meshtype,dim,approximation ;965 int meshtype,dim,approximation,dofpernode; 966 966 int* doflist = NULL; 967 967 968 968 /*Get some parameters*/ 969 969 element->FindParam(&meshtype,MeshTypeEnum); 970 970 switch(meshtype){ 971 case Mesh2DverticalEnum: dim = 2; break; 972 case Mesh3DEnum: dim = 3; break; 971 case Mesh2DhorizontalEnum: dim = 2; dofpernode = 2; break; 972 case Mesh2DverticalEnum: dim = 2; dofpernode = 1; break; 973 case Mesh3DEnum: dim = 3; dofpernode = 2; break; 973 974 default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet"); 974 975 } 975 976 976 977 /*Fetch number of nodes and dof for this finite element*/ 977 978 int numnodes = element->GetNumberOfNodes(); 978 int numdof = numnodes* (dim-1);979 int numdof = numnodes*dofpernode; 979 980 element->GetInputValue(&approximation,ApproximationEnum); 980 981 981 982 /*Fetch dof list and allocate solution vector*/ … … 985 986 /*Get inputs*/ 986 987 Input* vx_input=element->GetInput(VxEnum); _assert_(vx_input); 987 988 Input* vy_input=NULL; 988 if( dim==3){vy_input=element->GetInput(VyEnum); _assert_(vy_input);}989 if(meshtype!=Mesh2DverticalEnum){vy_input=element->GetInput(VyEnum); _assert_(vy_input);} 989 990 990 991 /*Ok, we have vx and vy in values, fill in vx and vy arrays: */ 991 992 Gauss* gauss=element->NewGauss(); … … 994 995 995 996 /*Recover vx and vy*/ 996 997 vx_input->GetInputValue(&vx,gauss); 997 values[i* (dim-1)+0]=vx;998 if(d im==3){998 values[i*dofpernode+0]=vx; 999 if(dofpernode==2){ 999 1000 vy_input->GetInputValue(&vy,gauss); 1000 values[i* (dim-1)+1]=vy;1001 values[i*dofpernode+1]=vy; 1001 1002 } 1002 1003 } 1003 1004
Note:
See TracBrowser
for help on using the repository browser.