MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
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.
 
 PWVectorCoefficient (int vd, const Array< int > &attr, const Array< VectorCoefficient * > &coefs)
 Construct the coefficient using arrays describing the pieces.
 
virtual void SetTime (real_t t)
 Set the time for time dependent coefficients.
 
void UpdateCoefficients (const Array< int > &attr, const Array< VectorCoefficient * > &coefs)
 Replace a set of coefficients.
 
void UpdateCoefficient (int attr, VectorCoefficient &coef)
 Replace a single Coefficient for a particular attribute.
 
void ZeroCoefficient (int attr)
 Remove a single VectorCoefficient for a particular attribute.
 
virtual void Eval (Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
 Evaluate the 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

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/2]

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 605 of file coefficient.cpp.

◆ Eval() [2/2]

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.

◆ SetTime()

void mfem::PWVectorCoefficient::SetTime ( real_t 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: