https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
Moose::Kokkos::FESystem Class Reference

The Kokkos FE system class. More...

#include <KokkosFESystem.h>

Inheritance diagram for Moose::Kokkos::FESystem:
[legend]

Public Member Functions

 FESystem (SystemBase &system)
 Constructor for standalone use (pure FE simulations)
 
 FESystem (System &base, SystemBase &system)
 Constructor for mixed FE+FV simulations, sharing device memory with an existing System.
 
void reinit ()
 Allocate the quadrature point vectors for active variable and tags and cache quadrature point values.
 
KOKKOS_FUNCTION const Array< unsigned int > & getFieldCoupling (unsigned int var) const
 Get the list of off-diagonal coupled field variable numbers of a variable.
 
KOKKOS_FUNCTION const Array< unsigned int > & getScalarCoupling (unsigned int var) const
 Get the list of off-diagonal coupled scalar variable numbers of a variable.
 
KOKKOS_FUNCTION bool hasNodalBCMatrixTag (dof_id_type dof, TagID tag) const
 Check whether a local DOF index is associated with a nodal BC for an extra matrix tag.
 
KOKKOS_FUNCTION unsigned int getFETypeID (unsigned int var) const
 Get the FE type ID of a variable.
 
KOKKOS_FUNCTION dof_id_type getNodeLocalDofIndex (ContiguousNodeID node, unsigned int i, unsigned int var) const
 Get the local DOF index of a variable for a node.
 
KOKKOS_FUNCTION dof_id_type getNodeGlobalDofIndex (ContiguousNodeID node, unsigned int i, unsigned int var) const
 Get the global DOF index of a variable for a node.
 
KOKKOS_FUNCTION bool isNodalDefined (ContiguousNodeID node, unsigned int var) const
 Get whether a variable is defined on a node.
 
KOKKOS_FUNCTION ADReal getVectorDofADValue (const dof_id_type dof, const TagID tag, const Real seed) const
 Get the DOF value of a tagged vector for automatic differentiation (AD)
 
KOKKOS_FUNCTION Real & getVectorQpValue (const ElementInfo info, const dof_id_type qp, const unsigned int var, const TagID tag) const
 Get the quadrature point value of a variable from a tagged vector.
 
KOKKOS_FUNCTION ADReal getVectorQpADValue (const ElementInfo info, const dof_id_type offset, const dof_id_type qp, const unsigned int var, const TagID tag, const Real seed) const
 Get the quadrature point value of a variable from a tagged vector for automatic differentiation (AD)
 
KOKKOS_FUNCTION Real3 & getVectorQpGrad (const ElementInfo info, const dof_id_type qp, const unsigned int var, const TagID tag) const
 Get the quadrature point gradient of a variable from a tagged vector.
 
KOKKOS_FUNCTION Real3 & getVectorQpVectorValue (const ElementInfo info, const dof_id_type qp, const unsigned int var, const TagID tag) const
 Get the quadrature point value of a vector variable from a tagged vector.
 
KOKKOS_FUNCTION Real33 & getVectorQpVectorGrad (const ElementInfo info, const dof_id_type qp, const unsigned int var, const TagID tag) const
 Get the quadrature point gradient of a vector variable from a tagged vector.
 
KOKKOS_FUNCTION Real3 & getVectorQpVectorCurl (const ElementInfo info, const dof_id_type qp, const unsigned int var, const TagID tag) const
 Get the quadrature point curl of a vector variable from a tagged vector.
 
KOKKOS_FUNCTION ADReal3 getVectorQpADGrad (const ElementInfo info, const Real33 jacobian, const dof_id_type offset, const dof_id_type qp, const unsigned int var, const TagID tag, const Real seed) const
 Get the quadrature point gradient of a variable from a tagged vector for automatic differentiation (AD)
 
KOKKOS_FUNCTION Real getVectorQpValueFace (const ElementInfo info, const unsigned int side, const unsigned int qp, const unsigned int var, const TagID tag) const
 Get the face quadrature point value of a variable from a tagged vector.
 
KOKKOS_FUNCTION Real3 getVectorQpVectorValueFace (const ElementInfo info, const unsigned int side, const unsigned int qp, const unsigned int var, const TagID tag) const
 Get the face quadrature point value of a vector variable from a tagged vector.
 
KOKKOS_FUNCTION ADReal getVectorQpADValueFace (const ElementInfo info, const unsigned int side, const unsigned int qp, const unsigned int var, const TagID tag, const Real seed) const
 Get the face quadrature point value of a variable from a tagged vector for automatic differentiation (AD)
 
KOKKOS_FUNCTION Real3 getVectorQpGradFace (const ElementInfo info, const unsigned int side, const Real33 jacobian, const unsigned int qp, const unsigned int var, const TagID tag) const
 Get the face quadrature point gradient of a variable from a tagged vector.
 
KOKKOS_FUNCTION Real33 getVectorQpVectorGradFace (const ElementInfo info, const unsigned int side, const Real33 jacobian, const unsigned int qp, const unsigned int var, const TagID tag) const
 Get the face quadrature point gradient of a vector variable from a tagged vector.
 
KOKKOS_FUNCTION ADReal3 getVectorQpADGradFace (const ElementInfo info, const unsigned int side, const Real33 jacobian, const unsigned int qp, const unsigned int var, const TagID tag, const Real seed) const
 Get the face quadrature point gradient of a variable from a tagged vector for automatic differentiation (AD)
 
KOKKOS_FUNCTION void operator() (const ThreadID tid) const
 Kokkos function for caching variable values on element quadrature points.
 
void sync (const MemcpyType dir)
 Synchronize the active tagged vectors and matrices between host and device.
 
void setActiveVariables (const std::set< MooseVariableFieldBase * > &vars)
 Set the active variables.
 
void setActiveSolutionTags (const std::set< TagID > &tags)
 Set the active solution tags.
 
void setActiveResidualTags (const std::set< TagID > &tags)
 Set the active residual tags.
 
void setActiveMatrixTags (const std::set< TagID > &tags)
 Set the active matrix tags.
 
void clearActiveVariables ()
 Clear the cached active variables.
 
void clearActiveSolutionTags ()
 Clear the cached active solution tags.
 
void clearActiveResidualTags ()
 Clear the cached active residual tags.
 
void clearActiveMatrixTags ()
 Clear the cached active matrix tags.
 
const libMesh::DofMap & getDofMap () const
 Get the libMesh DOF map.
 
const Parallel::Communicator & getComm () const
 Get the libMesh communicator.
 
const Array< Array< dof_id_type > > & getLocalCommList () const
 Get the list of local DOF indices to communicate.
 
const Array< Array< dof_id_type > > & getGhostCommList () const
 Get the list of ghost DOF indices to communicate.
 
const Sparsity & getSparsity () const
 Get the sparisty pattern data.
 
void buildCooIndices (std::vector< PetscInt > &coo_i, std::vector< PetscInt > &coo_j) const
 Build the COO index arrays describing the sparsity pattern.
 
KOKKOS_FUNCTION bool isScalarVariable (unsigned int var) const
 Check whether a variable is scalar.
 
KOKKOS_FUNCTION bool isVariableActive (unsigned int var, ContiguousSubdomainID subdomain) const
 Check whether a variable is active on a subdomain.
 
KOKKOS_FUNCTION bool isResidualTagActive (TagID tag) const
 Check whether a residual tag is active.
 
KOKKOS_FUNCTION bool isMatrixTagActive (TagID tag) const
 Check whether a matrix tag is active.
 
KOKKOS_FUNCTION dof_id_type getNumLocalDofs () const
 Get the number of local DOFs.
 
KOKKOS_FUNCTION dof_id_type getNumGhostDofs () const
 Get the number of ghost DOFs.
 
KOKKOS_FUNCTION unsigned int getNumScalarDofs (unsigned int var) const
 Get the number of DOFs of a scalar variable.
 
KOKKOS_FUNCTION dof_id_type getElemLocalDofIndex (ContiguousElementID elem, unsigned int i, unsigned int var) const
 Get the local DOF index of a variable for an element.
 
KOKKOS_FUNCTION dof_id_type getScalarLocalDofIndex (unsigned int i, unsigned int var) const
 Get the local DOF index of a scalar variable.
 
KOKKOS_FUNCTION dof_id_type getElemGlobalDofIndex (ContiguousElementID elem, unsigned int i, unsigned int var) const
 Get the global DOF index of a variable for an element.
 
KOKKOS_FUNCTION dof_id_type getScalarGlobalDofIndex (unsigned int i, unsigned int var) const
 Get the global DOF index of a scalar variable.
 
KOKKOS_FUNCTION dof_id_type localToGlobalDofIndex (dof_id_type dof) const
 Get the global DOF index of a local DOF index.
 
KOKKOS_FUNCTION Vector & getVector (TagID tag) const
 Get a tagged Kokkos vector.
 
KOKKOS_FUNCTION Matrix & getMatrix (TagID tag) const
 Get a tagged Kokkos matrix.
 
KOKKOS_FUNCTION Real & getVectorDofValue (const dof_id_type dof, const TagID tag) const
 Get the DOF value of a tagged vector.
 
KOKKOS_FUNCTION Real & getMatrixValue (dof_id_type row, dof_id_type col, TagID tag) const
 Get an entry from a tagged matrix.
 
PerfGraph & perfGraph ()
 Get the PerfGraph.
 
KOKKOS_FUNCTION const Mesh & kokkosMesh () const
 Get the const reference of the Kokkos mesh.
 
KOKKOS_FUNCTION const Assembly & kokkosAssembly () const
 Get the const reference of the Kokkos assembly.
 
void sync (const std::set< TagID > &tags, const MemcpyType dir)
 Synchronize the specified tagged vectors between host and device.
 
void sync (const std::vector< TagID > &tags, const MemcpyType dir)
 
void sync (const TagID tag, const MemcpyType dir)
 
SystemBase & getSystem ()
 Get the MOOSE system.
 
const SystemBase & getSystem () const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 Call to register a named section for timing.
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 Call to register a named section for timing.
 
std::string timedSectionName (const std::string &section_name) const
 

Protected Attributes

SystemBase & _system
 Reference of the MOOSE system.
 
const MooseMesh & _mesh
 Reference of the MOOSE mesh.
 
const libMesh::DofMap & _dof_map
 Reference of the libMesh DOF map.
 
const Parallel::Communicator & _comm
 Reference of the libMesh communicator.
 
const unsigned int _num_vars
 Number of variables.
 
const dof_id_type _num_local_dofs
 Number of local DOFs.
 
const dof_id_type _num_ghost_dofs
 Number of ghost DOFs.
 
Array< Array2D< dof_id_type > > _local_elem_dof_index
 Local element DOF indices of each variable.
 
Array< Array< dof_id_type > > _scalar_dof_index
 DOF indices of each scalar variable.
 
Array< dof_id_type > _local_to_global_dof_index
 Map from local DOF index to global DOF index.
 
Array< unsigned int > _max_dofs_per_elem
 Maximum number of DOFs per element for each variable.
 
Array< bool > _var_is_scalar
 Whether each variable is scalar.
 
Array2D< bool > _var_subdomain_active
 Whether each variable is active on subdomains.
 
Array< unsigned int > _active_variables
 List of active variable numbers.
 
MooseApp & _pg_moose_app
 The MooseApp that owns the PerfGraph.
 
const std::string _prefix
 A prefix to use for all sections.
 
Array< Vector > _vectors
 Kokkos vectors and matrices on device.
 
Array< Matrix > _matrices
 
Array< TagID > _active_solution_tags
 List of active tags.
 
Array< TagID > _active_residual_tags
 
Array< TagID > _active_matrix_tags
 
Array< bool > _residual_tag_active
 Flag whether each tag is active.
 
Array< bool > _matrix_tag_active
 
Array< Array< dof_id_type > > _local_comm_list
 List of DOFs to send and receive.
 
Array< Array< dof_id_type > > _ghost_comm_list
 

Private Member Functions

void setupVariables ()
 Setup variable data.
 
void setupDofs ()
 Setup DOF data.
 
void setupCoupling ()
 Setup coupling data between variables.
 
void setupNodalBCDofs ()
 Mark the DOFs covered by nodal BCs.
 
void getNodalBCDofs (const NodalBCBase *nbc, Array< bool > &dofs)
 Get the list of DOFs covered by a nodal BC.
 
void setupSparsity ()
 Setup sparsity data.
 

Private Attributes

Thread _thread
 Kokkos thread object.
 
Array< Array< dof_id_type > > _local_node_dof_index
 Local nodal DOF indices of each variable.
 
Array< unsigned int > _var_fe_types
 FE type ID of each variable.
 
Array< bool > _var_is_vector
 Whether each variable is vector-valued.
 
Array< Array< bool > > _nbc_matrix_tag_dof
 Per-matrix-tag local-plus-ghost DOF masks for nodal BC coverage.
 
Sparsity _sparsity
 Matrix sparsity pattern data.
 
const Mesh & _mesh_host
 Host reference of the Kokkos mesh.
 
const Mesh _mesh_device
 Device copy of the Kokkos mesh.
 
const Assembly & _assembly_host
 Host reference of the Kokkos assembly.
 
const Assembly _assembly_device
 Device copy of the Kokkos assembly.
 
Array< Array2D< Array< Real > > > _qp_solutions
 Cached elemental quadrature values and gradients.
 
Array< Array2D< Array< Real3 > > > _qp_solutions_grad
 
Array< Array2D< Array< Real3 > > > _qp_vector_solutions
 
Array< Array2D< Array< Real33 > > > _qp_vector_solutions_grad
 
Array< Array2D< Array< Real3 > > > _qp_vector_solutions_curl
 
Array< Array< unsigned int > > _field_coupling
 Off-diagonal coupled field and scalar variable numbers of each variable.
 
Array< Array< unsigned int > > _scalar_coupling
 

Detailed Description

The Kokkos FE system class.

Each system in MOOSE with FE variables has a corresponding Kokkos FE system.

Definition at line 27 of file KokkosFESystem.h.

Constructor & Destructor Documentation

◆ FESystem() [1/2]

Moose::Kokkos::FESystem::FESystem ( SystemBase &  system)

Constructor for standalone use (pure FE simulations)

Parameters
systemThe associated MOOSE system

◆ FESystem() [2/2]

Moose::Kokkos::FESystem::FESystem ( System &  base,
SystemBase &  system 
)

Constructor for mixed FE+FV simulations, sharing device memory with an existing System.

Parameters
baseThe existing Kokkos System whose device memory to share
systemThe associated MOOSE system

Member Function Documentation

◆ buildCooIndices()

void Moose::Kokkos::System::buildCooIndices ( std::vector< PetscInt > &  coo_i,
std::vector< PetscInt > &  coo_j 
) const
inherited

Build the COO index arrays describing the sparsity pattern.

PETSc consumes these arrays destructively, so a fresh pair is needed for each matrix preallocated from this system. The arrays are resized to the number of nonzeros and fully overwritten, which lets one allocation be reused across the matrices.

Parameters
coo_iThe row index of each nonzero
coo_jThe column index of each nonzero

◆ clearActiveMatrixTags()

void Moose::Kokkos::System::clearActiveMatrixTags ( )
inlineinherited

Clear the cached active matrix tags.

Definition at line 117 of file KokkosSystem.h.

118 {
120 _matrix_tag_active = false;
121 }
void destroy()
Free all data and reset.
Array< TagID > _active_matrix_tags
Array< bool > _matrix_tag_active

◆ clearActiveResidualTags()

void Moose::Kokkos::System::clearActiveResidualTags ( )
inlineinherited

Clear the cached active residual tags.

Definition at line 108 of file KokkosSystem.h.

109 {
111 _residual_tag_active = false;
112 }
Array< TagID > _active_residual_tags
Array< bool > _residual_tag_active
Flag whether each tag is active.

◆ clearActiveSolutionTags()

void Moose::Kokkos::System::clearActiveSolutionTags ( )
inlineinherited

Clear the cached active solution tags.

Definition at line 103 of file KokkosSystem.h.

Array< TagID > _active_solution_tags
List of active tags.

◆ clearActiveVariables()

void Moose::Kokkos::System::clearActiveVariables ( )
inlineinherited

Clear the cached active variables.

Definition at line 98 of file KokkosSystem.h.

Array< unsigned int > _active_variables
List of active variable numbers.

◆ getComm()

const Parallel::Communicator & Moose::Kokkos::System::getComm ( ) const
inlineinherited

Get the libMesh communicator.

Returns
The libMesh communicator

Definition at line 142 of file KokkosSystem.h.

142{ return _comm; }
const Parallel::Communicator & _comm
Reference of the libMesh communicator.

◆ getDofMap()

const libMesh::DofMap & Moose::Kokkos::System::getDofMap ( ) const
inlineinherited

Get the libMesh DOF map.

Returns
The libMesh DOF map

Definition at line 136 of file KokkosSystem.h.

136{ return _dof_map; }
const libMesh::DofMap & _dof_map
Reference of the libMesh DOF map.

◆ getElemGlobalDofIndex()

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::System::getElemGlobalDofIndex ( ContiguousElementID  elem,
unsigned int  i,
unsigned int  var 
) const
inlineinherited

Get the global DOF index of a variable for an element.

Parameters
elemThe contiguous element ID
iThe element-local DOF index
varThe variable number
Returns
The global DOF index

Definition at line 260 of file KokkosSystem.h.

263 {
265 }
KOKKOS_FUNCTION dof_id_type getElemLocalDofIndex(ContiguousElementID elem, unsigned int i, unsigned int var) const
Get the local DOF index of a variable for an element.
Array< dof_id_type > _local_to_global_dof_index
Map from local DOF index to global DOF index.

◆ getElemLocalDofIndex()

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::System::getElemLocalDofIndex ( ContiguousElementID  elem,
unsigned int  i,
unsigned int  var 
) const
inlineinherited

Get the local DOF index of a variable for an element.

Parameters
elemThe contiguous element ID
iThe element-local DOF index
varThe variable number
Returns
The local DOF index

Definition at line 235 of file KokkosSystem.h.

238 {
239 return _local_elem_dof_index[var](i, elem);
240 }
Array< Array2D< dof_id_type > > _local_elem_dof_index
Local element DOF indices of each variable.

Referenced by Moose::Kokkos::System::getElemGlobalDofIndex(), getVectorQpADGrad(), getVectorQpADGradFace(), getVectorQpADValue(), getVectorQpADValueFace(), getVectorQpGradFace(), getVectorQpValueFace(), getVectorQpVectorGradFace(), and getVectorQpVectorValueFace().

◆ getFETypeID()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::FESystem::getFETypeID ( unsigned int  var) const
inline

Get the FE type ID of a variable.

Parameters
varThe variable number
Returns
The FE type ID

Definition at line 87 of file KokkosFESystem.h.

87{ return _var_fe_types[var]; }
Array< unsigned int > _var_fe_types
FE type ID of each variable.

◆ getFieldCoupling()

KOKKOS_FUNCTION const Array< unsigned int > & Moose::Kokkos::FESystem::getFieldCoupling ( unsigned int  var) const
inline

Get the list of off-diagonal coupled field variable numbers of a variable.

Parameters
varThe variable number
Returns
The list of off-diagonal coupled field variable numbers

Definition at line 56 of file KokkosFESystem.h.

57 {
58 return _field_coupling[var];
59 }
Array< Array< unsigned int > > _field_coupling
Off-diagonal coupled field and scalar variable numbers of each variable.

◆ getGhostCommList()

const Array< Array< dof_id_type > > & Moose::Kokkos::System::getGhostCommList ( ) const
inlineinherited

Get the list of ghost DOF indices to communicate.

Returns
The list of ghost DOF indices to communicate

Definition at line 154 of file KokkosSystem.h.

154{ return _ghost_comm_list; }
Array< Array< dof_id_type > > _ghost_comm_list

◆ getLocalCommList()

const Array< Array< dof_id_type > > & Moose::Kokkos::System::getLocalCommList ( ) const
inlineinherited

Get the list of local DOF indices to communicate.

Returns
The list of local DOF indices to communicate

Definition at line 148 of file KokkosSystem.h.

148{ return _local_comm_list; }
Array< Array< dof_id_type > > _local_comm_list
List of DOFs to send and receive.

◆ getMatrix()

KOKKOS_FUNCTION Matrix & Moose::Kokkos::System::getMatrix ( TagID  tag) const
inlineinherited

Get a tagged Kokkos matrix.

Parameters
tagThe matrix tag
Returns
The Kokkos matrix

Definition at line 300 of file KokkosSystem.h.

300{ return _matrices[tag]; }
Array< Matrix > _matrices

◆ getMatrixValue()

KOKKOS_FUNCTION Real & Moose::Kokkos::System::getMatrixValue ( dof_id_type  row,
dof_id_type  col,
TagID  tag 
) const
inlineinherited

Get an entry from a tagged matrix.

Parameters
rowThe local row index
colThe global column index
tagThe matrix tag
Returns
The entry from the tagged matrix

Definition at line 320 of file KokkosSystem.h.

321 {
322 return _matrices[tag](row, col);
323 }

◆ getNodalBCDofs()

void Moose::Kokkos::FESystem::getNodalBCDofs ( const NodalBCBase *  nbc,
Array< bool > &  dofs 
)
private

Get the list of DOFs covered by a nodal BC.

Parameters
nbcThe Kokkos nodal BC object
dofsLocal-plus-ghost DOF mask; entries are set true for DOFs covered by the nodal BC

◆ getNodeGlobalDofIndex()

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::FESystem::getNodeGlobalDofIndex ( ContiguousNodeID  node,
unsigned int  i,
unsigned int  var 
) const
inline

Get the global DOF index of a variable for a node.

Parameters
nodeThe contiguous node ID
iThe node-local DOF index
varThe variable number
Returns
The global DOF index

Definition at line 110 of file KokkosFESystem.h.

113 {
115 }
KOKKOS_FUNCTION dof_id_type getNodeLocalDofIndex(ContiguousNodeID node, unsigned int i, unsigned int var) const
Get the local DOF index of a variable for a node.

◆ getNodeLocalDofIndex()

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::FESystem::getNodeLocalDofIndex ( ContiguousNodeID  node,
unsigned int  i,
unsigned int  var 
) const
inline

Get the local DOF index of a variable for a node.

Parameters
nodeThe contiguous node ID
iThe node-local DOF index
varThe variable number
Returns
The local DOF index

Definition at line 96 of file KokkosFESystem.h.

99 {
100 return _local_node_dof_index[var][node] + i;
101 }
Array< Array< dof_id_type > > _local_node_dof_index
Local nodal DOF indices of each variable.

Referenced by getNodeGlobalDofIndex().

◆ getNumGhostDofs()

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::System::getNumGhostDofs ( ) const
inlineinherited

Get the number of ghost DOFs.

Returns
The number of ghost DOFs

Definition at line 216 of file KokkosSystem.h.

216{ return _num_ghost_dofs; }
const dof_id_type _num_ghost_dofs
Number of ghost DOFs.

◆ getNumLocalDofs()

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::System::getNumLocalDofs ( ) const
inlineinherited

Get the number of local DOFs.

Returns
The number of local DOFs

Definition at line 210 of file KokkosSystem.h.

210{ return _num_local_dofs; }
const dof_id_type _num_local_dofs
Number of local DOFs.

◆ getNumScalarDofs()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::System::getNumScalarDofs ( unsigned int  var) const
inlineinherited

Get the number of DOFs of a scalar variable.

Parameters
varThe variable number
Returns
The number of scalar DOFs

Definition at line 223 of file KokkosSystem.h.

224 {
225 return _scalar_dof_index[var].size();
226 }
Array< Array< dof_id_type > > _scalar_dof_index
DOF indices of each scalar variable.

◆ getScalarCoupling()

KOKKOS_FUNCTION const Array< unsigned int > & Moose::Kokkos::FESystem::getScalarCoupling ( unsigned int  var) const
inline

Get the list of off-diagonal coupled scalar variable numbers of a variable.

Parameters
varThe variable number
Returns
The list of off-diagonal coupled scalar variable numbers

Definition at line 66 of file KokkosFESystem.h.

67 {
68 return _scalar_coupling[var];
69 }
Array< Array< unsigned int > > _scalar_coupling

◆ getScalarGlobalDofIndex()

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::System::getScalarGlobalDofIndex ( unsigned int  i,
unsigned int  var 
) const
inlineinherited

Get the global DOF index of a scalar variable.

Parameters
iThe scalar DOF index
varThe variable number
Returns
The global DOF index

Definition at line 273 of file KokkosSystem.h.

