22 template <
typename Derived>
70 template <
typename Derived>
76 "preset",
true,
"Whether or not to preset the BC (apply the value before the solve begins).");
80 template <
typename Derived>
82 :
NodalBC<Derived>(parameters), _preset(this->template getParam<bool>(
"preset"))
86 template <
typename Derived>
92 ::Kokkos::parallel_for(::Kokkos::RangePolicy<ExecSpace, ::Kokkos::IndexType<ThreadID>>(
93 0, this->numKokkosBoundaryNodes()),
94 *static_cast<Derived *>(
this));
97 template <
typename Derived>
101 auto bc =
static_cast<const Derived *
>(
this);
102 auto node = kokkosBoundaryNodeID(tid);
103 auto & sys = kokkosSystem(_kokkos_var.sys());
104 auto dof = sys.getNodeLocalDofIndex(node, _kokkos_var.var());
109 sys.getVectorDofValue(dof, _solution_tag) = bc->computeValue(node);
112 template <
typename Derived>
116 auto bc =
static_cast<const Derived *
>(
this);
118 return _u(node) - bc->computeValue(node);
124 #define usingKokkosDirichletBCBaseMembers(T) \ 125 usingKokkosNodalBCMembers(T); \ 128 using Moose::Kokkos::DirichletBCBase<T>::operator() virtual bool preset() const override
Get whether the value is to be preset.
const bool _preset
Flag whether the value is to be preset.
virtual void presetSolution(TagID tag) override
Dispatch solution vector preset.
const InputParameters & parameters() const
Get the parameters of the object.
virtual Real computeQpResidual() override
usingKokkosNodalBCMembers(Derived)
TagID _solution_tag
Tag associated with the solution vector to be preset.
DirichletBCBase(const InputParameters ¶meters)
Constructor.
static InputParameters validParams()
dof_id_type ContiguousNodeID
static const dof_id_type invalid_id
static InputParameters validParams()
KOKKOS_FUNCTION void operator()(const ThreadID tid) const
The preset function called by Kokkos.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
KOKKOS_FUNCTION Real computeQpResidual(const ContiguousNodeID node) const
Compute residual contribution on a node.
The base class for a user to derive their own Kokkos nodal boundary conditions.
The base Kokkos boundary condition of a Dirichlet type.