Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CDR_Model_decl.hpp
Go to the documentation of this file.
1 //@HEADER
2 // *****************************************************************************
3 // Tempus: Time Integration and Sensitivity Analysis Package
4 //
5 // Copyright 2017 NTESS and the Tempus contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 //@HEADER
9 
10 #ifndef TEMPUS_CDR_MODEL_DECL_HPP
11 #define TEMPUS_CDR_MODEL_DECL_HPP
12 
13 #include "Thyra_StateFuncModelEvaluatorBase.hpp"
14 
15 class Epetra_Comm;
16 class Epetra_Map;
17 class Epetra_Vector;
18 class Epetra_CrsGraph;
19 class Epetra_Import;
20 
21 namespace Tempus_Test {
22 
23 template <class Scalar>
25 
46 template <class Scalar>
48  public:
50  const int num_global_elements, const Scalar z_min,
51  const Scalar z_max,
52  const Scalar a, // convection
53  const Scalar k); // source
54 
57 
59 
60  void setShowGetInvalidArgs(bool showGetInvalidArg);
61 
62  void set_W_factory(
63  const Teuchos::RCP<const ::Thyra::LinearOpWithSolveFactoryBase<Scalar> >
64  &W_factory);
65 
67 
70 
77  get_W_factory() const;
81 
82  private:
85 
88 
90  void evalModelImpl(
91  const ::Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
92  const ::Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
93 
95 
96  private: // data members
99  const Scalar z_min_;
100  const Scalar z_max_;
101  const Scalar a_;
102  const Scalar k_;
103 
108 
111 
113 
115 
118 
122 
124 
131 };
132 
133 //==================================================================
134 // Finite Element Basis Object
135 class Basis {
136  public:
137  // Constructor
138  Basis();
139 
140  // Destructor
141  ~Basis();
142 
143  // Calculates the values of u and x at the specified gauss point
144  void computeBasis(int gp, double *z, double *u, double *u_dot = nullptr);
145 
146  public:
147  // Variables that are calculated at the gauss point
148  double *phi, *dphide;
149  double uu, zz, duu, eta, wt;
150  double dz;
151  // These are only needed for transient
152  double uu_dot, duu_dot;
153 };
154 
155 } // namespace Tempus_Test
156 
157 #endif
::Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs() const
void evalModelImpl(const ::Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const ::Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Teuchos::RCP< const Epetra_Map > x_ghosted_map_
Teuchos::RCP< const ::Thyra::LinearOpWithSolveFactoryBase< Scalar > > get_W_factory() const
CDR_Model(const Teuchos::RCP< const Epetra_Comm > &comm, const int num_global_elements, const Scalar z_min, const Scalar z_max, const Scalar a, const Scalar k)
::Thyra::ModelEvaluatorBase::OutArgs< Scalar > prototypeOutArgs_
virtual Teuchos::RCP< Epetra_CrsGraph > createGraph()
Teuchos::RCP< Epetra_Vector > u_dot_ptr
Teuchos::RCP< Epetra_CrsGraph > W_graph_
Teuchos::RCP< Epetra_Vector > node_coordinates_
Teuchos::RCP< const Epetra_Map > f_owned_map_
Teuchos::RCP< Epetra_Vector > J_diagonal_
Teuchos::RCP< ::Thyra::VectorBase< Scalar > > x0_
Teuchos::RCP< ::Thyra::PreconditionerBase< Scalar > > create_W_prec() const
Teuchos::RCP< Epetra_Vector > x_ptr
Teuchos::RCP< Epetra_Vector > ghosted_node_coordinates_
void setShowGetInvalidArgs(bool showGetInvalidArg)
Teuchos::RCP< const Epetra_Map > x_owned_map_
::Thyra::ModelEvaluatorBase::InArgs< Scalar > nominalValues_
void set_W_factory(const Teuchos::RCP< const ::Thyra::LinearOpWithSolveFactoryBase< Scalar > > &W_factory)
void set_x0(const Teuchos::ArrayView< const Scalar > &x0)
void computeBasis(int gp, double *z, double *u, double *u_dot=nullptr)
Teuchos::RCP< const ::Thyra::VectorSpaceBase< Scalar > > x_space_
Teuchos::RCP< ::Thyra::LinearOpBase< Scalar > > create_W_op() const
Teuchos::RCP< Thyra::LinearOpWithSolveBase< double > > create_W() const
::Thyra::ModelEvaluatorBase::OutArgs< Scalar > createOutArgsImpl() const
Teuchos::RCP< const ::Thyra::VectorSpaceBase< Scalar > > get_f_space() const
Teuchos::Array< Scalar > p_
Teuchos::RCP< const ::Thyra::LinearOpWithSolveFactoryBase< Scalar > > W_factory_
Teuchos::RCP< Epetra_Vector > u_ptr
::Thyra::ModelEvaluatorBase::InArgs< Scalar > prototypeInArgs_
Teuchos::RCP< const ::Thyra::VectorSpaceBase< Scalar > > get_x_space() const
const Teuchos::RCP< const Epetra_Comm > comm_
Teuchos::RCP< const ::Thyra::VectorSpaceBase< Scalar > > f_space_
::Thyra::ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const
1D CGFEM model for convection/diffusion/reaction
Teuchos::RCP< const Epetra_Import > importer_