The Kokkos system class. More...
#include <KokkosSystem.h>
Classes | |
| struct | Sparsity |
| CSR format sparsity data. More... | |
Public Member Functions | |
| System (SystemBase &system) | |
| Constructor. More... | |
| void | sync (const MemcpyKind dir) |
| Synchronize the active tagged vectors and matrices between host and device. More... | |
| void | sync (const std::set< TagID > &tags, const MemcpyKind dir) |
| Synchronize the specified tagged vectors between host and device. More... | |
| void | sync (const std::vector< TagID > &tags, const MemcpyKind dir) |
| void | sync (const TagID tag, const MemcpyKind dir) |
| void | reinit () |
| Allocate the quadrature point vectors for active variable and tags and cache quadrature point values. 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... | |
| auto & | getSystem () |
| Get the MOOSE system. More... | |
| const auto & | getSystem () const |
| const auto & | getDofMap () const |
| Get the libMesh DOF map. More... | |
| const auto & | getComm () const |
| Get the libMesh communicator. More... | |
| const auto & | getLocalCommList () const |
| Get the list of local DOF indices to communicate. More... | |
| const auto & | getGhostCommList () const |
| Get the list of ghost DOF indices to communicate. More... | |
| const auto & | getSparsity () const |
| Get the sparisty pattern data. 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 | 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 bool | hasNodalBC (dof_id_type dof) const |
| Check whether a local DOF index is covered by a nodal BC. More... | |
| KOKKOS_FUNCTION bool | hasNodalBCResidualTag (dof_id_type dof, TagID tag) const |
| Check whether a local DOF index is covered by a nodal BC for an extra residual tag. 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 | 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 unsigned int | getMaxDofsPerElem (unsigned int var) const |
| Get the maximum number of DOFs per element of a variable This number is local to each process. 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 | 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 | 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 | getNodeGlobalDofIndex (ContiguousNodeID node, unsigned int var) const |
| Get the global DOF index of a variable for a node. 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 bool | isNodalDefined (ContiguousNodeID node, unsigned int var) const |
| Get whether a variable is defined on a node. More... | |
| KOKKOS_FUNCTION auto & | getVector (TagID tag) const |
| Get a tagged Kokkos vector. More... | |
| KOKKOS_FUNCTION auto & | getMatrix (TagID tag) const |
| Get a tagged Kokkos matrix. More... | |
| KOKKOS_FUNCTION Real & | getVectorDofValue (dof_id_type dof, TagID tag) const |
| Get the DOF value of a tagged vector. More... | |
| KOKKOS_FUNCTION Real & | getVectorQpValue (ElementInfo info, dof_id_type qp, unsigned int var, TagID tag) const |
| Get the quadrature value of a variable from a tagged vector. More... | |
| KOKKOS_FUNCTION Real3 & | getVectorQpGrad (ElementInfo info, dof_id_type qp, unsigned int var, TagID tag) const |
| Get the quadrature gradient of a variable from a tagged vector. 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 value of a variable from a tagged vector. 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 gradient of a variable from a tagged vector. More... | |
| KOKKOS_FUNCTION Real & | getMatrixValue (dof_id_type row, dof_id_type col, TagID tag) const |
| Get an entry from a tagged matrix. More... | |
| KOKKOS_FUNCTION void | operator() (const ThreadID tid) const |
| Kokkos function for caching variable values on element quadrature points. More... | |
| KOKKOS_FUNCTION const Mesh & | kokkosMesh () const |
| Get the const reference of the Kokkos mesh. More... | |
| KOKKOS_FUNCTION const Assembly & | kokkosAssembly () const |
| Get the const reference of the Kokkos assembly. More... | |
Private Member Functions | |
| void | setupVariables () |
| Setup variable data. More... | |
| void | setupDofs () |
| Setup DOF data. More... | |
| void | setupSparsity () |
| Setup sparsity data. More... | |
| void | checkNodalBCs () |
| Check if the DOFs are 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... | |
| 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< 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... | |
| Array< unsigned int > | _var_fe_types |
| FE type ID of each variable. More... | |
| Array2D< bool > | _var_subdomain_active |
| Whether each variable is active on subdomains. More... | |
| Array< Array< unsigned int > > | _coupling |
| Off-diagonal coupled variable numbers of each variable. More... | |
| Array< unsigned int > | _active_variables |
| List of active variable numbers. More... | |
| Array< bool > | _nbc_dof |
| Flag whether each DOF is covered by a nodal BC. More... | |
| Sparsity | _sparsity |
| Matrix sparsity pattern data. More... | |
| Array< Vector > | _vectors |
| Kokkos vectors and matrices on device. More... | |
| Array< Matrix > | _matrices |
| Array< Array2D< Array< Real > > > | _qp_solutions |
| Cached elemental quadrature values and gradients. More... | |
| Array< Array2D< Array< Real3 > > > | _qp_solutions_grad |
| Array< Array2D< dof_id_type > > | _local_elem_dof_index |
| Local DOF index of each variable. More... | |
| Array< Array< dof_id_type > > | _local_node_dof_index |
| 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< bool > > | _nbc_residual_tag_dof |
| Flag whether each DOF is covered by a nodal BC for extra residual tags. More... | |
| Array< Array< bool > > | _nbc_matrix_tag_dof |
| Array< Array< dof_id_type > > | _local_comm_list |
| List of DOFs to send and receive. More... | |
| Array< Array< dof_id_type > > | _ghost_comm_list |
The Kokkos system class.
Each nonlinear and auxiliary system in MOOSE has a corresponding Kokkos system.
Definition at line 35 of file KokkosSystem.h.
| Moose::Kokkos::System::System | ( | SystemBase & | system | ) |
Constructor.
| system | The associated MOOSE system |
|
private |
Check if the DOFs are covered by nodal BCs.
|
inline |
Clear the cached active matrix tags.
Definition at line 104 of file KokkosSystem.h.
|
inline |
Clear the cached active residual tags.
Definition at line 96 of file KokkosSystem.h.
|
inline |
Clear the cached active solution tags.
Definition at line 92 of file KokkosSystem.h.
|
inline |
Clear the cached active variables.
Definition at line 88 of file KokkosSystem.h.
|
inline |
Get the libMesh communicator.
Definition at line 126 of file KokkosSystem.h.
|
inline |
Get the list of off-diagonal coupled variable numbers of a variable.
| var | The variable number |
Definition at line 147 of file KokkosSystem.h.
Referenced by Moose::Kokkos::NodalBC::operator()(), Moose::Kokkos::NodalKernel::operator()(), Moose::Kokkos::Kernel::operator()(), and Moose::Kokkos::IntegratedBC::operator()().
|
inline |
Get the libMesh DOF map.
Definition at line 121 of file KokkosSystem.h.
|
inline |
Get the global DOF index of a variable for an element.
| elem | The contiguous element ID |
| i | The element-local DOF index |
| var | The variable number |
Definition at line 258 of file KokkosSystem.h.
|
inline |
Get the local DOF index of a variable for an element.
| elem | The contiguous element ID |
| i | The element-local DOF index |
| var | The variable number |
Definition at line 232 of file KokkosSystem.h.
Referenced by Moose::Kokkos::ResidualObject::accumulateTaggedElementalMatrix(), Moose::Kokkos::ResidualObject::accumulateTaggedElementalResidual(), getVectorQpGradFace(), and getVectorQpValueFace().
Get the FE type ID of a variable.
| var | The variable number |
Definition at line 204 of file KokkosSystem.h.
|
inline |
Get the list of ghost DOF indices to communicate.
Definition at line 136 of file KokkosSystem.h.
|
inline |
Get the list of local DOF indices to communicate.
Definition at line 131 of file KokkosSystem.h.
|
inline |
Get a tagged Kokkos matrix.
| tag | The matrix tag |
Definition at line 304 of file KokkosSystem.h.
|
inline |
Get an entry from a tagged matrix.
| row | The local row index |
| col | The global column index |
| tag | The matrix tag |
Definition at line 378 of file KokkosSystem.h.
|
inline |
Get the maximum number of DOFs per element of a variable This number is local to each process.
| var | The variable number |
Definition at line 221 of file KokkosSystem.h.
|
private |
Get the list of DOFs covered by a nodal BC.
| nbc | The Kokkos nodal BC object |
| dofs | The flag whether each DOF is covered by the nodal BC |
|
inline |
Get the global DOF index of a variable for a node.
| node | The contiguous node ID |
| var | The variable number |
Definition at line 270 of file KokkosSystem.h.
|
inline |
Get the local DOF index of a variable for a node.
| node | The contiguous node ID |
| idx | The node-local DOF index |
| var | The variable number |
Definition at line 245 of file KokkosSystem.h.
Referenced by Moose::Kokkos::ResidualObject::accumulateTaggedNodalMatrix(), and Moose::Kokkos::ResidualObject::accumulateTaggedNodalResidual().
|
inline |
Get the number of ghost DOFs.
Definition at line 214 of file KokkosSystem.h.
|
inline |
Get the number of local DOFs.
Definition at line 209 of file KokkosSystem.h.
|
inline |
Get the sparisty pattern data.
Definition at line 141 of file KokkosSystem.h.
|
inline |
Get the MOOSE system.
Definition at line 114 of file KokkosSystem.h.
|
inline |
Definition at line 115 of file KokkosSystem.h.
|
inline |
Get a tagged Kokkos vector.
| tag | The vector tag |
Definition at line 298 of file KokkosSystem.h.
|
inline |
Get the DOF value of a tagged vector.
| dof | The local DOF index |
| tag | The vector tag |
Definition at line 311 of file KokkosSystem.h.
Referenced by getVectorQpGradFace(), and getVectorQpValueFace().
|
inline |
Get the quadrature gradient of a variable from a tagged vector.
| info | The element information object |
| qp | The global quadrature point index |
| var | The variable number |
| tag | The vector tag |
Definition at line 337 of file KokkosSystem.h.
|
inline |
Get the face quadrature gradient of a variable from a tagged vector.
| info | The element information object |
| side | The side index |
| jacobian | The inverse Jacobian matrix |
| qp | The local quadrature point index |
| var | The variable number |
| tag | The vector tag |
Definition at line 559 of file KokkosSystem.h.
|
inline |
Get the quadrature value of a variable from a tagged vector.
| info | The element information object |
| qp | The global quadrature point index |
| var | The variable number |
| tag | The vector tag |
Definition at line 324 of file KokkosSystem.h.
|
inline |
Get the face quadrature value of a variable from a tagged vector.
| info | The element information object |
| side | The side index |
| qp | The local quadrature point index |
| var | The vriable number |
| tag | The vector tag |
Definition at line 544 of file KokkosSystem.h.
|
inline |
Check whether a local DOF index is covered by a nodal BC.
| dof | The local DOF index |
Definition at line 175 of file KokkosSystem.h.
|
inline |
Check whether a local DOF index is associated with a nodal BC for an extra matrix tag.
| dof | The local DOF index |
| tag | The extra matrix tag |
Definition at line 195 of file KokkosSystem.h.
|
inline |
Check whether a local DOF index is covered by a nodal BC for an extra residual tag.
| dof | The local DOF index |
| tag | The extra residual tag |
Definition at line 185 of file KokkosSystem.h.
|
inline |
Check whether a matrix tag is active.
| tag | The matrix tag |
Definition at line 169 of file KokkosSystem.h.
|
inline |
Get whether a variable is defined on a node.
| node | The contiguous node ID |
| var | The variable number |
Definition at line 289 of file KokkosSystem.h.
|
inline |
Check whether a residual tag is active.
| tag | The residual tag |
Definition at line 163 of file KokkosSystem.h.
|
inline |
Check whether a variable is active on a subdomain.
| var | The variable number |
| subdomain | The contiguous subdomain ID |
Definition at line 154 of file KokkosSystem.h.
|
inlineinherited |
Get the const reference of the Kokkos assembly.
Definition at line 504 of file KokkosAssembly.h.
Referenced by getVectorQpGradFace(), getVectorQpValueFace(), Moose::Kokkos::AuxKernel::operator()(), Moose::Kokkos::Material::operator()(), Moose::Kokkos::NodalKernel::operator()(), Moose::Kokkos::NodalBC::operator()(), Moose::Kokkos::Kernel::operator()(), and Moose::Kokkos::IntegratedBC::operator()().
|
inlineinherited |
Get the const reference of the Kokkos mesh.
Definition at line 360 of file KokkosMesh.h.
Referenced by Moose::Kokkos::Assembly::computePhysicalMap(), KokkosBoundNodalKernel< KokkosUpperBoundNodalKernel >::KokkosBoundNodalKernel(), Moose::Kokkos::IntegratedBC::operator()(), Moose::Kokkos::Kernel::operator()(), and Moose::Kokkos::Datum::q_point().
|
inline |
Get the global DOF index of a local DOF index.
| dof | The local DOF index |
Definition at line 279 of file KokkosSystem.h.
Kokkos function for caching variable values on element quadrature points.
| void Moose::Kokkos::System::reinit | ( | ) |
Allocate the quadrature point vectors for active variable and tags and cache quadrature point values.
Set the active matrix tags.
| vars | The active matrix tags |
Set the active residual tags.
| tags | The active residual tags |
Set the active solution tags.
| tags | The active solution tags |
| void Moose::Kokkos::System::setActiveVariables | ( | const std::set< MooseVariableFieldBase *> & | vars | ) |
Set the active variables.
| vars | The active MOOSE variables |
|
private |
Setup DOF data.
|
private |
Setup sparsity data.
|
private |
Setup variable data.
| void Moose::Kokkos::System::sync | ( | const MemcpyKind | dir | ) |
Synchronize the active tagged vectors and matrices between host and device.
| dir | Copy direction |
| void Moose::Kokkos::System::sync | ( | const std::set< TagID > & | tags, |
| const MemcpyKind | dir | ||
| ) |
Synchronize the specified tagged vectors between host and device.
| tags | The vector tags |
| dir | Copy direction{@ |
| void Moose::Kokkos::System::sync | ( | const std::vector< TagID > & | tags, |
| const MemcpyKind | dir | ||
| ) |
| void Moose::Kokkos::System::sync | ( | const TagID | tag, |
| const MemcpyKind | dir | ||
| ) |
Definition at line 508 of file KokkosSystem.h.
Referenced by clearActiveMatrixTags().
Definition at line 507 of file KokkosSystem.h.
Referenced by clearActiveResidualTags().
List of active tags.
Definition at line 506 of file KokkosSystem.h.
Referenced by clearActiveSolutionTags().
List of active variable numbers.
Definition at line 501 of file KokkosSystem.h.
Referenced by clearActiveVariables().
|
private |
Reference of the libMesh communicator.
Definition at line 442 of file KokkosSystem.h.
Referenced by getComm().
Off-diagonal coupled variable numbers of each variable.
Definition at line 496 of file KokkosSystem.h.
Referenced by getCoupling().
|
private |
Reference of the libMesh DOF map.
Definition at line 438 of file KokkosSystem.h.
|
private |
Definition at line 533 of file KokkosSystem.h.
Referenced by getGhostCommList().
|
private |
List of DOFs to send and receive.
Definition at line 532 of file KokkosSystem.h.
Referenced by getLocalCommList().
|
private |
Local DOF index of each variable.
Definition at line 474 of file KokkosSystem.h.
Referenced by getElemGlobalDofIndex(), and getElemLocalDofIndex().
|
private |
Definition at line 475 of file KokkosSystem.h.
Referenced by getNodeGlobalDofIndex(), getNodeLocalDofIndex(), and isNodalDefined().
|
private |
Map from local DOF index to global DOF index.
Definition at line 480 of file KokkosSystem.h.
Referenced by getElemGlobalDofIndex(), getNodeGlobalDofIndex(), and localToGlobalDofIndex().
Definition at line 461 of file KokkosSystem.h.
Referenced by getMatrix(), and getMatrixValue().
|
private |
Definition at line 515 of file KokkosSystem.h.
Referenced by clearActiveMatrixTags(), and isMatrixTagActive().
Maximum number of DOFs per element for each variable.
Definition at line 484 of file KokkosSystem.h.
Referenced by getMaxDofsPerElem().
|
private |
Reference of the MOOSE mesh.
Definition at line 434 of file KokkosSystem.h.
|
private |
Flag whether each DOF is covered by a nodal BC.
Definition at line 520 of file KokkosSystem.h.
Referenced by hasNodalBC().
Definition at line 526 of file KokkosSystem.h.
Referenced by hasNodalBCMatrixTag().
Flag whether each DOF is covered by a nodal BC for extra residual tags.
Definition at line 525 of file KokkosSystem.h.
Referenced by hasNodalBCResidualTag().
|
private |
Number of ghost DOFs.
Definition at line 454 of file KokkosSystem.h.
Referenced by getNumGhostDofs().
|
private |
Number of local DOFs.
Definition at line 450 of file KokkosSystem.h.
Referenced by getNumLocalDofs().
|
private |
Number of variables.
Definition at line 446 of file KokkosSystem.h.
Cached elemental quadrature values and gradients.
Definition at line 467 of file KokkosSystem.h.
Referenced by getVectorQpValue().
Definition at line 468 of file KokkosSystem.h.
Referenced by getVectorQpGrad().
|
private |
Flag whether each tag is active.
Definition at line 514 of file KokkosSystem.h.
Referenced by clearActiveResidualTags(), and isResidualTagActive().
|
private |
Matrix sparsity pattern data.
Definition at line 539 of file KokkosSystem.h.
Referenced by getSparsity().
|
private |
Reference of the MOOSE system.
Definition at line 430 of file KokkosSystem.h.
Referenced by getDofMap(), and getSystem().
|
private |
Kokkos thread object.
Definition at line 426 of file KokkosSystem.h.
FE type ID of each variable.
Definition at line 488 of file KokkosSystem.h.
Referenced by getFETypeID(), getVectorQpGradFace(), and getVectorQpValueFace().
|
private |
Whether each variable is active on subdomains.
Definition at line 492 of file KokkosSystem.h.
Referenced by isVariableActive().
Kokkos vectors and matrices on device.
Definition at line 460 of file KokkosSystem.h.
Referenced by getVector(), and getVectorDofValue().
1.8.14