https://mooseframework.inl.gov
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) More...
 
 FESystem (System &base, SystemBase &system)
 Constructor for mixed FE+FV simulations, sharing device memory with an existing System. More...
 
void reinit ()
 Allocate the quadrature point vectors for active variable and tags and cache quadrature point values. More...
 
KOKKOS_FUNCTION const auto & getCoupling (unsigned int var) const
 Get the list of off-diagonal coupled variable numbers of a variable. More...
 
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. More...
 
KOKKOS_FUNCTION unsigned int getFETypeID (unsigned int var) const
 Get the FE type ID of a variable. More...
 
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. More...
 
KOKKOS_FUNCTION dof_id_type getNodeGlobalDofIndex (ContiguousNodeID node, unsigned int var) const
 Get the global DOF index of a variable for a node. More...
 
KOKKOS_FUNCTION bool isNodalDefined (ContiguousNodeID node, unsigned int var) const
 Get whether a variable is defined on a node. More...
 
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) More...
 
KOKKOS_FUNCTION RealgetVectorQpValue (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. More...
 
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) More...
 
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. More...
 
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) More...
 
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. More...
 
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) More...
 
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. More...
 
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) More...
 
KOKKOS_FUNCTION void operator() (const ThreadID tid) const
 Kokkos function for caching variable values on element quadrature points. More...
 
void sync (const MemcpyType dir)
 Synchronize the active tagged vectors and matrices between host and device. More...
 
void setActiveVariables (const std::set< MooseVariableFieldBase *> &vars)
 Set the active variables. More...
 
void setActiveSolutionTags (const std::set< TagID > &tags)
 Set the active solution tags. More...
 
void setActiveResidualTags (const std::set< TagID > &tags)
 Set the active residual tags. More...
 
void setActiveMatrixTags (const std::set< TagID > &tags)
 Set the active matrix tags. More...
 
void clearActiveVariables ()
 Clear the cached active variables. More...
 
void clearActiveSolutionTags ()
 Clear the cached active solution tags. More...
 
void clearActiveResidualTags ()
 Clear the cached active residual tags. More...
 
void clearActiveMatrixTags ()
 Clear the cached active matrix tags. More...
 
const libMesh::DofMapgetDofMap () const
 Get the libMesh DOF map. More...
 
const Parallel::CommunicatorgetComm () const
 Get the libMesh communicator. More...
 
const Array< Array< dof_id_type > > & getLocalCommList () const
 Get the list of local DOF indices to communicate. More...
 
const Array< Array< dof_id_type > > & getGhostCommList () const
 Get the list of ghost DOF indices to communicate. More...
 
const SparsitygetSparsity () const
 Get the sparisty pattern data. More...
 
KOKKOS_FUNCTION bool isVariableActive (unsigned int var, ContiguousSubdomainID subdomain) const
 Check whether a variable is active on a subdomain. More...
 
KOKKOS_FUNCTION bool isResidualTagActive (TagID tag) const
 Check whether a residual tag is active. More...
 
KOKKOS_FUNCTION bool isMatrixTagActive (TagID tag) const
 Check whether a matrix tag is active. More...
 
KOKKOS_FUNCTION dof_id_type getNumLocalDofs () const
 Get the number of local DOFs. More...
 
KOKKOS_FUNCTION dof_id_type getNumGhostDofs () const
 Get the number of ghost DOFs. More...
 
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. More...
 
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. More...
 
KOKKOS_FUNCTION dof_id_type localToGlobalDofIndex (dof_id_type dof) const
 Get the global DOF index of a local DOF index. More...
 
KOKKOS_FUNCTION VectorgetVector (TagID tag) const
 Get a tagged Kokkos vector. More...
 
KOKKOS_FUNCTION MatrixgetMatrix (TagID tag) const
 Get a tagged Kokkos matrix. More...
 
KOKKOS_FUNCTION RealgetVectorDofValue (const dof_id_type dof, const TagID tag) const
 Get the DOF value of a tagged vector. More...
 
KOKKOS_FUNCTION RealgetMatrixValue (dof_id_type row, dof_id_type col, TagID tag) const
 Get an entry from a tagged matrix. More...
 
PerfGraphperfGraph ()
 Get the PerfGraph. More...
 
KOKKOS_FUNCTION const MeshkokkosMesh () const
 Get the const reference of the Kokkos mesh. More...
 
KOKKOS_FUNCTION const AssemblykokkosAssembly () const
 Get the const reference of the Kokkos assembly. More...
 
void sync (const std::set< TagID > &tags, const MemcpyType dir)
 Synchronize the specified tagged vectors between host and device. More...
 
void sync (const std::vector< TagID > &tags, const MemcpyType dir)
 
void sync (const TagID tag, const MemcpyType dir)
 
SystemBasegetSystem ()
 Get the MOOSE system. More...
 
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. More...
 
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. More...
 
std::string timedSectionName (const std::string &section_name) const
 

Protected Attributes

SystemBase_system
 Reference of the MOOSE system. More...
 
const MooseMesh_mesh
 Reference of the MOOSE mesh. More...
 
const libMesh::DofMap_dof_map
 Reference of the libMesh DOF map. More...
 
const Parallel::Communicator_comm
 Reference of the libMesh communicator. More...
 
const unsigned int _num_vars
 Number of variables. More...
 
const dof_id_type _num_local_dofs
 Number of local DOFs. More...
 
const dof_id_type _num_ghost_dofs
 Number of ghost DOFs. More...
 
Array< Array2D< dof_id_type > > _local_elem_dof_index
 Local element DOF indices of each variable. More...
 
Array< dof_id_type_local_to_global_dof_index
 Map from local DOF index to global DOF index. More...
 
Array< unsigned int_max_dofs_per_elem
 Maximum number of DOFs per element for each variable. More...
 
Array2D< bool > _var_subdomain_active
 Whether each variable is active on subdomains. More...
 
Array< unsigned int_active_variables
 List of active variable numbers. More...
 
MooseApp_pg_moose_app
 The MooseApp that owns the PerfGraph. More...
 
const std::string _prefix
 A prefix to use for all sections. More...
 
Array< Vector_vectors
 Kokkos vectors and matrices on device. More...
 
Array< Matrix_matrices
 
Array< TagID_active_solution_tags
 List of active tags. More...
 
Array< TagID_active_residual_tags
 
Array< TagID_active_matrix_tags
 
Array< bool > _residual_tag_active
 Flag whether each tag is active. More...
 
Array< bool > _matrix_tag_active
 
Array< Array< dof_id_type > > _local_comm_list
 List of DOFs to send and receive. More...
 
Array< Array< dof_id_type > > _ghost_comm_list
 

Private Member Functions

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

Private Attributes

Thread _thread
 Kokkos thread object. More...
 
Array< Array< dof_id_type > > _local_node_dof_index
 Local nodal DOF indices of each variable. More...
 
Array< unsigned int_var_fe_types
 FE type ID of each variable. More...
 
Array< Array< unsigned int > > _coupling
 Off-diagonal coupled variable numbers of each variable. More...
 
Array< Array< bool > > _nbc_matrix_tag_dof
 Per-matrix-tag local-plus-ghost DOF masks for nodal BC coverage. More...
 
Array< Array2D< Array< Real > > > _qp_solutions
 Cached elemental quadrature values and gradients. More...
 
Array< Array2D< Array< Real3 > > > _qp_solutions_grad
 

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  }
Array< TagID > _active_matrix_tags
Definition: KokkosSystem.h:352
void destroy()
Free all data and reset.
Definition: KokkosArray.h:896
Array< bool > _matrix_tag_active
Definition: KokkosSystem.h:360

◆ 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< bool > _residual_tag_active
Flag whether each tag is active.
Definition: KokkosSystem.h:359
Array< TagID > _active_residual_tags
Definition: KokkosSystem.h:351
void destroy()
Free all data and reset.
Definition: KokkosArray.h:896

◆ clearActiveSolutionTags()

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

Clear the cached active solution tags.

Definition at line 104 of file KokkosSystem.h.

void destroy()
Free all data and reset.
Definition: KokkosArray.h:896
Array< TagID > _active_solution_tags
List of active tags.
Definition: KokkosSystem.h:350

◆ clearActiveVariables()

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

Clear the cached active variables.

Definition at line 99 of file KokkosSystem.h.

void destroy()
Free all data and reset.
Definition: KokkosArray.h:896
Array< unsigned int > _active_variables
List of active variable numbers.
Definition: KokkosSystem.h:344

◆ 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.
Definition: KokkosSystem.h:296

◆ 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
inherited

Get the libMesh DOF map.

Returns
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.
Definition: KokkosSystem.h:329
Array< Array2D< dof_id_type > > _local_elem_dof_index
Local element DOF indices of each variable.
Definition: KokkosSystem.h:324

◆ 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.

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

210  {
211  return _local_elem_dof_index[var](i, elem);
212  }
Array< Array2D< dof_id_type > > _local_elem_dof_index
Local element DOF indices of each variable.
Definition: KokkosSystem.h:324

◆ 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
Definition: KokkosSystem.h:368

◆ 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.
Definition: KokkosSystem.h:367

◆ 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
Definition: KokkosSystem.h:318

◆ 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  }
Array< Matrix > _matrices
Definition: KokkosSystem.h:318

◆ 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  var 
) const
inline

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

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

Definition at line 96 of file KokkosFESystem.h.

