21 : mesh(mesh_), order(ir.GetOrder())
56 d_full_offset_cache[e] = nq * e;
68 const int N = weights.
Size();
69 const int n = ir.
Size();
75 d_weights[i] *= d_w[i%n];
91 ScaleByQuadratureWeights(
weights, ir);
114 const int vdim = coeff.
GetVDim();
138 for (
int i = 0; i < num_elem; i++)
142 MFEM_ASSERT(
int_rule[geom] !=
nullptr,
"Missing integration rule.");
159 const char *msg =
"invalid input stream";
162 in >> ident; MFEM_VERIFY(ident ==
"QuadratureSpace", msg);
163 in >> ident; MFEM_VERIFY(ident ==
"Type:", msg);
165 if (ident ==
"default_quadrature")
167 in >> ident; MFEM_VERIFY(ident ==
"Order:", msg);
172 MFEM_ABORT(
"unknown QuadratureSpace type: " << ident);
183 "Constructor not valid for mixed meshes");
189 os <<
"QuadratureSpace\n"
190 <<
"Type: default_quadrature\n"
191 <<
"Order: " <<
order <<
'\n';
208 face_indices(mesh.GetFaceIndices(face_type_)),
209 face_indices_inv(mesh.GetInvFaceIndices(face_type_))
217 face_type(face_type_),
218 face_indices(mesh.GetFaceIndices(face_type_)),
219 face_indices_inv(mesh.GetInvFaceIndices(face_type_))
222 "Constructor not valid for mixed meshes");
226void FaceQuadratureSpace::ConstructOffsets()
247 MFEM_ASSERT(
int_rule[geom] !=
nullptr,
"Missing integration rule");
254void FaceQuadratureSpace::Construct()
262 const int f_idx = face_indices[idx];
267 const int q1d = (int)floor(pow(ir.
GetNPoints(), 1.0/(
dim-1)) + 0.5);
289 auto get_face_index = [
this](
const int idx)
291 const auto it = face_indices_inv.find(idx);
292 if (it == face_indices_inv.end()) {
return -1; }
293 else {
return it->second; }
304 MFEM_ABORT(
"Invalid element type.");
311 os <<
"FaceQuadratureSpace\n"
312 <<
"Type: default_quadrature\n"
313 <<
"Order: " <<
order <<
'\n';
316const Vector &FaceQuadratureSpace::GetGeometricFactorWeights()
const
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
T * Write(bool on_dev=true)
Shortcut for mfem::Write(a.GetMemory(), a.Size(), on_dev).
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
T * HostWrite()
Shortcut for mfem::Write(a.GetMemory(), a.Size(), false).
T & Last()
Return the last element in the array.
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
virtual void Project(QuadratureFunction &qf)
Fill the QuadratureFunction qf by evaluating the coefficient at the quadrature points.
Vector detJ
Determinants of the Jacobians at all quadrature points.
int GetEntityIndex(const ElementTransformation &T) const override
Returns the index associated with the face described by T.
Geometry::Type GetGeometry(int idx) const override
Returns the geometry type of face idx.
void Save(std::ostream &out) const override
Write the FaceQuadratureSpace to the stream out.
int GetPermutedIndex(int idx, int iq) const override
Returns the permuted index of the iq quadrature point in entity idx.
FaceQuadratureSpace(Mesh &mesh_, int order_, FaceType face_type_)
Create a FaceQuadratureSpace based on the global rules from IntRules.
ElementTransformation * GetTransformation(int idx) override
Returns the face transformation of face idx.
Vector detJ
Determinants of the Jacobians at all quadrature points.
static bool IsTensorProduct(Type geom)
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 & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
void GetGeometries(int dim, Array< Geometry::Type > &el_geoms) const
Return all element geometries of the given dimension present in the mesh.
Geometry::Type GetFaceGeometry(int i) const
Return the Geometry::Type associated with face i.
int GetBdrElementFaceIndex(int be_idx) const
Return the local face (codimension-1) index for the given boundary element index.
virtual int GetNFbyType(FaceType type) const
Returns the number of faces according to the requested type, does not count master nonconforming face...
ElementTransformation * GetFaceTransformation(int FaceNo)
Returns a pointer to the transformation defining the given face element.
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.
FaceInformation GetFaceInformation(int f) const
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.
const Array< int > & GetBdrFaceAttributes() const
Returns the attributes for all boundary elements in this mesh.
int GetNumGeometries(int dim) const
Return the number of geometries of the given dimension present in the mesh.
Geometry::Type GetElementBaseGeometry(int i) const
long GetNodesSequence() const
Return the nodes update counter.
Represents values or vectors of values at quadrature points on a mesh.
real_t Integrate() const
Return the integral of the quadrature function (vdim = 1 only).
Abstract base class for QuadratureSpace and FaceQuadratureSpace.
Vector weights
Integration weights.
const Vector & GetWeights() const
Return the integration weights (including geometric factors).
void ConstructWeights() const
Compute the integration weights.
int GetNE() const
Return the number of entities.
void ConstructIntRules(int dim)
Fill the int_rule array for each geometry type using order.
const IntegrationRule * int_rule[Geometry::NumGeom]
The quadrature rules used for each geometry type.
QuadratureSpaceBase(Mesh &mesh_, int order_=0)
Protected constructor. Used by derived classes.
long nodes_sequence
Nodes counter for cache invalidation.
int order
The order of integration rule.
const IntegrationRule & GetIntRule(int idx) const
Return the IntegrationRule associated with entity idx.
virtual const Vector & GetGeometricFactorWeights() const =0
Compute the det(J) (volume or faces, depending on the type).
int ne
Number of entities.
const Array< int > & Offsets(QSpaceOffsetStorage storage) const
Entity quadrature point offset array.
Array< int > full_offset_cache
Cached version of the "full" offsets, returned by Offsets() when QSpaceOffsetStorage::FULL is provide...
Mesh & mesh
The underlying mesh.
Array< int > offsets
Entity quadrature point offset array.
int size
Total number of quadrature points.
real_t Integrate(Coefficient &coeff) const
Return the integral of the scalar Coefficient coeff.
const Vector & GetGeometricFactorWeights() const override
Compute the det(J) (volume or faces, depending on the type).
void Save(std::ostream &out) const override
Write the QuadratureSpace to the stream out.
QuadratureSpace(Mesh *mesh_, int order_)
Create a QuadratureSpace based on the global rules from IntRules.
Base class for vector Coefficients that optionally depend on time and space.
int GetVDim()
Returns dimension of the vector.
virtual void Project(QuadratureFunction &qf)
Fill the QuadratureFunction qf by evaluating the coefficient at the quadrature points.
virtual real_t * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), on_dev).
int Size() const
Returns the size of the vector.
int ToLexOrdering(const int dim, const int face_id, const int size1d, const int index)
Convert a dof face index from Native ordering to lexicographic ordering for quads and hexes.
void forall(int N, lambda &&body)
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)