20 #include "libmesh/communicator.h" 43 #ifdef MOOSE_KOKKOS_SCOPE 214 unsigned int var)
const 227 unsigned int var)
const 240 unsigned int var)
const 304 const Real seed)
const;
315 const unsigned int var,
316 const TagID tag)
const 333 const unsigned int var,
335 const Real seed)
const;
346 const unsigned int var,
347 const TagID tag)
const 367 const unsigned int var,
369 const Real seed)
const;
380 const unsigned int side,
381 const unsigned int qp,
382 const unsigned int var,
383 const TagID tag)
const;
396 const unsigned int side,
397 const unsigned int qp,
398 const unsigned int var,
400 const Real seed)
const;
412 const unsigned int side,
414 const unsigned int qp,
415 const unsigned int var,
416 const TagID tag)
const;
430 const unsigned int side,
432 const unsigned int qp,
433 const unsigned int var,
435 const Real seed)
const;
600 #ifdef MOOSE_KOKKOS_SCOPE 601 KOKKOS_FUNCTION
inline ADReal 612 KOKKOS_FUNCTION
inline ADReal 616 const unsigned int var,
618 const Real seed)
const 630 for (
unsigned int i = 0; i < n_dofs; ++i)
642 const unsigned int var,
644 const Real seed)
const 656 for (
unsigned int i = 0; i < n_dofs; ++i)
658 (jacobian * grad_phi(i, qp));
664 KOKKOS_FUNCTION
inline Real 666 const unsigned int side,
667 const unsigned int qp,
668 const unsigned int var,
669 const TagID tag)
const 677 for (
unsigned int i = 0; i < n_dofs; ++i)
683 KOKKOS_FUNCTION
inline ADReal 685 const unsigned int side,
686 const unsigned int qp,
687 const unsigned int var,
689 const Real seed)
const 697 for (
unsigned int i = 0; i < n_dofs; ++i)
703 KOKKOS_FUNCTION
inline Real3 705 const unsigned int side,
707 const unsigned int qp,
708 const unsigned int var,
709 const TagID tag)
const 717 for (
unsigned int i = 0; i < n_dofs; ++i)
719 (jacobian * grad_phi(i, qp));
726 const unsigned int side,
728 const unsigned int qp,
729 const unsigned int var,
731 const Real seed)
const 739 for (
unsigned int i = 0; i < n_dofs; ++i)
741 (jacobian * grad_phi(i, qp));
769 #ifdef MOOSE_KOKKOS_SCOPE SystemHolder(Array< System > &systems)
Constructor.
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 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.
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.
MemcpyType
The enumerator that dictates the memory copy direction.
void sync(const MemcpyType dir)
Synchronize the active tagged vectors and matrices between host and device.
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
Flag whether each DOF is covered by a nodal BC for each matrix tag.
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.
void setActiveSolutionTags(const std::set< TagID > &tags)
Set the active solution tags.
KOKKOS_FUNCTION const Assembly & kokkosAssembly() const
Get the const reference of the Kokkos assembly.
Thread _thread
Kokkos thread object.
void setupNodalBCDofs()
Mark the DOFs covered by nodal BCs.
dof_id_type ContiguousElementID
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 value of a variable from a tagged vector for automatic differentiation (AD) ...
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 dof_id_type getNumLocalDofs() const
Get the number of local DOFs.
Array< PetscInt > col_idx
const auto & getComm() const
Get the libMesh communicator.
const MooseMesh & _mesh
Reference of the MOOSE mesh.
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 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.
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)
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 gradient of a variable from a tagged vector for automatic differentiation (AD) ...
The Kokkos interface that holds the host reference of the Kokkos mesh and copies it to device during ...
KOKKOS_FUNCTION Real & getVectorDofValue(const dof_id_type dof, const TagID tag) const
Get the DOF value of a tagged vector.
Array< TagID > _active_matrix_tags
DualNumber< Real, DNDerivativeType, false > ADReal
const auto & getSystem() const
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.
void setupVariables()
Setup variable data.
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< Vector > _vectors
Kokkos vectors and matrices on device.
MOOSE_KOKKOS_INDEX_TYPE ThreadID
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.
static constexpr dof_id_type invalid_id
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.
KOKKOS_FUNCTION auto & getMatrix(TagID tag) const
Get a tagged Kokkos matrix.
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 value of a variable from a tagged vector for automatic differentiation (AD) ...
KOKKOS_FUNCTION bool isNodalDefined(ContiguousNodeID node, unsigned int var) const
Get whether a variable is defined on a node.
void clearActiveSolutionTags()
Clear the cached active solution tags.
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.
void setActiveVariables(const std::set< MooseVariableFieldBase *> &vars)
Set the active variables.
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.
void destroy()
Free all data and reset.
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
Base class for deriving any boundary condition that works at nodes.
Interface for objects interacting with the PerfGraph.
const Array< System > _systems_device
Device copy of the Kokkos systems.
KOKKOS_FUNCTION Real3 & getVectorQpGrad(const ElementInfo info, const dof_id_type qp, const unsigned int var, const TagID tag) const
Get the quadrature gradient of a 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 gradient of a variable from a tagged vector for automatic differentiation (AD...
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 vectors for active variable and tags and cache quadrature point values...
auto & getSystem()
Get the MOOSE system.
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.
KOKKOS_FUNCTION Real & getVectorQpValue(const ElementInfo info, const dof_id_type qp, const unsigned int var, const TagID tag) const
Get the quadrature value of a variable from a tagged vector.
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.
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 const auto & getCoupling(unsigned int var) const
Get the list of off-diagonal coupled variable numbers of a variable.
Array< TagID > _active_solution_tags
List of active tags.
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