VertexCFD  0.0-dev
VertexCFD_Closure_RADErrorNorms.hpp
1 #ifndef VERTEXCFD_CLOSURE_RADERRORNORMS_HPP
2 #define VERTEXCFD_CLOSURE_RADERRORNORMS_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 // Compute error norms between exact solution and numerical solutions
25 //---------------------------------------------------------------------------//
26 template<class EvalType, class Traits>
27 class RADErrorNorms : public panzer::EvaluatorWithBaseImpl<Traits>,
28  public PHX::EvaluatorDerived<EvalType, Traits>
29 {
30  public:
31  using scalar_type = typename EvalType::ScalarT;
32 
34  const panzer::IntegrationRule& ir,
36 
37  void evaluateFields(typename Traits::EvalData workset) override;
38 
39  KOKKOS_INLINE_FUNCTION
40  void operator()(
41  const Kokkos::TeamPolicy<PHX::exec_space>::member_type& team) const;
42 
43  private:
44  int _num_species;
45 
46  public:
47  Kokkos::Array<PHX::MDField<scalar_type, panzer::Cell, panzer::Point>,
48  VertexCFD::Constants::MAX_NUM_VIEW>
49  _L1_error_species;
50  Kokkos::Array<PHX::MDField<scalar_type, panzer::Cell, panzer::Point>,
51  VertexCFD::Constants::MAX_NUM_VIEW>
52  _L2_error_species;
53  PHX::MDField<scalar_type, panzer::Cell, panzer::Point> _volume;
54 
55  private:
56  Kokkos::Array<PHX::MDField<const scalar_type, panzer::Cell, panzer::Point>,
57  VertexCFD::Constants::MAX_NUM_VIEW>
58  _exact_species;
59  Kokkos::Array<PHX::MDField<const scalar_type, panzer::Cell, panzer::Point>,
60  VertexCFD::Constants::MAX_NUM_VIEW>
61  _species;
62 };
63 
64 //---------------------------------------------------------------------------//
65 
66 } // namespace ClosureModel
67 } // end namespace VertexCFD
68 
69 #include "VertexCFD_Closure_RADErrorNorms_impl.hpp"
70 
71 #endif // VERTEXCFD_CLOSURE_RADERRORNORMS_HPP
VertexCFD
Definition: tstMethodManufacturedSolutionBC.cpp:23
VertexCFD::SpeciesProperties::ConstantSpeciesProperties
Definition: VertexCFD_ConstantSpeciesProperties.hpp:17
VertexCFD::ClosureModel::RADErrorNorms
Definition: VertexCFD_Closure_RADErrorNorms.hpp:29