https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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.
 
void init ()
 Initialize assembly.
 
unsigned int getFETypeID (FEType type) const
 Get the FE type ID.
 
KOKKOS_FUNCTION unsigned int getDimension () const
 Get the mesh dimension.
 
KOKKOS_FUNCTION unsigned int getMaxQpsPerElem () const
 Get the maximum number of quadrature points per element in the current partition.
 
KOKKOS_FUNCTION dof_id_type getNumQps (ContiguousSubdomainID subdomain) const
 Get the total number of elemental quadrature points in a subdomain.
 
KOKKOS_FUNCTION unsigned int getNumQps (ElementInfo info) const
 Get the number of quadrature points of an element.
 
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.
 
KOKKOS_FUNCTION unsigned int getNumFaceQps (ElementInfo info, unsigned int side) const
 Get the number of quadrature points of a side of an element.
 
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.
 
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.
 
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.
 
KOKKOS_FUNCTION dof_id_type getElemFacePropertySize (ContiguousSubdomainID subdomain) const
 Get the size of element-constant face material property data storage of a subdomain.
 
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.
 
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 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.
 
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.
 
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 & getVectorPhi (ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
 Get the vector shape functions of a FE type for an element type and subdomain.
 
KOKKOS_FUNCTION const auto & getVectorPhiFace (ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
 Get the face vector shape functions of a FE type for an element type and subdomain.
 
KOKKOS_FUNCTION const auto & getVectorGradPhi (ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
 Get the gradient of vector shape functions of a FE type for an element type and subdomain.
 
KOKKOS_FUNCTION const auto & getVectorGradPhiFace (ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
 Get the gradient of face vector shape functions of a FE type for an element type and subdomain.
 
KOKKOS_FUNCTION bool isVectorFEType (unsigned int fe_type) const
 Get whether a cached FE type is vector-valued.
 
KOKKOS_FUNCTION Real33 getJacobian (ElementInfo info, unsigned int qp) const
 Get the inverse of Jacobian matrix of an element quadrature point.
 
KOKKOS_FUNCTION Real getJxW (ElementInfo info, unsigned int qp) const
 Get the transformed Jacobian weight of an element quadrature point.
 
KOKKOS_FUNCTION Real3 getQPoint (ElementInfo info, unsigned int qp) const
 Get the coordinate of an element quadrature point.
 
KOKKOS_FUNCTION Real coordTransformFactor (const ContiguousSubdomainID subdomain, const Real3 point) const
 Get the coordinate transform factor for a point in a subdomain.
 
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.
 
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.
 
KOKKOS_FUNCTION void operator() (const ThreadID tid) const
 Kokkos function for caching physical maps on element quadrature points.
 
const auto & getMaterialBoundaries () const
 Get the list of boundaries to cache face material properties.
 
KOKKOS_FUNCTION const MeshkokkosMesh () const
 Get the const reference of the Kokkos mesh.
 

Private Member Functions

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

Private Attributes

FEProblemBase_problem
 Reference of the MOOSE problem.
 
MooseMesh_mesh
 Reference of the MOOSE mesh.
 
std::map< FEType, unsigned int_fe_type_map
 FE type ID map.
 
const unsigned int _dimension
 Mesh dimension.
 
Array< Moose::CoordinateSystemType_coord_type
 Coordinate system type of each subdomain.
 
unsigned int _rz_radial_coord = libMesh::invalid_uint
 Radial coordinate index in cylindrical coordinate system.
 
Array< Pair< Real3, Real3 > > _rz_axis
 General axisymmetric axis of each subdomain in cylindrical coordinate system.
 
std::set< BoundaryID_material_boundaries
 Boundaries to cache face material properties.
 
const Mesh_mesh_host
 Host reference of the Kokkos mesh.
 
const Mesh _mesh_device
 Device copy of the Kokkos mesh.
 
Array< dof_id_type > _qp_offset
 Starting offset into the global quadrature point index NOTE: The global quadrature point index is subdomain-wise.
 
Array2D< dof_id_type > _qp_offset_face
 
Array< unsigned int_n_qps
 Number of quadrature points.
 
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.
 
Array< dof_id_type > _n_elem_face_properties
 
Array2D< Array< Real3 > > _q_points
 Quadrature points and weights for reference elements.
 
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.
 
Array3D< Array< Array2D< Real > > > _phi_face
 
Array3D< Array2D< Real3 > > _grad_phi
 
Array3D< Array< Array2D< Real3 > > > _grad_phi_face
 
Array3D< Array2D< Real3 > > _vector_phi
 
Array3D< Array< Array2D< Real3 > > > _vector_phi_face
 
Array3D< Array2D< Real33 > > _vector_grad_phi
 
Array3D< Array< Array2D< Real33 > > > _vector_grad_phi_face
 
Array< bool > _is_vector_fe_type
 
Array2D< unsigned int_n_dofs
 
Array2D< Array2D< Real > > _map_phi
 Shape functions for computing reference-to-physical maps.
 
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.
 
Array2D< Array< Array2D< Real > > > _normal_dx_deta
 
Array< Array< Real33 > > _jacobian
 Cached physical maps on element quadrature points.
 
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 482 of file KokkosAssembly.h.

487{
488 auto sid = info.subdomain;
489 auto eid = info.id;
490 auto elem_type = info.type;
491 auto num_nodes = kokkosMesh().getNumNodes(elem_type);
492
493 auto & phi = _map_phi(sid, elem_type);
494 auto & grad_phi = _map_grad_phi(sid, elem_type);
495
496 Real33 J;
497 Real3 xyz;
498
499 for (unsigned int node = 0; node < num_nodes; ++node)
500 {
501 auto points = kokkosMesh().getNodePoint(kokkosMesh().getContiguousNodeID(eid, node));
502
503 if (jacobian || JxW)
504 J += grad_phi(node, qp).cartesian_product(points);
505
506 xyz += phi(node, qp) * points;
507 }
508
509 if (jacobian)
510 *jacobian = J.inverse(_dimension);
511
512 if (JxW)
513 *JxW =
514 J.determinant(_dimension) * _weights(sid, elem_type)[qp] * coordTransformFactor(sid, xyz);
515
516 if (q_points)
517 *q_points = xyz;
518}
Array2D< Array2D< Real3 > > _map_grad_phi
Array2D< Array2D< Real > > _map_phi
Shape functions for computing reference-to-physical maps.
const unsigned int _dimension
Mesh dimension.
Array2D< Array< Real > > _weights
KOKKOS_FUNCTION Real coordTransformFactor(const ContiguousSubdomainID subdomain, const Real3 point) const
Get the coordinate transform factor for a point in a subdomain.
KOKKOS_FUNCTION const Mesh & kokkosMesh() const
Get the const reference of the Kokkos mesh.
Definition KokkosMesh.h:651
KOKKOS_FUNCTION unsigned int getNumNodes(unsigned int elem_type) const
Get the number of nodes of an element type.
Definition KokkosMesh.h:363
KOKKOS_FUNCTION Real3 getNodePoint(ContiguousNodeID node) const
Get the coordinate of a node.
Definition KokkosMesh.h:428
Vector3< Real > Real3
Definition KokkosTypes.h:32
MPI_Info info
KOKKOS_INLINE_FUNCTION Real determinant(const unsigned int dim=3) const
KOKKOS_INLINE_FUNCTION Real33 inverse(const unsigned int dim=3) const
KOKKOS_INLINE_FUNCTION Real33 cartesian_product(const Real3 vector) const

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

◆ 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 521 of file KokkosAssembly.h.

528{
529 auto sid = info.subdomain;
530 auto eid = info.id;
531 auto elem_type = info.type;
532 auto num_nodes = kokkosMesh().getNumNodes(elem_type);
533 auto num_side_nodes = kokkosMesh().getNumNodes(elem_type, side);
534
535 auto & phi = _map_phi_face(sid, elem_type)(side);
536 auto & grad_phi = _map_grad_phi_face(sid, elem_type)(side);
537
538 auto & normal_dx_dxi = _normal_dx_dxi(sid, elem_type)(side);
539 auto & normal_dx_deta = _normal_dx_deta(sid, elem_type)(side);
540
541 Real33 J;
542 Real3 xyz;
543
544 Real3 dxyz_dxi;
545 Real3 dxyz_deta;
546
547 for (unsigned int node = 0; node < num_nodes; ++node)
548 {
549 auto points = kokkosMesh().getNodePoint(kokkosMesh().getContiguousNodeID(eid, node));
550
551 if (jacobian)
552 J += grad_phi(node, qp).cartesian_product(points);
553
554 if (JxW || q_points)
555 xyz += phi(node, qp) * points;
556
557 if (normal)
558 {
559 if (_dimension < 3)
560 dxyz_dxi += normal_dx_dxi(node, qp) * points;
561 if (_dimension == 2)
562 dxyz_deta += normal_dx_deta(node, qp) * points;
563 }
564 }
565
566 if (jacobian)
567 *jacobian = J.inverse(_dimension);
568
569 if (q_points)
570 *q_points = xyz;
571
572 if (JxW || (normal && _dimension > 1))
573 {
574 J = 0;
575
576 auto & grad_psi = _map_grad_psi_face(sid, elem_type)(side);
577
578 for (unsigned int node = 0; node < num_side_nodes; ++node)
579 {
580 auto points = kokkosMesh().getNodePoint(kokkosMesh().getContiguousNodeID(info, side, node));
581
582 J += grad_psi(node, qp).cartesian_product(points);
583 }
584 }
585
586 if (JxW)
587 *JxW = ::Kokkos::sqrt((J * J.transpose()).determinant(_dimension - 1)) *
588 _weights_face(sid, elem_type)[side][qp] * coordTransformFactor(sid, xyz);
589
590 if (normal)
591 {
592 if (_dimension == 3)
593 *normal = J.row(0).cross_product(J.row(1));
594 else if (_dimension == 2)
595 *normal = J.row(0).cross_product(dxyz_dxi.cross_product(dxyz_deta));
596 else
597 *normal = side ? dxyz_dxi : -dxyz_dxi;
598
599 *normal *= 1.0 / normal->norm();
600 }
601}
Array2D< Array< Array2D< Real > > > _normal_dx_deta
Array2D< Array< Array< Real > > > _weights_face
Array2D< Array< Array2D< Real3 > > > _map_grad_phi_face
Array2D< Array< Array2D< Real > > > _map_phi_face
Array2D< Array< Array2D< Real > > > _normal_dx_dxi
Shape functions for computing normal vectors.
Array2D< Array< Array2D< Real3 > > > _map_grad_psi_face

◆ 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 462 of file KokkosAssembly.h.

463{
464 switch (_coord_type[subdomain])
465 {
466 case Moose::COORD_XYZ:
467 return 1;
468 case Moose::COORD_RZ:
470 return 2 * M_PI *
471 (point - _rz_axis[subdomain].first).cross_product(_rz_axis[subdomain].second).norm();
472 else
473 return 2 * M_PI * point(_rz_radial_coord);
475 return 4 * M_PI * point(0) * point(0);
476 default:
477 return 0;
478 }
479}
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.
unsigned int _rz_radial_coord
Radial coordinate index in cylindrical coordinate system.
@ COORD_RZ
Definition MooseTypes.h:866
@ COORD_RSPHERICAL
Definition MooseTypes.h:867
@ COORD_XYZ
Definition MooseTypes.h:865
const unsigned int invalid_uint

Referenced by computePhysicalMap(), and computePhysicalMap().

◆ getDimension()

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

◆ 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 }
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.

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

Referenced by Moose::Kokkos::MaterialProperty< T, dimension >::allocate().

◆ 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.

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

Referenced by Moose::Kokkos::FESystem::getVectorQpADGrad(), and Moose::Kokkos::VariableShapeGradient< is_test >::reference().

◆ 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.

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

Referenced by Moose::Kokkos::FESystem::getVectorQpADGradFace(), Moose::Kokkos::FESystem::getVectorQpGradFace(), and Moose::Kokkos::VariableShapeGradient< is_test >::reference().

◆ 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 256 of file KokkosAssembly.h.

257 {
258 return _jacobian[info.subdomain][getQpOffset(info) + qp];
259 }
Array< Array< Real33 > > _jacobian
Cached physical maps on element quadrature points.
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.

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

◆ 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 266 of file KokkosAssembly.h.

267 {
268 return _jxw[info.subdomain][getQpOffset(info) + qp];
269 }
Array< Array< Real > > _jxw

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

◆ 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 329 of file KokkosAssembly.h.

329{ 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; }

◆ getNumDofs()

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

◆ 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.

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

Referenced by Moose::Kokkos::MaterialProperty< T, dimension >::allocate().

◆ 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

◆ 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.

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

Referenced by Moose::Kokkos::MaterialProperty< T, dimension >::allocate().

◆ 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]; }
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.

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

Referenced by Moose::Kokkos::FESystem::getVectorQpADValue(), and Moose::Kokkos::VariableShapeValue< is_test >::operator()().

◆ 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.

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

Referenced by Moose::Kokkos::FESystem::getVectorQpADValueFace(), Moose::Kokkos::FESystem::getVectorQpValueFace(), and Moose::Kokkos::VariableShapeValue< is_test >::operator()().

◆ 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 }
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.

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

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

◆ 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 276 of file KokkosAssembly.h.

277 {
278 return _xyz[info.subdomain][getQpOffset(info) + qp];
279 }
Array< Array< Real3 > > _xyz

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

◆ getVectorGradPhi()

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

Get the gradient of vector 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 vector shape functions at quadrature points

Definition at line 222 of file KokkosAssembly.h.

225 {
226 return _vector_grad_phi(subdomain, elem_type, fe_type);
227 }
Array3D< Array2D< Real33 > > _vector_grad_phi

Referenced by Moose::Kokkos::VectorVariableShapeCurl< is_test >::operator()(), and Moose::Kokkos::VectorVariableShapeGradient< is_test >::reference().

◆ getVectorGradPhiFace()

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

Get the gradient of face vector 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 vector shape functions of all sides at quadrature points

Definition at line 235 of file KokkosAssembly.h.

238 {
239 return _vector_grad_phi_face(subdomain, elem_type, fe_type);
240 }
Array3D< Array< Array2D< Real33 > > > _vector_grad_phi_face

Referenced by Moose::Kokkos::FESystem::getVectorQpVectorGradFace(), Moose::Kokkos::VectorVariableShapeCurl< is_test >::operator()(), Moose::Kokkos::VectorVariableCurl::operator()(), and Moose::Kokkos::VectorVariableShapeGradient< is_test >::reference().