97  {
99  }
Array< dof_id_type > _local_to_global_dof_index
Map from local DOF index to global DOF index.
Definition: KokkosSystem.h:329
Array< Array< dof_id_type > > _local_node_dof_index
Local nodal DOF indices of each variable.

◆ 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.

◆ 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.
Definition: KokkosSystem.h:311

◆ 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.
Definition: KokkosSystem.h:306

◆ 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.
Definition: KokkosSystem.h:390

◆ 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.
Definition: KokkosSystem.h:281

◆ getSystem() [2/2]

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

Definition at line 130 of file KokkosSystem.h.

130 { return _system; }
SystemBase & _system
Reference of the MOOSE system.
Definition: KokkosSystem.h:281

◆ 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.
Definition: KokkosSystem.h:317

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

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

328 {
329  ADReal value = _vectors[tag][dof];
330 
331  if (seed != 0)
332  value.derivatives().insert(_local_to_global_dof_index[dof]) = seed;
333 
334  return value;
335 }
Array< dof_id_type > _local_to_global_dof_index
Map from local DOF index to global DOF index.
Definition: KokkosSystem.h:329
Array< Vector > _vectors
Kokkos vectors and matrices on device.
Definition: KokkosSystem.h:317
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

◆ 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.

Referenced by getVectorQpGradFace(), and getVectorQpValueFace().

259  {
260  return _vectors[tag][dof];
261  }
Array< Vector > _vectors
Kokkos vectors and matrices on device.
Definition: KokkosSystem.h:317

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

370 {
371  ADReal3 grad;
372 
373  if (seed == 0)
374  grad = getVectorQpGrad(info, offset + qp, var, tag);
375  else
376  {
377  auto fe = _var_fe_types[var];
378  auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
379  auto & grad_phi = kokkosAssembly().getGradPhi(info.subdomain, info.type, fe);
380 
381  for (unsigned int i = 0; i < n_dofs; ++i)
382  grad += getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) *
383  (jacobian * grad_phi(i, qp));
384  }
385 
386  return grad;
387 }
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.
Definition: KokkosSystem.h:207
KOKKOS_FUNCTION const Assembly & kokkosAssembly() const
Get the const reference of the Kokkos assembly.
MPI_Info info
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 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 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 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)
Array< unsigned int > _var_fe_types
FE type ID of each variable.
Vector3< ADReal > ADReal3
Definition: KokkosTypes.h:32

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

457 {
458  auto fe = _var_fe_types[var];
459  auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
460  auto & grad_phi = kokkosAssembly().getGradPhiFace(info.subdomain, info.type, fe)(side);
461 
462  ADReal3 grad = ADReal(0);
463 
464  for (unsigned int i = 0; i < n_dofs; ++i)
465  grad += getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) *
466  (jacobian * grad_phi(i, qp));
467 
468  return grad;
469 }
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.
Definition: KokkosSystem.h:207
KOKKOS_FUNCTION const Assembly & kokkosAssembly() const
Get the const reference of the Kokkos assembly.
MPI_Info info
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.
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.
DualNumber< Real, DNDerivativeType, false > ADReal
Definition: KokkosADReal.h:28
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)
Array< unsigned int > _var_fe_types
FE type ID of each variable.
Vector3< ADReal > ADReal3
Definition: KokkosTypes.h:32

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

344 {
345  ADReal value = 0;
346 
347  if (seed == 0)
348  value = getVectorQpValue(info, offset + qp, var, tag);
349  else
350  {
351  auto fe = _var_fe_types[var];
352  auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
353  auto & phi = kokkosAssembly().getPhi(info.subdomain, info.type, fe);
354 
355  for (unsigned int i = 0; i < n_dofs; ++i)
356  value += getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) * phi(i, qp);
357  }
358 
359  return value;
360 }
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 dof_id_type getElemLocalDofIndex(ContiguousElementID elem, unsigned int i, unsigned int var) const
Get the local DOF index of a variable for an element.
Definition: KokkosSystem.h:207
KOKKOS_FUNCTION const Assembly & kokkosAssembly() const
Get the const reference of the Kokkos assembly.
MPI_Info info
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 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.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
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)
Array< unsigned int > _var_fe_types
FE type ID of each variable.

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

415 {
416  auto fe = _var_fe_types[var];
417  auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
418  auto & phi = kokkosAssembly().getPhiFace(info.subdomain, info.type, fe)(side);
419 
420  ADReal value = 0;
421 
422  for (unsigned int i = 0; i < n_dofs; ++i)
423  value += getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) * phi(i, qp);
424 
425  return value;
426 }
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.
Definition: KokkosSystem.h:207
KOKKOS_FUNCTION const Assembly & kokkosAssembly() const
Get the const reference of the Kokkos assembly.
MPI_Info info
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 & 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.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
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)
Array< unsigned int > _var_fe_types
FE type ID of each variable.

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

