Tempus Version of the Day
Time Integration
Loading...
Searching...
No Matches
Tempus_Stepper_ErrorNorm_decl.hpp
Go to the documentation of this file.
1// @HEADER
2// ****************************************************************************
3// Tempus: Copyright (2017) Sandia Corporation
4//
5// Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6// ****************************************************************************
7// @HEADER
8
9#ifndef Tempus_Stepper_ErrorNorm_decl_hpp
10#define Tempus_Stepper_ErrorNorm_decl_hpp
11
12#include "Tempus_config.hpp"
13
14#include "Teuchos_RCPDecl.hpp"
15#include "Thyra_VectorBase.hpp"
16#include "Thyra_VectorSpaceFactoryBase.hpp"
17namespace Tempus {
18
22template<class Scalar>
24{
25public:
26
29
31 Stepper_ErrorNorm(const Scalar relTol, const Scalar absTol);
32
35
52 Scalar computeWRMSNorm(
53 const Teuchos::RCP<const Thyra::VectorBase<Scalar>> &x,
54 const Teuchos::RCP<const Thyra::VectorBase<Scalar>> &xNext,
55 const Teuchos::RCP<const Thyra::VectorBase<Scalar>> &err);
56
68 Scalar errorNorm(const Teuchos::RCP<const Thyra::VectorBase<Scalar>> &x);
69
70 void setRelativeTolerance(const Scalar relTol) { relTol_ = relTol; }
71 void setAbsoluteTolerance(const Scalar absTol) { abssTol_ = absTol; }
72
73
74protected:
75
76 Scalar relTol_;
77 Scalar abssTol_;
78 Teuchos::RCP<Thyra::VectorBase<Scalar>> u_;
79 Teuchos::RCP<Thyra::VectorBase<Scalar>> uNext_;
80 Teuchos::RCP<Thyra::VectorBase<Scalar>> errorWeightVector_;
81 Teuchos::RCP<Thyra::VectorBase<Scalar>> scratchVector_;
82
83};
84
85} // namespace Tempus
86#endif //Tempus_Stepper_ErrorNorm_decl_hpp
Stepper_ErrorNorm provides error norm calcualtions for variable time stepping.
void setAbsoluteTolerance(const Scalar absTol)
Scalar computeWRMSNorm(const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &x, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &xNext, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &err)
Compute the weigthed root mean square norm.
Teuchos::RCP< Thyra::VectorBase< Scalar > > errorWeightVector_
Teuchos::RCP< Thyra::VectorBase< Scalar > > u_
Teuchos::RCP< Thyra::VectorBase< Scalar > > uNext_
Scalar errorNorm(const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &x)
Compute the error Norm.
void setRelativeTolerance(const Scalar relTol)
Teuchos::RCP< Thyra::VectorBase< Scalar > > scratchVector_