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

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

#include <coefficient.hpp>

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

Public Member Functions

 PWCoefficient ()
 Constructs a piecewise coefficient. More...
 
 PWCoefficient (const Array< int > &attr, const Array< Coefficient *> &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< Coefficient *> &coefs)
 Replace a set of coefficients. More...
 
void UpdateCoefficient (int attr, Coefficient &coef)
 Replace a single Coefficient for a particular attribute. More...
 
void ZeroCoefficient (int attr)
 Remove a single Coefficient for a particular attribute. More...
 
virtual double Eval (ElementTransformation &T, const IntegrationPoint &ip)
 Evaluate the coefficient. More...
 
- Public Member Functions inherited from mfem::Coefficient
 Coefficient ()
 
double GetTime ()
 Get the time for time dependent coefficients. More...
 
double Eval (ElementTransformation &T, const IntegrationPoint &ip, double t)
 Evaluate the coefficient in the element described by T at the point ip at time t. More...
 
virtual void Project (QuadratureFunction &qf)
 Fill the QuadratureFunction qf by evaluating the coefficient at the quadrature points. More...
 
virtual ~Coefficient ()
 

Additional Inherited Members

- Protected Attributes inherited from mfem::Coefficient
double time
 

Detailed Description

A piecewise 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 Coefficient objects passed to it. Consequently, the caller must ensure that the individual Coefficient objects are not deleted while this PWCoefficient is still in use.

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

Definition at line 153 of file coefficient.hpp.

Constructor & Destructor Documentation

◆ PWCoefficient() [1/2]

mfem::PWCoefficient::PWCoefficient ( )
inlineexplicit

Constructs a piecewise coefficient.

Definition at line 182 of file coefficient.hpp.

◆ PWCoefficient() [2/2]

mfem::PWCoefficient::PWCoefficient ( const Array< int > &  attr,
const Array< Coefficient *> &  coefs 
)
inline

Construct the coefficient using arrays describing the pieces.

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

Definition at line 193 of file coefficient.hpp.

Member Function Documentation

◆ Eval()

double mfem::PWCoefficient::Eval ( ElementTransformation T,
const IntegrationPoint ip 
)
virtual

Evaluate the coefficient.

Implements mfem::Coefficient.

Definition at line 114 of file coefficient.cpp.

◆ SetTime()

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

Set the time for time dependent coefficients.

Reimplemented from mfem::Coefficient.

Definition at line 100 of file coefficient.cpp.

◆ UpdateCoefficient()

void mfem::PWCoefficient::UpdateCoefficient ( int  attr,
Coefficient coef 
)
inline

Replace a single Coefficient for a particular attribute.

Definition at line 206 of file coefficient.hpp.

◆ UpdateCoefficients()

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

Replace a set of coefficients.

Definition at line 201 of file coefficient.hpp.

◆ ZeroCoefficient()

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

Remove a single Coefficient for a particular attribute.

Definition at line 210 of file coefficient.hpp.


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