24 using real_type = std::conditional_t<is_ad, ADReal, Real>;
56 template <
typename Derived>
59 template <
typename Derived>
62 using Base = std::conditional_t<is_ad, ADNodalBC, NodalBC>;
63 using Base::operator();
66 using Base::_kokkos_var;
70 using Base::kokkosAssembly;
71 using Base::kokkosBoundaryNodeID;
72 using Base::kokkosSystem;
73 using Base::kokkosSystems;
74 using Base::numKokkosBoundaryNodes;
88template <
typename Derived>
92 auto comp = _thread(tid, 0);
93 auto node = kokkosBoundaryNodeID(_thread(tid, 1));
94 auto & sys = kokkosSystem(_kokkos_var.sys(comp));
95 auto dof = sys.getNodeLocalDofIndex(node, 0, _kokkos_var.var(comp));
101 node, kokkosAssembly(), kokkosSystems(), _kokkos_var, _kokkos_var.var(comp), comp);
103 sys.getVectorDofValue(dof, _solution_tag) = bc.computeValue(0, datum);
107template <
typename Derived>
111 auto bc =
static_cast<const Derived *
>(
this);
113 return _u(datum, qp) -
real_type(bc->computeValue(qp, datum));
121#define registerKokkosDirichletBC(app, classname) \
122 registerKokkosResidualObject(app, classname); \
123 registerKokkosAdditionalOperation(classname, PresetLoop)
125#define registerKokkosADDirichletBC(app, classname) \
126 registerKokkosADResidualObject(app, classname); \
127 registerKokkosAdditionalOperation(classname, PresetLoop)
The Kokkos object that holds thread-private data in the parallel operations of Kokkos kernels.
The base Kokkos boundary condition of a Dirichlet type.
KOKKOS_FUNCTION auto computeQpResidual(const unsigned int qp, AssemblyDatum &datum) const
virtual void presetSolution(TagID tag) override
Dispatch solution vector preset.
const bool _preset
Flag whether the value is to be preset.
KOKKOS_FUNCTION void operator()(PresetLoop, const ThreadID tid, const Derived &bc) const
The preset function called by Kokkos.
std::conditional_t< is_ad, ADNodalBC, NodalBC > Base
TagID _solution_tag
Tag associated with the solution vector to be preset.
DirichletBCBaseTempl(const InputParameters ¶meters)
Constructor.
virtual bool preset() const override
Get whether the value is to be preset.
static InputParameters validParams()
std::conditional_t< is_ad, ADReal, Real > real_type
static constexpr dof_id_type invalid_id
DirichletBCBaseTempl< true > ADDirichletBCBase
DirichletBCBaseTempl< false > DirichletBCBase
MOOSE_KOKKOS_INDEX_TYPE ThreadID
Function tag for preset loop.