MFEM  v4.4.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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 ~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 144 of file coefficient.hpp.

Constructor & Destructor Documentation

mfem::PWCoefficient::PWCoefficient ( )
inlineexplicit

Constructs a piecewise coefficient.

Definition at line 173 of file coefficient.hpp.

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 184 of file coefficient.hpp.

Member Function Documentation

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

Evaluate the coefficient.

Implements mfem::Coefficient.

Definition at line 89 of file coefficient.cpp.

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

Set the time for time dependent coefficients.

Reimplemented from mfem::Coefficient.

Definition at line 75 of file coefficient.cpp.

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

Replace a single Coefficient for a particular attribute.

Definition at line 197 of file coefficient.hpp.

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

Replace a set of coefficients.

Definition at line 192 of file coefficient.hpp.

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

Remove a single Coefficient for a particular attribute.

Definition at line 201 of file coefficient.hpp.


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