Changeset 301


Ignore:
Timestamp:
05/07/09 12:10:59 (16 years ago)
Author:
Eric.Larour
Message:

Added pressure computation

Location:
issm/trunk/src/c/objects
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Element.h

    r246 r301  
    3838                virtual void  GradjB(Vec grad_g,double* u_g,double* lambda_g,void* inputs,int analysis_type)=0;
    3939        virtual double Misfit(double* u_g,double* u_g_obs,void* inputs,int analysis_type)=0;
     40        virtual void  ComputePressure(Vec p_g)=0;
    4041
    4142                int           Enum();
  • issm/trunk/src/c/objects/Input.cpp

    r258 r301  
    150150
    151151                /*Get 1d dof of this node: */
    152                 dof1=node->GetDoflist1();
     152                dof1=node->GetDofList1();
    153153
    154154                for(j=0;j<ndofin;j++){
  • issm/trunk/src/c/objects/Node.cpp

    r246 r301  
    426426}
    427427
     428int   Node::GetDofList1(void){
     429        return doflist1[0];
     430}
    428431
    429432double Node::GetX(){return x[0];}
     
    488491}
    489492               
    490 int   Node::GetDoflist1(void){
    491         return doflist1[0];
    492 }
  • issm/trunk/src/c/objects/Node.h

    r246 r301  
    6666                void  CreateVecSets(Vec pv_g,Vec pv_m,Vec pv_n,Vec pv_f,Vec pv_s);
    6767                void  GetDofList(int* outdoflist,int* pnumberofdofspernode);
    68                 int   GetDoflist1(void);
     68                int   GetDofList1(void);
    6969                double GetX();
    7070                double GetY();
  • issm/trunk/src/c/objects/Penta.cpp

    r272 r301  
    947947}
    948948
    949 
     949void  Penta::GetDofList1(int* doflist){
     950
     951        int i;
     952        for(i=0;i<6;i++){
     953                doflist[i]=nodes[i]->GetDofList1();
     954        }
     955
     956}
    950957#undef __FUNCT__
    951958#define __FUNCT__ "Penta::GetStrainRate"
     
    17531760
    17541761}
     1762
     1763#undef __FUNCT__
     1764#define __FUNCT__ "Penta::ComputePressure"
     1765void  Penta::ComputePressure(Vec pg){
     1766
     1767        int i;
     1768        const int numgrids=6;
     1769        int doflist[numgrids];
     1770        double pressure[numgrids];
     1771        double rho_ice,g;
     1772        double       xyz_list[numgrids][3];
     1773               
     1774        /*Get node data: */
     1775        GetElementNodeData( &xyz_list[0][0], nodes, numgrids);
     1776       
     1777        /*pressure is lithostatic: */
     1778        //md.pressure=md.rho_ice*md.g*(md.surface-md.z); a la matlab
     1779
     1780        /*Get dof list on which we will plug the pressure values: */
     1781        GetDofList1(&doflist[0]);
     1782
     1783        /*pressure is lithostatic: */
     1784        rho_ice=matpar->GetRhoIce();
     1785        g=matpar->GetG();
     1786        for(i=0;i<numgrids;i++){
     1787                pressure[i]=rho_ice*g*(s[i]-xyz_list[i][2]);
     1788        }
     1789       
     1790        /*plug local pressure values into global pressure vector: */
     1791        VecSetValues(pg,numgrids,doflist,(const double*)pressure,INSERT_VALUES);
     1792
     1793}
  • issm/trunk/src/c/objects/Penta.h

    r246 r301  
    7878                void  UpdateFromInputs(void* inputs);
    7979                void  GetDofList(int* doflist,int* pnumberofdofs);
     80                void  GetDofList1(int* doflist);
    8081                void* GetMatPar();
    8182                int   GetShelf();
     
    109110                void  GetNodalFunctions(double* l1l2l3l4l5l6, double* gauss_l1l2l3l4);
    110111                void  VelocityExtrude(Vec ug,double* ug_serial);
     112                void  ComputePressure(Vec p_g);
    111113
    112114};
  • issm/trunk/src/c/objects/Tria.cpp

    r262 r301  
    905905}
    906906
     907void  Tria::GetDofList1(int* doflist){
     908
     909        int i;
     910        for(i=0;i<3;i++){
     911                doflist[i]=nodes[i]->GetDofList1();
     912        }
     913
     914}
     915
    907916
    908917#undef __FUNCT__
     
    17421751        /* node data: */
    17431752        const int    numgrids=3;
     1753        const int    NDOF1=1;
    17441754        const int    NDOF2=2;
    17451755        const int    numdofs=NDOF2*numgrids;
     
    23662376
    23672377}
     2378
     2379#undef __FUNCT__
     2380#define __FUNCT__ "Tria::ComputePressure"
     2381void  Tria::ComputePressure(Vec pg){
     2382
     2383        int i;
     2384        const int numgrids=3;
     2385        int doflist[numgrids];
     2386        double pressure[numgrids];
     2387        double rho_ice,g;
     2388
     2389        /*Get dof list on which we will plug the pressure values: */
     2390        GetDofList1(&doflist[0]);
     2391
     2392        /*pressure is lithostatic: */
     2393        rho_ice=matpar->GetRhoIce();
     2394        g=matpar->GetG();
     2395        for(i=0;i<numgrids;i++){
     2396                pressure[i]=rho_ice*g*h[i];
     2397        }
     2398       
     2399        /*plug local pressure values into global pressure vector: */
     2400        VecSetValues(pg,numgrids,doflist,(const double*)pressure,INSERT_VALUES);
     2401
     2402}
  • issm/trunk/src/c/objects/Tria.h

    r246 r301  
    6969                void  UpdateFromInputs(void* inputs);
    7070                void  GetDofList(int* doflist,int* pnumberofdofs);
    71                
     71                void  GetDofList1(int* doflist);
    7272                void  CreateKMatrixDiagnosticHoriz(Mat Kgg,void* inputs,int analysis_type);
    7373                void  CreateKMatrixDiagnosticHorizFriction(Mat Kgg,void* inputs,int analysis_type);
     
    105105                void  MaticeConfiguration(Matice* matice,int matice_offset);
    106106                void  MatparConfiguration(Matpar* matpar,int matpar_offset);
     107                void  ComputePressure(Vec p_g);
    107108
    108109
Note: See TracChangeset for help on using the changeset viewer.