18 #include "libmesh/communicator.h" 55 #ifdef MOOSE_KOKKOS_SCOPE 209 unsigned int var)
const 223 unsigned int var)
const 393 #ifdef MOOSE_KOKKOS_SCOPE 394 #define MakeSystemHolderMethods(SystemTypeName) \ 395 KOKKOS_FUNCTION const Array<SystemTypeName> & kokkosSystems() const \ 397 KOKKOS_IF_ON_HOST(return _systems_host;) \ 398 return _systems_device; \ 400 Array<SystemTypeName> & kokkosSystems() { return _systems_host; } \ 401 KOKKOS_FUNCTION const SystemTypeName & kokkosSystem(unsigned int sys) const \ 403 KOKKOS_IF_ON_HOST(return _systems_host[sys];) \ 404 return _systems_device[sys]; \ 406 SystemTypeName & kokkosSystem(unsigned int sys) { return _systems_host[sys]; } 408 #define MakeSystemHolderMethods(SystemTypeName) 418 #define MakeSystemHolder(SystemTypeName) \ 419 class SystemTypeName##Holder \ 422 SystemTypeName##Holder(Array<SystemTypeName> & systems) \ 423 : _systems_host(systems), _systems_device(systems) \ 426 SystemTypeName##Holder(const SystemTypeName##Holder & holder) \ 427 : _systems_host(holder._systems_host), _systems_device(holder._systems_host) \ 430 MakeSystemHolderMethods(SystemTypeName) \ 432 Array<SystemTypeName> & _systems_host; \ 433 const Array<SystemTypeName> _systems_device; \ 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.
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.
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< 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.
dof_id_type ContiguousElementID
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 MooseMesh & _mesh
Reference of the MOOSE mesh.
SystemBase & getSystem()
Get the MOOSE system.
void setupSparsity()
Setup sparsity data.
Base class for a system (of equations)
The Kokkos base system class.
The Kokkos interface that holds the host reference of the Kokkos mesh and copies it to device during ...
The Kokkos wrapper class for PETSc matrix.
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
const Array< Array< dof_id_type > > & getLocalCommList() const
Get the list of local DOF indices to communicate.
Array< PetscInt > row_ptr
SystemBase & _system
Reference of the MOOSE system.
const Array< Array< dof_id_type > > & getGhostCommList() const
Get the list of ghost DOF indices to communicate.
void clearActiveMatrixTags()
Clear the cached active matrix tags.
void setupVariables()
Setup variable data.
Array< Vector > _vectors
Kokkos vectors and matrices on device.
KOKKOS_FUNCTION dof_id_type localToGlobalDofIndex(dof_id_type dof) const
Get the global DOF index of a local DOF index.
KOKKOS_FUNCTION bool isVariableActive(unsigned int var, ContiguousSubdomainID subdomain) const
Check whether a variable is active on a subdomain.
KOKKOS_FUNCTION bool isResidualTagActive(TagID tag) const
Check whether a residual tag is active.
The Kokkos wrapper class for PETSc vector.
System(SystemBase &system)
Constructor.
const unsigned int _num_vars
Number of variables.
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...
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 dof_id_type getElemGlobalDofIndex(ContiguousElementID elem, unsigned int i, unsigned int var) const
Get the global DOF index of a variable for an element.
const SystemBase & getSystem() const
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.
Array< PetscInt > row_idx
Interface for objects interacting with the PerfGraph.
Array< Array< dof_id_type > > _ghost_comm_list
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
const libMesh::DofMap & getDofMap() const
Get the libMesh DOF map.
const Sparsity & getSparsity() const
Get the sparisty pattern data.
MakeSystemHolder(FESystem)
KOKKOS_FUNCTION Vector & getVector(TagID tag) const
Get a tagged Kokkos vector.
Array< unsigned int > _active_variables
List of active variable numbers.
const Parallel::Communicator & _comm
Reference of the libMesh communicator.
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.
KOKKOS_FUNCTION Matrix & getMatrix(TagID tag) const
Get a tagged Kokkos matrix.
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 element DOF indices of each variable.
Array< bool > _matrix_tag_active
const Parallel::Communicator & getComm() const
Get the libMesh communicator.
Array< Matrix > _matrices