19 #include "libmesh/communicator.h" 44 #ifdef MOOSE_KOKKOS_SCOPE 227 unsigned int var)
const 250 unsigned int var)
const 313 KOKKOS_FUNCTION
Real &
326 KOKKOS_FUNCTION
Real3 &
341 const unsigned int side,
342 const unsigned int qp,
343 const unsigned int var,
344 const TagID tag)
const;
356 const unsigned int side,
358 const unsigned int qp,
359 const unsigned int var,
360 const TagID tag)
const;
532 #ifdef MOOSE_KOKKOS_SCOPE 533 KOKKOS_FUNCTION
inline Real 543 for (
unsigned int i = 0; i < n_dofs; ++i)
548 KOKKOS_FUNCTION
inline Real3 562 for (
unsigned int i = 0; i < n_dofs; ++i)
564 (jacobian * grad_phi(i, qp));
592 #ifdef MOOSE_KOKKOS_SCOPE SystemHolder(Array< System > &systems)
Constructor.
KOKKOS_FUNCTION auto & getVector(TagID tag) const
Get a tagged Kokkos 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.
Array< Array2D< Array< Real > > > _qp_solutions
Cached elemental quadrature values and gradients.
const auto & getLocalCommList() const
Get the list of local DOF indices to communicate.
The Kokkos object that contains the information of an element The IDs used in Kokkos are different fr...
KOKKOS_FUNCTION Real & getMatrixValue(dof_id_type row, dof_id_type col, TagID tag) const
Get an entry from a tagged matrix.
void clearActiveResidualTags()
Clear the cached active residual tags.
Array< Array< bool > > _nbc_matrix_tag_dof
Array< dof_id_type > _local_to_global_dof_index
Map from local DOF index to global DOF index.
Array< bool > _residual_tag_active
Flag whether each tag is active.
Array< bool > _nbc_dof
Flag whether each DOF is covered by a nodal BC.
void clearActiveVariableTags()
Clear the cached active solution tags.
Array< Array< bool > > _nbc_residual_tag_dof
Flag whether each DOF is covered by a nodal BC for extra residual tags.
KOKKOS_FUNCTION const Assembly & kokkosAssembly() const
Get the const reference of the Kokkos assembly.
Thread _thread
Kokkos thread object.
dof_id_type ContiguousElementID
const auto & getGhostCommList() const
Get the list of ghost DOF indices to communicate.
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...
KOKKOS_FUNCTION dof_id_type getNumGhostDofs() const
Get the number of ghost DOFs.
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.
KOKKOS_FUNCTION dof_id_type getNumLocalDofs() const
Get the number of local DOFs.
KOKKOS_FUNCTION dof_id_type getNodeLocalDofIndex(ContiguousNodeID node, unsigned int var) const
Get the local DOF index of a variable for a node.
Array< PetscInt > col_idx
const auto & getComm() const
Get the libMesh communicator.
const MooseMesh & _mesh
Reference of the MOOSE mesh.
MemcpyKind
The enumerator that dictates the memory copy direction.
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.
void setActiveVariableTags(const std::set< TagID > &tags)
Set the active solution tags.
Array< Array< dof_id_type > > _local_node_dof_index
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.
The Kokkos interface that holds the host reference of the Kokkos systems and copies it to device duri...
const auto & getSparsity() const
Get the sparisty pattern data.
void setupSparsity()
Setup sparsity data.
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.
Base class for a system (of equations)
The Kokkos interface that holds the host reference of the Kokkos mesh and copies it to device during ...
Array< TagID > _active_matrix_tags
const auto & getSystem() const
Get the MOOSE system.
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.
Array< PetscInt > row_ptr
SystemBase & _system
Reference of the MOOSE system.
void clearActiveMatrixTags()
Clear the cached active matrix tags.
Array< TagID > _active_variable_tags
List of active tags.
void setupVariables()
Setup variable data.
Array< Vector > _vectors
Kokkos vectors and matrices on device.
virtual libMesh::DofMap & dofMap()
Gets writeable reference to the dof map.
KOKKOS_FUNCTION dof_id_type localToGlobalDofIndex(dof_id_type dof) const
Get the global DOF index of a local DOF index.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
KOKKOS_FUNCTION bool isVariableActive(unsigned int var, ContiguousSubdomainID subdomain) const
Check whether a variable is active on a subdomain.
dof_id_type ContiguousNodeID
KOKKOS_FUNCTION bool isResidualTagActive(TagID tag) const
Check whether a residual tag is active.
const auto & getDofMap() const
Get the libMesh DOF map.
void getNodalBCDofs(const NodalBCBase *nbc, Array< bool > &dofs)
Get the list of DOFs covered by a nodal BC.
System(SystemBase &system)
Constructor.
const unsigned int _num_vars
Number of variables.
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.
void checkNodalBCs()
Check if the DOFs are covered by nodal BCs.
KOKKOS_FUNCTION auto & getMatrix(TagID tag) const
Get a tagged Kokkos matrix.
KOKKOS_FUNCTION bool isNodalDefined(ContiguousNodeID node, unsigned int var) const
Get whether a variable is defined on a node.
void clearActiveVariables()
Clear the cached active variables.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
KOKKOS_FUNCTION const System & kokkosSystem(unsigned int sys) const
Get the const reference of a Kokkos system.
The Kokkos interface that holds the host reference of the Kokkos assembly and copies it to device dur...
Array< System > & kokkosSystems()
Get the writeable host reference of the Kokkos systems.
void setupDofs()
Setup DOF data.
static const dof_id_type invalid_id
void setActiveVariables(const std::set< MooseVariableFieldBase *> &vars)
Set the active variables.
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.
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.
Array< TagID > _active_residual_tags
void setActiveResidualTags(const std::set< TagID > &tags)
Set the active residual tags.
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 dof_id_type getElemGlobalDofIndex(ContiguousElementID elem, unsigned int i, unsigned int var) const
Get the global DOF index of a variable for an element.
SystemHolder(const SystemHolder &holder)
Copy constructor.
const dof_id_type _num_local_dofs
Number of local DOFs.
KOKKOS_FUNCTION bool isMatrixTagActive(TagID tag) const
Check whether a matrix tag is active.
void setActiveMatrixTags(const std::set< TagID > &tags)
Set the active matrix tags.
The base class for Kokkos nodal boundary conditions.
Array< PetscInt > row_idx
void sync(const MemcpyKind dir)
Synchronize the active tagged vectors and matrices between host and device.
Base class for deriving any boundary condition that works at nodes.
const Array< System > _systems_device
Device copy of the Kokkos systems.
KOKKOS_FUNCTION bool hasNodalBC(dof_id_type dof) const
Check whether a local DOF index is covered by a nodal BC.
Array< unsigned int > _var_fe_types
FE type ID of each variable.
Array< Array< dof_id_type > > _ghost_comm_list
Array< Array2D< Array< Real3 > > > _qp_solutions_grad
Array< Array< dof_id_type > > _local_comm_list
List of DOFs to send and receive.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void reinit()
Allocate the quadrature point solution vectors for active variable and tags and cache quadrature poin...
KOKKOS_FUNCTION dof_id_type getNodeGlobalDofIndex(ContiguousNodeID node, unsigned int var) const
Get the global DOF index of a variable for a node.
KOKKOS_FUNCTION void operator()(const ThreadID tid) const
Kokkos function for caching variable values on element quadrature points.
Array< unsigned int > _active_variables
List of active variable numbers.
const Parallel::Communicator & _comm
Reference of the libMesh communicator.
Array< System > & _systems_host
Host reference of the Kokkos systems.
CSR format sparsity data.
Array2D< bool > _var_subdomain_active
Whether each variable is active on subdomains.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
const libMesh::DofMap & _dof_map
Reference of the libMesh DOF map.
const dof_id_type _num_ghost_dofs
Number of ghost DOFs.
System & kokkosSystem(unsigned int sys)
Get the writeable reference of a Kokkos system.
Array< Array< unsigned int > > _coupling
Off-diagonal coupled variable numbers of each variable.
KOKKOS_FUNCTION Real & getVectorDofValue(dof_id_type dof, TagID tag) const
Get the DOF value of a tagged vector.
KOKKOS_FUNCTION const auto & getCoupling(unsigned int var) const
Get the list of off-diagonal coupled variable numbers of a variable.
Sparsity _sparsity
Matrix sparsity pattern data.
Array< unsigned int > _max_dofs_per_elem
Maximum number of DOFs per element for each variable.
Array< Array2D< dof_id_type > > _local_elem_dof_index
Local DOF index of each variable.
KOKKOS_FUNCTION unsigned int getFETypeID(unsigned int var) const
Get the FE type ID of a variable.
The Kokkos thread object that aids in converting the one-dimensional thread index into multi-dimensio...
Array< bool > _matrix_tag_active
KOKKOS_FUNCTION const Array< System > & kokkosSystems() const
Get the const reference of the Kokkos systems.
Array< Matrix > _matrices