https://mooseframework.inl.gov
KokkosSystem.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "KokkosTypes.h"
13 #include "KokkosVector.h"
14 #include "KokkosMatrix.h"
15 #include "KokkosAssembly.h"
16 
17 #include "SystemBase.h"
18 #include "PerfGraphInterface.h"
19 
20 #include "libmesh/communicator.h"
21 
22 class MooseMesh;
23 class SystemBase;
24 
25 namespace Moose::Kokkos
26 {
27 
28 class NodalBCBase;
29 
34 class System : public PerfGraphInterface, public MeshHolder, public AssemblyHolder
35 {
36 public:
41  System(SystemBase & system);
42 
43 #ifdef MOOSE_KOKKOS_SCOPE
44 
48  void sync(const MemcpyType dir);
54  void sync(const std::set<TagID> & tags, const MemcpyType dir);
56  void sync(const std::vector<TagID> & tags, const MemcpyType dir);
57  void sync(const TagID tag, const MemcpyType dir);
59 
63  void reinit();
68  void setActiveVariables(const std::set<MooseVariableFieldBase *> & vars);
73  void setActiveSolutionTags(const std::set<TagID> & tags);
78  void setActiveResidualTags(const std::set<TagID> & tags);
83  void setActiveMatrixTags(const std::set<TagID> & tags);
96  {
98  _residual_tag_active = false;
99  }
104  {
106  _matrix_tag_active = false;
107  }
112  auto & getSystem() { return _system; }
114  const auto & getSystem() const { return _system; }
116 
120  const auto & getDofMap() const { return _system.dofMap(); }
125  const auto & getComm() const { return _comm; }
130  const auto & getLocalCommList() const { return _local_comm_list; }
135  const auto & getGhostCommList() const { return _ghost_comm_list; }
140  const auto & getSparsity() const { return _sparsity; }
146  KOKKOS_FUNCTION const auto & getCoupling(unsigned int var) const { return _coupling[var]; }
153  KOKKOS_FUNCTION bool isVariableActive(unsigned int var, ContiguousSubdomainID subdomain) const
154  {
155  return _var_subdomain_active(var, subdomain);
156  }
162  KOKKOS_FUNCTION bool isResidualTagActive(TagID tag) const { return _residual_tag_active[tag]; }
168  KOKKOS_FUNCTION bool isMatrixTagActive(TagID tag) const { return _matrix_tag_active[tag]; }
175  KOKKOS_FUNCTION bool hasNodalBCMatrixTag(dof_id_type dof, TagID tag) const
176  {
177  return _nbc_matrix_tag_dof[tag].isAlloc() && _nbc_matrix_tag_dof[tag][dof];
178  }
184  KOKKOS_FUNCTION unsigned int getFETypeID(unsigned int var) const { return _var_fe_types[var]; }
189  KOKKOS_FUNCTION dof_id_type getNumLocalDofs() const { return _num_local_dofs; }
194  KOKKOS_FUNCTION dof_id_type getNumGhostDofs() const { return _num_ghost_dofs; }
201  KOKKOS_FUNCTION unsigned int getMaxDofsPerElem(unsigned int var) const
202  {
203  return _max_dofs_per_elem[var];
204  }
213  unsigned int i,
214  unsigned int var) const
215  {
216  return _local_elem_dof_index[var](i, elem);
217  }
226  unsigned int i,
227  unsigned int var) const
228  {
229  return _local_node_dof_index[var][node] + i;
230  }
239  unsigned int i,
240  unsigned int var) const
241  {
243  }
250  KOKKOS_FUNCTION dof_id_type getNodeGlobalDofIndex(ContiguousNodeID node, unsigned int var) const
251  {
253  }
259  KOKKOS_FUNCTION dof_id_type localToGlobalDofIndex(dof_id_type dof) const
260  {
261  return _local_to_global_dof_index[dof];
262  }
269  KOKKOS_FUNCTION bool isNodalDefined(ContiguousNodeID node, unsigned int var) const
270  {
272  }
278  KOKKOS_FUNCTION auto & getVector(TagID tag) const { return _vectors[tag]; }
284  KOKKOS_FUNCTION auto & getMatrix(TagID tag) const { return _matrices[tag]; }
291  KOKKOS_FUNCTION Real & getVectorDofValue(const dof_id_type dof, const TagID tag) const
292  {
293  return _vectors[tag][dof];
294  }
302  KOKKOS_FUNCTION ADReal getVectorDofADValue(const dof_id_type dof,
303  const TagID tag,
304  const Real seed) const;
313  KOKKOS_FUNCTION Real & getVectorQpValue(const ElementInfo info,
314  const dof_id_type qp,
315  const unsigned int var,
316  const TagID tag) const
317  {
318  return _qp_solutions[tag](info.subdomain, var)[qp];
319  }
330  KOKKOS_FUNCTION ADReal getVectorQpADValue(const ElementInfo info,
331  const dof_id_type offset,
332  const dof_id_type qp,
333  const unsigned int var,
334  const TagID tag,
335  const Real seed) const;
344  KOKKOS_FUNCTION Real3 & getVectorQpGrad(const ElementInfo info,
345  const dof_id_type qp,
346  const unsigned int var,
347  const TagID tag) const
348  {
349  return _qp_solutions_grad[tag](info.subdomain, var)[qp];
350  }
363  KOKKOS_FUNCTION ADReal3 getVectorQpADGrad(const ElementInfo info,
364  const Real33 jacobian,
365  const dof_id_type offset,
366  const dof_id_type qp,
367  const unsigned int var,
368  const TagID tag,
369  const Real seed) const;
379  KOKKOS_FUNCTION Real getVectorQpValueFace(const ElementInfo info,
380  const unsigned int side,
381  const unsigned int qp,
382  const unsigned int var,
383  const TagID tag) const;
395  KOKKOS_FUNCTION ADReal getVectorQpADValueFace(const ElementInfo info,
396  const unsigned int side,
397  const unsigned int qp,
398  const unsigned int var,
399  const TagID tag,
400  const Real seed) const;
411  KOKKOS_FUNCTION Real3 getVectorQpGradFace(const ElementInfo info,
412  const unsigned int side,
413  const Real33 jacobian,
414  const unsigned int qp,
415  const unsigned int var,
416  const TagID tag) const;
429  KOKKOS_FUNCTION ADReal3 getVectorQpADGradFace(const ElementInfo info,
430  const unsigned int side,
431  const Real33 jacobian,
432  const unsigned int qp,
433  const unsigned int var,
434  const TagID tag,
435  const Real seed) const;
443  KOKKOS_FUNCTION Real & getMatrixValue(dof_id_type row, dof_id_type col, TagID tag) const
444  {
445  return _matrices[tag](row, col);
446  }
447 
451  KOKKOS_FUNCTION void operator()(const ThreadID tid) const;
452 #endif
453 
457  struct Sparsity
458  {
462  };
463 
464 private:
468  void setupVariables();
472  void setupDofs();
476  void setupSparsity();
480  void setupNodalBCDofs();
486  void getNodalBCDofs(const NodalBCBase * nbc, Array<bool> & dofs);
487 
499  const MooseMesh & _mesh;
511  const unsigned int _num_vars;
520 
528 
535 
542 
562 
575 
582 
593 
598 };
599 
600 #ifdef MOOSE_KOKKOS_SCOPE
601 KOKKOS_FUNCTION inline ADReal
602 System::getVectorDofADValue(const dof_id_type dof, TagID tag, const Real seed) const
603 {
604  ADReal value = _vectors[tag][dof];
605 
606  if (seed != 0)
607  value.derivatives().insert(_local_to_global_dof_index[dof]) = seed;
608 
609  return value;
610 }
611 
612 KOKKOS_FUNCTION inline ADReal
614  const dof_id_type offset,
615  const dof_id_type qp,
616  const unsigned int var,
617  const TagID tag,
618  const Real seed) const
619 {
620  ADReal value = 0;
621 
622  if (seed == 0)
623  value = getVectorQpValue(info, offset + qp, var, tag);
624  else
625  {
626  auto fe = _var_fe_types[var];
627  auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
628  auto & phi = kokkosAssembly().getPhi(info.subdomain, info.type, fe);
629 
630  for (unsigned int i = 0; i < n_dofs; ++i)
631  value += getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) * phi(i, qp);
632  }
633 
634  return value;
635 }
636 
637 KOKKOS_FUNCTION inline ADReal3
639  const Real33 jacobian,
640  const dof_id_type offset,
641  const dof_id_type qp,
642  const unsigned int var,
643  const TagID tag,
644  const Real seed) const
645 {
646  ADReal3 grad;
647 
648  if (seed == 0)
649  grad = getVectorQpGrad(info, offset + qp, var, tag);
650  else
651  {
652  auto fe = _var_fe_types[var];
653  auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
654  auto & grad_phi = kokkosAssembly().getGradPhi(info.subdomain, info.type, fe);
655 
656  for (unsigned int i = 0; i < n_dofs; ++i)
657  grad += getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) *
658  (jacobian * grad_phi(i, qp));
659  }
660 
661  return grad;
662 }
663 
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
670 {
671  auto fe = _var_fe_types[var];
672  auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
673  auto & phi = kokkosAssembly().getPhiFace(info.subdomain, info.type, fe)(side);
674 
675  Real value = 0;
676 
677  for (unsigned int i = 0; i < n_dofs; ++i)
678  value += getVectorDofValue(getElemLocalDofIndex(info.id, i, var), tag) * phi(i, qp);
679 
680  return value;
681 }
682 
683 KOKKOS_FUNCTION inline ADReal
685  const unsigned int side,
686  const unsigned int qp,
687  const unsigned int var,
688  const TagID tag,
689  const Real seed) const
690 {
691  auto fe = _var_fe_types[var];
692  auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
693  auto & phi = kokkosAssembly().getPhiFace(info.subdomain, info.type, fe)(side);
694 
695  ADReal value = 0;
696 
697  for (unsigned int i = 0; i < n_dofs; ++i)
698  value += getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) * phi(i, qp);
699 
700  return value;
701 }
702 
703 KOKKOS_FUNCTION inline Real3
705  const unsigned int side,
706  const Real33 jacobian,
707  const unsigned int qp,
708  const unsigned int var,
709  const TagID tag) const
710 {
711  auto fe = _var_fe_types[var];
712  auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
713  auto & grad_phi = kokkosAssembly().getGradPhiFace(info.subdomain, info.type, fe)(side);
714 
715  Real3 grad = 0;
716 
717  for (unsigned int i = 0; i < n_dofs; ++i)
718  grad += getVectorDofValue(getElemLocalDofIndex(info.id, i, var), tag) *
719  (jacobian * grad_phi(i, qp));
720 
721  return grad;
722 }
723 
724 KOKKOS_FUNCTION inline ADReal3
726  const unsigned int side,
727  const Real33 jacobian,
728  const unsigned int qp,
729  const unsigned int var,
730  const TagID tag,
731  const Real seed) const
732 {
733  auto fe = _var_fe_types[var];
734  auto n_dofs = kokkosAssembly().getNumDofs(info.type, fe);
735  auto & grad_phi = kokkosAssembly().getGradPhiFace(info.subdomain, info.type, fe)(side);
736 
737  ADReal3 grad = ADReal(0);
738 
739  for (unsigned int i = 0; i < n_dofs; ++i)
740  grad += getVectorDofADValue(getElemLocalDofIndex(info.id, i, var), tag, seed) *
741  (jacobian * grad_phi(i, qp));
742 
743  return grad;
744 }
745 #endif
746 
754 {
755 public:
760  SystemHolder(Array<System> & systems) : _systems_host(systems), _systems_device(systems) {}
764  SystemHolder(const SystemHolder & holder)
766  {
767  }
768 
769 #ifdef MOOSE_KOKKOS_SCOPE
770 
775  KOKKOS_FUNCTION const Array<System> & kokkosSystems() const
776  {
777  KOKKOS_IF_ON_HOST(return _systems_host;)
778 
779  return _systems_device;
780  }
792  KOKKOS_FUNCTION const System & kokkosSystem(unsigned int sys) const
793  {
794  KOKKOS_IF_ON_HOST(return _systems_host[sys];)
795 
796  return _systems_device[sys];
797  }
803  System & kokkosSystem(unsigned int sys) { return _systems_host[sys]; }
804 #endif
805 
806 private:
815 };
816 
817 } // namespace Moose::Kokkos
SystemHolder(Array< System > &systems)
Constructor.
Definition: KokkosSystem.h:760
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.
Definition: KokkosSystem.h:278
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:212
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.
Definition: KokkosSystem.h:225
MemcpyType
The enumerator that dictates the memory copy direction.
Definition: KokkosArray.h:40
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.
Definition: KokkosSystem.h:532
const auto & getLocalCommList() const
Get the list of local DOF indices to communicate.
Definition: KokkosSystem.h:130
The Kokkos object that contains the information of an element The IDs used in Kokkos are different fr...
Definition: KokkosMesh.h:33
KOKKOS_FUNCTION Real & getMatrixValue(dof_id_type row, dof_id_type col, TagID tag) const
Get an entry from a tagged matrix.
Definition: KokkosSystem.h:443
void clearActiveResidualTags()
Clear the cached active residual tags.
Definition: KokkosSystem.h:95
Array< Array< bool > > _nbc_matrix_tag_dof
Flag whether each DOF is covered by a nodal BC for each matrix tag.
Definition: KokkosSystem.h:585
Array< dof_id_type > _local_to_global_dof_index
Map from local DOF index to global DOF index.
Definition: KokkosSystem.h:545
Array< bool > _residual_tag_active
Flag whether each tag is active.
Definition: KokkosSystem.h:579
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.
unsigned int TagID
Definition: MooseTypes.h:238
Thread _thread
Kokkos thread object.
Definition: KokkosSystem.h:491
void setupNodalBCDofs()
Mark the DOFs covered by nodal BCs.
MPI_Info info
dof_id_type ContiguousElementID
Definition: KokkosMesh.h:20
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) ...
Definition: KokkosSystem.h:613
const auto & getGhostCommList() const
Get the list of ghost DOF indices to communicate.
Definition: KokkosSystem.h:135
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...
Definition: KokkosSystem.h:201
KOKKOS_FUNCTION dof_id_type getNumGhostDofs() const
Get the number of ghost DOFs.
Definition: KokkosSystem.h:194
KOKKOS_FUNCTION dof_id_type getNumLocalDofs() const
Get the number of local DOFs.
Definition: KokkosSystem.h:189
char ** vars
const auto & getComm() const
Get the libMesh communicator.
Definition: KokkosSystem.h:125
const MooseMesh & _mesh
Reference of the MOOSE mesh.
Definition: KokkosSystem.h:499
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
Definition: KokkosSystem.h:540
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...
Definition: KokkosSystem.h:753
const auto & getSparsity() const
Get the sparisty pattern data.
Definition: KokkosSystem.h:140
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.
Definition: KokkosSystem.h:665
Base class for a system (of equations)
Definition: SystemBase.h:85
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) ...
Definition: KokkosSystem.h:638
The Kokkos system class.
Definition: KokkosSystem.h:34
The Kokkos interface that holds the host reference of the Kokkos mesh and copies it to device during ...
Definition: KokkosMesh.h:430
KOKKOS_FUNCTION Real & getVectorDofValue(const dof_id_type dof, const TagID tag) const
Get the DOF value of a tagged vector.
Definition: KokkosSystem.h:291
Array< TagID > _active_matrix_tags
Definition: KokkosSystem.h:573
DualNumber< Real, DNDerivativeType, false > ADReal
Definition: KokkosADReal.h:28
const auto & getSystem() const
Definition: KokkosSystem.h:114
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.
SystemBase & _system
Reference of the MOOSE system.
Definition: KokkosSystem.h:495
void clearActiveMatrixTags()
Clear the cached active matrix tags.
Definition: KokkosSystem.h:103
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)
Definition: KokkosSystem.h:602
Array< Vector > _vectors
Kokkos vectors and matrices on device.
Definition: KokkosSystem.h:525
MOOSE_KOKKOS_INDEX_TYPE ThreadID
Definition: KokkosThread.h:22
virtual libMesh::DofMap & dofMap()
Gets writeable reference to the dof map.
Definition: SystemBase.C:1164
KOKKOS_FUNCTION dof_id_type localToGlobalDofIndex(dof_id_type dof) const
Get the global DOF index of a local DOF index.
Definition: KokkosSystem.h:259
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.
Definition: KokkosSystem.h:153
static constexpr dof_id_type invalid_id
dof_id_type ContiguousNodeID
Definition: KokkosMesh.h:21
KOKKOS_FUNCTION bool isResidualTagActive(TagID tag) const
Check whether a residual tag is active.
Definition: KokkosSystem.h:162
const auto & getDofMap() const
Get the libMesh DOF map.
Definition: KokkosSystem.h:120
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.
Definition: KokkosSystem.h:511
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.
Definition: KokkosSystem.h:704
KOKKOS_FUNCTION auto & getMatrix(TagID tag) const
Get a tagged Kokkos matrix.
Definition: KokkosSystem.h:284
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) ...
Definition: KokkosSystem.h:684
KOKKOS_FUNCTION bool isNodalDefined(ContiguousNodeID node, unsigned int var) const
Get whether a variable is defined on a node.
Definition: KokkosSystem.h:269
void clearActiveSolutionTags()
Clear the cached active solution tags.
Definition: KokkosSystem.h:91
void clearActiveVariables()
Clear the cached active variables.
Definition: KokkosSystem.h:87
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:93
KOKKOS_FUNCTION const System & kokkosSystem(unsigned int sys) const
Get the const reference of a Kokkos system.
Definition: KokkosSystem.h:792
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.
Definition: KokkosSystem.h:785
void setupDofs()
Setup DOF data.
void setActiveVariables(const std::set< MooseVariableFieldBase *> &vars)
Set the active variables.
Array< TagID > _active_residual_tags
Definition: KokkosSystem.h:572
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...
Definition: KokkosSystem.h:175
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.
Definition: KokkosSystem.h:238
SystemHolder(const SystemHolder &holder)
Copy constructor.
Definition: KokkosSystem.h:764
const dof_id_type _num_local_dofs
Number of local DOFs.
Definition: KokkosSystem.h:515
void destroy()
Free all data and reset.
Definition: KokkosArray.h:674
KOKKOS_FUNCTION bool isMatrixTagActive(TagID tag) const
Check whether a matrix tag is active.
Definition: KokkosSystem.h:168
void setActiveMatrixTags(const std::set< TagID > &tags)
Set the active matrix tags.
The base class for Kokkos nodal boundary conditions.
Base class for deriving any boundary condition that works at nodes.
Definition: NodalBCBase.h:26
Interface for objects interacting with the PerfGraph.
const Array< System > _systems_device
Device copy of the Kokkos systems.
Definition: KokkosSystem.h:814
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.
Definition: KokkosSystem.h:344
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...
Definition: KokkosSystem.h:725
Array< unsigned int > _var_fe_types
FE type ID of each variable.
Definition: KokkosSystem.h:553
Array< Array< dof_id_type > > _ghost_comm_list
Definition: KokkosSystem.h:591
Array< Array2D< Array< Real3 > > > _qp_solutions_grad
Definition: KokkosSystem.h:533
Array< Array< dof_id_type > > _local_comm_list
List of DOFs to send and receive.
Definition: KokkosSystem.h:590
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.
Definition: KokkosSystem.h:113
KOKKOS_FUNCTION dof_id_type getNodeGlobalDofIndex(ContiguousNodeID node, unsigned int var) const
Get the global DOF index of a variable for a node.
Definition: KokkosSystem.h:250
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.
Definition: KokkosSystem.h:566
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.
Definition: KokkosSystem.h:313
const Parallel::Communicator & _comm
Reference of the libMesh communicator.
Definition: KokkosSystem.h:507
Array< System > & _systems_host
Host reference of the Kokkos systems.
Definition: KokkosSystem.h:810
CSR format sparsity data.
Definition: KokkosSystem.h:457
Array2D< bool > _var_subdomain_active
Whether each variable is active on subdomains.
Definition: KokkosSystem.h:557
const libMesh::DofMap & _dof_map
Reference of the libMesh DOF map.
Definition: KokkosSystem.h:503
const dof_id_type _num_ghost_dofs
Number of ghost DOFs.
Definition: KokkosSystem.h:519
System & kokkosSystem(unsigned int sys)
Get the writeable reference of a Kokkos system.
Definition: KokkosSystem.h:803
Array< Array< unsigned int > > _coupling
Off-diagonal coupled variable numbers of each variable.
Definition: KokkosSystem.h:561
KOKKOS_FUNCTION const auto & getCoupling(unsigned int var) const
Get the list of off-diagonal coupled variable numbers of a variable.
Definition: KokkosSystem.h:146
Array< TagID > _active_solution_tags
List of active tags.
Definition: KokkosSystem.h:571
Sparsity _sparsity
Matrix sparsity pattern data.
Definition: KokkosSystem.h:597
Array< unsigned int > _max_dofs_per_elem
Maximum number of DOFs per element for each variable.
Definition: KokkosSystem.h:549
Array< Array2D< dof_id_type > > _local_elem_dof_index
Local DOF index of each variable.
Definition: KokkosSystem.h:539
KOKKOS_FUNCTION unsigned int getFETypeID(unsigned int var) const
Get the FE type ID of a variable.
Definition: KokkosSystem.h:184
The Kokkos thread object that aids in converting the one-dimensional thread index into multi-dimensio...
Definition: KokkosThread.h:29
Array< bool > _matrix_tag_active
Definition: KokkosSystem.h:580
KOKKOS_FUNCTION const Array< System > & kokkosSystems() const
Get the const reference of the Kokkos systems.
Definition: KokkosSystem.h:775
uint8_t dof_id_type
Array< Matrix > _matrices
Definition: KokkosSystem.h:526