Changeset 17245
- Timestamp:
- 02/07/14 17:31:01 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
r17244 r17245 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 } … … 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 … … 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 } … … 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 … … 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: */ … … 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 }
Note:
See TracChangeset
for help on using the changeset viewer.