VertexCFD  0.0-dev
VertexCFD_Closure_RADBADExactSolution.hpp
1 #ifndef VERTEXCFD_CLOSURE_RADBADExactSolution_HPP
2 #define VERTEXCFD_CLOSURE_RADBADExactSolution_HPP
3 
4 #include "rad_solver/species_properties/VertexCFD_ConstantSpeciesProperties.hpp"
5 #include "utils/VertexCFD_Utils_Constants.hpp"
6 
7 #include <Panzer_Dimension.hpp>
8 #include <Panzer_Evaluator_WithBaseImpl.hpp>
9 
10 #include <Phalanx_Evaluator_Derived.hpp>
11 #include <Phalanx_Evaluator_WithBaseImpl.hpp>
12 #include <Phalanx_FieldManager.hpp>
13 #include <Phalanx_config.hpp>
14 
15 #include <Teuchos_ParameterList.hpp>
16 
17 #include <Kokkos_Core.hpp>
18 
19 namespace VertexCFD
20 {
21 namespace ClosureModel
22 {
23 //---------------------------------------------------------------------------//
24 // Bateman Advection Diffusion equation exact solution.
25 //---------------------------------------------------------------------------//
26 template<class EvalType, class Traits, int NumSpaceDim>
27 class RADBADExactSolution : public panzer::EvaluatorWithBaseImpl<Traits>,
28  public PHX::EvaluatorDerived<EvalType, Traits>
29 {
30  public:
31  using scalar_type = typename EvalType::ScalarT;
32  static constexpr int num_space_dim = NumSpaceDim;
33 
35  const panzer::IntegrationRule& ir,
37  const Teuchos::ParameterList& closure_params);
38 
39  void postRegistrationSetup(typename Traits::SetupData sd,
40  PHX::FieldManager<Traits>& fm) override;
41 
42  void evaluateFields(typename Traits::EvalData workset) override;
43 
44  KOKKOS_INLINE_FUNCTION
45  void operator()(
46  const Kokkos::TeamPolicy<PHX::exec_space>::member_type& team) const;
47 
48  private:
49  int _num_species;
50 
51  public:
52  Kokkos::Array<PHX::MDField<scalar_type, panzer::Cell, panzer::Point>,
53  VertexCFD::Constants::MAX_NUM_VIEW>
54  _exact_species;
55 
56  private:
57  int _ir_degree;
58  int _ir_index;
59 
60  PHX::MDField<const double, panzer::Cell, panzer::Point, panzer::Dim> _ip_coords;
61  Kokkos::Array<PHX::MDField<const scalar_type, panzer::Cell, panzer::Point>,
62  num_space_dim>
63  _velocity;
64  double _nu;
65  Kokkos::View<double**, Kokkos::LayoutLeft, PHX::mem_space> _bateman_matrix;
66  Kokkos::Array<double, VertexCFD::Constants::MAX_NUM_VIEW> _scale;
67  bool _build_bateman;
68  bool _build_advection;
69  bool _build_diffusion;
70  double _time;
71  double _sigma;
72  double _init_loc;
73 
74  enum TmpVars
75  {
76  GAUSSIAN,
77  DENUM,
78  SUM_K,
79  PROD_L,
80  LMBD_PROD,
81  NUM_TMPS
82  };
83 
85  using scratch_view
86  = Kokkos::View<scalar_type**,
87  typename PHX::DevLayout<scalar_type>::type,
88  typename PHX::exec_space::scratch_memory_space,
89  Kokkos::MemoryUnmanaged>;
90 };
91 
92 //---------------------------------------------------------------------------//
93 
94 } // namespace ClosureModel
95 } // end namespace VertexCFD
96 
97 #endif // VERTEXCFD_CLOSURE_RADBADExactSolution_HPP
VertexCFD
Definition: tstMethodManufacturedSolutionBC.cpp:23
VertexCFD::SpeciesProperties::ConstantSpeciesProperties
Definition: VertexCFD_ConstantSpeciesProperties.hpp:17
VertexCFD::ClosureModel::RADBADExactSolution
Definition: VertexCFD_Closure_RADBADExactSolution.hpp:29