https://mooseframework.inl.gov
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Moose::Kokkos::Assembly Class Reference

The Kokkos assembly class. More...

#include <KokkosAssembly.h>

Inheritance diagram for Moose::Kokkos::Assembly:
[legend]

Public Member Functions

 Assembly (FEProblemBase &problem)
 Constructor. More...
 
void init ()
 Initialize assembly. More...
 
unsigned int getFETypeID (FEType type) const
 Get the FE type ID. More...
 
KOKKOS_FUNCTION unsigned int getDimension () const
 Get the mesh dimension. More...
 
KOKKOS_FUNCTION unsigned int getMaxQpsPerElem () const
 Get the maximum number of quadrature points per element in the current partition. More...
 
KOKKOS_FUNCTION dof_id_type getNumQps (ContiguousSubdomainID subdomain) const
 Get the total number of elemental quadrature points in a subdomain. More...
 
KOKKOS_FUNCTION unsigned int getNumQps (ElementInfo info) const
 Get the number of quadrature points of an element. More...
 
KOKKOS_FUNCTION dof_id_type getNumFaceQps (ContiguousSubdomainID subdomain) const
 Get the total number of facial quadrature points in a subdomain NOTE: This number does not represent the real number of facial quadrature points but only the facial quadrature points that need global caching, such as face material properties. More...
 
KOKKOS_FUNCTION unsigned int getNumFaceQps (ElementInfo info, unsigned int side) const
 Get the number of quadrature points of a side of an element. More...
 
KOKKOS_FUNCTION dof_id_type getQpOffset (ElementInfo info) const
 Get the starting offset of quadrature points of an element into the global quadrature point index. More...
 
KOKKOS_FUNCTION dof_id_type getQpFaceOffset (ElementInfo info, unsigned int side) const
 Get the starting offset of quadrature points of a side of an element into the global quadrature point index. More...
 
KOKKOS_FUNCTION dof_id_type getElemFacePropertyIndex (ElementInfo info, unsigned int side) const
 Get the index of a side of an element into the element-constant face material property data. More...
 
KOKKOS_FUNCTION dof_id_type getElemFacePropertySize (ContiguousSubdomainID subdomain) const
 Get the size of element-constant face material property data storage of a subdomain. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
KOKKOS_FUNCTION Real33 getJacobian (ElementInfo info, unsigned int qp) const
 Get the inverse of Jacobian matrix of an element quadrature point. More...
 
KOKKOS_FUNCTION Real getJxW (ElementInfo info, unsigned int qp) const
 Get the transformed Jacobian weight of an element quadrature point. More...
 
KOKKOS_FUNCTION Real3 getQPoint (ElementInfo info, unsigned int qp) const
 Get the coordinate of an element quadrature point. More...
 
KOKKOS_FUNCTION Real coordTransformFactor (const ContiguousSubdomainID subdomain, const Real3 point) const
 Get the coordinate transform factor for a point in a subdomain. More...
 
KOKKOS_FUNCTION void computePhysicalMap (const ElementInfo info, const unsigned int qp, Real33 *const jacobian, Real *const JxW, Real3 *const q_points) const
 Compute physical transformation data for an element. More...
 
KOKKOS_FUNCTION void computePhysicalMap (const ElementInfo info, const unsigned int side, const unsigned int qp, Real33 *const jacobian, Real *const JxW, Real3 *const q_points, Real3 *const normal) const
 Compute physical transformation data for a side. More...
 
KOKKOS_FUNCTION void operator() (const ThreadID tid) const
 Kokkos function for caching physical maps on element quadrature points. More...
 
const auto & getMaterialBoundaries () const
 Get the list of boundaries to cache face material properties. More...
 
KOKKOS_FUNCTION const MeshkokkosMesh () const
 Get the const reference of the Kokkos mesh. More...
 

Private Member Functions

void initQuadrature ()
 Initialize quadrature data. More...
 
void initShape ()
 Initialize shape data. More...
 
void cachePhysicalMap ()
 Cache physical maps on element quadrature points. More...
 

Private Attributes

FEProblemBase_problem
 Reference of the MOOSE problem. More...
 
MooseMesh_mesh
 Reference of the MOOSE mesh. More...
 
std::map< FEType, unsigned int_fe_type_map
 FE type ID map. More...
 
const unsigned int _dimension
 Mesh dimension. More...
 
Array< Moose::CoordinateSystemType_coord_type
 Coordinate system type of each subdomain. More...
 
unsigned int _rz_radial_coord = libMesh::invalid_uint
 Radial coordinate index in cylindrical coordinate system. More...
 
Array< Pair< Real3, Real3 > > _rz_axis
 General axisymmetric axis of each subdomain in cylindrical coordinate system. More...
 
std::set< BoundaryID_material_boundaries
 Boundaries to cache face material properties. More...
 
Array< dof_id_type_qp_offset
 Starting offset into the global quadrature point index NOTE: The global quadrature point index is subdomain-wise. More...
 
Array2D< dof_id_type_qp_offset_face
 
Array< unsigned int_n_qps
 Number of quadrature points. More...
 
Array2D< unsigned int_n_qps_face
 
unsigned int _max_qps_per_elem = 0
 
Array< dof_id_type_n_subdomain_qps
 
Array< dof_id_type_n_subdomain_qps_face
 
Array2D< dof_id_type_elem_face_property_idx
 Index into the element-constant face material property data. More...
 
Array< dof_id_type_n_elem_face_properties
 
Array2D< Array< Real3 > > _q_points
 Quadrature points and weights for reference elements. More...
 
Array2D< Array< Array< Real3 > > > _q_points_face
 
Array2D< Array< Real > > _weights
 
Array2D< Array< Array< Real > > > _weights_face
 
Array3D< Array2D< Real > > _phi
 Shape functions for reference elements. More...
 
Array3D< Array< Array2D< Real > > > _phi_face
 
Array3D< Array2D< Real3 > > _grad_phi
 
Array3D< Array< Array2D< Real3 > > > _grad_phi_face
 
Array2D< unsigned int_n_dofs
 
Array2D< Array2D< Real > > _map_phi
 Shape functions for computing reference-to-physical maps. More...
 
Array2D< Array< Array2D< Real > > > _map_phi_face
 
Array2D< Array< Array2D< Real > > > _map_psi_face
 
Array2D< Array2D< Real3 > > _map_grad_phi
 
Array2D< Array< Array2D< Real3 > > > _map_grad_phi_face
 
Array2D< Array< Array2D< Real3 > > > _map_grad_psi_face
 
Array2D< Array< Array2D< Real > > > _normal_dx_dxi
 Shape functions for computing normal vectors. More...
 
Array2D< Array< Array2D< Real > > > _normal_dx_deta
 
Array< Array< Real33 > > _jacobian
 Cached physical maps on element quadrature points. More...
 
Array< Array< Real > > _jxw
 
Array< Array< Real3 > > _xyz
 

Detailed Description

The Kokkos assembly class.

Definition at line 28 of file KokkosAssembly.h.

Constructor & Destructor Documentation

◆ Assembly()

Moose::Kokkos::Assembly::Assembly ( FEProblemBase problem)

Constructor.

Parameters
problemThe MOOSE problem

Member Function Documentation

◆ cachePhysicalMap()

void Moose::Kokkos::Assembly::cachePhysicalMap ( )
private

Cache physical maps on element quadrature points.

◆ computePhysicalMap() [1/2]

KOKKOS_FUNCTION void Assembly::computePhysicalMap ( const ElementInfo  info,
const unsigned int  qp,
Real33 *const  jacobian,
Real *const  JxW,
Real3 *const  q_points 
) const
inline

Compute physical transformation data for an element.

Parameters
infoThe element information object
qpThe local quadrature point index
jacobianThe pointer to store the inverse of Jacobian matrix
JxWThe pointer to store transformed Jacobian weight
q_pointsThe pointer to store physical quadrature point coordinate

Definition at line 417 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::Datum::reinitTransform().

422 {
423  auto sid = info.subdomain;
424  auto eid = info.id;
425  auto elem_type = info.type;
426  auto num_nodes = kokkosMesh().getNumNodes(elem_type);
427 
428  auto & phi = _map_phi(sid, elem_type);
429  auto & grad_phi = _map_grad_phi(sid, elem_type);
430 
431  Real33 J;
432  Real3 xyz;
433 
434  for (unsigned int node = 0; node < num_nodes; ++node)
435  {
436  auto points = kokkosMesh().getNodePoint(kokkosMesh().getContiguousNodeID(eid, node));
437 
438  if (jacobian || JxW)
439  J += grad_phi(node, qp).cartesian_product(points);
440 
441  xyz += phi(node, qp) * points;
442  }
443 
444  if (jacobian)
445  *jacobian = J.inverse(_dimension);
446 
447  if (JxW)
448  *JxW =
449  J.determinant(_dimension) * _weights(sid, elem_type)[qp] * coordTransformFactor(sid, xyz);
450 
451  if (q_points)
452  *q_points = xyz;
453 }
Array2D< Array< Real > > _weights
Vector3< Real > Real3
Definition: KokkosTypes.h:31
MPI_Info info
KOKKOS_INLINE_FUNCTION Real33 inverse(const unsigned int dim=3) const
Definition: KokkosTypes.h:380
const unsigned int _dimension
Mesh dimension.
KOKKOS_FUNCTION Real coordTransformFactor(const ContiguousSubdomainID subdomain, const Real3 point) const
Get the coordinate transform factor for a point in a subdomain.
Array2D< Array2D< Real > > _map_phi
Shape functions for computing reference-to-physical maps.
KOKKOS_FUNCTION unsigned int getNumNodes(unsigned int elem_type) const
Get the number of nodes of an element type.
Definition: KokkosMesh.h:208
KOKKOS_INLINE_FUNCTION Real33 cartesian_product(const Real3 vector) const
KOKKOS_FUNCTION Real3 getNodePoint(ContiguousNodeID node) const
Get the coordinate of a node.
Definition: KokkosMesh.h:272
KOKKOS_INLINE_FUNCTION Real determinant(const unsigned int dim=3) const
Definition: KokkosTypes.h:361
KOKKOS_FUNCTION const Mesh & kokkosMesh() const
Get the const reference of the Kokkos mesh.
Definition: KokkosMesh.h:452
Array2D< Array2D< Real3 > > _map_grad_phi

◆ computePhysicalMap() [2/2]

KOKKOS_FUNCTION void Assembly::computePhysicalMap ( const ElementInfo  info,
const unsigned int  side,
const unsigned int  qp,
Real33 *const  jacobian,
Real *const  JxW,
Real3 *const  q_points,
Real3 *const  normal 
) const
inline

Compute physical transformation data for a side.

Parameters
infoThe element information object
sideThe side index
qpThe local quadrature point index
jacobianThe pointer to store the inverse of Jacobian matrix
JxWThe pointer to store transformed Jacobian weight
q_pointsThe pointer to store physical quadrature point coordinate
normalThe pointer to store normal vector

Definition at line 456 of file KokkosAssembly.h.

463 {
464  auto sid = info.subdomain;
465  auto eid = info.id;
466  auto elem_type = info.type;
467  auto num_nodes = kokkosMesh().getNumNodes(elem_type);
468  auto num_side_nodes = kokkosMesh().getNumNodes(elem_type, side);
469 
470  auto & phi = _map_phi_face(sid, elem_type)(side);
471  auto & grad_phi = _map_grad_phi_face(sid, elem_type)(side);
472 
473  auto & normal_dx_dxi = _normal_dx_dxi(sid, elem_type)(side);
474  auto & normal_dx_deta = _normal_dx_deta(sid, elem_type)(side);
475 
476  Real33 J;
477  Real3 xyz;
478 
479  Real3 dxyz_dxi;
480  Real3 dxyz_deta;
481 
482  for (unsigned int node = 0; node < num_nodes; ++node)
483  {
484  auto points = kokkosMesh().getNodePoint(kokkosMesh().getContiguousNodeID(eid, node));
485 
486  if (jacobian)
487  J += grad_phi(node, qp).cartesian_product(points);
488 
489  if (JxW || q_points)
490  xyz += phi(node, qp) * points;
491 
492  if (normal)
493  {
494  if (_dimension < 3)
495  dxyz_dxi += normal_dx_dxi(node, qp) * points;
496  if (_dimension == 2)
497  dxyz_deta += normal_dx_deta(node, qp) * points;
498  }
499  }
500 
501  if (jacobian)
502  *jacobian = J.inverse(_dimension);
503 
504  if (q_points)
505  *q_points = xyz;
506 
507  if (JxW || (normal && _dimension > 1))
508  {
509  J = 0;
510 
511  auto & grad_psi = _map_grad_psi_face(sid, elem_type)(side);
512 
513  for (unsigned int node = 0; node < num_side_nodes; ++node)
514  {
515  auto points = kokkosMesh().getNodePoint(kokkosMesh().getContiguousNodeID(info, side, node));
516 
517  J += grad_psi(node, qp).cartesian_product(points);
518  }
519  }
520 
521  if (JxW)
522  *JxW = ::Kokkos::sqrt((J * J.transpose()).determinant(_dimension - 1)) *
523  _weights_face(sid, elem_type)[side][qp] * coordTransformFactor(sid, xyz);
524 
525  if (normal)
526  {
527  if (_dimension == 3)
528  *normal = J.row(0).cross_product(J.row(1));
529  else if (_dimension == 2)
530  *normal = J.row(0).cross_product(dxyz_dxi.cross_product(dxyz_deta));
531  else
532  *normal = side ? dxyz_dxi : -dxyz_dxi;
533 
534  *normal *= 1.0 / normal->norm();
535  }
536 }
Array2D< Array< Array2D< Real3 > > > _map_grad_psi_face
Vector3< Real > Real3
Definition: KokkosTypes.h:31
Array2D< Array< Array2D< Real > > > _map_phi_face
MPI_Info info
KOKKOS_INLINE_FUNCTION Real33 inverse(const unsigned int dim=3) const
Definition: KokkosTypes.h:380
Array2D< Array< Array2D< Real > > > _normal_dx_deta
const unsigned int _dimension
Mesh dimension.
Array2D< Array< Array< Real > > > _weights_face
KOKKOS_FUNCTION Real coordTransformFactor(const ContiguousSubdomainID subdomain, const Real3 point) const
Get the coordinate transform factor for a point in a subdomain.
Array2D< Array< Array2D< Real3 > > > _map_grad_phi_face
KOKKOS_FUNCTION unsigned int getNumNodes(unsigned int elem_type) const
Get the number of nodes of an element type.
Definition: KokkosMesh.h:208
Array2D< Array< Array2D< Real > > > _normal_dx_dxi
Shape functions for computing normal vectors.
KOKKOS_INLINE_FUNCTION Real33 cartesian_product(const Real3 vector) const
KOKKOS_FUNCTION Real3 getNodePoint(ContiguousNodeID node) const
Get the coordinate of a node.
Definition: KokkosMesh.h:272
KOKKOS_FUNCTION const Mesh & kokkosMesh() const
Get the const reference of the Kokkos mesh.
Definition: KokkosMesh.h:452
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh

