40 :
Vector(vdim_*qspace_.GetSize()),
59 :
Vector(qf_data, vdim_*qspace_->GetSize()),
155 inline void GetValues(
int idx,
const int ip_num,
Vector &values)
const;
188 int compression_level=0,
const std::string &field_name=
"u")
const;
196 int compression_level=0,
const std::string &field_name=
"u")
const;
223 int idx,
Vector &values)
const
230 for (
int i = 0; i<values.
Size(); i++)
237 int idx,
const int ip_num,
Vector &values)
244 int idx,
const int ip_num,
Vector &values)
const
250 for (
int i = 0; i < values.
Size(); i++)
276 for (
int j = 0; j<sl_size; j++)
278 for (
int i = 0; i<
vdim; i++)
280 values(i,j) = *(q++);
Data type dense matrix using column-major storage.
real_t * HostWrite()
Shortcut for mfem::Write(GetMemory(), TotalSize(), false).
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
Memory< real_t > & GetMemory()
Class for grid function - Vector with associated FE space.
Class for an integration rule - an Array of IntegrationPoint.
Class used by MFEM to store pointers to host and/or device memory.
void MakeAlias(const Memory &base, int offset, int size)
Create a memory object that points inside the memory object base.
void Delete()
Delete the owned pointers and reset the Memory object.
Represents values or vectors of values at quadrature points on a mesh.
void SetVDim(int vdim_)
Set the vector dimension, updating the size by calling Vector::SetSize().
QuadratureSpaceBase * GetSpace()
Get the associated QuadratureSpaceBase object.
void Integrate(Vector &integrals) const
Integrate the (potentially vector-valued) quadrature function, storing the results in integrals (leng...
QuadratureFunction(const QuadratureFunction &orig)
Copy constructor. The QuadratureSpace ownership flag, own_qspace, in the new object is set to false.
real_t Integrate() const
Return the integral of the quadrature function (vdim = 1 only).
void ProjectGridFunction(const GridFunction &gf)
Evaluate a grid function at each quadrature point.
QuadratureFunction()
Default constructor, results in an empty vector.
QuadratureFunction(QuadratureSpaceBase *qspace_, int vdim_=1)
Create a QuadratureFunction based on the given QuadratureSpaceBase.
void GetValues(int idx, Vector &values)
Return all values associated with mesh element idx in a Vector.
QuadratureFunction & operator=(real_t value)
Set this equal to a constant value.
void SaveVTU(const std::string &filename, VTKFormat format=VTKFormat::ASCII, int compression_level=0, const std::string &field_name="u") const
Save the QuadratureFunction to a VTU (ParaView) file.
QuadratureFunction(QuadratureSpaceBase *qspace_, real_t *qf_data, int vdim_=1)
Create a QuadratureFunction based on the given QuadratureSpaceBase, using the external (host) data,...
const QuadratureSpaceBase * GetSpace() const
Get the associated QuadratureSpaceBase object (const version).
QuadratureFunction & operator=(const Vector &v)
Copy the data from v.
void SetOwnsSpace(bool own)
Set the QuadratureSpaceBase ownership flag.
void SaveVTU(std::ostream &out, VTKFormat format=VTKFormat::ASCII, int compression_level=0, const std::string &field_name="u") const
Write the QuadratureFunction to out in VTU (ParaView) format.
int GetVDim() const
Get the vector dimension.
QuadratureFunction(Mesh *mesh, std::istream &in)
Read a QuadratureFunction from the stream in.
virtual ~QuadratureFunction()
QuadratureFunction(QuadratureSpaceBase &qspace_, int vdim_=1)
Create a QuadratureFunction based on the given QuadratureSpaceBase.
int vdim
Vector dimension.
bool OwnsSpace()
Get the QuadratureSpaceBase ownership flag.
QuadratureSpaceBase * qspace
Associated QuadratureSpaceBase object.
void SetSpace(QuadratureSpaceBase *qspace_, int vdim_=-1)
Change the QuadratureSpaceBase and optionally the vector dimension.
void Save(std::ostream &out) const
Write the QuadratureFunction to the stream out.
const IntegrationRule & GetIntRule(int idx) const
Get the IntegrationRule associated with entity (element or face) idx.
bool own_qspace
Does this own the associated QuadratureSpaceBase?
Abstract base class for QuadratureSpace and FaceQuadratureSpace.
int GetSize() const
Return the total number of quadrature points.
const IntegrationRule & GetIntRule(int idx) const
Return the IntegrationRule associated with entity idx.
Array< int > offsets
Entity quadrature point offset array, of size num_entities + 1.
virtual const real_t * HostRead() const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), false).
Memory< real_t > & GetMemory()
Return a reference to the Memory object used by the Vector.
virtual bool UseDevice() const
Return the device flag of the Memory object used by the Vector.
int Size() const
Returns the size of the vector.
void SetSize(int s)
Resize the vector to size s.
virtual real_t * HostWrite()
Shortcut for mfem::Write(vec.GetMemory(), vec.Size(), false).
void NewDataAndSize(real_t *d, int s)
Set the Vector data and size, deleting the old data, if owned.
Vector & operator=(const real_t *v)
Copy Size() entries from v.
void MakeRef(Vector &base, int offset, int size)
Reset the Vector to be a reference to a sub-vector of base.
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
VTKFormat
Data array format for VTK and VTU files.
@ ASCII
Data arrays will be written in ASCII format.