◆ getVectorPhi()

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

Get the vector 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 vector shape functions at quadrature points

Definition at line 198 of file KokkosAssembly.h.

199 {
200 return _vector_phi(subdomain, elem_type, fe_type);
201 }
Array3D< Array2D< Real3 > > _vector_phi

Referenced by Moose::Kokkos::VectorVariableShapeValue< is_test >::operator()().

◆ getVectorPhiFace()

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

Get the face vector 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 vector shape functions of all sides at quadrature points

Definition at line 209 of file KokkosAssembly.h.

212 {
213 return _vector_phi_face(subdomain, elem_type, fe_type);
214 }
Array3D< Array< Array2D< Real3 > > > _vector_phi_face

Referenced by Moose::Kokkos::FESystem::getVectorQpVectorValueFace(), and Moose::Kokkos::VectorVariableShapeValue< is_test >::operator()().

◆ 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.

◆ isVectorFEType()

KOKKOS_FUNCTION bool Moose::Kokkos::Assembly::isVectorFEType ( unsigned int  fe_type) const
inline

Get whether a cached FE type is vector-valued.

Parameters
fe_typeThe FE type ID
Returns
Whether the FE type is vector-valued

Definition at line 246 of file KokkosAssembly.h.

247 {
248 return _is_vector_fe_type[fe_type];
249 }
Array< bool > _is_vector_fe_type

◆ 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 651 of file KokkosMesh.h.

652 {
653 KOKKOS_IF_ON_HOST(
655 "kokkosMesh() was called too early. Kokkos mesh is available after problem "
656 "initialization. Override initialSetup() if you need to setup your object data "
657 "using the Kokkos mesh.");
658
659 return _mesh_host;)
660
661 return _mesh_device;
662 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
const Mesh & _mesh_host
Host reference of the Kokkos mesh.
Definition KokkosMesh.h:669
const Mesh _mesh_device
Device copy of the Kokkos mesh.
Definition KokkosMesh.h:673
bool initialized() const
Get whether the mesh was initialized.
Definition KokkosMesh.h:68

Referenced by computePhysicalMap(), computePhysicalMap(), Moose::Kokkos::LinearFVFluxKernel::operator()(), Moose::Kokkos::LinearFVBoundaryCondition::operator()(), Moose::Kokkos::LinearFVFluxKernel::operator()(), Moose::Kokkos::LinearFVBoundaryCondition::operator()(), Moose::Kokkos::LinearFVFluxKernel::operator()(), Moose::Kokkos::LinearFVFluxKernel::operator()(), Moose::Kokkos::LinearFVElementalKernel::operator()(), Moose::Kokkos::IntegratedBC::operator()(), Moose::Kokkos::VectorIntegratedBC::operator()(), Moose::Kokkos::Kernel::operator()(), Moose::Kokkos::VectorKernel::operator()(), Moose::Kokkos::LinearFVElementalKernel::operator()(), Moose::Kokkos::Datum::q_point(), and KokkosBoundNodalKernel::skipOnBoundary().

