Changeset 17184


Ignore:
Timestamp:
01/28/14 12:04:16 (11 years ago)
Author:
Mathieu Morlighem
Message:

BUG: fixing extrusion for 3d meshes

Location:
issm/trunk-jpl/src/c/analyses
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp

    r17183 r17184  
    6464
    6565        /*Intermediaries */
    66         int         meshtype,dim;
    6766        IssmDouble  Jdet,D;
    6867        IssmDouble *xyz_list = NULL;
    6968
    7069        /*Get dimension*/
     70        int dim,meshtype;
    7171        element->FindParam(&meshtype,MeshTypeEnum);
    7272        switch(meshtype){
     
    116116
    117117        /*Intermediaries */
    118         IssmDouble  Jdet,D,normal[2];
     118        IssmDouble  Jdet,D,normal[3];
    119119        IssmDouble *xyz_list_top = NULL;
     120
     121        /*Get dimension*/
     122        int dim,meshtype;
     123        element->FindParam(&meshtype,MeshTypeEnum);
     124        switch(meshtype){
     125                case Mesh2DverticalEnum: dim = 2; break;
     126                case Mesh3DEnum:         dim = 3; break;
     127                default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet");
     128        }
    120129
    121130        /*Fetch number of nodes and dof for this finite element*/
     
    137146                element->JacobianDeterminantTop(&Jdet,xyz_list_top,gauss);
    138147                element->NodalFunctions(basis,gauss);
    139                 D = - gauss->weight*Jdet*normal[1];
     148                D = - gauss->weight*Jdet*normal[dim-1];
    140149
    141150                TripleMultiply(basis,1,numnodes,1,
     
    157166
    158167        /*Intermediaries */
    159         IssmDouble  Jdet,D,normal[2];
     168        IssmDouble  Jdet,D,normal[3];
    160169        IssmDouble *xyz_list_base = NULL;
     170
     171        /*Get dimension*/
     172        int dim,meshtype;
     173        element->FindParam(&meshtype,MeshTypeEnum);
     174        switch(meshtype){
     175                case Mesh2DverticalEnum: dim = 2; break;
     176                case Mesh3DEnum:         dim = 3; break;
     177                default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet");
     178        }
    161179
    162180        /*Fetch number of nodes and dof for this finite element*/
     
    178196                element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
    179197                element->NodalFunctions(basis,gauss);
    180                 D = - gauss->weight*Jdet*normal[1];
     198                D = - gauss->weight*Jdet*normal[dim-1];
    181199
    182200                TripleMultiply(basis,1,numnodes,1,
  • issm/trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp

    r17183 r17184  
    119119        IssmDouble *xyz_list_top = NULL;
    120120
     121        /*Get dimension*/
     122        int dim,meshtype;
     123        element->FindParam(&meshtype,MeshTypeEnum);
     124        switch(meshtype){
     125                case Mesh2DverticalEnum: dim = 2; break;
     126                case Mesh3DEnum:         dim = 3; break;
     127                default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet");
     128        }
     129
    121130        /*Fetch number of nodes and dof for this finite element*/
    122131        int numnodes = element->GetNumberOfNodes();
     
    137146                element->JacobianDeterminantTop(&Jdet,xyz_list_top,gauss);
    138147                element->NodalFunctions(basis,gauss);
    139                 D = - gauss->weight*Jdet*normal[1];
     148                D = - gauss->weight*Jdet*normal[dim-1];
    140149
    141150                TripleMultiply(basis,1,numnodes,1,
     
    157166
    158167        /*Intermediaries */
    159         IssmDouble  Jdet,D,normal[2];
     168        IssmDouble  Jdet,D,normal[3];
    160169        IssmDouble *xyz_list_base = NULL;
     170
     171        /*Get dimension*/
     172        int dim,meshtype;
     173        element->FindParam(&meshtype,MeshTypeEnum);
     174        switch(meshtype){
     175                case Mesh2DverticalEnum: dim = 2; break;
     176                case Mesh3DEnum:         dim = 3; break;
     177                default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet");
     178        }
    161179
    162180        /*Fetch number of nodes and dof for this finite element*/
     
    178196                element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
    179197                element->NodalFunctions(basis,gauss);
    180                 D = - gauss->weight*Jdet*normal[1];
     198                D = - gauss->weight*Jdet*normal[dim-1];
    181199
    182200                TripleMultiply(basis,1,numnodes,1,
Note: See TracChangeset for help on using the changeset viewer.