MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
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.
 
 PWConstCoefficient (Vector &c)
 Construct the constant coefficient using a vector of constants.
 
void UpdateConstants (Vector &c)
 Update the constants with vector c.
 
real_toperator() (int i)
 Return a reference to the i-th constant.
 
void operator= (real_t c)
 Set the constants for all attributes to constant c.
 
int GetNConst ()
 Returns the number of constants representing different attributes.
 
virtual real_t Eval (ElementTransformation &T, const IntegrationPoint &ip)
 Evaluate the coefficient.
 
- Public Member Functions inherited from mfem::Coefficient
 Coefficient ()
 
virtual void SetTime (real_t t)
 Set the time for time dependent coefficients.
 
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 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()

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

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