274 {
276 }
KOKKOS_FUNCTION dof_id_type getScalarLocalDofIndex(unsigned int i, unsigned int var) const
Get the local DOF index of a scalar variable.

◆ getScalarLocalDofIndex()

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::System::getScalarLocalDofIndex ( unsigned int  i,
unsigned int  var 
) const
inlineinherited

Get the local DOF index of a scalar variable.

Parameters
iThe scalar DOF index
varThe variable number
Returns
The local DOF index

Definition at line 248 of file KokkosSystem.h.

249 {
250 return _scalar_dof_index[var][i];
251 }

Referenced by Moose::Kokkos::VariableValueTempl< is_ad >::get(), and Moose::Kokkos::System::getScalarGlobalDofIndex().

◆ getSparsity()

const Sparsity & Moose::Kokkos::System::getSparsity ( ) const
inlineinherited

Get the sparisty pattern data.

Returns
The sparisty pattern data

Definition at line 160 of file KokkosSystem.h.

160{ return _sparsity; }
Sparsity _sparsity
Matrix sparsity pattern data.

◆ getSystem() [1/2]

SystemBase & Moose::Kokkos::System::getSystem ( )
inlineinherited

Get the MOOSE system.

Returns
The MOOSE system

Definition at line 128 of file KokkosSystem.h.

128{ return _system; }
SystemBase & _system
Reference of the MOOSE system.

◆ getSystem() [2/2]

const SystemBase & Moose::Kokkos::System::getSystem ( ) const
inlineinherited

Definition at line 129 of file KokkosSystem.h.

129{ return _system; }

◆ getVector()

KOKKOS_FUNCTION Vector & Moose::Kokkos::System::getVector ( TagID  tag) const
inlineinherited

Get a tagged Kokkos vector.

Parameters
tagThe vector tag
Returns
The Kokkos vector

Definition at line 293 of file KokkosSystem.h.

293{ return _vectors[tag]; }
Array< Vector > _vectors
Kokkos vectors and matrices on device.

◆ getVectorDofADValue()

KOKKOS_FUNCTION ADReal Moose::Kokkos::FESystem::getVectorDofADValue ( const dof_id_type  dof,
const TagID  tag,
const Real  seed 
) const
inline

Get the DOF value of a tagged vector for automatic differentiation (AD)

Parameters
dofThe local DOF index
tagThe vector tag
seedThe derivative seed
Returns
The DOF AD value with optional seed derivative

Definition at line 429 of file KokkosFESystem.h.

430{
431 ADReal value = _vectors[tag][dof];
432
433 if (seed != 0)
434 value.derivatives().insert(_local_to_global_dof_index[dof]) = seed;
435
436 return value;
437}
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

Referenced by getVectorQpADGrad(), getVectorQpADGradFace(), getVectorQpADValue(), and getVectorQpADValueFace().

◆ getVectorDofValue()

KOKKOS_FUNCTION Real & Moose::Kokkos::System::getVectorDofValue ( const dof_id_type  dof,
const TagID  tag 
) const
inlineinherited

Get the DOF value of a tagged vector.

Parameters
dofThe local DOF index
tagThe vector tag
Returns
The DOF value

Definition at line 308 of file KokkosSystem.h.

309 {
310 return _vectors[tag][dof];
311 }

Referenced by getVectorQpGradFace(), getVectorQpValueFace(), getVectorQpVectorGradFace(), and getVectorQpVectorValueFace().

◆ getVectorQpADGrad()

KOKKOS_FUNCTION ADReal3 Moose::Kokkos::FESystem::getVectorQpADGrad ( const ElementInfo  info,
const Real33  jacobian,
const dof_id_type  offset,
const dof_id_type  qp,
const unsigned int  var,
const TagID  tag,
const Real  seed 
) const
inline

Get the quadrature point gradient of a variable from a tagged vector for automatic differentiation (AD)

Parameters
infoThe element information object
jacobianThe inverse Jacobian matrix
offsetThe element's offset into the subdomain-local flattened quadrature point index
qpThe local quadrature point index
varThe variable number
tagThe vector tag
seedThe derivative seed
Returns
The quadrature AD gradient

Definition at line 465 of file KokkosFESystem.h.

472{
473 ADReal3 grad;
474
475 if (seed == 0)
476 grad = getVectorQpGrad(info, offset + qp, var, tag);
477 else
478 {
479 auto fe = _var_fe_types[var];
480 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
481 auto & grad_phi = kokkosAssembly().getGradPhi(info.subdomain, info.type, fe);
482
483 for (unsigned int i = 0; i < n_dofs; ++i)
484 grad +=
485 getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) * grad_phi(i, qp);
486
487 grad = jacobian * grad;
488 }
489
490 return grad;
491}
KOKKOS_FUNCTION const Assembly & kokkosAssembly() const
Get the const reference of the Kokkos assembly.
KOKKOS_FUNCTION unsigned int getNumDofs(unsigned int elem_type, unsigned int fe_type) const
Get the number of DOFs of a FE type for an element type.
KOKKOS_FUNCTION const auto & getGradPhi(ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
Get the gradient of shape functions of a FE type for an element type and subdomain.
KOKKOS_FUNCTION ADReal getVectorDofADValue(const dof_id_type dof, const TagID tag, const Real seed) const
Get the DOF value of a tagged vector for automatic differentiation (AD)
KOKKOS_FUNCTION Real3 & getVectorQpGrad(const ElementInfo info, const dof_id_type qp, const unsigned int var, const TagID tag) const
Get the quadrature point gradient of a variable from a tagged vector.
Vector3< ADReal > ADReal3
Definition KokkosTypes.h:33
MPI_Info info

◆ getVectorQpADGradFace()

KOKKOS_FUNCTION ADReal3 Moose::Kokkos::FESystem::getVectorQpADGradFace ( const ElementInfo  info,
const unsigned int  side,
const Real33  jacobian,
const unsigned int  qp,
const unsigned int  var,
const TagID  tag,
const Real  seed 
) const
inline

Get the face quadrature point gradient of a variable from a tagged vector for automatic differentiation (AD)

Parameters
infoThe element information object
sideThe side index
jacobianThe inverse Jacobian matrix
qpThe local quadrature point index
varThe variable number
tagThe vector tag
seedThe derivative seed
Returns
The face quadrature AD gradient

Definition at line 596 of file KokkosFESystem.h.

603{
604 auto fe = _var_fe_types[var];
605 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
606 auto & grad_phi = kokkosAssembly().getGradPhiFace(info.subdomain, info.type, fe)(side);
607
608 ADReal3 grad = ADReal(0);
609
610 for (unsigned int i = 0; i < n_dofs; ++i)
611 grad += getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) * grad_phi(i, qp);
612
613 grad = jacobian * grad;
614
615 return grad;
616}
KOKKOS_FUNCTION const auto & getGradPhiFace(ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
Get the gradient of face shape functions of a FE type for an element type and subdomain.
DualNumber< Real, DNDerivativeType, false > ADReal

Referenced by Moose::Kokkos::VariableGradientTempl< is_ad >::get().

◆ getVectorQpADValue()

KOKKOS_FUNCTION ADReal Moose::Kokkos::FESystem::getVectorQpADValue ( const ElementInfo  info,
const dof_id_type  offset,
const dof_id_type  qp,
const unsigned int  var,
const TagID  tag,
const Real  seed 
) const
inline

Get the quadrature point value of a variable from a tagged vector for automatic differentiation (AD)

Parameters
infoThe element information object
offsetThe element's offset into the subdomain-local flattened quadrature point index
qpThe local quadrature point index
varThe variable number
tagThe vector tag
seedThe derivative seed
Returns
The quadrature AD value

Definition at line 440 of file KokkosFESystem.h.

446{
447 ADReal value = 0;
448
449 if (seed == 0)
450 value = getVectorQpValue(info, offset + qp, var, tag);
451 else
452 {
453 auto fe = _var_fe_types[var];
454 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
455 auto & phi = kokkosAssembly().getPhi(info.subdomain, info.type, fe);
456
457 for (unsigned int i = 0; i < n_dofs; ++i)
458 value += getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) * phi(i, qp);
459 }
460
461 return value;
462}
KOKKOS_FUNCTION const auto & getPhi(ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
Get the shape functions of a FE type for an element type and subdomain.
KOKKOS_FUNCTION Real & getVectorQpValue(const ElementInfo info, const dof_id_type qp, const unsigned int var, const TagID tag) const
Get the quadrature point value of a variable from a tagged vector.

◆ getVectorQpADValueFace()

KOKKOS_FUNCTION ADReal Moose::Kokkos::FESystem::getVectorQpADValueFace ( const ElementInfo  info,
const unsigned int  side,
const unsigned int  qp,
const unsigned int  var,
const TagID  tag,
const Real  seed 
) const
inline

Get the face quadrature point value of a variable from a tagged vector for automatic differentiation (AD)

Parameters
infoThe element information object
sideThe side index
qpThe local quadrature point index
varThe variable number
tagThe vector tag
seedThe derivative seed
Returns
The face quadrature AD value

Definition at line 532 of file KokkosFESystem.h.

538{
539 auto fe = _var_fe_types[var];
540 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
541 auto & phi = kokkosAssembly().getPhiFace(info.subdomain, info.type, fe)(side);
542
543 ADReal value = 0;
544
545 for (unsigned int i = 0; i < n_dofs; ++i)
546 value += getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) * phi(i, qp);
547
548 return value;
549}
KOKKOS_FUNCTION const auto & getPhiFace(ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
Get the face shape functions of a FE type for an element type and subdomain.

◆ getVectorQpGrad()

KOKKOS_FUNCTION Real3 & Moose::Kokkos::FESystem::getVectorQpGrad ( const ElementInfo  info,
const dof_id_type  qp,
const unsigned int  var,
const TagID  tag 
) const
inline

Get the quadrature point gradient of a variable from a tagged vector.

Parameters
infoThe element information object
qpThe subdomain-local flattened quadrature point index
varThe variable number
tagThe vector tag
Returns
The quadrature gradient

Definition at line 178 of file KokkosFESystem.h.

182 {
183 return _qp_solutions_grad[tag](info.subdomain, var)[qp];
184 }
Array< Array2D< Array< Real3 > > > _qp_solutions_grad

Referenced by Moose::Kokkos::VariableGradientTempl< is_ad >::get(), and getVectorQpADGrad().

◆ getVectorQpGradFace()

KOKKOS_FUNCTION Real3 Moose::Kokkos::FESystem::getVectorQpGradFace ( const ElementInfo  info,
const unsigned int  side,
const Real33  jacobian,
const unsigned int  qp,
const unsigned int  var,
const TagID  tag 
) const
inline

Get the face quadrature point gradient of a variable from a tagged vector.

Parameters
infoThe element information object
sideThe side index
jacobianThe inverse Jacobian matrix
qpThe local quadrature point index
varThe variable number
tagThe vector tag
Returns
The face quadrature gradient

Definition at line 552 of file KokkosFESystem.h.

558{
559 auto fe = _var_fe_types[var];
560 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
561 auto & grad_phi = kokkosAssembly().getGradPhiFace(info.subdomain, info.type, fe)(side);
562
563 Real3 grad = 0;
564
565 for (unsigned int i = 0; i < n_dofs; ++i)
566 grad += getVectorDofValue(getElemLocalDofIndex(info.id, i, var), tag) * grad_phi(i, qp);
567
568 grad = jacobian * grad;
569
570 return grad;
571}
KOKKOS_FUNCTION Real & getVectorDofValue(const dof_id_type dof, const TagID tag) const
Get the DOF value of a tagged vector.
Vector3< Real > Real3
Definition KokkosTypes.h:32

Referenced by Moose::Kokkos::VariableGradientTempl< is_ad >::get().

◆ getVectorQpValue()

KOKKOS_FUNCTION Real & Moose::Kokkos::FESystem::getVectorQpValue ( const ElementInfo  info,
const dof_id_type  qp,
const unsigned int  var,
const TagID  tag 
) const
inline

Get the quadrature point value of a variable from a tagged vector.

Parameters
infoThe element information object
qpThe subdomain-local flattened quadrature point index
varThe variable number
tagThe vector tag
Returns
The quadrature value

Definition at line 146 of file KokkosFESystem.h.

150 {
151 return _qp_solutions[tag](info.subdomain, var)[qp];
152 }
Array< Array2D< Array< Real > > > _qp_solutions
Cached elemental quadrature values and gradients.

Referenced by getVectorQpADValue().

◆ getVectorQpValueFace()

KOKKOS_FUNCTION Real Moose::Kokkos::FESystem::getVectorQpValueFace ( const ElementInfo  info,
const unsigned int  side,
const unsigned int  qp,
const unsigned int  var,
const TagID  tag 
) const
inline

Get the face quadrature point value of a variable from a tagged vector.

Parameters
infoThe element information object
sideThe side index
qpThe local quadrature point index
varThe variable number
tagThe vector tag
Returns
The face quadrature value

Definition at line 494 of file KokkosFESystem.h.

499{
500 auto fe = _var_fe_types[var];
501 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
502 auto & phi = kokkosAssembly().getPhiFace(info.subdomain, info.type, fe)(side);
503
504 Real value = 0;
505
506 for (unsigned int i = 0; i < n_dofs; ++i)
507 value += getVectorDofValue(getElemLocalDofIndex(info.id, i, var), tag) * phi(i, qp);
508
509 return value;
510}
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ getVectorQpVectorCurl()

KOKKOS_FUNCTION Real3 & Moose::Kokkos::FESystem::getVectorQpVectorCurl ( const ElementInfo  info,
const dof_id_type  qp,
const unsigned int  var,
const TagID  tag 
) const
inline

Get the quadrature point curl of a vector variable from a tagged vector.

Parameters
infoThe element information object
qpThe subdomain-local flattened quadrature point index
varThe variable number
tagThe vector tag
Returns
The quadrature vector curl

Definition at line 223 of file KokkosFESystem.h.

227 {
228 return _qp_vector_solutions_curl[tag](info.subdomain, var)[qp];
229 }
Array< Array2D< Array< Real3 > > > _qp_vector_solutions_curl

◆ getVectorQpVectorGrad()

KOKKOS_FUNCTION Real33 & Moose::Kokkos::FESystem::getVectorQpVectorGrad ( const ElementInfo  info,
const dof_id_type  qp,
const unsigned int  var,
const TagID  tag 
) const
inline

Get the quadrature point gradient of a vector variable from a tagged vector.

Parameters
infoThe element information object
qpThe subdomain-local flattened quadrature point index
varThe variable number
tagThe vector tag
Returns
The quadrature vector gradient

Definition at line 208 of file KokkosFESystem.h.

212 {
213 return _qp_vector_solutions_grad[tag](info.subdomain, var)[qp];
214 }
Array< Array2D< Array< Real33 > > > _qp_vector_solutions_grad

◆ getVectorQpVectorGradFace()

KOKKOS_FUNCTION Real33 Moose::Kokkos::FESystem::getVectorQpVectorGradFace ( const ElementInfo  info,
const unsigned int  side,
const Real33  jacobian,
const unsigned int  qp,
const unsigned int  var,
const TagID  tag 
) const
inline

Get the face quadrature point gradient of a vector variable from a tagged vector.

Parameters
infoThe element information object
sideThe side index
jacobianThe inverse Jacobian matrix
qpThe local quadrature point index
varThe variable number
tagThe vector tag
Returns
The face quadrature vector gradient

Definition at line 574 of file KokkosFESystem.h.

580{
581 auto fe = _var_fe_types[var];
582 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
583 auto & grad_phi = kokkosAssembly().getVectorGradPhiFace(info.subdomain, info.type, fe)(side);
584
585 Real33 grad = 0;
586
587 for (unsigned int i = 0; i < n_dofs; ++i)
588 grad += getVectorDofValue(getElemLocalDofIndex(info.id, i, var), tag) * grad_phi(i, qp);
589
590 grad = grad * jacobian.transpose();
591
592 return grad;
593}
KOKKOS_FUNCTION const auto & getVectorGradPhiFace(ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
Get the gradient of face vector shape functions of a FE type for an element type and subdomain.

◆ getVectorQpVectorValue()

KOKKOS_FUNCTION Real3 & Moose::Kokkos::FESystem::getVectorQpVectorValue ( const ElementInfo  info,
const dof_id_type  qp,
const unsigned int  var,
const TagID  tag 
) const
inline

Get the quadrature point value of a vector variable from a tagged vector.

Parameters
infoThe element information object
qpThe subdomain-local flattened quadrature point index
varThe variable number
tagThe vector tag
Returns
The quadrature vector value

Definition at line 193 of file KokkosFESystem.h.

197 {
198 return _qp_vector_solutions[tag](info.subdomain, var)[qp];
199 }
Array< Array2D< Array< Real3 > > > _qp_vector_solutions

◆ getVectorQpVectorValueFace()

KOKKOS_FUNCTION Real3 Moose::Kokkos::FESystem::getVectorQpVectorValueFace ( const ElementInfo  info,
const unsigned int  side,
const unsigned int  qp,
const unsigned int  var,
const TagID  tag 
) const
inline

Get the face quadrature point value of a vector variable from a tagged vector.

Parameters
infoThe element information object
sideThe side index
qpThe local quadrature point index
varThe variable number
tagThe vector tag
Returns
The face quadrature vector value

Definition at line 513 of file KokkosFESystem.h.

518{
519 auto fe = _var_fe_types[var];
520 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
521 auto & phi = kokkosAssembly().getVectorPhiFace(info.subdomain, info.type, fe)(side);
522
523 Real3 value = 0;
524
525 for (unsigned int i = 0; i < n_dofs; ++i)
526 value += getVectorDofValue(getElemLocalDofIndex(info.id, i, var), tag) * phi(i, qp);
527
528 return value;
529}
KOKKOS_FUNCTION const auto & getVectorPhiFace(ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
Get the face vector shape functions of a FE type for an element type and subdomain.

◆ hasNodalBCMatrixTag()

KOKKOS_FUNCTION bool Moose::Kokkos::FESystem::hasNodalBCMatrixTag ( dof_id_type  dof,
TagID  tag 
) const
inline

Check whether a local DOF index is associated with a nodal BC for an extra matrix tag.

Parameters
dofThe local DOF index
tagThe extra matrix tag
Returns
Whether the local DOF index is covered by a nodal BC

Definition at line 77 of file KokkosFESystem.h.

78 {
79 return _nbc_matrix_tag_dof[tag].isAlloc() && _nbc_matrix_tag_dof[tag][dof];
80 }
Array< Array< bool > > _nbc_matrix_tag_dof
Per-matrix-tag local-plus-ghost DOF masks for nodal BC coverage.

◆ isMatrixTagActive()

KOKKOS_FUNCTION bool Moose::Kokkos::System::isMatrixTagActive ( TagID  tag) const
inlineinherited

Check whether a matrix tag is active.

Parameters
tagThe matrix tag
Returns
Whether the matrix tag is active

Definition at line 204 of file KokkosSystem.h.

204{ return _matrix_tag_active[tag]; }

◆ isNodalDefined()

KOKKOS_FUNCTION bool Moose::Kokkos::FESystem::isNodalDefined ( ContiguousNodeID  node,
unsigned int  var 
) const
inline

Get whether a variable is defined on a node.

Parameters
nodeThe contiguous node ID
varThe variable number
Returns
Whether the variable is defined on the node

Definition at line 123 of file KokkosFESystem.h.

124 {
126 }
static constexpr dof_id_type invalid_id

◆ isResidualTagActive()

KOKKOS_FUNCTION bool Moose::Kokkos::System::isResidualTagActive ( TagID  tag) const
inlineinherited

Check whether a residual tag is active.

Parameters
tagThe residual tag
Returns
Whether the residual tag is active

Definition at line 197 of file KokkosSystem.h.

197{ return _residual_tag_active[tag]; }

◆ isScalarVariable()

KOKKOS_FUNCTION bool Moose::Kokkos::System::isScalarVariable ( unsigned int  var) const
inlineinherited

Check whether a variable is scalar.

Parameters
varThe variable number
Returns
Whether the variable is scalar

Definition at line 179 of file KokkosSystem.h.

179{ return _var_is_scalar[var]; }
Array< bool > _var_is_scalar
Whether each variable is scalar.

◆ isVariableActive()

KOKKOS_FUNCTION bool Moose::Kokkos::System::isVariableActive ( unsigned int  var,
ContiguousSubdomainID  subdomain 
) const
inlineinherited

Check whether a variable is active on a subdomain.

Parameters
varThe variable number
subdomainThe contiguous subdomain ID
Returns
Whether the variable is active

Definition at line 187 of file KokkosSystem.h.

188 {
189 return _var_subdomain_active(var, subdomain);
190 }
Array2D< bool > _var_subdomain_active
Whether each variable is active on subdomains.

◆ kokkosAssembly()

KOKKOS_FUNCTION const Assembly & Moose::Kokkos::AssemblyHolder::kokkosAssembly ( ) const
inlineinherited

Get the const reference of the Kokkos assembly.

Returns
The const reference of the Kokkos assembly depending on the architecture this function is being called on

Definition at line 634 of file KokkosAssembly.h.

635 {
636 KOKKOS_IF_ON_HOST(return _assembly_host;)
637
638 return _assembly_device;
639 }
const Assembly _assembly_device
Device copy of the Kokkos assembly.
const Assembly & _assembly_host
Host reference of the Kokkos assembly.

Referenced by getVectorQpADGrad(), getVectorQpADGradFace(), getVectorQpADValue(), getVectorQpADValueFace(), getVectorQpGradFace(), getVectorQpValueFace(), getVectorQpVectorGradFace(), getVectorQpVectorValueFace(), Moose::Kokkos::ElementUserObject::operator()(), Moose::Kokkos::NodalUserObject::operator()(), Moose::Kokkos::SideUserObject::operator()(), Moose::Kokkos::Material::operator()(), Moose::Kokkos::Material::operator()(), Moose::Kokkos::AuxKernel::operator()(), Moose::Kokkos::IntegratedBC::operator()(), Moose::Kokkos::NodalBC::operator()(), Moose::Kokkos::VectorIntegratedBC::operator()(), Moose::Kokkos::VectorNodalBC::operator()(), Moose::Kokkos::Kernel::operator()(), Moose::Kokkos::VectorKernel::operator()(), Moose::Kokkos::NodalKernel::operator()(), Moose::Kokkos::Material::operator()(), Moose::Kokkos::Material::operator()(), Moose::Kokkos::AuxKernel::operator()(), Moose::Kokkos::IntegratedBC::operator()(), Moose::Kokkos::NodalBC::operator()(), Moose::Kokkos::VectorIntegratedBC::operator()(), Moose::Kokkos::VectorNodalBC::operator()(), Moose::Kokkos::Kernel::operator()(), Moose::Kokkos::VectorKernel::operator()(), Moose::Kokkos::NodalKernel::operator()(), Moose::Kokkos::IntegratedBC::operator()(), Moose::Kokkos::Kernel::operator()(), Moose::Kokkos::ElementReducer::operator()(), Moose::Kokkos::NodalReducer::operator()(), Moose::Kokkos::SideReducer::operator()(), Moose::Kokkos::ADIntegratedBC::operator()(), Moose::Kokkos::ADNodalBC::operator()(), Moose::Kokkos::IntegratedBC::operator()(), Moose::Kokkos::NodalBC::operator()(), Moose::Kokkos::VectorIntegratedBC::operator()(), Moose::Kokkos::VectorNodalBC::operator()(), Moose::Kokkos::ADKernel::operator()(), Moose::Kokkos::Kernel::operator()(), Moose::Kokkos::VectorKernel::operator()(), Moose::Kokkos::NodalKernel::operator()(), Moose::Kokkos::Material::operator()(), and Moose::Kokkos::Material::operator()().

◆ kokkosMesh()

KOKKOS_FUNCTION const Mesh & Moose::Kokkos::MeshHolder::kokkosMesh ( ) const
inlineinherited

Get the const reference of the Kokkos mesh.

Returns
The const reference of the Kokkos mesh depending on the architecture this function is being called on

Definition at line 651 of file KokkosMesh.h.

652 {
653 KOKKOS_IF_ON_HOST(
655 "kokkosMesh() was called too early. Kokkos mesh is available after problem "
656 "initialization. Override initialSetup() if you need to setup your object data "
657 "using the Kokkos mesh.");
658
659 return _mesh_host;)
660
661 return _mesh_device;
662 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
const Mesh & _mesh_host
Host reference of the Kokkos mesh.
Definition KokkosMesh.h:669
const Mesh _mesh_device
Device copy of the Kokkos mesh.
Definition KokkosMesh.h:673
bool initialized() const
Get whether the mesh was initialized.
Definition KokkosMesh.h:68

Referenced by Moose::Kokkos::Assembly::computePhysicalMap(), Moose::Kokkos::Assembly::computePhysicalMap(), Moose::Kokkos::LinearFVFluxKernel::operator()(), Moose::Kokkos::LinearFVBoundaryCondition::operator()(), Moose::Kokkos::LinearFVFluxKernel::operator()(), Moose::Kokkos::LinearFVBoundaryCondition::operator()(), Moose::Kokkos::LinearFVFluxKernel::operator()(), Moose::Kokkos::LinearFVFluxKernel::operator()(), Moose::Kokkos::LinearFVElementalKernel::operator()(), Moose::Kokkos::IntegratedBC::operator()(), Moose::Kokkos::VectorIntegratedBC::operator()(), Moose::Kokkos::Kernel::operator()(), Moose::Kokkos::VectorKernel::operator()(), Moose::Kokkos::IntegratedBC::operator()(), Moose::Kokkos::Kernel::operator()(), Moose::Kokkos::LinearFVElementalKernel::operator()(), Moose::Kokkos::Datum::q_point(), and KokkosBoundNodalKernel::skipOnBoundary().

◆ localToGlobalDofIndex()

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::System::localToGlobalDofIndex ( dof_id_type  dof) const
inlineinherited

Get the global DOF index of a local DOF index.

Parameters
dofThe local DOF index
Returns
The global DOF index

Definition at line 283 of file KokkosSystem.h.

284 {
285 return _local_to_global_dof_index[dof];
286 }

◆ operator()()

KOKKOS_FUNCTION void Moose::Kokkos::FESystem::operator() ( const ThreadID  tid) const

Kokkos function for caching variable values on element quadrature points.

◆ perfGraph()

PerfGraph & PerfGraphInterface::perfGraph ( )
inherited

Get the PerfGraph.

Definition at line 86 of file PerfGraphInterface.C.

87{
88 return _pg_moose_app.perfGraph();
89}
PerfGraph & perfGraph()
Get the PerfGraph for this app.
Definition MooseApp.h:179
MooseApp & _pg_moose_app
The MooseApp that owns the PerfGraph.

Referenced by CommonOutputAction::act(), PerfGraphData::finalize(), PerfGraphReporter::finalize(), and PerfGraphOutput::output().

◆ registerTimedSection() [1/2]

PerfID PerfGraphInterface::registerTimedSection ( const std::string &  section_name,
const unsigned int  level 
) const
protectedinherited

Call to register a named section for timing.

Parameters
section_nameThe name of the code section to be timed
levelThe importance of the timer - lower is more important (0 will always come out)
Returns
The ID of the section - use when starting timing

Definition at line 61 of file PerfGraphInterface.C.

63{
64 const auto timed_section_name = timedSectionName(section_name);
65 if (!moose::internal::getPerfGraphRegistry().sectionExists(timed_section_name))
66 return moose::internal::getPerfGraphRegistry().registerSection(timed_section_name, level);
67 else
68 return moose::internal::getPerfGraphRegistry().sectionID(timed_section_name);
69}
std::string timedSectionName(const std::string &section_name) const
PerfID sectionID(const std::string &section_name) const
Given a name return the PerfID @section_name The name of the section.
PerfID registerSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
PerfGraphRegistry & getPerfGraphRegistry()
Get the global PerfGraphRegistry singleton.

◆ registerTimedSection() [2/2]

PerfID PerfGraphInterface::registerTimedSection ( const std::string &  section_name,
const unsigned int  level,
const std::string &  live_message,
const bool  print_dots = true 
) const
protectedinherited

Call to register a named section for timing.

Parameters
section_nameThe name of the code section to be timed
levelThe importance of the timer - lower is more important (0 will always come out)
live_messageThe message to be printed to the screen during execution
print_dotsWhether or not progress dots should be printed for this section
Returns
The ID of the section - use when starting timing

Definition at line 72 of file PerfGraphInterface.C.

76{
77 const auto timed_section_name = timedSectionName(section_name);
78 if (!moose::internal::getPerfGraphRegistry().sectionExists(timed_section_name))
80 timedSectionName(section_name), level, live_message, print_dots);
81 else
82 return moose::internal::getPerfGraphRegistry().sectionID(timed_section_name);
83}

◆ reinit()

void Moose::Kokkos::FESystem::reinit ( )

Allocate the quadrature point vectors for active variable and tags and cache quadrature point values.

◆ setActiveMatrixTags()

void Moose::Kokkos::System::setActiveMatrixTags ( const std::set< TagID > &  tags)
inherited

Set the active matrix tags.

Parameters
varsThe active matrix tags

◆ setActiveResidualTags()

void Moose::Kokkos::System::setActiveResidualTags ( const std::set< TagID > &  tags)
inherited

Set the active residual tags.

Parameters
tagsThe active residual tags

◆ setActiveSolutionTags()

void Moose::Kokkos::System::setActiveSolutionTags ( const std::set< TagID > &  tags)
inherited

Set the active solution tags.

Parameters
tagsThe active solution tags

◆ setActiveVariables()

void Moose::Kokkos::System::setActiveVariables ( const std::set< MooseVariableFieldBase * > &  vars)
inherited

Set the active variables.

Parameters
varsThe active MOOSE variables

◆ setupCoupling()

void Moose::Kokkos::FESystem::setupCoupling ( )
private

Setup coupling data between variables.

◆ setupDofs()

void Moose::Kokkos::FESystem::setupDofs ( )
private

Setup DOF data.

◆ setupNodalBCDofs()

void Moose::Kokkos::FESystem::setupNodalBCDofs ( )
private

Mark the DOFs covered by nodal BCs.

◆ setupSparsity()

void Moose::Kokkos::System::setupSparsity ( )
privateinherited

Setup sparsity data.

◆ setupVariables()

void Moose::Kokkos::FESystem::setupVariables ( )
private

Setup variable data.

◆ sync() [1/4]

void Moose::Kokkos::System::sync ( const MemcpyType  dir)
inherited

Synchronize the active tagged vectors and matrices between host and device.

Parameters
dirCopy direction

◆ sync() [2/4]

void Moose::Kokkos::System::sync ( const std::set< TagID > &  tags,
const MemcpyType  dir 
)
inherited

Synchronize the specified tagged vectors between host and device.

Parameters
tagsThe vector tags
dirCopy direction

◆ sync() [3/4]

void Moose::Kokkos::System::sync ( const std::vector< TagID > &  tags,
const MemcpyType  dir 
)
inherited

◆ sync() [4/4]

void Moose::Kokkos::System::sync ( const TagID  tag,
const MemcpyType  dir 
)
inherited

◆ timedSectionName()

std::string PerfGraphInterface::timedSectionName ( const std::string &  section_name) const
protectedinherited
Returns
The name of the timed section with the name section_name.

Optionally adds a prefix if one is defined.

Definition at line 55 of file PerfGraphInterface.C.

56{
57 return _prefix.empty() ? "" : (_prefix + "::") + section_name;
58}
const std::string _prefix
A prefix to use for all sections.

Referenced by PerfGraphInterface::registerTimedSection(), and PerfGraphInterface::registerTimedSection().

◆ validParams()

InputParameters PerfGraphInterface::validParams ( )
staticinherited

Definition at line 16 of file PerfGraphInterface.C.

17{
19 return params;
20}
InputParameters emptyInputParameters()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.

Referenced by Convergence::validParams().

Member Data Documentation

◆ _active_matrix_tags

Array<TagID> Moose::Kokkos::System::_active_matrix_tags
protectedinherited

Definition at line 412 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::clearActiveMatrixTags().

◆ _active_residual_tags

Array<TagID> Moose::Kokkos::System::_active_residual_tags
protectedinherited

Definition at line 411 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::clearActiveResidualTags().

◆ _active_solution_tags

Array<TagID> Moose::Kokkos::System::_active_solution_tags
protectedinherited

List of active tags.

Definition at line 410 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::clearActiveSolutionTags().

◆ _active_variables

Array<unsigned int> Moose::Kokkos::System::_active_variables
protectedinherited

List of active variable numbers.

Definition at line 404 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::clearActiveVariables().

◆ _assembly_device

const Assembly Moose::Kokkos::AssemblyHolder::_assembly_device
privateinherited

Device copy of the Kokkos assembly.

Definition at line 650 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::AssemblyHolder::kokkosAssembly().

◆ _assembly_host

const Assembly& Moose::Kokkos::AssemblyHolder::_assembly_host
privateinherited

Host reference of the Kokkos assembly.

Definition at line 646 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::AssemblyHolder::kokkosAssembly().

◆ _comm

const Parallel::Communicator& Moose::Kokkos::System::_comm
protectedinherited

Reference of the libMesh communicator.

Definition at line 346 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::getComm().

◆ _dof_map

const libMesh::DofMap& Moose::Kokkos::System::_dof_map
protectedinherited

Reference of the libMesh DOF map.

Definition at line 341 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::getDofMap().

◆ _field_coupling

Array<Array<unsigned int> > Moose::Kokkos::FESystem::_field_coupling
private

Off-diagonal coupled field and scalar variable numbers of each variable.

Definition at line 416 of file KokkosFESystem.h.

Referenced by getFieldCoupling().

◆ _ghost_comm_list

Array<Array<dof_id_type> > Moose::Kokkos::System::_ghost_comm_list
protectedinherited

Definition at line 428 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::getGhostCommList().

◆ _local_comm_list

Array<Array<dof_id_type> > Moose::Kokkos::System::_local_comm_list
protectedinherited

List of DOFs to send and receive.

Definition at line 427 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::getLocalCommList().

◆ _local_elem_dof_index

Array<Array2D<dof_id_type> > Moose::Kokkos::System::_local_elem_dof_index
protectedinherited

Local element DOF indices of each variable.

Definition at line 374 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::getElemLocalDofIndex().

◆ _local_node_dof_index

Array<Array<dof_id_type> > Moose::Kokkos::FESystem::_local_node_dof_index
private

Local nodal DOF indices of each variable.

Definition at line 400 of file KokkosFESystem.h.

Referenced by getNodeLocalDofIndex(), and isNodalDefined().

◆ _local_to_global_dof_index

Array<dof_id_type> Moose::Kokkos::System::_local_to_global_dof_index
protectedinherited

◆ _matrices

Array<Matrix> Moose::Kokkos::System::_matrices
protectedinherited

◆ _matrix_tag_active

Array<bool> Moose::Kokkos::System::_matrix_tag_active
protectedinherited

◆ _max_dofs_per_elem

Array<unsigned int> Moose::Kokkos::System::_max_dofs_per_elem
protectedinherited

Maximum number of DOFs per element for each variable.

Definition at line 389 of file KokkosSystem.h.

◆ _mesh

const MooseMesh& Moose::Kokkos::System::_mesh
protectedinherited

Reference of the MOOSE mesh.

Definition at line 336 of file KokkosSystem.h.

◆ _mesh_device

const Mesh Moose::Kokkos::MeshHolder::_mesh_device
privateinherited

Device copy of the Kokkos mesh.

Definition at line 673 of file KokkosMesh.h.

Referenced by Moose::Kokkos::MeshHolder::kokkosMesh().

◆ _mesh_host

const Mesh& Moose::Kokkos::MeshHolder::_mesh_host
privateinherited

Host reference of the Kokkos mesh.

Definition at line 669 of file KokkosMesh.h.

Referenced by Moose::Kokkos::MeshHolder::kokkosMesh().

◆ _nbc_matrix_tag_dof

Array<Array<bool> > Moose::Kokkos::FESystem::_nbc_matrix_tag_dof
private

Per-matrix-tag local-plus-ghost DOF masks for nodal BC coverage.

Definition at line 423 of file KokkosFESystem.h.

Referenced by hasNodalBCMatrixTag().

◆ _num_ghost_dofs

const dof_id_type Moose::Kokkos::System::_num_ghost_dofs
protectedinherited

Number of ghost DOFs.

Definition at line 361 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::getNumGhostDofs().

◆ _num_local_dofs

const dof_id_type Moose::Kokkos::System::_num_local_dofs
protectedinherited

Number of local DOFs.

Definition at line 356 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::getNumLocalDofs().

◆ _num_vars

const unsigned int Moose::Kokkos::System::_num_vars
protectedinherited

Number of variables.

Definition at line 351 of file KokkosSystem.h.

◆ _pg_moose_app

MooseApp& PerfGraphInterface::_pg_moose_app
protectedinherited

The MooseApp that owns the PerfGraph.

Definition at line 135 of file PerfGraphInterface.h.

Referenced by PerfGraphInterface::perfGraph().

◆ _prefix

const std::string PerfGraphInterface::_prefix
protectedinherited

A prefix to use for all sections.

Definition at line 138 of file PerfGraphInterface.h.

Referenced by PerfGraphInterface::timedSectionName().

◆ _qp_solutions

Array<Array2D<Array<Real> > > Moose::Kokkos::FESystem::_qp_solutions
private

Cached elemental quadrature values and gradients.

Definition at line 390 of file KokkosFESystem.h.

Referenced by getVectorQpValue().

◆ _qp_solutions_grad

Array<Array2D<Array<Real3> > > Moose::Kokkos::FESystem::_qp_solutions_grad
private

Definition at line 391 of file KokkosFESystem.h.

Referenced by getVectorQpGrad().

◆ _qp_vector_solutions

Array<Array2D<Array<Real3> > > Moose::Kokkos::FESystem::_qp_vector_solutions
private

Definition at line 392 of file KokkosFESystem.h.

Referenced by getVectorQpVectorValue().

◆ _qp_vector_solutions_curl

Array<Array2D<Array<Real3> > > Moose::Kokkos::FESystem::_qp_vector_solutions_curl
private

Definition at line 394 of file KokkosFESystem.h.

Referenced by getVectorQpVectorCurl().

◆ _qp_vector_solutions_grad

Array<Array2D<Array<Real33> > > Moose::Kokkos::FESystem::_qp_vector_solutions_grad
private

Definition at line 393 of file KokkosFESystem.h.

Referenced by getVectorQpVectorGrad().

◆ _residual_tag_active

Array<bool> Moose::Kokkos::System::_residual_tag_active
protectedinherited

Flag whether each tag is active.

Definition at line 419 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::clearActiveResidualTags(), and Moose::Kokkos::System::isResidualTagActive().

◆ _scalar_coupling

Array<Array<unsigned int> > Moose::Kokkos::FESystem::_scalar_coupling
private

Definition at line 417 of file KokkosFESystem.h.

Referenced by getScalarCoupling().

◆ _scalar_dof_index

Array<Array<dof_id_type> > Moose::Kokkos::System::_scalar_dof_index
protectedinherited

DOF indices of each scalar variable.

Definition at line 379 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::getNumScalarDofs(), and Moose::Kokkos::System::getScalarLocalDofIndex().

◆ _sparsity

Sparsity Moose::Kokkos::System::_sparsity
privateinherited

Matrix sparsity pattern data.

Definition at line 450 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::getSparsity().

◆ _system

SystemBase& Moose::Kokkos::System::_system
protectedinherited

Reference of the MOOSE system.

Definition at line 331 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::getSystem(), and Moose::Kokkos::System::getSystem().

◆ _thread

Thread Moose::Kokkos::FESystem::_thread
private

Kokkos thread object.

Definition at line 384 of file KokkosFESystem.h.

◆ _var_fe_types

Array<unsigned int> Moose::Kokkos::FESystem::_var_fe_types
private

◆ _var_is_scalar

Array<bool> Moose::Kokkos::System::_var_is_scalar
protectedinherited

Whether each variable is scalar.

Definition at line 394 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::isScalarVariable().

◆ _var_is_vector

Array<bool> Moose::Kokkos::FESystem::_var_is_vector
private

Whether each variable is vector-valued.

Definition at line 410 of file KokkosFESystem.h.

◆ _var_subdomain_active

Array2D<bool> Moose::Kokkos::System::_var_subdomain_active
protectedinherited

Whether each variable is active on subdomains.

Definition at line 399 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::isVariableActive().

◆ _vectors

Array<Vector> Moose::Kokkos::System::_vectors
protectedinherited

Kokkos vectors and matrices on device.

Definition at line 367 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::getVector(), getVectorDofADValue(), and Moose::Kokkos::System::getVectorDofValue().


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