Changeset 1196
- Timestamp:
- 07/01/09 11:11:40 (16 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Penta.cpp
r1188 r1196 1222 1222 void Penta::GradjDrag(Vec grad_g,void* inputs,int analysis_type,int sub_analysis_type){ 1223 1223 1224 1225 1224 Tria* tria=NULL; 1226 1225 … … 1241 1240 #define __FUNCT__ "Penta::GradjB" 1242 1241 void Penta::GradjB(Vec grad_g,void* inputs,int analysis_type,int sub_analysis_type){ 1243 throw ErrorException(__FUNCT__," not supported yet!"); 1242 1243 Tria* tria=NULL; 1244 1245 if (collapse){ 1246 /*Bail out element if collapsed (2d) and not on bed*/ 1247 if (!onbed) return; 1248 1249 /*This element should be collapsed into a tria element at its base. Create this tria element, 1250 * and compute gardj*/ 1251 tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face). 1252 tria->GradjB(grad_g,inputs,analysis_type,sub_analysis_type); 1253 delete tria; 1254 return; 1255 } 1256 else{ 1257 throw ErrorException(__FUNCT__," not supported yet!"); 1258 } 1244 1259 } 1245 1260 … … 1888 1903 1889 1904 #undef __FUNCT__ 1890 #define __FUNCT__ "Penta:: CreateKMatrix"1905 #define __FUNCT__ "Penta::GetParameterValue" 1891 1906 void Penta::GetParameterValue(double* pvalue, double* v_list,double* gauss_l1l2l3l4){ 1892 1907 … … 2011 2026 } 2012 2027 } //if (strcmp(field_name,"velocity")==0) 2028 else if (strcmp(field_name,"gradj")==0){ 2029 2030 /* node data: */ 2031 int dof1; 2032 double fieldel; 2033 2034 /*this penta is a collapsed macayeal. For each node on the base of this penta, 2035 * we grab the field. Once we know the field, we follow the upper nodes, 2036 * inserting the same field value into field, until we reach the surface: */ 2037 for(i=0;i<3;i++){ 2038 2039 node=nodes[i]; //base nodes 2040 dof1=node->GetDofList1(); 2041 2042 /*get field for this base node: */ 2043 fieldel=field_serial[dof1]; 2044 2045 //go throfieldn all nodes which sit on top of this node, until we reach the surface, 2046 //and plfield field in field 2047 for(;;){ 2048 2049 dof1=node->GetDofList1(); 2050 VecSetValues(field,1,&dof1,&fieldel,INSERT_VALUES); 2051 2052 if (node->IsOnSurface())break; 2053 /*get next node: */ 2054 node=node->GetUpperNode(); 2055 } 2056 } 2057 } 2013 2058 else if ( 2014 2059 (strcmp(field_name,"thickness")==0) || … … 2016 2061 (strcmp(field_name,"bed")==0) || 2017 2062 (strcmp(field_name,"slopex")==0) || 2018 (strcmp(field_name,"slopey")==0) 2063 (strcmp(field_name,"slopey")==0) 2019 2064 ){ 2020 2065 -
issm/trunk/src/c/parallel/GradJCompute.cpp
r1188 r1196 41 41 Vec grad_g=NULL; 42 42 43 /*flags: */ 44 int debug=0; 45 int dim=-1; 43 46 44 47 /*some parameters:*/ … … 48 51 femmodel->parameters->FindParam((void*)&solverstring,"solverstring"); 49 52 femmodel->parameters->FindParam((void*)&control_type,"control_type"); 53 femmodel->parameters->FindParam((void*)&debug,"debug"); 54 femmodel->parameters->FindParam((void*)&dim,"dim"); 50 55 51 56 _printf_("%s\n"," recover solution for this stiffness and right hand side:"); … … 75 80 Gradjx( &grad_g, numberofnodes,femmodel->elements,femmodel->nodes, femmodel->loads, femmodel->materials, 76 81 inputs,analysis_type,sub_analysis_type,control_type); 82 83 if (dim==3){ 84 85 _printf_("%s\n"," extruding gradient..."); 86 FieldExtrudex( grad_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,"gradj",1); 87 } 77 88 78 89 /*Free ressources:*/
Note:
See TracChangeset
for help on using the changeset viewer.