VertexCFD  0.0-dev
VertexCFD_Closure_ConductionErrorNorms.hpp
1 #ifndef VERTEXCFD_CLOSURE_CONDUCTIONERRORNORMS_HPP
2 #define VERTEXCFD_CLOSURE_CONDUCTIONERRORNORMS_HPP
3 
4 #include <Panzer_Dimension.hpp>
5 #include <Panzer_Evaluator_WithBaseImpl.hpp>
6 
7 #include <Phalanx_Evaluator_Derived.hpp>
8 #include <Phalanx_Evaluator_WithBaseImpl.hpp>
9 #include <Phalanx_FieldManager.hpp>
10 #include <Phalanx_config.hpp>
11 
12 #include <Teuchos_ParameterList.hpp>
13 
14 #include <Kokkos_Core.hpp>
15 
16 namespace VertexCFD
17 {
18 namespace ClosureModel
19 {
31 template<class EvalType, class Traits, int NumSpaceDim>
32 class ConductionErrorNorms : public panzer::EvaluatorWithBaseImpl<Traits>,
33  public PHX::EvaluatorDerived<EvalType, Traits>
34 {
35  public:
37  using scalar_type = typename EvalType::ScalarT;
38 
40  static constexpr int num_space_dim = NumSpaceDim;
41 
49  ConductionErrorNorms(const panzer::IntegrationRule& ir);
50 
60  void evaluateFields(typename Traits::EvalData workset) override;
61 
68  KOKKOS_INLINE_FUNCTION
69  void operator()(
70  const Kokkos::TeamPolicy<PHX::exec_space>::member_type& team) const;
71 
73  PHX::MDField<scalar_type, panzer::Cell, panzer::Point> _L1_error_continuity;
74 
80  Kokkos::Array<PHX::MDField<scalar_type, panzer::Cell, panzer::Point>,
83 
85  PHX::MDField<scalar_type, panzer::Cell, panzer::Point> _L1_error_energy;
86 
88  PHX::MDField<scalar_type, panzer::Cell, panzer::Point> _L2_error_continuity;
89 
91  Kokkos::Array<PHX::MDField<scalar_type, panzer::Cell, panzer::Point>,
94 
96  PHX::MDField<scalar_type, panzer::Cell, panzer::Point> _L2_error_energy;
97 
99  PHX::MDField<scalar_type, panzer::Cell, panzer::Point> _volume;
100 
101  private:
103  PHX::MDField<const double, panzer::Cell, panzer::Point> _exact_temperature;
104 
106  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point> _temperature;
107 };
108 
109 //-----------------------------------------------------------------------------//
110 
111 } // namespace ClosureModel
112 } // end namespace VertexCFD
113 
114 #include "VertexCFD_Closure_ConductionErrorNorms_impl.hpp"
115 
116 #endif // VERTEXCFD_CLOSURE_CONDUCTIONERRORNORMS_HPP
VertexCFD::ClosureModel::ConductionErrorNorms::_L1_error_continuity
PHX::MDField< scalar_type, panzer::Cell, panzer::Point > _L1_error_continuity
L1 error of the continuity equation (scalar field).
Definition: VertexCFD_Closure_ConductionErrorNorms.hpp:73
VertexCFD
Definition: tstMethodManufacturedSolutionBC.cpp:23
VertexCFD::ClosureModel::ConductionErrorNorms::_L1_error_momentum
Kokkos::Array< PHX::MDField< scalar_type, panzer::Cell, panzer::Point >, num_space_dim > _L1_error_momentum
L1 error of the momentum equations (vector field).
Definition: VertexCFD_Closure_ConductionErrorNorms.hpp:82
VertexCFD::ClosureModel::ConductionErrorNorms::_L2_error_continuity
PHX::MDField< scalar_type, panzer::Cell, panzer::Point > _L2_error_continuity
L2 error of the continuity equation (scalar field).
Definition: VertexCFD_Closure_ConductionErrorNorms.hpp:88
VertexCFD::ClosureModel::ConductionErrorNorms::ConductionErrorNorms
ConductionErrorNorms(const panzer::IntegrationRule &ir)
Constructor.
Definition: VertexCFD_Closure_ConductionErrorNorms_impl.hpp:22
VertexCFD::ClosureModel::ConductionErrorNorms::_L1_error_energy
PHX::MDField< scalar_type, panzer::Cell, panzer::Point > _L1_error_energy
L1 error of the energy equation (scalar field).
Definition: VertexCFD_Closure_ConductionErrorNorms.hpp:85
VertexCFD::ClosureModel::ConductionErrorNorms::scalar_type
typename EvalType::ScalarT scalar_type
Alias for the scalar type used by the evaluation type.
Definition: VertexCFD_Closure_ConductionErrorNorms.hpp:37
VertexCFD::ClosureModel::ConductionErrorNorms
Compute error norms between exact and numerical conduction solutions.
Definition: VertexCFD_Closure_ConductionErrorNorms.hpp:34
VertexCFD::ClosureModel::ConductionErrorNorms::_L2_error_energy
PHX::MDField< scalar_type, panzer::Cell, panzer::Point > _L2_error_energy
L2 error of the energy equation (scalar field).
Definition: VertexCFD_Closure_ConductionErrorNorms.hpp:96
VertexCFD::ClosureModel::ConductionErrorNorms::num_space_dim
static constexpr int num_space_dim
Number of spatial dimensions (compile‑time constant).
Definition: VertexCFD_Closure_ConductionErrorNorms.hpp:40
VertexCFD::ClosureModel::ConductionErrorNorms::operator()
KOKKOS_INLINE_FUNCTION void operator()(const Kokkos::TeamPolicy< PHX::exec_space >::member_type &team) const
Kokkos functor invoked for each team of threads.
Definition: VertexCFD_Closure_ConductionErrorNorms_impl.hpp:67
VertexCFD::ClosureModel::ConductionErrorNorms::_L2_error_momentum
Kokkos::Array< PHX::MDField< scalar_type, panzer::Cell, panzer::Point >, num_space_dim > _L2_error_momentum
L2 error of the momentum equations (vector field).
Definition: VertexCFD_Closure_ConductionErrorNorms.hpp:93
VertexCFD::ClosureModel::ConductionErrorNorms::_volume
PHX::MDField< scalar_type, panzer::Cell, panzer::Point > _volume
Cell volume at each integration point (used for weighting).
Definition: VertexCFD_Closure_ConductionErrorNorms.hpp:99
VertexCFD::ClosureModel::ConductionErrorNorms::evaluateFields
void evaluateFields(typename Traits::EvalData workset) override
Evaluate the error norm fields over the workset.
Definition: VertexCFD_Closure_ConductionErrorNorms_impl.hpp:56