source: issm/oecreview/Archive/16554-17801/ISSM-17244-17245.diff@ 17802

Last change on this file since 17802 was 17802, checked in by Mathieu Morlighem, 11 years ago

Added archives

File size: 2.3 KB
RevLine 
[17802]1Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
2===================================================================
3--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp (revision 17244)
4+++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp (revision 17245)
5@@ -483,7 +483,7 @@
6 }
7 else{
8 IoModelToConstraintsx(constraints,iomodel,StressbalanceSpcvxEnum,StressbalanceAnalysisEnum,finiteelement,1);
9- if(iomodel->meshtype==Mesh3DEnum){
10+ if(iomodel->meshtype!=Mesh2DverticalEnum){
11 IoModelToConstraintsx(constraints,iomodel,StressbalanceSpcvyEnum,StressbalanceAnalysisEnum,finiteelement,2);
12 }
13 }
14@@ -962,20 +962,21 @@
15 void StressbalanceAnalysis::GetSolutionFromInputsHoriz(Vector<IssmDouble>* solution,Element* element){/*{{{*/
16
17 IssmDouble vx,vy;
18- int meshtype,dim,approximation;
19+ int meshtype,dim,approximation,dofpernode;
20 int* doflist = NULL;
21
22 /*Get some parameters*/
23 element->FindParam(&meshtype,MeshTypeEnum);
24 switch(meshtype){
25- case Mesh2DverticalEnum: dim = 2; break;
26- case Mesh3DEnum: dim = 3; break;
27+ case Mesh2DhorizontalEnum: dim = 2; dofpernode = 2; break;
28+ case Mesh2DverticalEnum: dim = 2; dofpernode = 1; break;
29+ case Mesh3DEnum: dim = 3; dofpernode = 2; break;
30 default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet");
31 }
32
33 /*Fetch number of nodes and dof for this finite element*/
34 int numnodes = element->GetNumberOfNodes();
35- int numdof = numnodes*(dim-1);
36+ int numdof = numnodes*dofpernode;
37 element->GetInputValue(&approximation,ApproximationEnum);
38
39 /*Fetch dof list and allocate solution vector*/
40@@ -985,7 +986,7 @@
41 /*Get inputs*/
42 Input* vx_input=element->GetInput(VxEnum); _assert_(vx_input);
43 Input* vy_input=NULL;
44- if(dim==3){vy_input=element->GetInput(VyEnum); _assert_(vy_input);}
45+ if(meshtype!=Mesh2DverticalEnum){vy_input=element->GetInput(VyEnum); _assert_(vy_input);}
46
47 /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
48 Gauss* gauss=element->NewGauss();
49@@ -994,10 +995,10 @@
50
51 /*Recover vx and vy*/
52 vx_input->GetInputValue(&vx,gauss);
53- values[i*(dim-1)+0]=vx;
54- if(dim==3){
55+ values[i*dofpernode+0]=vx;
56+ if(dofpernode==2){
57 vy_input->GetInputValue(&vy,gauss);
58- values[i*(dim-1)+1]=vy;
59+ values[i*dofpernode+1]=vy;
60 }
61 }
62
Note: See TracBrowser for help on using the repository browser.