NewtonConvergenceChecker.h
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------
2  * _
3  * _ __ ___ __ _ _ __ _ __ ___ ___ | |_
4  * | '_ ` _ \ / _` | '__| '_ ` _ \ / _ \| __|
5  * | | | | | | (_| | | | | | | | | (_) | |_
6  * |_| |_| |_|\__,_|_| |_| |_| |_|\___/ \__|
7  *
8  * Unit of Strength of Materials and Structural Analysis
9  * University of Innsbruck,
10  * 2020 - today
11  *
12  * festigkeitslehre@uibk.ac.at
13  *
14  * Matthias Neuner matthias.neuner@uibk.ac.at
15  *
16  * This file is part of the MAteRialMOdellingToolbox (marmot).
17  *
18  * This library is free software; you can redistribute it and/or
19  * modify it under the terms of the GNU Lesser General Public
20  * License as published by the Free Software Foundation; either
21  * version 2.1 of the License, or (at your option) any later version.
22  *
23  * The full text of the license can be found in the file LICENSE.md at
24  * the top level directory of marmot.
25  * ---------------------------------------------------------------------
26  */
27 
28 #pragma once
29 #include "Marmot/MarmotTypedefs.h"
30 
33 
34  const Eigen::VectorXd residualScaleVector;
35  const int nMaxNewtonCycles;
37  const double newtonTol;
38  const double newtonRTol;
39  const double newtonTolAlt;
40  const double newtonRTolAlt;
41 
42  public:
43  NewtonConvergenceChecker( const Eigen::VectorXd& residualScaleVector,
44  int nMaxNewtonCycles,
46  double newtonTol,
47  double newtonRTol,
48  double newtonTolAlt,
49  double newtonRTolAlt );
50 
51  double relativeNorm( const Eigen::VectorXd& increment, const Eigen::VectorXd& reference );
52 
53  double residualNorm( const Eigen::VectorXd& Residual );
54 
55  bool iterationFinished( const Eigen::VectorXd& residual,
56  const Eigen::VectorXd& X,
57  const Eigen::VectorXd& dX,
58  int numberOfIterations );
59 
60  bool isConverged( const Eigen::VectorXd& residual,
61  const Eigen::VectorXd& X,
62  const Eigen::VectorXd& dX,
63  int numberOfIterations );
64  };
65 } // namespace Marmot::NumericalAlgorithms
Marmot::NumericalAlgorithms::NewtonConvergenceChecker::relativeNorm
double relativeNorm(const Eigen::VectorXd &increment, const Eigen::VectorXd &reference)
Definition: NewtonConvergenceChecker.cpp:25
Marmot::NumericalAlgorithms
Definition: MarmotNumericalDifferentiation.h:34
Marmot::NumericalAlgorithms::NewtonConvergenceChecker::isConverged
bool isConverged(const Eigen::VectorXd &residual, const Eigen::VectorXd &X, const Eigen::VectorXd &dX, int numberOfIterations)
Definition: NewtonConvergenceChecker.cpp:56
Marmot::NumericalAlgorithms::NewtonConvergenceChecker::newtonRTol
const double newtonRTol
Definition: NewtonConvergenceChecker.h:38
MarmotTypedefs.h
Marmot::NumericalAlgorithms::NewtonConvergenceChecker::nMaxNewtonCyclesAlt
const int nMaxNewtonCyclesAlt
Definition: NewtonConvergenceChecker.h:36
Marmot::NumericalAlgorithms::NewtonConvergenceChecker
Definition: NewtonConvergenceChecker.h:32
Marmot::NumericalAlgorithms::NewtonConvergenceChecker::iterationFinished
bool iterationFinished(const Eigen::VectorXd &residual, const Eigen::VectorXd &X, const Eigen::VectorXd &dX, int numberOfIterations)
Definition: NewtonConvergenceChecker.cpp:45
Marmot::NumericalAlgorithms::NewtonConvergenceChecker::residualScaleVector
const Eigen::VectorXd residualScaleVector
Definition: NewtonConvergenceChecker.h:34
Marmot::NumericalAlgorithms::NewtonConvergenceChecker::nMaxNewtonCycles
const int nMaxNewtonCycles
Definition: NewtonConvergenceChecker.h:35
Marmot::NumericalAlgorithms::NewtonConvergenceChecker::newtonTol
const double newtonTol
Definition: NewtonConvergenceChecker.h:37
Marmot::NumericalAlgorithms::NewtonConvergenceChecker::newtonTolAlt
const double newtonTolAlt
Definition: NewtonConvergenceChecker.h:39
Marmot::NumericalAlgorithms::NewtonConvergenceChecker::residualNorm
double residualNorm(const Eigen::VectorXd &Residual)
Definition: NewtonConvergenceChecker.cpp:40
Marmot::NumericalAlgorithms::NewtonConvergenceChecker::newtonRTolAlt
const double newtonRTolAlt
Definition: NewtonConvergenceChecker.h:40
Marmot::NumericalAlgorithms::NewtonConvergenceChecker::NewtonConvergenceChecker
NewtonConvergenceChecker(const Eigen::VectorXd &residualScaleVector, int nMaxNewtonCycles, int nMaxNewtonCyclesAlt, double newtonTol, double newtonRTol, double newtonTolAlt, double newtonRTolAlt)
Definition: NewtonConvergenceChecker.cpp:8