◆ coordTransformFactor()

KOKKOS_FUNCTION Real Assembly::coordTransformFactor ( const ContiguousSubdomainID  subdomain,
const Real3  point 
) const
inline

Get the coordinate transform factor for a point in a subdomain.

Parameters
subdomainThe contiguous subdomain ID
pointThe point coordinate
Returns
The coordinate transform factor

Definition at line 397 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

398 {
399  switch (_coord_type[subdomain])
400  {
401  case Moose::COORD_XYZ:
402  return 1;
403  case Moose::COORD_RZ:
405  return 2 * M_PI *
406  (point - _rz_axis[subdomain].first).cross_product(_rz_axis[subdomain].second).norm();
407  else
408  return 2 * M_PI * point(_rz_radial_coord);
410  return 4 * M_PI * point(0) * point(0);
411  default:
412  return 0;
413  }
414 }
unsigned int _rz_radial_coord
Radial coordinate index in cylindrical coordinate system.
const unsigned int invalid_uint
Array< Pair< Real3, Real3 > > _rz_axis
General axisymmetric axis of each subdomain in cylindrical coordinate system.
Array< Moose::CoordinateSystemType > _coord_type
Coordinate system type of each subdomain.

◆ getDimension()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::Assembly::getDimension ( ) const
inline

Get the mesh dimension.

Returns
The mesh dimension

Definition at line 52 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::Datum::J().

52 { return _dimension; }
const unsigned int _dimension
Mesh dimension.

◆ getElemFacePropertyIndex()

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::Assembly::getElemFacePropertyIndex ( ElementInfo  info,
unsigned int  side 
) const
inline

Get the index of a side of an element into the element-constant face material property data.

Parameters
infoThe element information object
sideThe side index
Returns
The index

Definition at line 118 of file KokkosAssembly.h.

119  {
120  return _elem_face_property_idx(side, info.id);
121  }
MPI_Info info
Array2D< dof_id_type > _elem_face_property_idx
Index into the element-constant face material property data.

◆ getElemFacePropertySize()

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::Assembly::getElemFacePropertySize ( ContiguousSubdomainID  subdomain) const
inline

Get the size of element-constant face material property data storage of a subdomain.

Parameters
subdomainThe contiguous subdomain ID
Returns
The storage size

Definition at line 127 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::MaterialProperty< Real >::allocate().

128  {
129  return _n_elem_face_properties[subdomain];
130  }
Array< dof_id_type > _n_elem_face_properties

◆ getFETypeID()

unsigned int Moose::Kokkos::Assembly::getFETypeID ( FEType  type) const
inline

Get the FE type ID.

Parameters
typeThe libMesh FEType object
Returns
The FE type ID

Definition at line 47 of file KokkosAssembly.h.

47 { return libmesh_map_find(_fe_type_map, type); }
std::map< FEType, unsigned int > _fe_type_map
FE type ID map.

◆ getGradPhi()

KOKKOS_FUNCTION const auto& Moose::Kokkos::Assembly::getGradPhi ( ContiguousSubdomainID  subdomain,
unsigned int  elem_type,
unsigned int  fe_type 
) const
inline

Get the gradient of shape functions of a FE type for an element type and subdomain.

Parameters
subdomainThe contiguous subdomain ID
elem_typeThe element type ID
fe_typeThe FE type ID
Returns
The gradient of shape functions at quadrature points

Definition at line 173 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::System::getVectorQpADGrad(), Moose::Kokkos::VariablePhiGradient::operator()(), and Moose::Kokkos::VariableTestGradient::operator()().

174  {
175  return _grad_phi(subdomain, elem_type, fe_type);
176  }
Array3D< Array2D< Real3 > > _grad_phi

◆ getGradPhiFace()

KOKKOS_FUNCTION const auto& Moose::Kokkos::Assembly::getGradPhiFace ( ContiguousSubdomainID  subdomain,
unsigned int  elem_type,
unsigned int  fe_type 
) const
inline

Get the gradient of face shape functions of a FE type for an element type and subdomain.

Parameters
subdomainThe contiguous subdomain ID
elem_typeThe element type ID
fe_typeThe FE type ID
Returns
The gradient of shape functions of all sides at quadrature points

Definition at line 184 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::System::getVectorQpADGradFace(), Moose::Kokkos::System::getVectorQpGradFace(), Moose::Kokkos::VariablePhiGradient::operator()(), and Moose::Kokkos::VariableTestGradient::operator()().

187  {
188  return _grad_phi_face(subdomain, elem_type, fe_type);
189  }
Array3D< Array< Array2D< Real3 > > > _grad_phi_face

◆ getJacobian()

KOKKOS_FUNCTION Real33 Moose::Kokkos::Assembly::getJacobian ( ElementInfo  info,
unsigned int  qp 
) const
inline

Get the inverse of Jacobian matrix of an element quadrature point.

Parameters
infoThe element information object
qpThe local quadrature point index
Returns
The inverse of Jacobian matrix

Definition at line 196 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::Datum::reinitTransform().

197  {
198  return _jacobian[info.subdomain][getQpOffset(info) + qp];
199  }
KOKKOS_FUNCTION dof_id_type getQpOffset(ElementInfo info) const
Get the starting offset of quadrature points of an element into the global quadrature point index...
MPI_Info info
Array< Array< Real33 > > _jacobian
Cached physical maps on element quadrature points.

◆ getJxW()

KOKKOS_FUNCTION Real Moose::Kokkos::Assembly::getJxW ( ElementInfo  info,
unsigned int  qp 
) const
inline

Get the transformed Jacobian weight of an element quadrature point.

Parameters
infoThe element information object
qpThe local quadrature point index
Returns
The inverse of Jacobian matrix

Definition at line 206 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::Datum::reinitTransform().

207  {
208  return _jxw[info.subdomain][getQpOffset(info) + qp];
209  }
KOKKOS_FUNCTION dof_id_type getQpOffset(ElementInfo info) const
Get the starting offset of quadrature points of an element into the global quadrature point index...
MPI_Info info
Array< Array< Real > > _jxw

◆ getMaterialBoundaries()

const auto& Moose::Kokkos::Assembly::getMaterialBoundaries ( ) const
inline

Get the list of boundaries to cache face material properties.

Returns
The list of boundaries

Definition at line 269 of file KokkosAssembly.h.

269 { return _material_boundaries; }
std::set< BoundaryID > _material_boundaries
Boundaries to cache face material properties.

◆ getMaxQpsPerElem()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::Assembly::getMaxQpsPerElem ( ) const
inline

Get the maximum number of quadrature points per element in the current partition.

Returns
The maximum number of quadrature points per element

Definition at line 57 of file KokkosAssembly.h.

57 { return _max_qps_per_elem; }
unsigned int _max_qps_per_elem

◆ getNumDofs()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::Assembly::getNumDofs ( unsigned int  elem_type,
unsigned int  fe_type 
) const
inline

Get the number of DOFs of a FE type for an element type.

Parameters
elem_typeThe element type ID
fe_typeThe FE type ID
Returns
The number of DOFs

Definition at line 137 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::System::getVectorQpADGrad(), Moose::Kokkos::System::getVectorQpADGradFace(), Moose::Kokkos::System::getVectorQpADValue(), Moose::Kokkos::System::getVectorQpADValueFace(), Moose::Kokkos::System::getVectorQpGradFace(), and Moose::Kokkos::System::getVectorQpValueFace().

138  {
139  return _n_dofs(elem_type, fe_type);
140  }
Array2D< unsigned int > _n_dofs

◆ getNumFaceQps() [1/2]

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::Assembly::getNumFaceQps ( ContiguousSubdomainID  subdomain) const
inline

Get the total number of facial quadrature points in a subdomain NOTE: This number does not represent the real number of facial quadrature points but only the facial quadrature points that need global caching, such as face material properties.

Parameters
subdomainThe contiguous subdomain ID
Returns
The number of quadrature points

Definition at line 80 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::MaterialProperty< Real >::allocate().

81  {
82  return _n_subdomain_qps_face[subdomain];
83  }
Array< dof_id_type > _n_subdomain_qps_face

◆ getNumFaceQps() [2/2]

KOKKOS_FUNCTION unsigned int Moose::Kokkos::Assembly::getNumFaceQps ( ElementInfo  info,
unsigned int  side 
) const
inline

Get the number of quadrature points of a side of an element.

Parameters
infoThe element information object
sideThe side index
Returns
The number of quadrature points

Definition at line 90 of file KokkosAssembly.h.

91  {
92  return _n_qps_face(side, info.id);
93  }
Array2D< unsigned int > _n_qps_face
MPI_Info info

◆ getNumQps() [1/2]

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::Assembly::getNumQps ( ContiguousSubdomainID  subdomain) const
inline

Get the total number of elemental quadrature points in a subdomain.

Parameters
subdomainThe contiguous subdomain ID
Returns
The number of quadrature points

Definition at line 63 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::MaterialProperty< Real >::allocate().

64  {
65  return _n_subdomain_qps[subdomain];
66  }
Array< dof_id_type > _n_subdomain_qps

◆ getNumQps() [2/2]

KOKKOS_FUNCTION unsigned int Moose::Kokkos::Assembly::getNumQps ( ElementInfo  info) const
inline

Get the number of quadrature points of an element.

Parameters
infoThe element information object
Returns
The number of quadrature points

Definition at line 72 of file KokkosAssembly.h.

72 { return _n_qps[info.id]; }
MPI_Info info
Array< unsigned int > _n_qps
Number of quadrature points.

◆ getPhi()

KOKKOS_FUNCTION const auto& Moose::Kokkos::Assembly::getPhi ( ContiguousSubdomainID  subdomain,
unsigned int  elem_type,
unsigned int  fe_type 
) const
inline

Get the shape functions of a FE type for an element type and subdomain.

Parameters
subdomainThe contiguous subdomain ID
elem_typeThe element type ID
fe_typeThe FE type ID
Returns
The shape functions at quadrature points

Definition at line 149 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::System::getVectorQpADValue(), Moose::Kokkos::VariablePhiValue::operator()(), and Moose::Kokkos::VariableTestValue::operator()().

150  {
151  return _phi(subdomain, elem_type, fe_type);
152  }
Array3D< Array2D< Real > > _phi
Shape functions for reference elements.

◆ getPhiFace()

KOKKOS_FUNCTION const auto& Moose::Kokkos::Assembly::getPhiFace ( ContiguousSubdomainID  subdomain,
unsigned int  elem_type,
unsigned int  fe_type 
) const
inline

Get the face shape functions of a FE type for an element type and subdomain.

Parameters
subdomainThe contiguous subdomain ID
elem_typeThe element type ID
fe_typeThe FE type ID
Returns
The shape functions of all sides at quadrature points

Definition at line 161 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::System::getVectorQpADValueFace(), Moose::Kokkos::System::getVectorQpValueFace(), Moose::Kokkos::VariablePhiValue::operator()(), and Moose::Kokkos::VariableTestValue::operator()().

162  {
163  return _phi_face(subdomain, elem_type, fe_type);
164  }
Array3D< Array< Array2D< Real > > > _phi_face

◆ getQpFaceOffset()

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::Assembly::getQpFaceOffset ( ElementInfo  info,
unsigned int  side 
) const
inline

Get the starting offset of quadrature points of a side of an element into the global quadrature point index.

Parameters
infoThe element information object
sideThe side index
Returns
The starting offset

Definition at line 108 of file KokkosAssembly.h.

109  {
110  return _qp_offset_face(side, info.id);
111  }
MPI_Info info
Array2D< dof_id_type > _qp_offset_face

◆ getQpOffset()

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::Assembly::getQpOffset ( ElementInfo  info) const
inline

Get the starting offset of quadrature points of an element into the global quadrature point index.

Parameters
infoThe element information object
Returns
The starting offset

Definition at line 100 of file KokkosAssembly.h.

Referenced by getJacobian(), getJxW(), and getQPoint().

100 { return _qp_offset[info.id]; }
MPI_Info info
Array< dof_id_type > _qp_offset
Starting offset into the global quadrature point index NOTE: The global quadrature point index is sub...

◆ getQPoint()

KOKKOS_FUNCTION Real3 Moose::Kokkos::Assembly::getQPoint ( ElementInfo  info,
unsigned int  qp 
) const
inline

Get the coordinate of an element quadrature point.

Parameters
infoThe element information object
qpThe local quadrature point index
Returns
The inverse of Jacobian matrix

Definition at line 216 of file KokkosAssembly.h.

Referenced by Moose::Kokkos::Datum::reinitTransform().

217  {
218  return _xyz[info.subdomain][getQpOffset(info) + qp];
219  }
KOKKOS_FUNCTION dof_id_type getQpOffset(ElementInfo info) const
Get the starting offset of quadrature points of an element into the global quadrature point index...
MPI_Info info
Array< Array< Real3 > > _xyz

◆ init()

void Moose::Kokkos::Assembly::init ( )

Initialize assembly.

◆ initQuadrature()

void Moose::Kokkos::Assembly::initQuadrature ( )
private

Initialize quadrature data.

◆ initShape()

void Moose::Kokkos::Assembly::initShape ( )
private

Initialize shape data.

◆ kokkosMesh()

KOKKOS_FUNCTION const Mesh& Moose::Kokkos::MeshHolder::kokkosMesh ( ) const
inlineinherited

Get the const reference of the Kokkos mesh.

Returns
The const reference of the Kokkos mesh depending on the architecture this function is being called on

Definition at line 452 of file KokkosMesh.h.

Referenced by computePhysicalMap(), Moose::Kokkos::Kernel::operator()(), Moose::Kokkos::IntegratedBC::operator()(), Moose::Kokkos::Datum::q_point(), and KokkosBoundNodalKernel::skipOnBoundary().

453  {
454  KOKKOS_IF_ON_HOST(
456  "kokkosMesh() was called too early. Kokkos mesh is available after problem "
457  "initialization. Override initialSetup() if you need to setup your object data "
458  "using the Kokkos mesh.");
459 
460  return _mesh_host;)
461 
462  return _mesh_device;
463  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
bool initialized() const
Get whether the mesh was initialized.
Definition: KokkosMesh.h:68
const Mesh _mesh_device
Device copy of the Kokkos mesh.
Definition: KokkosMesh.h:474
const Mesh & _mesh_host
Host reference of the Kokkos mesh.
Definition: KokkosMesh.h:470

◆ operator()()

KOKKOS_FUNCTION void Moose::Kokkos::Assembly::operator() ( const ThreadID  tid) const

Kokkos function for caching physical maps on element quadrature points.

Member Data Documentation

◆ _coord_type

Array<Moose::CoordinateSystemType> Moose::Kokkos::Assembly::_coord_type
private

Coordinate system type of each subdomain.

Definition at line 306 of file KokkosAssembly.h.

Referenced by coordTransformFactor().

◆ _dimension

const unsigned int Moose::Kokkos::Assembly::_dimension
private

Mesh dimension.

Definition at line 302 of file KokkosAssembly.h.

Referenced by computePhysicalMap(), and getDimension().

◆ _elem_face_property_idx

Array2D<dof_id_type> Moose::Kokkos::Assembly::_elem_face_property_idx
private

Index into the element-constant face material property data.

Definition at line 340 of file KokkosAssembly.h.

Referenced by getElemFacePropertyIndex().

◆ _fe_type_map

std::map<FEType, unsigned int> Moose::Kokkos::Assembly::_fe_type_map
private

FE type ID map.

Definition at line 297 of file KokkosAssembly.h.

Referenced by getFETypeID().

◆ _grad_phi

Array3D<Array2D<Real3> > Moose::Kokkos::Assembly::_grad_phi
private

Definition at line 358 of file KokkosAssembly.h.

Referenced by getGradPhi().

◆ _grad_phi_face

Array3D<Array<Array2D<Real3> > > Moose::Kokkos::Assembly::_grad_phi_face
private

Definition at line 359 of file KokkosAssembly.h.

Referenced by getGradPhiFace().

◆ _jacobian

Array<Array<Real33> > Moose::Kokkos::Assembly::_jacobian
private

Cached physical maps on element quadrature points.

Definition at line 384 of file KokkosAssembly.h.

Referenced by getJacobian().

◆ _jxw

Array<Array<Real> > Moose::Kokkos::Assembly::_jxw
private

Definition at line 385 of file KokkosAssembly.h.

Referenced by getJxW().

◆ _map_grad_phi

Array2D<Array2D<Real3> > Moose::Kokkos::Assembly::_map_grad_phi
private

Definition at line 369 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

◆ _map_grad_phi_face

Array2D<Array<Array2D<Real3> > > Moose::Kokkos::Assembly::_map_grad_phi_face
private

Definition at line 370 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

◆ _map_grad_psi_face

Array2D<Array<Array2D<Real3> > > Moose::Kokkos::Assembly::_map_grad_psi_face
private

Definition at line 371 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

◆ _map_phi

Array2D<Array2D<Real> > Moose::Kokkos::Assembly::_map_phi
private

Shape functions for computing reference-to-physical maps.

Definition at line 366 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

◆ _map_phi_face

Array2D<Array<Array2D<Real> > > Moose::Kokkos::Assembly::_map_phi_face
private

Definition at line 367 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

◆ _map_psi_face

Array2D<Array<Array2D<Real> > > Moose::Kokkos::Assembly::_map_psi_face
private

Definition at line 368 of file KokkosAssembly.h.

◆ _material_boundaries

std::set<BoundaryID> Moose::Kokkos::Assembly::_material_boundaries
private

Boundaries to cache face material properties.

Definition at line 392 of file KokkosAssembly.h.

Referenced by getMaterialBoundaries().

◆ _max_qps_per_elem

unsigned int Moose::Kokkos::Assembly::_max_qps_per_elem = 0
private

Definition at line 331 of file KokkosAssembly.h.

Referenced by getMaxQpsPerElem().

◆ _mesh

MooseMesh& Moose::Kokkos::Assembly::_mesh
private

Reference of the MOOSE mesh.

Definition at line 293 of file KokkosAssembly.h.

◆ _n_dofs

Array2D<unsigned int> Moose::Kokkos::Assembly::_n_dofs
private

Definition at line 360 of file KokkosAssembly.h.

Referenced by getNumDofs().

◆ _n_elem_face_properties

Array<dof_id_type> Moose::Kokkos::Assembly::_n_elem_face_properties
private

Definition at line 341 of file KokkosAssembly.h.

Referenced by getElemFacePropertySize().

◆ _n_qps

Array<unsigned int> Moose::Kokkos::Assembly::_n_qps
private

Number of quadrature points.

Definition at line 328 of file KokkosAssembly.h.

Referenced by getNumQps().

◆ _n_qps_face

Array2D<unsigned int> Moose::Kokkos::Assembly::_n_qps_face
private

Definition at line 329 of file KokkosAssembly.h.

Referenced by getNumFaceQps().

◆ _n_subdomain_qps

Array<dof_id_type> Moose::Kokkos::Assembly::_n_subdomain_qps
private

Definition at line 333 of file KokkosAssembly.h.

Referenced by getNumQps().

◆ _n_subdomain_qps_face

Array<dof_id_type> Moose::Kokkos::Assembly::_n_subdomain_qps_face
private

Definition at line 334 of file KokkosAssembly.h.

Referenced by getNumFaceQps().

◆ _normal_dx_deta

Array2D<Array<Array2D<Real> > > Moose::Kokkos::Assembly::_normal_dx_deta
private

Definition at line 378 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

◆ _normal_dx_dxi

Array2D<Array<Array2D<Real> > > Moose::Kokkos::Assembly::_normal_dx_dxi
private

Shape functions for computing normal vectors.

Definition at line 377 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

◆ _phi

Array3D<Array2D<Real> > Moose::Kokkos::Assembly::_phi
private

Shape functions for reference elements.

Definition at line 356 of file KokkosAssembly.h.

Referenced by getPhi().

◆ _phi_face

Array3D<Array<Array2D<Real> > > Moose::Kokkos::Assembly::_phi_face
private

Definition at line 357 of file KokkosAssembly.h.

Referenced by getPhiFace().

◆ _problem

FEProblemBase& Moose::Kokkos::Assembly::_problem
private

Reference of the MOOSE problem.

Definition at line 289 of file KokkosAssembly.h.

◆ _q_points

Array2D<Array<Real3> > Moose::Kokkos::Assembly::_q_points
private

Quadrature points and weights for reference elements.

Definition at line 347 of file KokkosAssembly.h.

◆ _q_points_face

Array2D<Array<Array<Real3> > > Moose::Kokkos::Assembly::_q_points_face
private

Definition at line 348 of file KokkosAssembly.h.

◆ _qp_offset

Array<dof_id_type> Moose::Kokkos::Assembly::_qp_offset
private

Starting offset into the global quadrature point index NOTE: The global quadrature point index is subdomain-wise.

Definition at line 321 of file KokkosAssembly.h.

Referenced by getQpOffset().

◆ _qp_offset_face

Array2D<dof_id_type> Moose::Kokkos::Assembly::_qp_offset_face
private

Definition at line 322 of file KokkosAssembly.h.

Referenced by getQpFaceOffset().

◆ _rz_axis

Array<Pair<Real3, Real3> > Moose::Kokkos::Assembly::_rz_axis
private

General axisymmetric axis of each subdomain in cylindrical coordinate system.

Definition at line 314 of file KokkosAssembly.h.

Referenced by coordTransformFactor().

◆ _rz_radial_coord

unsigned int Moose::Kokkos::Assembly::_rz_radial_coord = libMesh::invalid_uint
private

Radial coordinate index in cylindrical coordinate system.

Definition at line 310 of file KokkosAssembly.h.

Referenced by coordTransformFactor().

◆ _weights

Array2D<Array<Real> > Moose::Kokkos::Assembly::_weights
private

Definition at line 349 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

◆ _weights_face

Array2D<Array<Array<Real> > > Moose::Kokkos::Assembly::_weights_face
private

Definition at line 350 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

◆ _xyz

Array<Array<Real3> > Moose::Kokkos::Assembly::_xyz
private

Definition at line 386 of file KokkosAssembly.h.

Referenced by getQPoint().


The documentation for this class was generated from the following file: