21 : mesh(mesh_), order(ir.GetOrder())
45 const int N = weights.
Size();
46 const int n = ir.
Size();
52 d_weights[i] *= d_w[i%n];
68 ScaleByQuadratureWeights(
weights, ir);
91 const int vdim = coeff.
GetVDim();
102 for (
int i = 0; i < num_elem; i++)
106 MFEM_ASSERT(
int_rule[geom] != NULL,
"Missing integration rule.");
121 const char *msg =
"invalid input stream";
124 in >> ident; MFEM_VERIFY(ident ==
"QuadratureSpace", msg);
125 in >> ident; MFEM_VERIFY(ident ==
"Type:", msg);
127 if (ident ==
"default_quadrature")
129 in >> ident; MFEM_VERIFY(ident ==
"Order:", msg);
134 MFEM_ABORT(
"unknown QuadratureSpace type: " << ident);
145 "Constructor not valid for mixed meshes");
151 os <<
"QuadratureSpace\n"
152 <<
"Type: default_quadrature\n"
153 <<
"Order: " <<
order <<
'\n';
170 face_type(face_type_),
171 num_faces(mesh.GetNFbyType(face_type))
179 face_type(face_type_),
180 num_faces(mesh.GetNFbyType(face_type))
183 "Constructor not valid for mixed meshes");
187void FaceQuadratureSpace::ConstructOffsets()
189 face_indices.
SetSize(num_faces);
200 face_indices[f_idx] = i;
201 face_indices_inv[i] = f_idx;
204 MFEM_ASSERT(
int_rule[geom] != NULL,
"Missing integration rule");
212void FaceQuadratureSpace::Construct()
220 const int f_idx = face_indices[idx];
225 const int q1d = (int)floor(pow(ir.
GetNPoints(), 1.0/(
dim-1)) + 0.5);
237 auto get_face_index = [
this](
const int idx)
239 const auto it = face_indices_inv.find(idx);
240 if (it == face_indices_inv.end()) {
return -1; }
241 else {
return it->second; }
252 MFEM_ABORT(
"Invalid element type.");
259 os <<
"FaceQuadratureSpace\n"
260 <<
"Type: default_quadrature\n"
261 <<
"Order: " <<
order <<
'\n';
264const 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.
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
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.
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.
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
int GetNumFacesWithGhost() const
Return the number of faces (3D), edges (2D) or vertices (1D) including ghost faces.
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.
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).
Mesh & mesh
The underlying mesh.
Array< int > offsets
Entity quadrature point offset array, of size num_entities + 1.
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)