Changeset 5281 for issm/trunk/src/c/objects/Elements/Penta.cpp
- Timestamp:
- 08/16/10 11:37:04 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r5263 r5281 666 666 } 667 667 /*}}}*/ 668 /*FUNCTION Penta:: CostFunction {{{1*/669 double Penta:: CostFunction(bool process_units){668 /*FUNCTION Penta::RegularizeInversion {{{1*/ 669 double Penta::RegularizeInversion(void){ 670 670 671 671 double J; … … 696 696 697 697 /*This element should be collapsed into a tria element at its base. Create this tria element, 698 * and compute CostFunction*/698 * and compute RegularizeInversion*/ 699 699 700 700 /*Depth Average B*/ … … 702 702 703 703 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(); 705 705 delete tria->matice; delete tria; 706 706 … … 720 720 721 721 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(); 723 723 delete tria->matice; delete tria; 724 724 … … 1597 1597 } 1598 1598 /*}}}*/ 1599 /*FUNCTION Penta:: Misfit {{{1*/1600 double Penta:: Misfit(bool process_units){1599 /*FUNCTION Penta::SurfaceAbsVelMisfit {{{1*/ 1600 double Penta::SurfaceAbsVelMisfit(bool process_units){ 1601 1601 1602 1602 double J; … … 1627 1627 1628 1628 /*This element should be collapsed into a tria element at its base. Create this tria element, 1629 * and compute Misfit*/1629 * and compute SurfaceAbsVelMisfit*/ 1630 1630 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); 1632 1632 delete tria->matice; delete tria; 1633 1633 return J; … … 1636 1636 1637 1637 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*/ 1645 double 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*/ 1690 double 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*/ 1735 double 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*/ 1780 double 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); 1639 1819 delete tria->matice; delete tria; 1640 1820 return J; … … 5900 6080 name==TemperatureEnum || 5901 6081 name==ControlParameterEnum || 5902 name== FitEnum ||6082 name==CmResponseEnum || 5903 6083 name==DragCoefficientEnum || 5904 6084 name==GradientEnum ||
Note:
See TracChangeset
for help on using the changeset viewer.