5
// ************************************************************************
7
// NOX: An Object-Oriented Nonlinear Solver Package
8
// Copyright (2002) Sandia Corporation
10
// LOCA: Library of Continuation Algorithms Package
11
// Copyright (2005) Sandia Corporation
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.
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.
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.
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
31
// Questions? Contact Roger Pawlowski (rppawlo@sandia.gov) or
32
// Eric Phipps (etphipp@sandia.gov), Sandia National Laboratories.
33
// ************************************************************************
39
// ************************************************************************
42
#ifndef LOCA_BIFURCATION_PITCHFORKBORD_STATUSTEST_PARAMETERUPDATENORM_H
43
#define LOCA_BIFURCATION_PITCHFORKBORD_STATUSTEST_PARAMETERUPDATENORM_H
45
#include "NOX_StatusTest_Generic.H" // base class
49
namespace Bifurcation {
51
namespace PitchforkBord {
53
//! Convergence tests relating to pitchfork groups
54
namespace StatusTest {
57
* \brief A convergence test based on the update of the parameter
58
* component for pitchfork location.
61
* Let \f$p\f$ be the pitchfork parameter (see
62
* LOCA::Bifurcation::PitchforkBord::ExtendedGroup). This
64
* defines convergence for the parameter when the following is true
66
\frac{|p-p_0|}{\epsilon_r|p| + \epsilon_a} < \tau
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
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.
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()
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.
89
class ParameterUpdateNorm : public NOX::StatusTest::Generic {
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.
99
ParameterUpdateNorm(double rtol, double atol, double tol);
102
virtual ~ParameterUpdateNorm();
104
//! Evaluates convergence criteria specified above
105
virtual NOX::StatusTest::StatusType
106
checkStatus(const NOX::Solver::Generic& problem);
108
//! Returns status as defined above
109
virtual NOX::StatusTest::StatusType
112
//! Prints current status
113
virtual ostream& print(ostream& stream, int indent = 0) const;
116
/* @name Accessor Functions
117
* Used to query current values of variables in the status test.
121
//! Returns the value of weighted parameter update norm.
122
double getUpdateNorm() const;
124
//! Returns the realative tolerance set in the constructor.
125
double getRTOL() const;
127
//! Returns the absolute tolerance set in the constructor.
128
double getATOL() const;
130
//! Returns the tolerance set in the constructor
131
double getTOL() const;
137
//! Relative tolerance for convergence.
140
//! Absolute tolerance for convergence.
143
//! Tolerance for convergence
146
//! Current value of the parameter update norm
147
double paramUpdateNorm;
149
//! Status of entire status test
150
NOX::StatusTest::StatusType status;
152
} // namespace StatusTest
153
} // namespace PitchforkBord
154
} // namespace Bifurcation