12 #ifndef MFEM_QFUNCTION
13 #define MFEM_QFUNCTION
15 #include "../config/config.hpp"
39 :
Vector(vdim_*qspace_.GetSize()),
143 inline void GetValues(
int idx,
const int ip_num,
Vector &values)
const;
168 void Save(std::ostream &
out)
const;
176 int compression_level=0)
const;
184 int compression_level=0)
const;
203 int idx,
Vector &values)
const
210 for (
int i = 0; i<values.
Size(); i++)
217 int idx,
const int ip_num,
Vector &values)
220 values.
MakeRef(*
this, s_offset, vdim);
224 int idx,
const int ip_num,
Vector &values)
const
229 const double *q =
HostRead() + s_offset;
230 for (
int i = 0; i < values.
Size(); i++)
256 for (
int j = 0; j<sl_size; j++)
258 for (
int i = 0; i<
vdim; i++)
260 values(i,j) = *(q++);
int GetVDim() const
Get the vector dimension.
Class for an integration rule - an Array of IntegrationPoint.
void NewDataAndSize(double *d, int s)
Set the Vector data and size, deleting the old data, if owned.
Class for grid function - Vector with associated FE space.
void ProjectGridFunction(const GridFunction &gf)
Evaluate a grid function at each quadrature point.
double * HostWrite()
Shortcut for mfem::Write(GetMemory(), TotalSize(), false).
Memory< double > & GetMemory()
void SetSize(int s)
Resize the vector to size s.
void Delete()
Delete the owned pointers and reset the Memory object.
QuadratureSpaceBase * qspace
Associated QuadratureSpaceBase object.
bool own_qspace
Does this own the associated QuadratureSpaceBase?
const QuadratureSpaceBase * GetSpace() const
Get the associated QuadratureSpaceBase object (const version).
virtual ~QuadratureFunction()
Data type dense matrix using column-major storage.
virtual double * HostWrite()
Shortcut for mfem::Write(vec.GetMemory(), vec.Size(), false).
int Size() const
Returns the size of the vector.
int vdim
Vector dimension.
Data arrays will be written in ASCII format.
bool OwnsSpace()
Get the QuadratureSpaceBase ownership flag.
Memory< double > & GetMemory()
Return a reference to the Memory object used by the Vector.
Vector & operator=(const double *v)
Copy Size() entries from v.
const IntegrationRule & GetIntRule(int idx) const
Get the IntegrationRule associated with entity (element or face) idx.
void SetOwnsSpace(bool own)
Set the QuadratureSpaceBase ownership flag.
QuadratureFunction(QuadratureSpaceBase &qspace_, int vdim_=1)
Create a QuadratureFunction based on the given QuadratureSpaceBase.
QuadratureFunction()
Default constructor, results in an empty vector.
VTKFormat
Data array format for VTK and VTU files.
void SetVDim(int vdim_)
Set the vector dimension, updating the size by calling Vector::SetSize().
virtual const double * HostRead() const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), false).
QuadratureFunction & operator=(double value)
Set this equal to a constant value.
void SaveVTU(std::ostream &out, VTKFormat format=VTKFormat::ASCII, int compression_level=0) const
Write the QuadratureFunction to out in VTU (ParaView) format.
Array< int > offsets
Entity quadrature point offset array, of size num_entities + 1.
Abstract base class for QuadratureSpace and FaceQuadratureSpace.
const IntegrationRule & GetIntRule(int idx) const
Return the IntegrationRule associated with entity idx.
void GetValues(int idx, Vector &values)
Return all values associated with mesh element idx in a Vector.
void MakeAlias(const Memory &base, int offset, int size)
Create a memory object that points inside the memory object base.
QuadratureSpaceBase * GetSpace()
Get the associated QuadratureSpaceBase object.
void SetSpace(QuadratureSpaceBase *qspace_, int vdim_=-1)
Change the QuadratureSpaceBase and optionally the vector dimension.
QuadratureFunction(const QuadratureFunction &orig)
Copy constructor. The QuadratureSpace ownership flag, own_qspace, in the new object is set to false...
void MakeRef(Vector &base, int offset, int size)
Reset the Vector to be a reference to a sub-vector of base.
QuadratureFunction(QuadratureSpaceBase *qspace_, int vdim_=1)
Create a QuadratureFunction based on the given QuadratureSpaceBase.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
int GetSize() const
Return the total number of quadrature points.
Represents values or vectors of values at quadrature points on a mesh.
void Save(std::ostream &out) const
Write the QuadratureFunction to the stream out.