VertexCFD  0.0-dev
VertexCFD_Closure_IncompressibleLocalTimeStepSize.hpp
1 #ifndef VERTEXCFD_CLOSURE_INCOMPRESSIBLELOCALTIMESTEPSIZE_HPP
2 #define VERTEXCFD_CLOSURE_INCOMPRESSIBLELOCALTIMESTEPSIZE_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 <Kokkos_Core.hpp>
13 
14 namespace VertexCFD
15 {
16 namespace ClosureModel
17 {
18 //---------------------------------------------------------------------------//
19 // Compute local time step size based on the mesh size and maximum eigenvalue.
20 // The time step size used by the solver and based on the CFL condition is
21 // computed in the observer
22 // 'VertexCFD_TempusTimeStepControl_GlobalCFL_impl.hpp'
23 //---------------------------------------------------------------------------//
24 template<class EvalType, class Traits, int NumSpaceDim>
26  : public panzer::EvaluatorWithBaseImpl<Traits>,
27  public PHX::EvaluatorDerived<EvalType, Traits>
28 {
29  public:
30  using scalar_type = typename EvalType::ScalarT;
31  static constexpr int num_space_dim = NumSpaceDim;
32 
33  IncompressibleLocalTimeStepSize(const panzer::IntegrationRule& ir);
34 
35  void evaluateFields(typename Traits::EvalData d) override;
36 
37  KOKKOS_INLINE_FUNCTION
38  void operator()(
39  const Kokkos::TeamPolicy<PHX::exec_space>::member_type& team) const;
40 
41  public:
42  PHX::MDField<scalar_type, panzer::Cell, panzer::Point> _local_dt;
43 
44  private:
45  PHX::MDField<const double, panzer::Cell, panzer::Point, panzer::Dim>
46  _element_length;
47  Kokkos::Array<PHX::MDField<const scalar_type, panzer::Cell, panzer::Point>,
48  num_space_dim>
49  _velocity;
50 };
51 
52 //---------------------------------------------------------------------------//
53 
54 } // end namespace ClosureModel
55 } // end namespace VertexCFD
56 
57 #endif // end VERTEXCFD_CLOSURE_INCOMPRESSIBLELOCALTIMESTEPSIZE_HPP
VertexCFD
Definition: tstMethodManufacturedSolutionBC.cpp:23
VertexCFD::ClosureModel::IncompressibleLocalTimeStepSize
Definition: VertexCFD_Closure_IncompressibleLocalTimeStepSize.hpp:28