Changeset 17109
- Timestamp:
- 01/14/14 13:15:26 (11 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp ¶
r17108 r17109 5 5 #include "../modules/modules.h" 6 6 #include "../solutionsequences/solutionsequences.h" 7 8 #define FSANALYTICAL 1 7 9 8 10 /*Model processing*/ … … 2719 2721 ElementVector* StressbalanceAnalysis::CreatePVectorFS(Element* element){/*{{{*/ 2720 2722 2723 #ifdef FSANALYTICAL 2724 ElementVector* pe=CreatePVectorFSAnalytical(element); 2725 2726 #else 2721 2727 /*compute all load vectors for this element*/ 2722 2728 ElementVector* pe1=CreatePVectorFSViscous(element); … … 2729 2735 delete pe2; 2730 2736 delete pe3; 2737 #endif 2738 2739 return pe; 2740 }/*}}}*/ 2741 ElementVector* StressbalanceAnalysis::CreatePVectorFSAnalytical(Element* element){/*{{{*/ 2742 2743 bool analytical_solution=0; 2744 int i,meshtype,dim; 2745 IssmDouble x_coord,y_coord,z_coord; 2746 IssmDouble Jdet,forcex,forcey,forcez; 2747 IssmDouble *xyz_list = NULL; 2748 2749 element->FindParam(&meshtype,MeshTypeEnum); 2750 switch(meshtype){ 2751 case Mesh3DEnum: dim = 3; break; 2752 default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet"); 2753 } 2754 2755 /*Fetch number of nodes and dof for this finite element*/ 2756 int vnumnodes = element->GetNumberOfNodesVelocity(); 2757 int pnumnodes = element->GetNumberOfNodesPressure(); 2758 2759 /*Prepare coordinate system list*/ 2760 int* cs_list = xNew<int>(vnumnodes+pnumnodes); 2761 if(dim==2) for(i=0;i<vnumnodes;i++) cs_list[i] = XYEnum; 2762 else for(i=0;i<vnumnodes;i++) cs_list[i] = XYZEnum; 2763 for(i=0;i<pnumnodes;i++) cs_list[vnumnodes+i] = PressureEnum; 2764 2765 /*Initialize vectors*/ 2766 ElementVector* pe = element->NewElementVector(FSvelocityEnum); 2767 IssmDouble* vbasis = xNew<IssmDouble>(vnumnodes); 2768 2769 /*Retrieve all inputs and parameters*/ 2770 element->GetVerticesCoordinates(&xyz_list); 2771 IssmDouble rho_ice =element->GetMaterialParameter(MaterialsRhoIceEnum); 2772 2773 /* Start looping on the number of gaussian points: */ 2774 Gauss* gauss=element->NewGauss(5); 2775 for(int ig=gauss->begin();ig<gauss->end();ig++){ 2776 gauss->GaussPoint(ig); 2777 2778 element->JacobianDeterminant(&Jdet,xyz_list,gauss); 2779 element->NodalFunctionsVelocity(vbasis,gauss); 2780 2781 forcex=1.0; forcey=1.0; forcez=1.0; 2782 // forcex->fx(x_coord,y_coord,z_coord); 2783 // forcex->fy(x_coord,y_coord,z_coord); 2784 // forcex->fz(x_coord,y_coord,z_coord); 2785 2786 for(i=0;i<vnumnodes;i++){ 2787 pe->values[i*dim+0] += +rho_ice*forcex *Jdet*gauss->weight*vbasis[i]; 2788 pe->values[i*dim+1] += +rho_ice*forcey *Jdet*gauss->weight*vbasis[i]; 2789 pe->values[i*dim+2] += +rho_ice*forcez *Jdet*gauss->weight*vbasis[i]; 2790 } 2791 } 2792 2793 /*Transform coordinate system*/ 2794 element->TransformLoadVectorCoord(pe,cs_list); 2795 2796 /*Clean up and return*/ 2797 delete gauss; 2798 xDelete<int>(cs_list); 2799 xDelete<IssmDouble>(vbasis); 2800 xDelete<IssmDouble>(xyz_list); 2731 2801 return pe; 2732 2802 }/*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.h ¶
r17075 r17109 69 69 ElementMatrix* CreateKMatrixFSFriction(Element* element); 70 70 ElementVector* CreatePVectorFS(Element* element); 71 ElementVector* CreatePVectorFSAnalytical(Element* element); 71 72 ElementVector* CreatePVectorFSViscous(Element* element); 72 73 ElementVector* CreatePVectorFSShelf(Element* element); -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Element.h ¶
r17100 r17109 166 166 virtual void GetVerticesCoordinatesBase(IssmDouble** xyz_list)=0; 167 167 virtual void GetVerticesCoordinatesTop(IssmDouble** xyz_list)=0; 168 virtual IssmDouble GetXcoord(Gauss* gauss)=0; 169 virtual IssmDouble GetYcoord(Gauss* gauss)=0; 168 170 virtual IssmDouble GetZcoord(Gauss* gauss)=0; 169 virtual IssmDouble GetYcoord(Gauss* gauss)=0;170 171 virtual void GetMaterialInputValue(IssmDouble* pvalue,Node* node,int enumtype)=0; 171 172 virtual int GetElementType(void)=0; -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.cpp ¶
r17065 r17109 1207 1207 /*We found the enum. Use its values to fill into the vector, using the vertices ids: */ 1208 1208 input->GetVectorFromInputs(vector,&vertexpidlist[0]); 1209 } 1210 /*}}}*/ 1211 /*FUNCTION Penta::GetXcoord {{{*/ 1212 IssmDouble Penta::GetXcoord(Gauss* gauss){ 1213 1214 int i; 1215 IssmDouble x; 1216 IssmDouble xyz_list[NUMVERTICES][3]; 1217 IssmDouble x_list[NUMVERTICES]; 1218 1219 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 1220 for(i=0;i<NUMVERTICES;i++) x_list[i]=xyz_list[i][0]; 1221 PentaRef::GetInputValue(&x,x_list,gauss); 1222 1223 return x; 1224 } 1225 /*}}}*/ 1226 /*FUNCTION Penta::GetYcoord {{{*/ 1227 IssmDouble Penta::GetYcoord(Gauss* gauss){ 1228 1229 int i; 1230 IssmDouble y; 1231 IssmDouble xyz_list[NUMVERTICES][3]; 1232 IssmDouble y_list[NUMVERTICES]; 1233 1234 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 1235 for(i=0;i<NUMVERTICES;i++) y_list[i]=xyz_list[i][1]; 1236 PentaRef::GetInputValue(&y,y_list,gauss); 1237 1238 return y; 1209 1239 } 1210 1240 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.h ¶
r17047 r17109 95 95 int GetNumberOfVertices(void); 96 96 void GetSolutionFromInputsOneDof(Vector<IssmDouble>* solution,int enum_type); 97 IssmDouble GetXcoord(Gauss* gauss); 98 IssmDouble GetYcoord(Gauss* gauss); 97 99 IssmDouble GetZcoord(Gauss* gauss); 98 IssmDouble GetYcoord(Gauss* gauss){_error_("Not implemented");};99 100 void GetVectorFromInputs(Vector<IssmDouble>* vector,int name_enum); 100 101 void GetVerticesCoordinates(IssmDouble** pxyz_list); -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Seg.h ¶
r17047 r17109 139 139 void GetMaterialInputValue(IssmDouble* pvalue,Node* node,int enumtype){_error_("not implemented yet");}; 140 140 Node* GetNode(int node_number){_error_("Not implemented");}; 141 IssmDouble GetXcoord(Gauss* gauss){_error_("Not implemented");}; 141 142 IssmDouble GetYcoord(Gauss* gauss){_error_("Not implemented");}; 142 143 IssmDouble GetZcoord(Gauss* gauss){_error_("not implemented yet");}; -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.h ¶
r17047 r17109 212 212 213 213 void GetVertexPidList(int* doflist); 214 IssmDouble GetXcoord(Gauss* gauss){_error_("not implemented");}; 214 215 IssmDouble GetYcoord(Gauss* gauss); 215 216 IssmDouble GetZcoord(Gauss* gauss){_error_("not implemented");}; -
TabularUnified issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp ¶
r15306 r17109 47 47 MatSetFromOptions(this->matrix); 48 48 MatMPIAIJSetPreallocation(this->matrix,0,d_nnz,0,o_nnz); 49 //MatSetOption(this->matrix,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_FALSE);49 MatSetOption(this->matrix,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_FALSE); 50 50 51 51 }
Note:
See TracChangeset
for help on using the changeset viewer.