Changeset 1196


Ignore:
Timestamp:
07/01/09 11:11:40 (16 years ago)
Author:
Mathieu Morlighem
Message:

Added Control method macayeal 3d

Location:
issm/trunk/src/c
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Penta.cpp

    r1188 r1196  
    12221222void  Penta::GradjDrag(Vec grad_g,void* inputs,int analysis_type,int sub_analysis_type){
    12231223       
    1224        
    12251224        Tria* tria=NULL;
    12261225       
     
    12411240#define __FUNCT__ "Penta::GradjB"
    12421241void  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        }
    12441259}
    12451260       
     
    18881903
    18891904#undef __FUNCT__
    1890 #define __FUNCT__ "Penta::CreateKMatrix"
     1905#define __FUNCT__ "Penta::GetParameterValue"
    18911906void Penta::GetParameterValue(double* pvalue, double* v_list,double* gauss_l1l2l3l4){
    18921907       
     
    20112026                        }
    20122027                } //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                }
    20132058                else if (
    20142059                                (strcmp(field_name,"thickness")==0) ||
     
    20162061                                (strcmp(field_name,"bed")==0)  ||
    20172062                                (strcmp(field_name,"slopex")==0)  ||
    2018                                 (strcmp(field_name,"slopey")==0) 
     2063                                (strcmp(field_name,"slopey")==0)
    20192064                                ){
    20202065
  • issm/trunk/src/c/parallel/GradJCompute.cpp

    r1188 r1196  
    4141        Vec grad_g=NULL;
    4242
     43        /*flags: */
     44        int debug=0;
     45        int dim=-1;
    4346       
    4447        /*some parameters:*/
     
    4851        femmodel->parameters->FindParam((void*)&solverstring,"solverstring");
    4952        femmodel->parameters->FindParam((void*)&control_type,"control_type");
     53        femmodel->parameters->FindParam((void*)&debug,"debug");
     54        femmodel->parameters->FindParam((void*)&dim,"dim");
    5055
    5156        _printf_("%s\n","      recover solution for this stiffness and right hand side:");
     
    7580        Gradjx( &grad_g, numberofnodes,femmodel->elements,femmodel->nodes, femmodel->loads, femmodel->materials,
    7681                                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        }
    7788       
    7889        /*Free ressources:*/
Note: See TracChangeset for help on using the changeset viewer.