MFEM v2.0
|
class for piecewise constant coefficient More...
#include <coefficient.hpp>
Public Member Functions | |
PWConstCoefficient (int NumOfSubD=0) | |
Constructs a piecewise constant coefficient in NumOfSubD subdomains. | |
PWConstCoefficient (Vector &c) | |
double & | operator() (int i) |
Member function to access or modify the value of the i-th constant. | |
void | operator= (double c) |
Set domain constants equal to the same constant c. | |
int | GetNConst () |
Returns the number of constants. | |
virtual double | Eval (ElementTransformation &T, const IntegrationPoint &ip) |
Evaluate the coefficient function. | |
virtual void | Read (istream &in) |
Private Attributes | |
Vector | constants |
class for piecewise constant coefficient
Definition at line 47 of file coefficient.hpp.
PWConstCoefficient::PWConstCoefficient | ( | int | NumOfSubD = 0 | ) | [inline, explicit] |
Constructs a piecewise constant coefficient in NumOfSubD subdomains.
Definition at line 55 of file coefficient.hpp.
References constants.
PWConstCoefficient::PWConstCoefficient | ( | Vector & | c | ) | [inline] |
c should be a vector defined by attributes, so for region with attribute i c[i] is the coefficient in that region
Definition at line 60 of file coefficient.hpp.
References constants, Vector::SetSize(), and Vector::Size().
double PWConstCoefficient::Eval | ( | ElementTransformation & | T, |
const IntegrationPoint & | ip | ||
) | [virtual] |
Evaluate the coefficient function.
Implements Coefficient.
Definition at line 18 of file coefficient.cpp.
References ElementTransformation::Attribute, and constants.
int PWConstCoefficient::GetNConst | ( | ) | [inline] |
Returns the number of constants.
Definition at line 70 of file coefficient.hpp.
References constants, and Vector::Size().
double& PWConstCoefficient::operator() | ( | int | i | ) | [inline] |
Member function to access or modify the value of the i-th constant.
Definition at line 64 of file coefficient.hpp.
References constants.
void PWConstCoefficient::operator= | ( | double | c | ) | [inline] |
Set domain constants equal to the same constant c.
Definition at line 67 of file coefficient.hpp.
References constants.
void PWConstCoefficient::Read | ( | istream & | in | ) | [virtual] |
Implements Coefficient.
Definition at line 25 of file coefficient.cpp.
References constants, and Vector::SetSize().
Vector PWConstCoefficient::constants [private] |
Definition at line 50 of file coefficient.hpp.
Referenced by Eval(), GetNConst(), operator()(), operator=(), PWConstCoefficient(), and Read().