https://mooseframework.inl.gov
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
Moose::Kokkos::DirichletBCBaseTempl< is_ad > Class Template Reference

The base Kokkos boundary condition of a Dirichlet type. More...

#include <KokkosDirichletBCBase.h>

Inheritance diagram for Moose::Kokkos::DirichletBCBaseTempl< is_ad >:
[legend]

Classes

struct  PresetLoop
 Function tag for preset loop. More...
 

Public Types

using Base = std::conditional_t< is_ad, ADNodalBC, NodalBC >
 

Public Member Functions

 DirichletBCBaseTempl (const InputParameters &parameters)
 Constructor. More...
 
virtual bool preset () const override
 Get whether the value is to be preset. More...
 
virtual void presetSolution (TagID tag) override
 Dispatch solution vector preset. More...
 
template<typename Derived >
KOKKOS_FUNCTION void operator() (PresetLoop, const ThreadID tid, const Derived &bc) const
 The preset function called by Kokkos. More...
 
template<typename Derived >
KOKKOS_FUNCTION auto computeQpResidual (const unsigned int qp, AssemblyDatum &datum) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Private Types

using real_type = std::conditional_t< is_ad, ADReal, Real >
 

Private Attributes

const bool _preset
 Flag whether the value is to be preset. More...
 
TagID _solution_tag
 Tag associated with the solution vector to be preset. More...
 

Detailed Description

template<bool is_ad>
class Moose::Kokkos::DirichletBCBaseTempl< is_ad >

The base Kokkos boundary condition of a Dirichlet type.

Definition at line 22 of file KokkosDirichletBCBase.h.

Member Typedef Documentation

◆ Base

template<bool is_ad>
using Moose::Kokkos::DirichletBCBaseTempl< is_ad >::Base = std::conditional_t<is_ad, ADNodalBC, NodalBC>

Definition at line 62 of file KokkosDirichletBCBase.h.

◆ real_type

template<bool is_ad>
using Moose::Kokkos::DirichletBCBaseTempl< is_ad >::real_type = std::conditional_t<is_ad, ADReal, Real>
private

Definition at line 24 of file KokkosDirichletBCBase.h.

Constructor & Destructor Documentation

◆ DirichletBCBaseTempl()

template<bool is_ad>
Moose::Kokkos::DirichletBCBaseTempl< is_ad >::DirichletBCBaseTempl ( const InputParameters parameters)

Constructor.

Member Function Documentation

◆ computeQpResidual()

template<bool is_ad>
template<typename Derived >
KOKKOS_FUNCTION auto Moose::Kokkos::DirichletBCBaseTempl< is_ad >::computeQpResidual ( const unsigned int  qp,
AssemblyDatum datum 
) const

Definition at line 105 of file KokkosDirichletBCBase.h.

106 {
107  auto bc = static_cast<const Derived *>(this);
108 
109  return _u(datum, qp) - real_type(bc->computeValue(qp, datum));
110 }
std::conditional_t< is_ad, ADReal, Real > real_type

◆ operator()()

template<bool is_ad>
template<typename Derived >
KOKKOS_FUNCTION void Moose::Kokkos::DirichletBCBaseTempl< is_ad >::operator() ( PresetLoop  ,
const ThreadID  tid,
const Derived &  bc 
) const

The preset function called by Kokkos.

Definition at line 88 of file KokkosDirichletBCBase.h.

89 {
90  auto node = kokkosBoundaryNodeID(tid);
91  auto & sys = kokkosSystem(_kokkos_var.sys());
92  auto dof = sys.getNodeLocalDofIndex(node, 0, _kokkos_var.var());
93 
95  return;
96 
97  AssemblyDatum datum(node, kokkosAssembly(), kokkosSystems(), _kokkos_var, _kokkos_var.var());
98 
99  sys.getVectorDofValue(dof, _solution_tag) = bc.computeValue(0, datum);
100 }
TagID _solution_tag
Tag associated with the solution vector to be preset.
static constexpr dof_id_type invalid_id
The Kokkos object that holds thread-private data in the parallel operations of Kokkos kernels...
Definition: KokkosDatum.h:364

◆ preset()

template<bool is_ad>
virtual bool Moose::Kokkos::DirichletBCBaseTempl< is_ad >::preset ( ) const
inlineoverridevirtual

Get whether the value is to be preset.

Returns
Whether the value is to be preset

Definition at line 38 of file KokkosDirichletBCBase.h.

38 { return _preset; }
const bool _preset
Flag whether the value is to be preset.

◆ presetSolution()

template<bool is_ad>
virtual void Moose::Kokkos::DirichletBCBaseTempl< is_ad >::presetSolution ( TagID  tag)
overridevirtual

Dispatch solution vector preset.

Parameters
tagThe tag associated with the solution vector to be preset

◆ validParams()

template<bool is_ad>
static InputParameters Moose::Kokkos::DirichletBCBaseTempl< is_ad >::validParams ( )
static

Member Data Documentation

◆ _preset

template<bool is_ad>
const bool Moose::Kokkos::DirichletBCBaseTempl< is_ad >::_preset
private

Flag whether the value is to be preset.

Definition at line 78 of file KokkosDirichletBCBase.h.

Referenced by Moose::Kokkos::DirichletBCBaseTempl< is_ad >::preset().

◆ _solution_tag

template<bool is_ad>
TagID Moose::Kokkos::DirichletBCBaseTempl< is_ad >::_solution_tag
private

Tag associated with the solution vector to be preset.

Definition at line 82 of file KokkosDirichletBCBase.h.


The documentation for this class was generated from the following file: