Changeset 1197


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

Added control method on B for Pattyn using MacAyeal's gradient

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

Legend:

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

    r1041 r1197  
    726726                        }
    727727                } //if (strcmp(field_name,"velocity")==0)
     728                else if (strcmp(field_name,"gradj")==0){
     729
     730                        /* node data: */
     731                        int          dof1;
     732                        double       fieldel;
     733
     734                        //initilaize node and get dof1
     735                        node=this;
     736                        dof1=node->GetDofList1();
     737
     738                        /*get field for this base node: */
     739                        fieldel=field_serial[dof1];
     740
     741                        //go throfieldn all nodes which sit on top of this node, until we reach the surface,
     742                        //and plfield  field in field
     743                        for(;;){
     744
     745                                dof1=node->GetDofList1();
     746                                VecSetValues(field,1,&dof1,&fieldel,INSERT_VALUES);
     747                                printf("dof=%i\n",dof1);
     748                                if(dof1>30){
     749                                        printf("dof=%i\n",dof1);
     750                                }
     751
     752                                if (node->IsOnSurface())break;
     753                                /*get next node: */
     754                                node=node->GetUpperNode();
     755                        }
     756                }
    728757                else if (
    729758                                (strcmp(field_name,"thickness")==0) ||
  • issm/trunk/src/c/objects/Penta.cpp

    r1196 r1197  
    12551255        }
    12561256        else{
    1257                 throw ErrorException(__FUNCT__," not supported yet!");
     1257                /*B is a 2d field, use MacAyeal(2d) gradient even if it is Stokes or Pattyn*/
     1258                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
     1259                tria->GradjB(grad_g,inputs,analysis_type,sub_analysis_type);
     1260                delete tria;
     1261                return;
    12581262        }
    12591263}
  • issm/trunk/src/c/parallel/GradJCompute.cpp

    r1196 r1197  
    8282
    8383        if (dim==3){
     84                PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok1\n");
     85                PetscSynchronizedFlush(MPI_COMM_WORLD);
     86
    8487
    8588                _printf_("%s\n","      extruding gradient...");
    86                 FieldExtrudex( grad_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,"gradj",1);
     89                FieldExtrudex( grad_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,"gradj",0);
    8790        }
    8891       
Note: See TracChangeset for help on using the changeset viewer.