Tempus  Version of the Day
Time Integration
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"
17 namespace Tempus {
18 
19 template<class Scalar>
21 {
22 
23  public:
24 
25  // ctor
27 
28  Stepper_ErrorNorm(const Scalar relTol, const Scalar absTol);
29 
31 
32  Scalar computeWRMSNorm(const Teuchos::RCP<const Thyra::VectorBase<Scalar>> &x,
33  const Teuchos::RCP<const Thyra::VectorBase<Scalar>> &xNext,
34  const Teuchos::RCP<const Thyra::VectorBase<Scalar>> &err);
35 
36  Scalar errorNorm(const Teuchos::RCP<const Thyra::VectorBase<Scalar>> &x);
37 
38  void setRelativeTolerance(const Scalar relTol) { relTol_ = relTol; }
39  void setAbsoluteTolerance(const Scalar absTol) { abssTol_ = absTol; }
40 
41 
42  protected:
43 
44  Scalar relTol_;
45  Scalar abssTol_;
46  Teuchos::RCP<Thyra::VectorBase<Scalar>> u_;
47  Teuchos::RCP<Thyra::VectorBase<Scalar>> uNext_;
48  Teuchos::RCP<Thyra::VectorBase<Scalar>> errorWeightVector_;
49  Teuchos::RCP<Thyra::VectorBase<Scalar>> scratchVector_;
50 
51 };
52 
53 } // namespace Tempus
54 #endif //Tempus_Stepper_ErrorNorm_decl_hpp
Teuchos::RCP< Thyra::VectorBase< Scalar > > errorWeightVector_
void setAbsoluteTolerance(const Scalar absTol)
Teuchos::RCP< Thyra::VectorBase< Scalar > > scratchVector_
void setRelativeTolerance(const Scalar relTol)
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)
Teuchos::RCP< Thyra::VectorBase< Scalar > > u_
Scalar errorNorm(const Teuchos::RCP< const Thyra::VectorBase< Scalar >> &x)
Teuchos::RCP< Thyra::VectorBase< Scalar > > uNext_