◆ 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 366 of file KokkosAssembly.h.

Referenced by coordTransformFactor().

◆ _dimension

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

Mesh dimension.

Definition at line 362 of file KokkosAssembly.h.

Referenced by computePhysicalMap(), 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 400 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 357 of file KokkosAssembly.h.

Referenced by getFETypeID().

◆ _grad_phi

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

Definition at line 418 of file KokkosAssembly.h.

Referenced by getGradPhi().

◆ _grad_phi_face

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

Definition at line 419 of file KokkosAssembly.h.

Referenced by getGradPhiFace().

◆ _is_vector_fe_type

Array<bool> Moose::Kokkos::Assembly::_is_vector_fe_type
private

Definition at line 424 of file KokkosAssembly.h.

Referenced by isVectorFEType().

◆ _jacobian

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

Cached physical maps on element quadrature points.

Definition at line 449 of file KokkosAssembly.h.

Referenced by getJacobian().

◆ _jxw

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

Definition at line 450 of file KokkosAssembly.h.

Referenced by getJxW().

◆ _map_grad_phi

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

Definition at line 434 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 435 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 436 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 431 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

◆ _map_phi_face

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

Definition at line 432 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

◆ _map_psi_face

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

Definition at line 433 of file KokkosAssembly.h.

◆ _material_boundaries

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

Boundaries to cache face material properties.

Definition at line 457 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 391 of file KokkosAssembly.h.

Referenced by getMaxQpsPerElem().

◆ _mesh

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

Reference of the MOOSE mesh.

Definition at line 353 of file KokkosAssembly.h.

◆ _mesh_device

const Mesh Moose::Kokkos::MeshHolder::_mesh_device
privateinherited

Device copy of the Kokkos mesh.

Definition at line 673 of file KokkosMesh.h.

Referenced by Moose::Kokkos::MeshHolder::kokkosMesh().

◆ _mesh_host

const Mesh& Moose::Kokkos::MeshHolder::_mesh_host
privateinherited

Host reference of the Kokkos mesh.

Definition at line 669 of file KokkosMesh.h.

Referenced by Moose::Kokkos::MeshHolder::kokkosMesh().

◆ _n_dofs

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

Definition at line 425 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 401 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 388 of file KokkosAssembly.h.

Referenced by getNumQps().

◆ _n_qps_face

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

Definition at line 389 of file KokkosAssembly.h.

Referenced by getNumFaceQps().

◆ _n_subdomain_qps

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

Definition at line 393 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 394 of file KokkosAssembly.h.

Referenced by getNumFaceQps().

◆ _normal_dx_deta

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

Definition at line 443 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 442 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

◆ _phi

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

Shape functions for reference elements.

Definition at line 416 of file KokkosAssembly.h.

Referenced by getPhi().

◆ _phi_face

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

Definition at line 417 of file KokkosAssembly.h.

Referenced by getPhiFace().

◆ _problem

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

Reference of the MOOSE problem.

Definition at line 349 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 407 of file KokkosAssembly.h.

◆ _q_points_face

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

Definition at line 408 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 381 of file KokkosAssembly.h.

Referenced by getQpOffset().

◆ _qp_offset_face

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

Definition at line 382 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 374 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 370 of file KokkosAssembly.h.

Referenced by coordTransformFactor().

◆ _vector_grad_phi

Array3D<Array2D<Real33> > Moose::Kokkos::Assembly::_vector_grad_phi
private

Definition at line 422 of file KokkosAssembly.h.

Referenced by getVectorGradPhi().

◆ _vector_grad_phi_face

Array3D<Array<Array2D<Real33> > > Moose::Kokkos::Assembly::_vector_grad_phi_face
private

Definition at line 423 of file KokkosAssembly.h.

Referenced by getVectorGradPhiFace().

◆ _vector_phi

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

Definition at line 420 of file KokkosAssembly.h.

Referenced by getVectorPhi().

◆ _vector_phi_face

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

Definition at line 421 of file KokkosAssembly.h.

Referenced by getVectorPhiFace().

◆ _weights

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

Definition at line 409 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

◆ _weights_face

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

Definition at line 410 of file KokkosAssembly.h.

Referenced by computePhysicalMap().

◆ _xyz

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

Definition at line 451 of file KokkosAssembly.h.

Referenced by getQPoint().


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