Referenced by getVectorQpADGrad().

166  {
167  return _qp_solutions_grad[tag](info.subdomain, var)[qp];
168  }
MPI_Info info
Array< Array2D< Array< Real3 > > > _qp_solutions_grad

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

435 {
436  auto fe = _var_fe_types[var];
437  auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
438  auto & grad_phi = kokkosAssembly().getGradPhiFace(info.subdomain, info.type, fe)(side);
439 
440  Real3 grad = 0;
441 
442  for (unsigned int i = 0; i < n_dofs; ++i)
443  grad += getVectorDofValue(getElemLocalDofIndex(info.id, i, var), tag) *
444  (jacobian * grad_phi(i, qp));
445 
446  return grad;
447 }
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.
Definition: KokkosSystem.h:207
Vector3< Real > Real3
Definition: KokkosTypes.h:31
KOKKOS_FUNCTION const Assembly & kokkosAssembly() const
Get the const reference of the Kokkos assembly.
MPI_Info info
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.
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 Real & getVectorDofValue(const dof_id_type dof, const TagID tag) const
Get the DOF value of a tagged vector.
Definition: KokkosSystem.h:258
Array< unsigned int > _var_fe_types
FE type ID of each variable.

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

Referenced by getVectorQpADValue().

134  {
135  return _qp_solutions[tag](info.subdomain, var)[qp];
136  }
MPI_Info info
Array< Array2D< Array< Real > > > _qp_solutions
Cached elemental quadrature values and gradients.

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

395 {
396  auto fe = _var_fe_types[var];
397  auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
398  auto & phi = kokkosAssembly().getPhiFace(info.subdomain, info.type, fe)(side);
399 
400  Real value = 0;
401 
402  for (unsigned int i = 0; i < n_dofs; ++i)
403  value += getVectorDofValue(getElemLocalDofIndex(info.id, i, var), tag) * phi(i, qp);
404 
405  return value;
406 }
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.
Definition: KokkosSystem.h:207
KOKKOS_FUNCTION const Assembly & kokkosAssembly() const
Get the const reference of the Kokkos assembly.
MPI_Info info
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 Real & getVectorDofValue(const dof_id_type dof, const TagID tag) const
Get the DOF value of a tagged vector.
Definition: KokkosSystem.h:258
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.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Array< unsigned int > _var_fe_types
FE type ID of each variable.

◆ 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]; }
Array< bool > _matrix_tag_active
Definition: KokkosSystem.h:360

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

108  {
110  }
static constexpr dof_id_type invalid_id
Array< Array< dof_id_type > > _local_node_dof_index
Local nodal DOF indices of each variable.

◆ 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]; }
Array< bool > _residual_tag_active
Flag whether each tag is active.
Definition: KokkosSystem.h:359

◆ 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.
Definition: KokkosSystem.h:339

◆ kokkosAssembly()

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

◆ 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.

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

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
bool initialized() const
Get whether the mesh was initialized.
Definition: KokkosMesh.h:68
const Mesh _mesh_device
Device copy of the Kokkos mesh.
Definition: KokkosMesh.h:673
const Mesh & _mesh_host
Host reference of the Kokkos mesh.
Definition: KokkosMesh.h:669

◆ 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  }
Array< dof_id_type > _local_to_global_dof_index
Map from local DOF index to global DOF index.
Definition: KokkosSystem.h:329

◆ 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.

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

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

◆ 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 }
PerfID registerSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
std::string timedSectionName(const std::string &section_name) const
PerfID sectionID(const std::string &section_name) const
Given a name return the PerfID The name of the section.
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 }
PerfID registerSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
std::string timedSectionName(const std::string &section_name) const
PerfID sectionID(const std::string &section_name) const
Given a name return the PerfID The name of the section.
PerfGraphRegistry & getPerfGraphRegistry()
Get the global PerfGraphRegistry singleton.

◆ 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.

◆ 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.

Referenced by PerfGraphInterface::registerTimedSection().

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

◆ validParams()

InputParameters PerfGraphInterface::validParams ( )
staticinherited

Definition at line 16 of file PerfGraphInterface.C.

Referenced by Convergence::validParams().

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

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().

◆ _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 316 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.

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

Referenced by getNodeGlobalDofIndex(), 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.

◆ _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 321 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 299 of file KokkosFESystem.h.

Referenced by getVectorQpValue().

◆ _qp_solutions_grad

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

Definition at line 300 of file KokkosFESystem.h.

Referenced by getVectorQpGrad().

◆ _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().

◆ _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().

◆ _thread

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

Kokkos thread object.

Definition at line 293 of file KokkosFESystem.h.

◆ _var_fe_types

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

◆ _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: