Changeset 15730
- Timestamp:
- 08/06/13 15:26:56 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r15726 r15730 954 954 /*First, figure out size of doflist and create it: */ 955 955 int numberofdofs=0; 956 for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(FS ApproximationEnum,setenum);956 for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(FSvelocityEnum,setenum); 957 957 958 958 /*Allocate output*/ … … 962 962 int count=0; 963 963 for(int i=0;i<numnodes;i++){ 964 nodes[i]->GetDofList(doflist+count,FS ApproximationEnum,setenum);965 count+=nodes[i]->GetNumberOfDofs(FS ApproximationEnum,setenum);964 nodes[i]->GetDofList(doflist+count,FSvelocityEnum,setenum); 965 count+=nodes[i]->GetNumberOfDofs(FSvelocityEnum,setenum); 966 966 } 967 967 … … 7090 7090 int cs_list[numnodes]; 7091 7091 int i,j; 7092 int init; 7092 7093 7093 7094 /*Prepare node list*/ … … 7099 7100 } 7100 7101 7102 /*Some parameters needed*/ 7103 init=this->element_type; 7104 7101 7105 /*compute all stiffness matrices for this element*/ 7102 7106 ElementMatrix* Ke1=new ElementMatrix(this->nodes,NUMVERTICES,this->parameters,HOApproximationEnum); … … 7105 7109 delete Ke1; 7106 7110 delete Ke2; 7107 Ke1=CreateKMatrixDiagnosticHO(); TransformInvStiffnessMatrixCoord(Ke1,this->nodes,NUMVERTICES,XYEnum); 7108 Ke2=CreateKMatrixDiagnosticFS(); TransformInvStiffnessMatrixCoord(Ke2,this->nodes,NUMVERTICES,XYZEnum); 7111 7112 this->element_type=P1Enum; 7113 Ke1=CreateKMatrixDiagnosticHO(); 7114 this->element_type=init; 7115 Ke2=CreateKMatrixDiagnosticFS(); 7109 7116 7110 7117 for(i=0;i<numdofs;i++) for(j=0;j<NUMVERTICES;j++){ … … 7131 7138 int approximation; 7132 7139 inputs->GetInputValue(&approximation,ApproximationEnum); 7133 7134 7140 switch(approximation){ 7135 7141 case SSAApproximationEnum: … … 7664 7670 7665 7671 /*compute all stiffness matrices for this element*/ 7672 int init = this->element_type; 7673 this->element_type=P1Enum; 7666 7674 ElementMatrix* Ke1=CreateKMatrixDiagnosticHO(); 7675 this->element_type=init; 7667 7676 ElementMatrix* Ke2=CreateKMatrixDiagnosticFS(); 7668 7677 ElementMatrix* Ke3=CreateKMatrixCouplingHOFS(); … … 9530 9539 for(int i=0;i<vnumnodes;i++){ 9531 9540 gauss->GaussNode(this->VelocityInterpolation(),i); 9532 9533 9541 vx_input->GetInputValue(&vx,gauss); 9534 9542 vy_input->GetInputValue(&vy,gauss); … … 9670 9678 void Penta::InputUpdateFromSolutionDiagnosticSSA(IssmDouble* solution){ 9671 9679 9672 const int numdof=NDOF2*NUMVERTICES; 9673 9674 int i; 9680 int numnodes = this->NumberofNodes(); 9681 int numdof=NDOF2*numnodes; 9682 9683 int i; 9675 9684 IssmDouble rho_ice,g; 9676 9685 IssmDouble values[numdof]; … … 9861 9870 /*Get dof listof this element (SSA dofs) and of the penta at base (SSA dofs): */ 9862 9871 penta->GetDofList(&doflistm,SSAApproximationEnum,GsetEnum); 9863 GetDofList(&doflists,FS ApproximationEnum,GsetEnum);9872 GetDofList(&doflists,FSvelocityEnum,GsetEnum); 9864 9873 this->parameters->FindParam(&FSreconditioning,DiagnosticFSreconditioningEnum); 9865 9874 … … 10090 10099 10091 10100 const int numdofp=NDOF2*NUMVERTICES; 10092 const int numdofs=NDOF4*NUMVERTICES; 10093 10094 int i; 10101 const int numdofs=NDOF3*NUMVERTICES; 10102 const int numdofpressure=NDOF1*NUMVERTICES; 10103 10104 int i; 10095 10105 IssmDouble HO_values[numdofp]; 10096 10106 IssmDouble FS_values[numdofs]; 10107 IssmDouble Pressure_values[numdofpressure]; 10097 10108 IssmDouble vx[NUMVERTICES]; 10098 10109 IssmDouble vy[NUMVERTICES]; … … 10104 10115 IssmDouble xyz_list[NUMVERTICES][3]; 10105 10116 IssmDouble FSreconditioning; 10106 int* doflistp = NULL; 10107 int* doflists = NULL; 10108 Penta *penta = NULL; 10117 int* doflistp = NULL; 10118 int* doflists = NULL; 10119 int* doflistpressure = NULL; 10120 Penta *penta = NULL; 10109 10121 10110 10122 /*OK, we have to add results of this element for HO … … 10114 10126 /*Get dof listof this element (HO dofs) and of the penta at base (SSA dofs): */ 10115 10127 GetDofList(&doflistp,HOApproximationEnum,GsetEnum); 10116 GetDofList(&doflists,FSApproximationEnum,GsetEnum); 10128 GetDofList(&doflists,FSvelocityEnum,GsetEnum); 10129 GetDofListPressure(&doflistpressure,GsetEnum); 10117 10130 this->parameters->FindParam(&FSreconditioning,DiagnosticFSreconditioningEnum); 10118 10131 … … 10123 10136 for(i=0;i<numdofp;i++) HO_values[i]=solution[doflistp[i]]; 10124 10137 for(i=0;i<numdofs;i++) FS_values[i]=solution[doflists[i]]; 10138 for(i=0;i<numdofpressure;i++) Pressure_values[i]=solution[doflistpressure[i]]; 10125 10139 10126 10140 /*Transform solution in Cartesian Space*/ … … 10130 10144 /*Ok, we have vx and vy in values, fill in vx and vy arrays: */ 10131 10145 for(i=0;i<NUMVERTICES;i++){ 10132 vx[i]=FS_values[i*NDOF 4+0]+HO_values[i*NDOF2+0];10133 vy[i]=FS_values[i*NDOF 4+1]+HO_values[i*NDOF2+1];10134 vzFS[i]=FS_values[i*NDOF 4+2];10135 pressure[i]=FS_values[i*NDOF 4+3]*FSreconditioning;10146 vx[i]=FS_values[i*NDOF3+0]+HO_values[i*NDOF2+0]; 10147 vy[i]=FS_values[i*NDOF3+1]+HO_values[i*NDOF2+1]; 10148 vzFS[i]=FS_values[i*NDOF3+2]; 10149 pressure[i]=FS_values[i*NDOF1]*FSreconditioning; 10136 10150 10137 10151 /*Check solution*/ … … 10178 10192 xDelete<int>(doflistp); 10179 10193 xDelete<int>(doflists); 10194 xDelete<int>(doflistpressure); 10180 10195 } 10181 10196 /*}}}*/ … … 10183 10198 void Penta::InputUpdateFromSolutionDiagnosticSIA(IssmDouble* solution){ 10184 10199 10185 const int numdof=NDOF2*NUMVERTICES; 10200 int numnodes = this->NumberofNodes(); 10201 int numdof=NDOF2*numnodes; 10186 10202 10187 10203 int i; … … 10246 10262 void Penta::InputUpdateFromSolutionDiagnosticVert(IssmDouble* solution){ 10247 10263 10248 const int numdof=NDOF1*NUMVERTICES; 10249 10250 int i; 10251 int approximation; 10264 int numnodes = this->NumberofNodes(); 10265 int numdof=NDOF1*numnodes; 10266 10267 int i; 10268 int approximation; 10252 10269 IssmDouble rho_ice,g; 10253 10270 IssmDouble values[numdof]; … … 10262 10279 IssmDouble surface[NUMVERTICES]; 10263 10280 IssmDouble xyz_list[NUMVERTICES][3]; 10264 int* doflist = NULL;10281 int* doflist = NULL; 10265 10282 10266 10283 /*Get the approximation and do nothing if the element in FS or None*/
Note:
See TracChangeset
for help on using the changeset viewer.