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

moved md.fit to md.cm_responses and 0-4 to enums

File:
1 edited

Legend:

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

    r5263 r5281  
    666666}
    667667/*}}}*/
    668 /*FUNCTION Penta::CostFunction {{{1*/
    669 double Penta::CostFunction(bool process_units){
     668/*FUNCTION Penta::RegularizeInversion {{{1*/
     669double Penta::RegularizeInversion(void){
    670670
    671671        double J;
     
    696696
    697697                /*This element should be collapsed into a tria element at its base. Create this tria element,
    698                  * and compute CostFunction*/
     698                 * and compute RegularizeInversion*/
    699699
    700700                /*Depth Average B*/
     
    702702
    703703                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
    704                 J=tria->CostFunction(process_units);
     704                J=tria->RegularizeInversion();
    705705                delete tria->matice; delete tria;
    706706
     
    720720
    721721                tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face).
    722                 J=tria->CostFunction(process_units);
     722                J=tria->RegularizeInversion();
    723723                delete tria->matice; delete tria;
    724724
     
    15971597}
    15981598/*}}}*/
    1599 /*FUNCTION Penta::Misfit {{{1*/
    1600 double Penta::Misfit(bool process_units){
     1599/*FUNCTION Penta::SurfaceAbsVelMisfit {{{1*/
     1600double Penta::SurfaceAbsVelMisfit(bool process_units){
    16011601
    16021602        double J;
     
    16271627
    16281628                /*This element should be collapsed into a tria element at its base. Create this tria element,
    1629                  * and compute Misfit*/
     1629                 * and compute SurfaceAbsVelMisfit*/
    16301630                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
    1631                 J=tria->Misfit(process_units);
     1631                J=tria->SurfaceAbsVelMisfit(process_units);
    16321632                delete tria->matice; delete tria;
    16331633                return J;
     
    16361636
    16371637                tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face).
    1638                 J=tria->Misfit(process_units);
     1638                J=tria->SurfaceAbsVelMisfit(process_units);
     1639                delete tria->matice; delete tria;
     1640                return J;
     1641        }
     1642}
     1643/*}}}*/
     1644/*FUNCTION Penta::SurfaceRelVelMisfit {{{1*/
     1645double Penta::SurfaceRelVelMisfit(bool process_units){
     1646
     1647        double J;
     1648        Tria* tria=NULL;
     1649
     1650        /*inputs: */
     1651        bool onwater;
     1652        bool onsurface;
     1653        bool onbed;
     1654        int  approximation;
     1655
     1656        /*retrieve inputs :*/
     1657        inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
     1658        inputs->GetParameterValue(&onbed,ElementOnBedEnum);
     1659        inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
     1660        inputs->GetParameterValue(&approximation,ApproximationEnum);
     1661
     1662        /*If on water, return 0: */
     1663        if(onwater)return 0;
     1664
     1665        /*Bail out if this element if:
     1666         * -> Non MacAyeal and not on the surface
     1667         * -> MacAyeal (2d model) and not on bed) */
     1668        if ((approximation!=MacAyealApproximationEnum && !onsurface) || (MacAyealApproximationEnum && !onbed)){
     1669                return 0;
     1670        }
     1671        else if (MacAyealApproximationEnum){
     1672
     1673                /*This element should be collapsed into a tria element at its base. Create this tria element,
     1674                 * and compute SurfaceRelVelMisfit*/
     1675                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
     1676                J=tria->SurfaceRelVelMisfit(process_units);
     1677                delete tria->matice; delete tria;
     1678                return J;
     1679        }
     1680        else{
     1681
     1682                tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face).
     1683                J=tria->SurfaceRelVelMisfit(process_units);
     1684                delete tria->matice; delete tria;
     1685                return J;
     1686        }
     1687}
     1688/*}}}*/
     1689/*FUNCTION Penta::SurfaceLogVelMisfit {{{1*/
     1690double Penta::SurfaceLogVelMisfit(bool process_units){
     1691
     1692        double J;
     1693        Tria* tria=NULL;
     1694
     1695        /*inputs: */
     1696        bool onwater;
     1697        bool onsurface;
     1698        bool onbed;
     1699        int  approximation;
     1700
     1701        /*retrieve inputs :*/
     1702        inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
     1703        inputs->GetParameterValue(&onbed,ElementOnBedEnum);
     1704        inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
     1705        inputs->GetParameterValue(&approximation,ApproximationEnum);
     1706
     1707        /*If on water, return 0: */
     1708        if(onwater)return 0;
     1709
     1710        /*Bail out if this element if:
     1711         * -> Non MacAyeal and not on the surface
     1712         * -> MacAyeal (2d model) and not on bed) */
     1713        if ((approximation!=MacAyealApproximationEnum && !onsurface) || (MacAyealApproximationEnum && !onbed)){
     1714                return 0;
     1715        }
     1716        else if (MacAyealApproximationEnum){
     1717
     1718                /*This element should be collapsed into a tria element at its base. Create this tria element,
     1719                 * and compute SurfaceLogVelMisfit*/
     1720                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
     1721                J=tria->SurfaceLogVelMisfit(process_units);
     1722                delete tria->matice; delete tria;
     1723                return J;
     1724        }
     1725        else{
     1726
     1727                tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face).
     1728                J=tria->SurfaceLogVelMisfit(process_units);
     1729                delete tria->matice; delete tria;
     1730                return J;
     1731        }
     1732}
     1733/*}}}*/
     1734/*FUNCTION Penta::SurfaceLogVxVyMisfit {{{1*/
     1735double Penta::SurfaceLogVxVyMisfit(bool process_units){
     1736
     1737        double J;
     1738        Tria* tria=NULL;
     1739
     1740        /*inputs: */
     1741        bool onwater;
     1742        bool onsurface;
     1743        bool onbed;
     1744        int  approximation;
     1745
     1746        /*retrieve inputs :*/
     1747        inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
     1748        inputs->GetParameterValue(&onbed,ElementOnBedEnum);
     1749        inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
     1750        inputs->GetParameterValue(&approximation,ApproximationEnum);
     1751
     1752        /*If on water, return 0: */
     1753        if(onwater)return 0;
     1754
     1755        /*Bail out if this element if:
     1756         * -> Non MacAyeal and not on the surface
     1757         * -> MacAyeal (2d model) and not on bed) */
     1758        if ((approximation!=MacAyealApproximationEnum && !onsurface) || (MacAyealApproximationEnum && !onbed)){
     1759                return 0;
     1760        }
     1761        else if (MacAyealApproximationEnum){
     1762
     1763                /*This element should be collapsed into a tria element at its base. Create this tria element,
     1764                 * and compute SurfaceLogVxVyMisfit*/
     1765                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
     1766                J=tria->SurfaceLogVxVyMisfit(process_units);
     1767                delete tria->matice; delete tria;
     1768                return J;
     1769        }
     1770        else{
     1771
     1772                tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face).
     1773                J=tria->SurfaceLogVxVyMisfit(process_units);
     1774                delete tria->matice; delete tria;
     1775                return J;
     1776        }
     1777}
     1778/*}}}*/
     1779/*FUNCTION Penta::SurfaceAverageVelMisfit {{{1*/
     1780double Penta::SurfaceAverageVelMisfit(bool process_units){
     1781
     1782        double J;
     1783        Tria* tria=NULL;
     1784
     1785        /*inputs: */
     1786        bool onwater;
     1787        bool onsurface;
     1788        bool onbed;
     1789        int  approximation;
     1790
     1791        /*retrieve inputs :*/
     1792        inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
     1793        inputs->GetParameterValue(&onbed,ElementOnBedEnum);
     1794        inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
     1795        inputs->GetParameterValue(&approximation,ApproximationEnum);
     1796
     1797        /*If on water, return 0: */
     1798        if(onwater)return 0;
     1799
     1800        /*Bail out if this element if:
     1801         * -> Non MacAyeal and not on the surface
     1802         * -> MacAyeal (2d model) and not on bed) */
     1803        if ((approximation!=MacAyealApproximationEnum && !onsurface) || (MacAyealApproximationEnum && !onbed)){
     1804                return 0;
     1805        }
     1806        else if (MacAyealApproximationEnum){
     1807
     1808                /*This element should be collapsed into a tria element at its base. Create this tria element,
     1809                 * and compute SurfaceAverageVelMisfit*/
     1810                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
     1811                J=tria->SurfaceAverageVelMisfit(process_units);
     1812                delete tria->matice; delete tria;
     1813                return J;
     1814        }
     1815        else{
     1816
     1817                tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face).
     1818                J=tria->SurfaceAverageVelMisfit(process_units);
    16391819                delete tria->matice; delete tria;
    16401820                return J;
     
    59006080                                name==TemperatureEnum ||
    59016081                                name==ControlParameterEnum ||
    5902                                 name==FitEnum ||
     6082                                name==CmResponseEnum ||
    59036083                                name==DragCoefficientEnum ||
    59046084                                name==GradientEnum ||
Note: See TracChangeset for help on using the changeset viewer.