Changeset 17047


Ignore:
Timestamp:
12/23/13 13:36:23 (11 years ago)
Author:
Eric.Larour
Message:

CHG: added MisfitArea function

Location:
issm/trunk-jpl/src/c/classes/Elements
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Element.h

    r17028 r17047  
    237237                virtual IssmDouble TotalSmb(void)=0;
    238238                virtual IssmDouble Misfit(int modelenum,int observationenum,int weightsenum)=0;
     239                virtual IssmDouble MisfitArea(int weightsenum)=0;
    239240                virtual int    VertexConnectivity(int vertexindex)=0;
    240241                virtual void   VerticalSegmentIndices(int** pindices,int* pnumseg)=0;
  • issm/trunk-jpl/src/c/classes/Elements/Penta.h

    r17028 r17047  
    184184                void   InputControlUpdate(IssmDouble scalar,bool save_parameter);
    185185                IssmDouble Misfit(int modelenum,int observationenum,int weightsenum){_error_("not implemented yet");};
     186                IssmDouble MisfitArea(int weightsenum){_error_("not implemented yet");};
    186187                #endif
    187188
  • issm/trunk-jpl/src/c/classes/Elements/Seg.h

    r17028 r17047  
    206206                void       MaxVz(IssmDouble* pmaxvz){_error_("not implemented yet");};
    207207                IssmDouble Misfit(int modelenum,int observationenum,int weightsenum){_error_("not implemented yet");};
     208                IssmDouble MisfitArea(int weightsenum){_error_("not implemented yet");};
    208209#endif
    209210
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r17033 r17047  
    22402240
    22412241        /*If on water, return 0: */
    2242         if(NoIceInElement())return 0;
     2242        if(NoIceInElement()){
     2243                printf("no ice in element!\n");
     2244                return 0;
     2245        }
    22432246
    22442247        ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
     
    28832886}
    28842887/*}}}*/
     2888/*FUNCTION Tria::MisfitArea{{{*/
     2889IssmDouble Tria::MisfitArea(int weightsenum){
     2890
     2891        /*Intermediaries*/
     2892        IssmDouble weight;
     2893        IssmDouble Jdet;
     2894        IssmDouble Jelem = 0;
     2895        IssmDouble xyz_list[NUMVERTICES][3];
     2896        GaussTria *gauss = NULL;
     2897
     2898        /*If on water, return 0: */
     2899        if(NoIceInElement())return 0;
     2900
     2901        /*Retrieve all inputs we will be needing: */
     2902        ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
     2903        Input* weights_input     =inputs->GetInput(weightsenum);     _assert_(weights_input);
     2904
     2905        /* Start  looping on the number of gaussian points: */
     2906        gauss=new GaussTria(2);
     2907        for(int ig=gauss->begin();ig<gauss->end();ig++){
     2908
     2909                gauss->GaussPoint(ig);
     2910
     2911                /* Get Jacobian determinant: */
     2912                GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
     2913
     2914                /*Get parameters at gauss point*/
     2915                weights_input->GetInputValue(&weight,gauss);
     2916
     2917                /*compute misfit between model and observation */
     2918                Jelem+=Jdet*weight*gauss->weight;
     2919        }
     2920
     2921        /* clean up and Return: */
     2922        delete gauss;
     2923        return Jelem;
     2924}
     2925/*}}}*/
    28852926/*FUNCTION Tria::Misfit{{{*/
    28862927IssmDouble Tria::Misfit(int modelenum,int observationenum,int weightsenum){
     
    29172958
    29182959                /*compute misfit between model and observation */
    2919                 Jelem+=0.5*(model-observation)*(model-observation)*weight*Jdet*gauss->weight;
     2960                Jelem+=0.5*(model-observation)*(model-observation)*Jdet*weight*gauss->weight;
    29202961        }
    29212962
  • issm/trunk-jpl/src/c/classes/Elements/Tria.h

    r17028 r17047  
    152152                void       MaxVz(IssmDouble* pmaxvz);
    153153                IssmDouble Misfit(int modelenum,int observationenum,int weightsenum);
     154                IssmDouble MisfitArea(int weightsenum);
    154155                #endif
    155156
Note: See TracChangeset for help on using the changeset viewer.