~chaffra/+junk/trilinos

« back to all changes in this revision

Viewing changes to packages/nox/src-loca/src/LOCA_Bifurcation_PitchforkBord_ParameterUpdateNorm.H

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Johannes Ring
  • Date: 2009-12-13 12:53:22 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091213125322-in0nrdjc55deqsw9
Tags: 10.0.3.dfsg-1
[Christophe Prud'homme]
* New upstream release

[Johannes Ring]
* debian/patches/libname.patch: Add prefix 'libtrilinos_' to all
  libraries. 
* debian/patches/soname.patch: Add soversion to libraries.
* debian/watch: Update download URL.
* debian/control:
  - Remove python-numeric from Build-Depends (virtual package).
  - Remove automake and autotools from Build-Depends and add cmake to
    reflect switch to CMake.
  - Add python-support to Build-Depends.
* debian/rules: 
  - Cleanup and updates for switch to CMake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// $Id$ 
 
2
// $Source$ 
 
3
 
 
4
//@HEADER
 
5
// ************************************************************************
 
6
// 
 
7
//            NOX: An Object-Oriented Nonlinear Solver Package
 
8
//                 Copyright (2002) Sandia Corporation
 
9
// 
 
10
//            LOCA: Library of Continuation Algorithms Package
 
11
//                 Copyright (2005) Sandia Corporation
 
12
// 
 
13
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
 
14
// license for use of this work by or on behalf of the U.S. Government.
 
15
// 
 
16
// This library is free software; you can redistribute it and/or modify
 
17
// it under the terms of the GNU Lesser General Public License as
 
18
// published by the Free Software Foundation; either version 2.1 of the
 
19
// License, or (at your option) any later version.
 
20
//  
 
21
// This library is distributed in the hope that it will be useful, but
 
22
// WITHOUT ANY WARRANTY; without even the implied warranty of
 
23
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
24
// Lesser General Public License for more details.
 
25
// 
 
26
// You should have received a copy of the GNU Lesser General Public
 
27
// License along with this library; if not, write to the Free Software
 
28
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 
29
// USA
 
30
// 
 
31
// Questions? Contact Roger Pawlowski (rppawlo@sandia.gov) or 
 
32
// Eric Phipps (etphipp@sandia.gov), Sandia National Laboratories.
 
33
// ************************************************************************
 
34
//  CVS Information
 
35
//  $Source$
 
36
//  $Author$
 
37
//  $Date$
 
38
//  $Revision$
 
39
// ************************************************************************
 
40
//@HEADER
 
41
 
 
42
#ifndef LOCA_BIFURCATION_PITCHFORKBORD_STATUSTEST_PARAMETERUPDATENORM_H
 
43
#define LOCA_BIFURCATION_PITCHFORKBORD_STATUSTEST_PARAMETERUPDATENORM_H
 
44
 
 
45
#include "NOX_StatusTest_Generic.H"     // base class
 
46
 
 
47
namespace LOCA {
 
48
  
 
49
  namespace Bifurcation {
 
50
    
 
51
    namespace PitchforkBord {
 
52
      
 
53
      //! Convergence tests relating to pitchfork groups
 
54
      namespace StatusTest {
 
55
 
 
56
        /*!
 
57
         * \brief A convergence test based on the update of the parameter 
 
58
         * component for pitchfork location.
 
59
         */
 
60
        /*!
 
61
         * Let \f$p\f$ be the pitchfork parameter (see 
 
62
         * LOCA::Bifurcation::PitchforkBord::ExtendedGroup).  This 
 
63
         * convergence test
 
64
         * defines convergence for the parameter when the following is true
 
65
         * \f[ 
 
66
         \frac{|p-p_0|}{\epsilon_r|p| + \epsilon_a} < \tau
 
67
         * \f]
 
68
         * where \f$p_0\f$ is the 
 
69
         * previous parameter value, \f$\epsilon_r\f$
 
70
         * is the relative tolerance, \f$\epsilon_a\f$ is the absolute
 
71
         * tolerance, and \f$\tau\f$ is an overall scale factor (typically
 
72
         * \f$\tau = 1\f$).
 
73
         *
 
74
         * Note that this status test deals only with the parameter component
 
75
         * of the pitchfork equations.  This status test should be combined
 
76
         * with other status tests for the solution and null vector components
 
77
         * (using NOX::StatusTest::Combo and LOCA::StatusTest::Wrapper) to 
 
78
         * build a composite status test for the entire system.
 
79
         *
 
80
         * Also note that if the group returned by the getSolutionGroup()
 
81
         * method of the solver supplied in checkStatus() is not a 
 
82
         * pitchfork group (i.e., not derived from 
 
83
         * LOCA::Bifurcation::Pitchforkbord::ExtendedGroup), checkStatus() 
 
84
         * returns 
 
85
         * NOX::StatusTest::Converged.  This allows the status test to 
 
86
         * be used in situations other than pitchfork tracking, e.g., 
 
87
         * steady-state solves, without raising error conditions.
 
88
         */
 
89
        class ParameterUpdateNorm : public NOX::StatusTest::Generic {
 
90
 
 
91
        public:
 
92
 
 
93
          //! Constructor
 
94
          /*!
 
95
           * \em rtol is the relative tolerance \f$\epsilon_r\f$, \em atol
 
96
           * is the absolute tolerance \f$\epsilon_a\f$, and \em tol is the
 
97
           * overall scale factor \f$\tau\f$ defined above.
 
98
           */
 
99
          ParameterUpdateNorm(double rtol, double atol, double tol);
 
100
 
 
101
          //! Destructor.
 
102
          virtual ~ParameterUpdateNorm();
 
103
 
 
104
          //! Evaluates convergence criteria specified above
 
105
          virtual NOX::StatusTest::StatusType 
 
106
          checkStatus(const NOX::Solver::Generic& problem);
 
107
        
 
108
          //! Returns status as defined above
 
109
          virtual NOX::StatusTest::StatusType 
 
110
          getStatus() const;
 
111
 
 
112
          //! Prints current status
 
113
          virtual ostream& print(ostream& stream, int indent = 0) const;
 
114
 
 
115
 
 
116
          /* @name Accessor Functions
 
117
           * Used to query current values of variables in the status test.
 
118
           */
 
119
          //@{
 
120
 
 
121
          //! Returns the value of weighted parameter update norm.
 
122
          double getUpdateNorm() const;
 
123
 
 
124
          //! Returns the realative tolerance set in the constructor.
 
125
          double getRTOL() const;
 
126
 
 
127
          //! Returns the absolute tolerance set in the constructor.  
 
128
          double getATOL() const;
 
129
 
 
130
          //! Returns the tolerance set in the constructor
 
131
          double getTOL() const;
 
132
 
 
133
          //@}
 
134
 
 
135
        protected:
 
136
 
 
137
          //! Relative tolerance for convergence.
 
138
          double rtol;
 
139
 
 
140
          //! Absolute tolerance for convergence.
 
141
          double atol;
 
142
 
 
143
          //! Tolerance for convergence
 
144
          double tol;
 
145
 
 
146
          //! Current value of the parameter update norm
 
147
          double paramUpdateNorm;
 
148
 
 
149
          //! Status of entire status test
 
150
          NOX::StatusTest::StatusType status;
 
151
        };
 
152
      } // namespace StatusTest
 
153
    } // namespace PitchforkBord
 
154
  } // namespace Bifurcation
 
155
} // namespace LOCA
 
156
 
 
157
#endif