Changeset 10524


Ignore:
Timestamp:
11/08/11 11:23:34 (13 years ago)
Author:
Mathieu Morlighem
Message:

Extended CS rotation to macayeal pattun coupling

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

Legend:

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

    r10523 r10524  
    51415141
    51425142        /*Constants*/
    5143         const int    numdofm=NDOF2*NUMVERTICES2D;
    5144         const int    numdofp=NDOF2*NUMVERTICES;
    5145         const int    numdoftotal=2*NDOF2*NUMVERTICES;
     5143        const int numnodes    = 2 *NUMVERTICES;
     5144        const int numdofm     = NDOF2 *NUMVERTICES2D;
     5145        const int numdofp     = NDOF2 *NUMVERTICES;
     5146        const int numdoftotal = 2 *NDOF2*NUMVERTICES;
    51465147
    51475148        /*Intermediaries */
     
    51595160        GaussPenta *gauss=NULL;
    51605161        GaussTria  *gauss_tria=NULL;
     5162        Node       *node_list[numnodes];
     5163        int         cs_list[numnodes];
    51615164
    51625165        /*Find penta on bed as pattyn must be coupled to the dofs on the bed: */
    51635166        Penta* pentabase=GetBasalElement();
    5164         Tria* tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
     5167        Tria*  tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
     5168
     5169        /*Prepare node list*/
     5170        for(i=0;i<NUMVERTICES;i++){
     5171                node_list[i+0*NUMVERTICES] = pentabase->nodes[i];
     5172                node_list[i+1*NUMVERTICES] = this->nodes[i];
     5173                cs_list[i+0*NUMVERTICES] = XYEnum;
     5174                cs_list[i+1*NUMVERTICES] = XYEnum;
     5175        }
    51655176
    51665177        /*Initialize Element matrix*/
     
    52095220        for(i=0;i<numdofm;i++) for(j=0;j<numdofp;j++) Ke->values[i*numdoftotal+(j+2*numdofm)]+=Ke_gg[j][i];
    52105221
     5222        /*Transform Coordinate System*/
     5223        TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list);
     5224
    52115225        /*Clean-up and return*/
    52125226        delete tria->matice; delete tria;
     
    52205234
    52215235        /*Constants*/
    5222         const int numdof        = NDOF2 *NUMVERTICES;
    5223         const int numdoftotal   = NDOF4 *NUMVERTICES;
     5236        const int numnodes    = 2 *NUMVERTICES;
     5237        const int numdof      = NDOF2 *NUMVERTICES;
     5238        const int numdoftotal = NDOF4 *NUMVERTICES;
    52245239       
    52255240        /*Intermediaries */
     
    52385253        Friction  *friction = NULL;
    52395254        GaussPenta *gauss=NULL;
     5255        Node       *node_list[numnodes];
     5256        int         cs_list[numnodes];
    52405257
    52415258        /*Initialize Element matrix and return if necessary*/
     
    52455262        ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2);
    52465263        delete Ke1; delete Ke2;
     5264
     5265        /*Prepare node list*/
     5266        for(i=0;i<NUMVERTICES;i++){
     5267                node_list[i+0*NUMVERTICES] = this->nodes[i];
     5268                node_list[i+1*NUMVERTICES] = this->nodes[i];
     5269                cs_list[i+0*NUMVERTICES] = XYEnum;
     5270                cs_list[i+1*NUMVERTICES] = XYEnum;
     5271        }
    52475272
    52485273        /*retrieve inputs :*/
     
    52935318        for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdoftotal+(numdof+j)]+=Ke_gg[i][j];
    52945319        for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[(i+numdof)*numdoftotal+j]+=Ke_gg[i][j];
     5320
     5321        /*Transform Coordinate System*/
     5322        TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list);
    52955323
    52965324        /*Clean up and return*/
     
    73547382        }
    73557383
     7384        /*Transform solution in Cartesian Space*/
     7385        TransformSolutionCoord(&macayeal_values[0],penta->nodes,NUMVERTICES,XYEnum);
     7386        TransformSolutionCoord(&pattyn_values[0],   this->nodes,NUMVERTICES,XYEnum);
     7387
    73567388        /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
    73577389        for(i=0;i<NUMVERTICES;i++){
  • issm/trunk/src/c/shared/Elements/CoordinateSystemTransform.cpp

    r10523 r10524  
    4545                        case XYEnum:
    4646                                /*We remove the z component, we need to renormalize x and y*/
    47                                 x_norm = sqrt( coord_system[0][0]*coord_system[0][0] + coord_system[1][0]*coord_system[1][0]);
    48                                 y_norm = sqrt( coord_system[0][1]*coord_system[0][1] + coord_system[1][1]*coord_system[1][1]);
     47                                x_norm = sqrt( coord_system[0][0]*coord_system[0][0] + coord_system[1][0]*coord_system[1][0]); _assert_(x_norm>1.e-5);
     48                                y_norm = sqrt( coord_system[0][1]*coord_system[0][1] + coord_system[1][1]*coord_system[1][1]); _assert_(y_norm>1.e-5);
    4949                                transform[(numdofs)*(counter+0) + counter+0] = coord_system[0][0]/x_norm;
    5050                                transform[(numdofs)*(counter+0) + counter+1] = coord_system[0][1]/y_norm;
Note: See TracChangeset for help on using the changeset viewer.