Changeset 4942


Ignore:
Timestamp:
08/03/10 09:04:37 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added new functionnalities for ice front

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

Legend:

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

    r4921 r4942  
    6060}
    6161/*}}}*/
     62/*FUNCTION BeamRef::GetJacobianDeterminant2d {{{1*/
     63void BeamRef::GetJacobianDeterminant2d(double*  Jdet, double* xyz_list,double gauss){
     64
     65        /*Jdet = 0.5 * length*/
     66        *Jdet=1.0/2.0*(sqrt(pow(xyz_list[3*1+0]-xyz_list[3*0+0],2)+pow(xyz_list[3*1+1]-xyz_list[3*0+1],2)));
     67        if(*Jdet<0) ISSMERROR(" negative jacobian determinant!");
     68
     69}
     70/*}}}*/
    6271/*FUNCTION BeamRef::GetNodalFunctions {{{1*/
    6372void BeamRef::GetNodalFunctions(double* l1l2, double gauss){
  • issm/trunk/src/c/objects/Elements/BeamRef.h

    r4921 r4942  
    2424                /*Numerics*/
    2525                void GetJacobianDeterminant(double* Jdet, double* z_list,double gauss);
     26                void GetJacobianDeterminant2d(double* Jdet, double* xyz_list,double gauss);
    2627                void GetNodalFunctions(double* l1l2, double gauss);
    2728                void GetParameterValue(double* pvalue, double* value_list,double gauss_coord);
  • issm/trunk/src/c/objects/Elements/Element.h

    r4935 r4942  
    3636                virtual bool   GetOnBed()=0;
    3737                virtual void   GetThicknessList(double* thickness_list)=0;
     38                virtual void   GetParameterValue(double* pvalue,Node* node,int enumtype)=0;
     39                virtual void   GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_seg,Input* input_in)=0;
    3840                virtual void   GetBedList(double* bed_list)=0;
    3941                virtual void   Gradj(Vec gradient,int control_type)=0;
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r4935 r4942  
    41484148                delete tria;
    41494149        }
    4150         extern int my_rank;
    41514150
    41524151        xfree((void**)&first_gauss_area_coord);
     
    42364235}
    42374236/*}}}*/
    4238 /*FUNCTION Penta::GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_seg,int enumtype) {{{1*/
     4237/*FUNCTION Penta::GetParameterValue(double* pvalue,Node* node,int enumtype) {{{1*/
    42394238void Penta::GetParameterValue(double* pvalue,Node* node,int enumtype){
    42404239
     
    42644263        return;
    42654264
     4265}
     4266/*}}}*/
     4267/*FUNCTION Penta::GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_seg,Input* input_in) {{{1*/
     4268void Penta::GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_seg,Input* input_in){
     4269
     4270        /*Output*/
     4271        double value;
     4272
     4273        /*Intermediaries*/
     4274        const int numnodes=6;
     4275        int       grid1=-1,grid2=-1;
     4276        int       grid3;
     4277        int       i;
     4278        double    gauss_penta[numnodes];
     4279
     4280        /*go through 6 nodes (all nodes for penta) and identify 1st and 2nd nodes: */
     4281        ISSMASSERT(nodes);
     4282        for(i=0;i<numnodes;i++){
     4283                if (node1==nodes[i]) grid1=i;
     4284                if (node2==nodes[i]) grid2=i;
     4285        }
     4286
     4287        /*Reverse grid1 and 2 if necessary*/
     4288        if (grid1>grid2){
     4289
     4290                /*Reverse grid1 and grid2*/
     4291                grid3=grid1; grid1=grid2; grid2=grid3;
     4292
     4293                /*Change segment gauss point (between -1 and +1)*/
     4294                gauss_seg=-gauss_seg;
     4295        }
     4296
     4297        /*Build Penta Gauss point*/
     4298        if (grid2<3){
     4299
     4300                /*We are on the basal triangle*/
     4301                gauss_penta[3]=-1.;
     4302
     4303                if (grid1==0 && grid2==1){
     4304                        /*gauss_seg is between 0 and 1*/
     4305                        gauss_penta[0]=0.5*(1.-gauss_seg);
     4306                        gauss_penta[1]=1.-0.5*(1.-gauss_seg);
     4307                        gauss_penta[2]=0.;
     4308                }
     4309                else if (grid1==0 && grid2==2){
     4310                        /*gauss_seg is between 0 and 2*/
     4311                        gauss_penta[0]=0.5*(1.-gauss_seg);
     4312                        gauss_penta[1]=0.;
     4313                        gauss_penta[2]=1.-0.5*(1.-gauss_seg);
     4314                }
     4315                else if (grid1==1 && grid2==2){
     4316                        /*gauss_seg is between 1 and 2*/
     4317                        gauss_penta[0]=0.;
     4318                        gauss_penta[1]=0.5*(1.-gauss_seg);
     4319                        gauss_penta[2]=1.-0.5*(1.-gauss_seg);
     4320                }
     4321                else{
     4322                        ISSMERROR("The 2 nodes provided are either the same or did not match current Penta nodes");
     4323                }
     4324        }
     4325        else if(grid1>2){
     4326
     4327                /*We are on the surface triangle*/
     4328                gauss_penta[3]=+1.;
     4329
     4330                if (grid1==3 && grid2==4){
     4331                        /*gauss_seg is between 0 and 1*/
     4332                        gauss_penta[0]=0.5*(1.-gauss_seg);
     4333                        gauss_penta[1]=1.-0.5*(1.-gauss_seg);
     4334                        gauss_penta[2]=0.;
     4335                }
     4336                else if (grid1==3 && grid2==5){
     4337                        /*gauss_seg is between 0 and 2*/
     4338                        gauss_penta[0]=0.5*(1.-gauss_seg);
     4339                        gauss_penta[1]=0.;
     4340                        gauss_penta[2]=1.-0.5*(1.-gauss_seg);
     4341                }
     4342                else if (grid1==4 && grid2==5){
     4343                        /*gauss_seg is between 1 and 2*/
     4344                        gauss_penta[0]=0.;
     4345                        gauss_penta[1]=0.5*(1.-gauss_seg);
     4346                        gauss_penta[2]=1.-0.5*(1.-gauss_seg);
     4347                }
     4348                else{
     4349                        ISSMERROR("The 2 nodes provided are either the same or did not match current Penta nodes");
     4350                }
     4351        }
     4352        else{
     4353                ISSMERROR("vertical segments not implemented yet");
     4354        }
     4355
     4356        /*OK, now we can call input method*/
     4357        input_in->GetParameterValue(&value, &gauss_penta[0]);
     4358
     4359        /*Assign output pointers:*/
     4360        *pvalue=value;
    42664361}
    42674362/*}}}*/
  • issm/trunk/src/c/objects/Elements/Penta.h

    r4935 r4942  
    147147                void      GetNodalFunctionsStokes(double* l1l7, double* gauss_coord);
    148148                void    GetParameterValue(double* pvalue,Node* node,int enumtype);
     149                void    GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_seg,Input* input_in);
    149150                void      GetPhi(double* phi, double*  epsilon, double viscosity);
    150151                void      GetSolutionFromInputsDiagnosticHoriz(Vec solutiong);
  • issm/trunk/src/c/objects/Elements/Tria.h

    r4931 r4942  
    142142                void      GetDofList(int* doflist,int* pnumberofdofs);
    143143                void      GetDofList1(int* doflist);
    144                 void      GetParameterValue(double* pp, double* plist, double* gauss_l1l2l3);
    145144                void    GetParameterValue(double* pvalue,Node* node,int enumtype);
    146145                void    GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_seg,int enumtype);
  • issm/trunk/src/c/objects/Loads/Numericalflux.cpp

    r4904 r4942  
    880880}
    881881/*}}}*/
    882 /*FUNCTION Numericalflux::GetParameterValue {{{1*/
     882/*FUNCTION Numericalflux::GetParameterValue(double* pvalue, double gauss_coord,int enumtype) {{{1*/
    883883void Numericalflux::GetParameterValue(double* pvalue, double gauss_coord,int enumtype){
    884884
     
    901901}
    902902/*}}}*/
    903 /*FUNCTION Numericalflux::GetParameterValue {{{1*/
     903/*FUNCTION Numericalflux::GetParameterValue(double* pvalue, double gauss_coord,Input* input_in) {{{1*/
    904904void Numericalflux::GetParameterValue(double* pvalue, double gauss_coord,Input* input_in){
    905905
Note: See TracChangeset for help on using the changeset viewer.