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: Copyright (2017) Sandia Corporation
4 //
5 // Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6 // ****************************************************************************
7 // @HEADER
8 
9 #ifndef TEMPUS_CDR_MODEL_DECL_HPP
10 #define TEMPUS_CDR_MODEL_DECL_HPP
11 
12 #include "Thyra_StateFuncModelEvaluatorBase.hpp"
13 
14 class Epetra_Comm;
15 class Epetra_Map;
16 class Epetra_Vector;
17 class Epetra_CrsGraph;
18 class Epetra_Import;
19 
20 namespace Tempus_Test {
21 
22 template<class Scalar> class ModelEvaluator1DFEM;
23 
44 template<class Scalar>
45 class CDR_Model
47 {
48 public:
49 
51  const int num_global_elements,
52  const Scalar z_min,
53  const Scalar z_max,
54  const Scalar a, // convection
55  const Scalar k); // source
56 
59 
61 
62  void setShowGetInvalidArgs(bool showGetInvalidArg);
63 
64  void set_W_factory(const Teuchos::RCP<const ::Thyra::LinearOpWithSolveFactoryBase<Scalar> >& W_factory);
65 
67 
70 
80 
81 private:
82 
85 
88 
90  void evalModelImpl(
91  const ::Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
92  const ::Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs
93  ) const;
94 
96 
97 private: // data members
98 
101  const Scalar z_min_;
102  const Scalar z_max_;
103  const Scalar a_;
104  const Scalar k_;
105 
110 
113 
115 
117 
120 
124 
126 
133 
134 };
135 
136 //==================================================================
137 // Finite Element Basis Object
138 class Basis {
139 
140  public:
141  // Constructor
142  Basis();
143 
144  // Destructor
145  ~Basis();
146 
147  // Calculates the values of u and x at the specified gauss point
148  void computeBasis(int gp, double *z, double *u, double *u_dot = nullptr);
149 
150  public:
151  // Variables that are calculated at the gauss point
152  double *phi, *dphide;
153  double uu, zz, duu, eta, wt;
154  double dz;
155  // These are only needed for transient
156  double uu_dot, duu_dot;
157 };
158 
159 } // namespace Tempus_Test
160 
161 #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_