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

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

#include <coefficient.hpp>

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

Public Member Functions

 PWConstCoefficient (int NumOfSubD=0)
 Constructs a piecewise constant coefficient in NumOfSubD subdomains. More...
 
 PWConstCoefficient (Vector &c)
 Construct the constant coefficient using a vector of constants. More...
 
void UpdateConstants (Vector &c)
 Update the constants with vector c. More...
 
double & operator() (int i)
 Return a reference to the i-th constant. More...
 
void operator= (double c)
 Set the constants for all attributes to constant c. More...
 
int GetNConst ()
 Returns the number of constants representing different attributes. More...
 
virtual double Eval (ElementTransformation &T, const IntegrationPoint &ip)
 Evaluate the coefficient. More...
 
- Public Member Functions inherited from mfem::Coefficient
 Coefficient ()
 
virtual void SetTime (double t)
 Set the time for time dependent coefficients. More...
 
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 constant coefficient with the constants keyed off the element attribute numbers.

Definition at line 103 of file coefficient.hpp.

Constructor & Destructor Documentation

◆ PWConstCoefficient() [1/2]

mfem::PWConstCoefficient::PWConstCoefficient ( int  NumOfSubD = 0)
inlineexplicit

Constructs a piecewise constant coefficient in NumOfSubD subdomains.

Definition at line 111 of file coefficient.hpp.

◆ PWConstCoefficient() [2/2]

mfem::PWConstCoefficient::PWConstCoefficient ( Vector c)
inline

Construct the constant coefficient using a vector of constants.

c should be a vector defined by attributes, so for region with attribute i c[i-1] is the coefficient in that region

Definition at line 117 of file coefficient.hpp.

Member Function Documentation

◆ Eval()

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

Evaluate the coefficient.

Implements mfem::Coefficient.

Definition at line 76 of file coefficient.cpp.

◆ GetNConst()

int mfem::PWConstCoefficient::GetNConst ( )
inline

Returns the number of constants representing different attributes.

Definition at line 130 of file coefficient.hpp.

◆ operator()()

double& mfem::PWConstCoefficient::operator() ( int  i)
inline

Return a reference to the i-th constant.

Definition at line 124 of file coefficient.hpp.

◆ operator=()

void mfem::PWConstCoefficient::operator= ( double  c)
inline

Set the constants for all attributes to constant c.

Definition at line 127 of file coefficient.hpp.

◆ UpdateConstants()

void mfem::PWConstCoefficient::UpdateConstants ( Vector c)
inline

Update the constants with vector c.

Definition at line 121 of file coefficient.hpp.


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