MFEM v4.9.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::VectorArrayCoefficient Class Reference

Vector coefficient defined by an array of scalar coefficients. Coefficients that are not set will evaluate to zero in the vector. This object takes ownership of the array of coefficients inside it and deletes them at object destruction. More...

#include <coefficient.hpp>

Inheritance diagram for mfem::VectorArrayCoefficient:
[legend]
Collaboration diagram for mfem::VectorArrayCoefficient:
[legend]

Public Member Functions

 VectorArrayCoefficient (int dim)
 Construct vector of dim coefficients. The actual coefficients still need to be added with Set().
 
void SetTime (real_t t) override
 Set the time for internally stored coefficients.
 
CoefficientGetCoeff (int i)
 Returns i'th coefficient.
 
Coefficient ** GetCoeffs ()
 Returns the entire array of coefficients.
 
void Set (int i, Coefficient *c, bool own=true)
 Sets coefficient in the vector.
 
void SetOwnership (int i, bool own)
 Set ownership of the i'th coefficient.
 
bool GetOwnership (int i) const
 Get ownership of the i'th coefficient.
 
real_t Eval (int i, ElementTransformation &T, const IntegrationPoint &ip)
 
void Eval (Vector &V, ElementTransformation &T, const IntegrationPoint &ip) override
 Evaluate the coefficient. Each element of vector V comes from the associated array of scalar coefficients.
 
virtual ~VectorArrayCoefficient ()
 Destroys vector coefficient.
 
virtual void Eval (DenseMatrix &M, ElementTransformation &T, const IntegrationRule &ir)
 Evaluate the vector coefficient in the element described by T at all points of ir, storing the result in M.
 
- Public Member Functions inherited from mfem::VectorCoefficient
 VectorCoefficient (int vd)
 Initialize the VectorCoefficient with vector dimension vd.
 
real_t GetTime ()
 Get the time for time dependent coefficients.
 
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 ~VectorCoefficient ()
 

Additional Inherited Members

- Protected Attributes inherited from mfem::VectorCoefficient
int vdim
 
real_t time
 

Detailed Description

Vector coefficient defined by an array of scalar coefficients. Coefficients that are not set will evaluate to zero in the vector. This object takes ownership of the array of coefficients inside it and deletes them at object destruction.

Definition at line 786 of file coefficient.hpp.

Constructor & Destructor Documentation

◆ VectorArrayCoefficient()

mfem::VectorArrayCoefficient::VectorArrayCoefficient ( int dim)
explicit

Construct vector of dim coefficients. The actual coefficients still need to be added with Set().

Definition at line 433 of file coefficient.cpp.

◆ ~VectorArrayCoefficient()

mfem::VectorArrayCoefficient::~VectorArrayCoefficient ( )
virtual

Destroys vector coefficient.

Definition at line 459 of file coefficient.cpp.

Member Function Documentation

◆ Eval() [1/3]

void mfem::VectorCoefficient::Eval ( DenseMatrix & M,
ElementTransformation & T,
const IntegrationRule & ir )
virtual

Evaluate the vector coefficient in the element described by T at all points of ir, storing the result in M.

The dimensions of M are GetVDim() by ir.GetNPoints() and they must be set by the implementation of this method.

The general implementation provided by the base class (using the Eval method for one IntegrationPoint at a time) can be overloaded for more efficient implementation.

Note
The IntegrationPoint associated with T is not used, and this method will generally modify this IntegrationPoint associated with T.

Reimplemented from mfem::VectorCoefficient.

Definition at line 613 of file coefficient.cpp.

◆ Eval() [2/3]

real_t mfem::VectorArrayCoefficient::Eval ( int i,
ElementTransformation & T,
const IntegrationPoint & ip )
inline

Evaluates i'th component of the vector of coefficients and returns the value.

Definition at line 817 of file coefficient.hpp.

◆ Eval() [3/3]

void mfem::VectorArrayCoefficient::Eval ( Vector & V,
ElementTransformation & T,
const IntegrationPoint & ip )
overridevirtual

Evaluate the coefficient. Each element of vector V comes from the associated array of scalar coefficients.

Implements mfem::VectorCoefficient.

Definition at line 467 of file coefficient.cpp.

◆ GetCoeff()

Coefficient * mfem::VectorArrayCoefficient::GetCoeff ( int i)
inline

Returns i'th coefficient.

Definition at line 801 of file coefficient.hpp.

◆ GetCoeffs()

Coefficient ** mfem::VectorArrayCoefficient::GetCoeffs ( )
inline

Returns the entire array of coefficients.

Definition at line 804 of file coefficient.hpp.

◆ GetOwnership()

bool mfem::VectorArrayCoefficient::GetOwnership ( int i) const
inline

Get ownership of the i'th coefficient.

Definition at line 813 of file coefficient.hpp.

◆ Set()

void mfem::VectorArrayCoefficient::Set ( int i,
Coefficient * c,
bool own = true )

Sets coefficient in the vector.

Definition at line 452 of file coefficient.cpp.

◆ SetOwnership()

void mfem::VectorArrayCoefficient::SetOwnership ( int i,
bool own )
inline

Set ownership of the i'th coefficient.

Definition at line 810 of file coefficient.hpp.

◆ SetTime()

void mfem::VectorArrayCoefficient::SetTime ( real_t t)
overridevirtual

Set the time for internally stored coefficients.

Reimplemented from mfem::VectorCoefficient.

Definition at line 443 of file coefficient.cpp.


The documentation for this class was generated from the following files: