Changeset 16018


Ignore:
Timestamp:
08/29/13 13:56:40 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: added stabilization

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

Legend:

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

    r16013 r16018  
    1919        femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
    2020
    21         if(VerboseSolution()) _printf0_("call computational core:\n");
    22         //femmodel->SetCurrentConfiguration(SurfaceSlopeAnalysisEnum,SmoothedSurfaceSlopeXAnalysisEnum);
    23         //solutionsequence_linear(femmodel);
    24         //femmodel->SetCurrentConfiguration(SurfaceSlopeAnalysisEnum,SmoothedSurfaceSlopeYAnalysisEnum);
    25         //solutionsequence_linear(femmodel);
    26         surfaceslope_core(femmodel);
     21        if(VerboseSolution()) _printf0_("computing smoothed slopes:\n");
     22        femmodel->SetCurrentConfiguration(SurfaceSlopeAnalysisEnum,SmoothedSurfaceSlopeXAnalysisEnum);
     23        solutionsequence_linear(femmodel);
     24        femmodel->SetCurrentConfiguration(SurfaceSlopeAnalysisEnum,SmoothedSurfaceSlopeYAnalysisEnum);
     25        solutionsequence_linear(femmodel);
     26        //surfaceslope_core(femmodel);
    2727
    2828        if(VerboseSolution()) _printf0_("call computational core:\n");
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r16017 r16018  
    72317231        IssmDouble h,gamma,thickness;
    72327232        IssmDouble hnx,hny,dhnx[2],dhny[2];
    7233         int        i,j;
    7234         IssmDouble D_scalar;
     7233        IssmDouble vel,vx,vy,dvxdx,dvydy;
     7234        IssmDouble D[2][2];
     7235        int        stabilization=1;
    72357236
    72367237        /*Fetch number of nodes and dof for this finite element*/
     
    72397240        /*Initialize Element matrix and vectors*/
    72407241        ElementMatrix* Ke     = new ElementMatrix(nodes,numnodes,this->parameters,NoneApproximationEnum);
     7242        IssmDouble*    B      = xNew<IssmDouble>(2*numnodes);
    72417243        IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
    72427244        IssmDouble*    dbasis = xNew<IssmDouble>(2*numnodes);
     
    72957297                                                        );
    72967298                        }
     7299                }
     7300
     7301                vx=hnx;
     7302                vy=hny;
     7303                if(stabilization==2){
     7304                        /*Streamline upwinding*/
     7305                        vel=sqrt(vx*vx+vy*vy)+1.e-8;
     7306                        D[0][0]=h/(2*vel)*vx*vx;
     7307                        D[1][0]=h/(2*vel)*vy*vx;
     7308                        D[0][1]=h/(2*vel)*vx*vy;
     7309                        D[1][1]=h/(2*vel)*vy*vy;
     7310                }
     7311                else if(stabilization==1){
     7312                        /*MacAyeal*/
     7313                        D[0][0]=h/2.0*fabs(vx);
     7314                        D[0][1]=0.;
     7315                        D[1][0]=0.;
     7316                        D[1][1]=h/2.0*fabs(vy);
     7317                }
     7318                if(stabilization==1 || stabilization==2){
     7319                        GetBprimeMasstransport(B,&xyz_list[0][0],gauss);
     7320                        D[0][0]=gauss->weight*Jdettria*D[0][0];
     7321                        D[1][0]=gauss->weight*Jdettria*D[1][0];
     7322                        D[0][1]=gauss->weight*Jdettria*D[0][1];
     7323                        D[1][1]=gauss->weight*Jdettria*D[1][1];
     7324                        TripleMultiply(B,2,numnodes,1,
     7325                                                &D[0][0],2,2,0,
     7326                                                B,2,numnodes,0,
     7327                                                &Ke->values[0],1);
    72977328                }
    72987329        }
     
    73067337        xDelete<IssmDouble>(HNx);
    73077338        xDelete<IssmDouble>(HNy);
     7339        xDelete<IssmDouble>(B);
    73087340        delete gauss;
    73097341        return Ke;
     
    73177349        IssmDouble xyz_list[NUMVERTICES][3];
    73187350        IssmDouble D[2][2];
    7319         IssmDouble l=12.;
     7351        IssmDouble l=15.;
    73207352
    73217353        /*Fetch number of nodes and dof for this finite element*/
     
    73397371                GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
    73407372                thickness_input->GetInputValue(&thickness,gauss);
     7373                if(thickness<50.) thickness=50.;
    73417374
    73427375                D_scalar=gauss->weight*Jdet*(l*thickness)*(l*thickness);
Note: See TracChangeset for help on using the changeset viewer.