VertexCFD  0.0-dev
VertexCFD_BoundaryState_FullInductionConducting.hpp
1 #ifndef VERTEXCFD_BOUNDARYSTATE_FULLINDUCTIONCONDUCTING_HPP
2 #define VERTEXCFD_BOUNDARYSTATE_FULLINDUCTIONCONDUCTING_HPP
3 
4 #include "full_induction_mhd_solver/mhd_properties/VertexCFD_FullInductionMHDProperties.hpp"
5 
6 #include <Panzer_Dimension.hpp>
7 #include <Panzer_Evaluator_WithBaseImpl.hpp>
8 
9 #include <Phalanx_Evaluator_Derived.hpp>
10 #include <Phalanx_Evaluator_WithBaseImpl.hpp>
11 #include <Phalanx_FieldManager.hpp>
12 #include <Phalanx_config.hpp>
13 
14 namespace VertexCFD
15 {
16 namespace BoundaryCondition
17 {
18 //---------------------------------------------------------------------------//
19 template<class EvalType, class Traits, int NumSpaceDim>
20 class FullInductionConducting : public panzer::EvaluatorWithBaseImpl<Traits>,
21  public PHX::EvaluatorDerived<EvalType, Traits>
22 {
23  public:
24  using scalar_type = typename EvalType::ScalarT;
25  static constexpr int num_space_dim = NumSpaceDim;
26 
28  const panzer::IntegrationRule& ir,
29  const Teuchos::ParameterList& bc_params,
31 
32  void evaluateFields(typename Traits::EvalData workset) override;
33 
34  KOKKOS_INLINE_FUNCTION
35  void operator()(
36  const Kokkos::TeamPolicy<PHX::exec_space>::member_type& team) const;
37 
38  public:
39  Kokkos::Array<PHX::MDField<scalar_type, panzer::Cell, panzer::Point>,
40  num_space_dim>
41  _boundary_induced_magnetic_field;
42  PHX::MDField<scalar_type, panzer::Cell, panzer::Point>
43  _boundary_scalar_magnetic_potential;
44 
45  Kokkos::Array<
46  PHX::MDField<scalar_type, panzer::Cell, panzer::Point, panzer::Dim>,
47  num_space_dim>
48  _boundary_grad_induced_magnetic_field;
49 
50  private:
51  Kokkos::Array<double, num_space_dim> _bnd_magn_field;
52  bool _build_magn_corr;
53  bool _build_resistive_flux;
54  bool _dirichlet_scalar_magn_pot;
55  double _bnd_scalar_magn_pot;
56  double _magnetic_permeability;
57 
58  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point, panzer::Dim>
59  _normals;
60  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point>
61  _scalar_magnetic_potential;
62 
63  Kokkos::Array<PHX::MDField<const scalar_type, panzer::Cell, panzer::Point>,
64  num_space_dim>
65  _boundary_velocity;
66 
67  Kokkos::Array<PHX::MDField<const scalar_type, panzer::Cell, panzer::Point>,
68  num_space_dim>
69  _induced_magnetic_field;
70 
71  Kokkos::Array<
72  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point, panzer::Dim>,
73  num_space_dim>
74  _grad_induced_magnetic_field;
75 
76  Kokkos::Array<PHX::MDField<const scalar_type, panzer::Cell, panzer::Point>, 3>
77  _external_magnetic_field;
78 
79  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point> _resistivity;
80 
81  using scratch_view_B
82  = Kokkos::View<scalar_type*,
83  typename PHX::DevLayout<scalar_type>::type,
84  typename PHX::exec_space::scratch_memory_space,
85  Kokkos::MemoryUnmanaged>;
86  // We know at compile time the size of the second dimension (num_space_dim)
87  // but using a compile-time dimension triggers a bug in shmem_size when
88  // scalar_type is a Sacado data type.
89  using scratch_view_gradB
90  = Kokkos::View<scalar_type**,
91  typename PHX::DevLayout<scalar_type>::type,
92  typename PHX::exec_space::scratch_memory_space,
93  Kokkos::MemoryUnmanaged>;
94 };
95 
96 //---------------------------------------------------------------------------//
97 
98 } // end namespace BoundaryCondition
99 } // end namespace VertexCFD
100 
101 #endif // VERTEXCFD_BOUNDARYSTATE_FULLINDUCTIONCONDUCTING_HPP
VertexCFD
Definition: tstMethodManufacturedSolutionBC.cpp:23
VertexCFD::MHDProperties::FullInductionMHDProperties
Definition: VertexCFD_FullInductionMHDProperties.hpp:17
VertexCFD::BoundaryCondition::FullInductionConducting
Definition: VertexCFD_BoundaryState_FullInductionConducting.hpp:22