Changeset 18222


Ignore:
Timestamp:
07/07/14 20:23:23 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: working on other cost functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r18147 r18222  
    12071207
    12081208        IssmDouble  weight,thicknessobs,thickness,potential;
     1209        IssmDouble  vx,vy,vxbar,vybar,vxobs,vyobs,vxbarobs,vybarobs,nux,nuy;
    12091210        IssmDouble  Jdet;
    12101211        IssmDouble* xyz_list = NULL;
     
    12231224                Input* thicknessobs_input=element->GetInput(InversionThicknessObsEnum);              _assert_(thicknessobs_input);
    12241225                Input* potential_input   =element->GetInput(PotentialEnum);                          _assert_(potential_input);
     1226                Input* vxobs_input       =element->GetInput(BalancethicknessVxObsEnum); _assert_(vxobs_input);
     1227                Input* vyobs_input       =element->GetInput(BalancethicknessVyObsEnum); _assert_(vyobs_input);
     1228                Input* vx_input          =element->GetInput(VxEnum); _assert_(vx_input);
     1229                Input* vy_input          =element->GetInput(VyEnum); _assert_(vy_input);
     1230                Input* nux_input       = element->GetInput(BalancethicknessNuxEnum);   _assert_(nux_input);
     1231                Input* nuy_input       = element->GetInput(BalancethicknessNuyEnum);   _assert_(nuy_input);
    12251232
    12261233                /* Start  looping on the number of gaussian points: */
     
    12381245                        thicknessobs_input->GetInputValue(&thicknessobs,gauss);
    12391246                        potential_input->GetInputValue(&potential,gauss);
    1240                         gauss->GaussPoint(ig);
    1241 
     1247                        vxobs_input->GetInputValue(&vxobs,gauss);
     1248                        vyobs_input->GetInputValue(&vyobs,gauss);
     1249                        vx_input->GetInputValue(&vxbar,gauss);
     1250                        vy_input->GetInputValue(&vybar,gauss);
     1251                        nux_input->GetInputValue(&nux,gauss);
     1252                        nuy_input->GetInputValue(&nuy,gauss);
     1253
     1254                        vxbarobs = nux*vxobs;
     1255                        vybarobs = nuy*vyobs;
     1256
     1257                        /*J = (H^2 - Hobs^2)^2*/
    12421258                        //J +=0.5*(thickness*thickness - thicknessobs*thicknessobs)*(thickness*thickness - thicknessobs*thicknessobs)*weight*Jdet*gauss->weight;
    1243                         J +=.5*potential*potential*weight*Jdet*gauss->weight;
     1259                        /*J = phi^2*/
     1260                        //J +=.5*potential*potential*weight*Jdet*gauss->weight; OK
     1261                        /*J = (ubar - nux*uobs)^2*/
     1262                        J +=0.5*((vxbarobs - vxbar)*(vxbarobs - vxbar) + (vybarobs - vybar)*(vybarobs - vybar))*weight*Jdet*gauss->weight;
    12441263                }
    12451264
Note: See TracChangeset for help on using the changeset viewer.