76 const bool const_c = coeff.
Size() == 1;
85 const real_t detJ = J(q, e);
86 const real_t coeff = const_c ? C(0, 0) : C(q, e);
87 v(q, e) = W(q) * coeff * (by_val ? detJ : 1.0 / detJ);
101 if (
ne == 0) {
return; }
121 const bool const_c = coeff.
Size() == 1;
126 const auto C = const_c ?
Reshape(coeff.
Read(), 1, 1)
131 const real_t detJ = J(q, e);
132 const real_t coeff = const_c ? C(0, 0) : C(q, e);
133 v(q, e) = W(q) * coeff * (by_val ? detJ : 1.0 / detJ);
147 "AssembleDiagonalPA requires AssemblePA to be called first,"
148 " and is not implemented for ragged tensor bases");
173 return internal::OccaPAMassApply2D(D1D,Q1D,
ne,B,Bt,D,x,y);
177 return internal::OccaPAMassApply3D(D1D,Q1D,
ne,B,Bt,D,x,y);
179 MFEM_ABORT(
"OCCA PA Mass Apply unknown kernel!");
194 const Array<int> &forward_map2d = rmaps->forward_map2d_mass;
195 const Array<int> &inverse_map2d = rmaps->inverse_map2d_mass;
196 const Array<int> &forward_map3d = rmaps->forward_map3d_mass;
197 const Array<int> &inverse_map3d = rmaps->inverse_map3d_mass;
198 ApplySimplexPAKernels::Run(
dim, D1D, Q1D,
ne, lex_map, forward_map2d,
200 forward_map3d, inverse_map3d, Ba1, Ba2, Ba3, Ba1t, Ba2t, Ba3t,
205 ApplyPAKernels::Run(
dim, D1D, Q1D,
ne, B, Bt, D, x, y, D1D, Q1D);
214 MFEM_ABORT(
"AddAbsMultPA not implemented with CEED!");
220 "AbsMultPA not implemented for ragged tensor basis");
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
void Abs()
Replace each entry of the array with its absolute value.
Class to represent a coefficient evaluated at quadrature points.
static MemoryType GetDeviceMemoryType()
Get the current Device MemoryType. This is the MemoryType used by most MFEM classes when allocating m...
Mode mode
Describes the contents of the B, Bt, G, and Gt arrays, see Mode.
@ RAGGED_TENSOR
Ragged tensor product representation using 1D matrices/tensors with dimensions using 1D number of qua...
@ TENSOR
Tensor product representation using 1D matrices/tensors with dimensions using 1D number of quadrature...
Array< real_t > B
Basis functions evaluated at quadrature points.
int ndof
Number of degrees of freedom = number of basis functions. When mode is TENSOR, this is the 1D number.
int nqpt
Number of quadrature points. When mode is TENSOR, this is the 1D number.
Array< real_t > Bt
Transpose of B.
Vector detJ
Determinants of the Jacobians at all quadrature points.
Class representing the storage layout of a FaceQuadratureFunction.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
bool IsVariableOrder() const
Returns true if the space contains elements of varying polynomial orders.
const FiniteElement * GetBE(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th boundary fac...
bool UsesRaggedTensorBasis() const
Return true if the mesh contains only one topology, the elements are all triangles or tetrahedrons,...
Mesh * GetMesh() const
Returns the mesh.
const FiniteElement * GetTypicalFE() const
Return GetFE(0) if the local mesh is not empty; otherwise return a typical FE based on the Geometry t...
Abstract class for all finite elements.
virtual const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mo...
int GetDim() const
Returns the reference space dimension for the finite element.
int GetMapType() const
Returns the FiniteElement::MapType of the element describing how reference functions are mapped to ph...
Vector detJ
Determinants of the Jacobians at all quadrature points.
Class for an integration rule - an Array of IntegrationPoint.
int GetNPoints() const
Returns the number of the points in the integration rule.
const Array< real_t > & GetWeights() const
Return the quadrature weights in a contiguous array.
const IntegrationRule * IntRule
const FiniteElementSpace * fespace
const FaceGeometricFactors * face_geom
Not owned.
void AddAbsMultPA(const Vector &, Vector &) const override
const DofToQuad * maps
Not owned.
void AddMultPA(const Vector &, Vector &) const override
Method for partially assembled action.
void AssemblePABoundary(const FiniteElementSpace &fes) override
static const IntegrationRule & GetRule(const FiniteElement &trial_fe, const FiniteElement &test_fe, const ElementTransformation &Trans, const bool stroud=false)
void AssembleDiagonalPA(Vector &diag) override
Assemble diagonal and add it to Vector diag.
void AssemblePA(const FiniteElementSpace &fes) override
Method defining partial assembly.
const GeometricFactors * geom
Not owned.
void AddMultTransposePA(const Vector &, Vector &) const override
Method for partially assembled transposed action.
void AddAbsMultTransposePA(const Vector &, Vector &) const override
virtual int GetNFbyType(FaceType type) const
Returns the number of faces according to the requested type, does not count master nonconforming face...
const FaceGeometricFactors * GetFaceGeometricFactors(const IntegrationRule &ir, const int flags, FaceType type, MemoryType d_mt=MemoryType::DEFAULT)
Return the mesh geometric factors for the faces corresponding to the given integration rule.
int GetNE() const
Returns number of elements.
int Dimension() const
Dimension of the reference space used within the elements.
ElementTransformation * GetTypicalElementTransformation()
If the local mesh is not empty return GetElementTransformation(0); otherwise, return the identity tra...
ElementTransformation * GetBdrElementTransformation(int i)
Returns a pointer to the transformation defining the i-th boundary element.
const GeometricFactors * GetGeometricFactors(const IntegrationRule &ir, const int flags, MemoryType d_mt=MemoryType::DEFAULT)
Return the mesh geometric factors corresponding to the given integration rule.
int GetNumGeometries(int dim) const
Return the number of geometries of the given dimension present in the mesh.
Class representing the storage layout of a QuadratureFunction.
Structure representing the matrices/tensors needed to evaluate (in reference space) the values,...
virtual const real_t * Read(bool on_dev=true) const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), on_dev).
int Size() const
Returns the size of the vector.
void Abs()
(*this)(i) = abs((*this)(i))
void SetSize(int s)
Resize the vector to size s.
virtual real_t * Write(bool on_dev=true)
Shortcut for mfem::Write(vec.GetMemory(), vec.Size(), on_dev).
void GetDiagonal(mfem::Vector &diag) const
void AddMult(const mfem::Vector &x, mfem::Vector &y, const real_t a=1.0) const override
Operator application: y+=A(x) (default) or y+=a*A(x).
Represent a MassIntegrator with AssemblyLevel::Partial using libCEED.
MFEM_HOST_DEVICE DeviceTensor< sizeof...(Dims), T > Reshape(T *ptr, Dims... dims)
Wrap a pointer as a DeviceTensor with automatically deduced template parameters.
bool DeviceCanUseCeed()
Function that determines if a CEED kernel should be used, based on the current mfem::Device configura...
@ COMPRESSED
Enable all above compressions.
bool DeviceCanUseOcca()
Function that determines if an OCCA kernel should be used, based on the current mfem::Device configur...
MemoryType
Memory types supported by MFEM.
void forall(int N, lambda &&body)