Changeset 7672


Ignore:
Timestamp:
03/22/11 14:14:39 (14 years ago)
Author:
jschierm
Message:

Tria.cpp: fix scaled thicknesses for qmu baseline solution to be the same as a non-qmu solution (1/06/11).

File:
1 edited

Legend:

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

    r7640 r7672  
    38543854                for(i=0;i<3;i++)nodeinputs[i]=iomodel->thickness[tria_vertex_ids[i]-1];
    38553855                this->inputs->AddInput(new TriaVertexInput(ThicknessEnum,nodeinputs));
     3856        }
     3857        if (iomodel->thickness_coeff) {
     3858                for(i=0;i<3;i++)nodeinputs[i]=iomodel->thickness_coeff[tria_vertex_ids[i]-1];
     3859                this->inputs->AddInput(new TriaVertexInput(ThicknessCoeffEnum,nodeinputs));
    38563860        }
    38573861        if (iomodel->surface) {
     
    44324436                                        /*Update thickness + surface: assume bed is constant. On ice shelves, takes hydrostatic equilibrium {{{2*/
    44334437                                        double  thickness[3];
     4438                                        double  thickness_init[3];
     4439                                        double  thickness_coeff[3];
    44344440                                        double  surface[3];
    44354441                                        double  bed[3];
    44364442                                       
    44374443                                        /*retrieve inputs: */
     4444                                        GetParameterListOnVertices(&thickness_init[0],ThicknessEnum);
     4445                                        GetParameterListOnVertices(&thickness_coeff[0],ThicknessCoeffEnum);
    44384446                                        GetParameterListOnVertices(&bed[0],BedEnum);
    44394447                                        GetParameterListOnVertices(&surface[0],SurfaceEnum);
    44404448
    44414449                                        /*build new thickness: */
    4442                                         for(j=0;j<3;j++)thickness[j]=values[j];
     4450//                                      for(j=0;j<3;j++)thickness[j]=values[j];
     4451
     4452                    printf("Tria::InputUpdateFromVectorDakota,id=%d\n",this->Id());
     4453                    printf("nodes:            %d,%d,%d\n",this->nodes[0]->Sid()+1,this->nodes[1]->Sid()+1,this->nodes[2]->Sid())+1;
     4454                    printf("init thickness:   %e,%e,%e\n",thickness_init[0],thickness_init[1],thickness_init[2]);
     4455                    printf("thickness_coeff:  %e,%e,%e\n",thickness_coeff[0],thickness_coeff[1],thickness_coeff[2]);
     4456                    printf("values:           %e,%e,%e\n",values[0],values[1],values[2]);
     4457                    printf("old bed:          %e,%e,%e\n",bed[0],bed[1],bed[2]);
     4458                    printf("old surface:      %e,%e,%e\n",surface[0],surface[1],surface[2]);
    44434459
    44444460                                        /*build new bed and surface: */
    44454461                                        if (this->IsOnShelf()){
     4462                        printf("shelf\n");
    44464463                                                /*hydrostatic equilibrium: */
    44474464                                                double rho_ice,rho_water,di;
     
    44514468                                                di=rho_ice/rho_water;
    44524469
    4453                                                 for(j=0;j<3;j++){
    4454                                                         surface[j]=(1-di)*thickness[j];
    4455                                                         bed[j]=-di*thickness[j];
     4470                                                /*build new thickness: */
     4471                                                for (j=0; j<3; j++) {
     4472                                                /*  for observed/interpolated/hydrostatic thickness, remove scaling from any hydrostatic thickness  */
     4473                                                        if     (thickness_coeff[j] >= 0.)
     4474                                                                thickness[j]=values[j]-(values[j]/thickness_init[j]-1.)*thickness_coeff[j]*surface[j]/(1.-di);
     4475                                                /*  for minimum thickness, don't scale  */
     4476                                                        else
     4477                                                                thickness[j]=thickness_init[j];
     4478
     4479                                                /*  check the computed thickness and update bed  */
     4480                                                        if (thickness[j] < 0.)
     4481                                                                thickness[j]=1./(1.-di);
     4482                                                        bed[j]=surface[j]-thickness[j];
    44564483                                                }
     4484
     4485//                                              for(j=0;j<3;j++){
     4486//                                                      surface[j]=(1-di)*thickness[j];
     4487//                                                      bed[j]=-di*thickness[j];
     4488//                                              }
    44574489                                        }
    44584490                                        else{
     4491                        printf("sheet\n");
     4492                                                /*build new thickness: */
     4493                                                for (j=0; j<3; j++) {
     4494                                                /*  for observed thickness, use scaled value  */
     4495                                                        if     (thickness_coeff[j] >= 0.)
     4496                                                                thickness[j]=values[j];
     4497                                                /*  for minimum thickness, don't scale  */
     4498                                                        else
     4499                                                                thickness[j]=thickness_init[j];
     4500                                                }
     4501
    44594502                                                /*update bed on grounded ice: */
    4460                                                 for(j=0;j<3;j++)surface[j]=bed[j]+thickness[j];
     4503//                                              for(j=0;j<3;j++)surface[j]=bed[j]+thickness[j];
     4504                                                for(j=0;j<3;j++)bed[j]=surface[j]-thickness[j];
    44614505                                        }
     4506
     4507                    printf("new thickness:    %e,%e,%e\n",thickness[0],thickness[1],thickness[2]);
     4508                    printf("new bed:          %e,%e,%e\n",bed[0],bed[1],bed[2]);
     4509                    printf("new surface:      %e,%e,%e\n",surface[0],surface[1],surface[2]);
    44624510
    44634511                                        /*Add new inputs: */
Note: See TracChangeset for help on using the changeset viewer.