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

Additional Inherited Members

- Protected Attributes inherited from mfem::Coefficient
real_t 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()

real_t 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 ( real_t 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: