MFEM  v4.6.0
Finite element discretization library
Public Member Functions | List of all members
mfem::PWVectorCoefficient Class Reference

A piecewise vector-valued coefficient with the pieces keyed off the element attribute numbers. More...

#include <coefficient.hpp>

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

Public Member Functions

 PWVectorCoefficient (int vd)
 Constructs a piecewise vector coefficient of dimension vd. More...
 
 PWVectorCoefficient (int vd, const Array< int > &attr, const Array< VectorCoefficient *> &coefs)
 Construct the coefficient using arrays describing the pieces. More...
 
virtual void SetTime (double t)
 Set the time for time dependent coefficients. More...
 
void UpdateCoefficients (const Array< int > &attr, const Array< VectorCoefficient *> &coefs)
 Replace a set of coefficients. More...
 
void UpdateCoefficient (int attr, VectorCoefficient &coef)
 Replace a single Coefficient for a particular attribute. More...
 
void ZeroCoefficient (int attr)
 Remove a single VectorCoefficient for a particular attribute. More...
 
virtual void Eval (Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
 Evaluate the coefficient. More...
 
virtual void Eval (Vector &V, ElementTransformation &T, const IntegrationPoint &ip)=0
 Evaluate the vector coefficient in the element described by T at the point ip, storing the result in V. More...
 
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. More...
 
- Public Member Functions inherited from mfem::VectorCoefficient
 VectorCoefficient (int vd)
 Initialize the VectorCoefficient with vector dimension vd. More...
 
double GetTime ()
 Get the time for time dependent coefficients. More...
 
int GetVDim ()
 Returns dimension of the vector. More...
 
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. More...
 
virtual void Project (QuadratureFunction &qf)
 Fill the QuadratureFunction qf by evaluating the coefficient at the quadrature points. More...
 
virtual ~VectorCoefficient ()
 

Additional Inherited Members

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

Detailed Description

A piecewise vector-valued coefficient with the pieces keyed off the element attribute numbers.

A value of zero will be returned for any missing attribute numbers.

This object will not assume ownership of any VectorCoefficient objects passed to it. Consequently, the caller must ensure that the individual VectorCoefficient objects are not deleted while this PWVectorCoefficient is still in use.

Note
The keys may either be domain attribute numbers or boundary attribute numbers. If the PWVectorCoefficient is used with a domain integrator the keys are assumed to be domain attribute numbers. Similarly, if the PWVectorCoefficient is used with a boundary integrator the keys are assumed to be boundary attribute numbers.

Definition at line 655 of file coefficient.hpp.

Constructor & Destructor Documentation

◆ PWVectorCoefficient() [1/2]

mfem::PWVectorCoefficient::PWVectorCoefficient ( int  vd)
inlineexplicit

Constructs a piecewise vector coefficient of dimension vd.

Definition at line 684 of file coefficient.hpp.

◆ PWVectorCoefficient() [2/2]

mfem::PWVectorCoefficient::PWVectorCoefficient ( int  vd,
const Array< int > &  attr,
const Array< VectorCoefficient *> &  coefs 
)
inline

Construct the coefficient using arrays describing the pieces.

Parameters
vd- dimension of the vector-valued result
attr- an array of attribute numbers for each piece
coefs- the corresponding array of VectorCoefficient pointers Any missing attributes or NULL coefficient pointers will result in a zero vector being returned for that attribute.
Note
Ownership of the VectorCoefficient objects will NOT be transferred to this object.

Definition at line 696 of file coefficient.hpp.

Member Function Documentation

◆ Eval() [1/3]

void mfem::PWVectorCoefficient::Eval ( Vector V,
ElementTransformation T,
const IntegrationPoint ip 
)
virtual

Evaluate the coefficient.

Implements mfem::VectorCoefficient.

Definition at line 341 of file coefficient.cpp.

◆ Eval() [2/3]

void mfem::VectorCoefficient::Eval

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.

Definition at line 265 of file coefficient.cpp.

◆ Eval() [3/3]

virtual void mfem::VectorCoefficient::Eval

Evaluate the vector coefficient in the element described by T at the point ip, storing the result in V.

Note
When this method is called, the caller must make sure that the IntegrationPoint associated with T is the same as ip. This can be achieved by calling T.SetIntPoint(&ip).

◆ SetTime()

void mfem::PWVectorCoefficient::SetTime ( double  t)
virtual

Set the time for time dependent coefficients.

Reimplemented from mfem::VectorCoefficient.

Definition at line 327 of file coefficient.cpp.

◆ UpdateCoefficient()

void mfem::PWVectorCoefficient::UpdateCoefficient ( int  attr,
VectorCoefficient coef 
)

Replace a single Coefficient for a particular attribute.

Definition at line 319 of file coefficient.cpp.

◆ UpdateCoefficients()

void mfem::PWVectorCoefficient::UpdateCoefficients ( const Array< int > &  attr,
const Array< VectorCoefficient *> &  coefs 
)
inline

Replace a set of coefficients.

Definition at line 704 of file coefficient.hpp.

◆ ZeroCoefficient()

void mfem::PWVectorCoefficient::ZeroCoefficient ( int  attr)
inline

Remove a single VectorCoefficient for a particular attribute.

Definition at line 712 of file coefficient.hpp.


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