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 auto & getCoupling (unsigned int var) const
 Get the list of off-diagonal coupled 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 Real3getVectorQpGrad (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 Real3getVectorQpVectorValue (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 Real33getVectorQpVectorGrad (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 Real3getVectorQpVectorCurl (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::DofMapgetDofMap () const
 Get the libMesh DOF map.
 
const Parallel::CommunicatorgetComm () 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 SparsitygetSparsity () const
 Get the sparisty pattern data.
 
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 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 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 localToGlobalDofIndex (dof_id_type dof) const
 Get the global DOF index of a local DOF index.
 
KOKKOS_FUNCTION VectorgetVector (TagID tag) const
 Get a tagged Kokkos vector.
 
KOKKOS_FUNCTION MatrixgetMatrix (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.
 
PerfGraphperfGraph ()
 Get the PerfGraph.
 
KOKKOS_FUNCTION const MeshkokkosMesh () const
 Get the const reference of the Kokkos mesh.
 
KOKKOS_FUNCTION const AssemblykokkosAssembly () 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)
 
SystemBasegetSystem ()
 Get the MOOSE system.
 
const SystemBasegetSystem () 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< 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.
 
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< unsigned int > > _coupling
 Off-diagonal coupled variable numbers of each variable.
 
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
 

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

◆ clearActiveMatrixTags()

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

Clear the cached active matrix tags.

Definition at line 118 of file KokkosSystem.h.

119 {
121 _matrix_tag_active = false;
122 }
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 109 of file KokkosSystem.h.

110 {
112 _residual_tag_active = false;
113 }
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 104 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 99 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 143 of file KokkosSystem.h.

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

◆ getCoupling()

KOKKOS_FUNCTION const auto & Moose::Kokkos::FESystem::getCoupling ( unsigned int  var) const
inline

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

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

Definition at line 56 of file KokkosFESystem.h.

56{ return _coupling[var]; }
Array< Array< unsigned int > > _coupling
Off-diagonal coupled variable numbers of each variable.

◆ getDofMap()

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

Get the libMesh DOF map.

Returns
The libMesh DOF map

Definition at line 137 of file KokkosSystem.h.

137{ 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 221 of file KokkosSystem.h.

224 {
226 }
Array< dof_id_type > _local_to_global_dof_index
Map from local DOF index to global DOF index.
Array< Array2D< dof_id_type > > _local_elem_dof_index
Local element DOF indices of each variable.

◆ 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 207 of file KokkosSystem.h.

210 {
211 return _local_elem_dof_index[var](i, elem);
212 }

Referenced by 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 74 of file KokkosFESystem.h.

74{ return _var_fe_types[var]; }
Array< unsigned int > _var_fe_types
FE type ID 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 155 of file KokkosSystem.h.

155{ 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 149 of file KokkosSystem.h.

149{ 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 250 of file KokkosSystem.h.

250{ 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 270 of file KokkosSystem.h.

271 {
272 return _matrices[tag](row, col);
273 }

◆ 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 97 of file KokkosFESystem.h.

100 {
102 }
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 83 of file KokkosFESystem.h.

86 {
87 return _local_node_dof_index[var][node] + i;
88 }
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 198 of file KokkosSystem.h.

198{ 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 192 of file KokkosSystem.h.

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

◆ getSparsity()

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

Get the sparisty pattern data.

Returns
The sparisty pattern data

Definition at line 161 of file KokkosSystem.h.

161{ 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 129 of file KokkosSystem.h.

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

◆ getSystem() [2/2]

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

Definition at line 130 of file KokkosSystem.h.

130{ 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 243 of file KokkosSystem.h.

243{ 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 413 of file KokkosFESystem.h.

414{
415 ADReal value = _vectors[tag][dof];
416
417 if (seed != 0)
418 value.derivatives().insert(_local_to_global_dof_index[dof]) = seed;
419
420 return value;
421}
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 258 of file KokkosSystem.h.

259 {
260 return _vectors[tag][dof];
261 }

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 449 of file KokkosFESystem.h.

456{
457 ADReal3 grad;
458
459 if (seed == 0)
460 grad = getVectorQpGrad(info, offset + qp, var, tag);
461 else
462 {
463 auto fe = _var_fe_types[var];
464 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
465 auto & grad_phi = kokkosAssembly().getGradPhi(info.subdomain, info.type, fe);
466
467 for (unsigned int i = 0; i < n_dofs; ++i)
468 grad +=
469 getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) * grad_phi(i, qp);
470
471 grad = jacobian * grad;
472 }
473
474 return grad;
475}
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.
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.
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 580 of file KokkosFESystem.h.

587{
588 auto fe = _var_fe_types[var];
589 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
590 auto & grad_phi = kokkosAssembly().getGradPhiFace(info.subdomain, info.type, fe)(side);
591
592 ADReal3 grad = ADReal(0);
593
594 for (unsigned int i = 0; i < n_dofs; ++i)
595 grad += getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) * grad_phi(i, qp);
596
597 grad = jacobian * grad;
598
599 return grad;
600}
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 424 of file KokkosFESystem.h.

430{
431 ADReal value = 0;
432
433 if (seed == 0)
434 value = getVectorQpValue(info, offset + qp, var, tag);
435 else
436 {
437 auto fe = _var_fe_types[var];
438 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
439 auto & phi = kokkosAssembly().getPhi(info.subdomain, info.type, fe);
440
441 for (unsigned int i = 0; i < n_dofs; ++i)
442 value += getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) * phi(i, qp);
443 }
444
445 return value;
446}
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 516 of file KokkosFESystem.h.

522{
523 auto fe = _var_fe_types[var];
524 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
525 auto & phi = kokkosAssembly().getPhiFace(info.subdomain, info.type, fe)(side);
526
527 ADReal value = 0;
528
529 for (unsigned int i = 0; i < n_dofs; ++i)
530 value += getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) * phi(i, qp);
531
532 return value;
533}
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 165 of file KokkosFESystem.h.

169 {
170 return _qp_solutions_grad[tag](info.subdomain, var)[qp];
171 }
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 536 of file KokkosFESystem.h.

542{
543 auto fe = _var_fe_types[var];
544 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
545 auto & grad_phi = kokkosAssembly().getGradPhiFace(info.subdomain, info.type, fe)(side);
546
547 Real3 grad = 0;
548
549 for (unsigned int i = 0; i < n_dofs; ++i)
550 grad += getVectorDofValue(getElemLocalDofIndex(info.id, i, var), tag) * grad_phi(i, qp);
551
552 grad = jacobian * grad;
553
554 return grad;
555}
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 133 of file KokkosFESystem.h.

137 {
138 return _qp_solutions[tag](info.subdomain, var)[qp];
139 }
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 478 of file KokkosFESystem.h.

483{
484 auto fe = _var_fe_types[var];
485 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
486 auto & phi = kokkosAssembly().getPhiFace(info.subdomain, info.type, fe)(side);
487
488 Real value = 0;
489
490 for (unsigned int i = 0; i < n_dofs; ++i)
491 value += getVectorDofValue(getElemLocalDofIndex(info.id, i, var), tag) * phi(i, qp);
492
493 return value;
494}
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 210 of file KokkosFESystem.h.

214 {
215 return _qp_vector_solutions_curl[tag](info.subdomain, var)[qp];
216 }
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 195 of file KokkosFESystem.h.

199 {
200 return _qp_vector_solutions_grad[tag](info.subdomain, var)[qp];
201 }
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 558 of file KokkosFESystem.h.

564{
565 auto fe = _var_fe_types[var];
566 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
567 auto & grad_phi = kokkosAssembly().getVectorGradPhiFace(info.subdomain, info.type, fe)(side);
568
569 Real33 grad = 0;
570
571 for (unsigned int i = 0; i < n_dofs; ++i)
572 grad += getVectorDofValue(getElemLocalDofIndex(info.id, i, var), tag) * grad_phi(i, qp);
573
574 grad = grad * jacobian.transpose();
575
576 return grad;
577}
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 180 of file KokkosFESystem.h.

184 {
185 return _qp_vector_solutions[tag](info.subdomain, var)[qp];
186 }
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 497 of file KokkosFESystem.h.

502{
503 auto fe = _var_fe_types[var];
504 auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
505 auto & phi = kokkosAssembly().getVectorPhiFace(info.subdomain, info.type, fe)(side);
506
507 Real3 value = 0;
508
509 for (unsigned int i = 0; i < n_dofs; ++i)
510 value += getVectorDofValue(getElemLocalDofIndex(info.id, i, var), tag) * phi(i, qp);
511
512 return value;
513}
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 64 of file KokkosFESystem.h.

65 {
66 return _nbc_matrix_tag_dof[tag].isAlloc() && _nbc_matrix_tag_dof[tag][dof];
67 }
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 186 of file KokkosSystem.h.

186{ 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 110 of file KokkosFESystem.h.

111 {
113 }
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 179 of file KokkosSystem.h.

179{ return _residual_tag_active[tag]; }

◆ 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 169 of file KokkosSystem.h.

170 {
171 return _var_subdomain_active(var, subdomain);
172 }
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::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::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 233 of file KokkosSystem.h.

234 {
235 return _local_to_global_dof_index[dof];
236 }

◆ 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 352 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 351 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 350 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 344 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 296 of file KokkosSystem.h.

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

◆ _coupling

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

Off-diagonal coupled variable numbers of each variable.

Definition at line 402 of file KokkosFESystem.h.

Referenced by getCoupling().

◆ _dof_map

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

Reference of the libMesh DOF map.

Definition at line 291 of file KokkosSystem.h.

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

◆ _ghost_comm_list

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

Definition at line 368 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 367 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 324 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::getElemGlobalDofIndex(), and 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 387 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

Map from local DOF index to global DOF index.

Definition at line 329 of file KokkosSystem.h.

Referenced by Moose::Kokkos::System::getElemGlobalDofIndex(), getNodeGlobalDofIndex(), getVectorDofADValue(), and Moose::Kokkos::System::localToGlobalDofIndex().

◆ _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 334 of file KokkosSystem.h.

◆ _mesh

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

Reference of the MOOSE mesh.

Definition at line 286 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 407 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 311 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 306 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 301 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 377 of file KokkosFESystem.h.

Referenced by getVectorQpValue().

◆ _qp_solutions_grad

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

Definition at line 378 of file KokkosFESystem.h.

Referenced by getVectorQpGrad().

◆ _qp_vector_solutions

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

Definition at line 379 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 381 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 380 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 359 of file KokkosSystem.h.

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

◆ _sparsity

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

Matrix sparsity pattern data.

Definition at line 390 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 281 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 371 of file KokkosFESystem.h.

◆ _var_fe_types

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

◆ _var_is_vector

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

Whether each variable is vector-valued.

Definition at line 397 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 339 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 317 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: