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

Scalar coefficient defined as the linear combination of two scalar coefficients or a scalar and a scalar coefficient. More...

#include <coefficient.hpp>

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

Public Member Functions

 SumCoefficient (double A, Coefficient &B, double alpha_=1.0, double beta_=1.0)
 Constructor with one coefficient. Result is alpha_ * A + beta_ * B. More...
 
 SumCoefficient (Coefficient &A, Coefficient &B, double alpha_=1.0, double beta_=1.0)
 Constructor with two coefficients. Result is alpha_ * A + beta_ * B. More...
 
void SetTime (double t)
 Set the time for internally stored coefficients. More...
 
void SetAConst (double A)
 Reset the first term in the linear combination as a constant. More...
 
double GetAConst () const
 Return the first term in the linear combination. More...
 
void SetACoef (Coefficient &A)
 Reset the first term in the linear combination. More...
 
CoefficientGetACoef () const
 Return the first term in the linear combination. More...
 
void SetBCoef (Coefficient &B)
 Reset the second term in the linear combination. More...
 
CoefficientGetBCoef () const
 Return the second term in the linear combination. More...
 
void SetAlpha (double alpha_)
 Reset the factor in front of the first term in the linear combination. More...
 
double GetAlpha () const
 Return the factor in front of the first term in the linear combination. More...
 
void SetBeta (double beta_)
 Reset the factor in front of the second term in the linear combination. More...
 
double GetBeta () const
 Return the factor in front of the second term in the linear combination. More...
 
virtual double Eval (ElementTransformation &T, const IntegrationPoint &ip)
 Evaluate the coefficient at ip. 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 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

Scalar coefficient defined as the linear combination of two scalar coefficients or a scalar and a scalar coefficient.

Coefficients based on sums, products, or other functions of coefficients.

Definition at line 1232 of file coefficient.hpp.

Constructor & Destructor Documentation

◆ SumCoefficient() [1/2]

mfem::SumCoefficient::SumCoefficient ( double  A,
Coefficient B,
double  alpha_ = 1.0,
double  beta_ = 1.0 
)
inline

Constructor with one coefficient. Result is alpha_ * A + beta_ * B.

Definition at line 1244 of file coefficient.hpp.

◆ SumCoefficient() [2/2]

mfem::SumCoefficient::SumCoefficient ( Coefficient A,
Coefficient B,
double  alpha_ = 1.0,
double  beta_ = 1.0 
)
inline

Constructor with two coefficients. Result is alpha_ * A + beta_ * B.

Definition at line 1249 of file coefficient.hpp.

Member Function Documentation

◆ Eval()

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

Evaluate the coefficient at ip.

Implements mfem::Coefficient.

Definition at line 1282 of file coefficient.hpp.

◆ GetACoef()

Coefficient* mfem::SumCoefficient::GetACoef ( ) const
inline

Return the first term in the linear combination.

Definition at line 1264 of file coefficient.hpp.

◆ GetAConst()

double mfem::SumCoefficient::GetAConst ( ) const
inline

Return the first term in the linear combination.

Definition at line 1259 of file coefficient.hpp.

◆ GetAlpha()

double mfem::SumCoefficient::GetAlpha ( ) const
inline

Return the factor in front of the first term in the linear combination.

Definition at line 1274 of file coefficient.hpp.

◆ GetBCoef()

Coefficient* mfem::SumCoefficient::GetBCoef ( ) const
inline

Return the second term in the linear combination.

Definition at line 1269 of file coefficient.hpp.

◆ GetBeta()

double mfem::SumCoefficient::GetBeta ( ) const
inline

Return the factor in front of the second term in the linear combination.

Definition at line 1279 of file coefficient.hpp.

◆ SetACoef()

void mfem::SumCoefficient::SetACoef ( Coefficient A)
inline

Reset the first term in the linear combination.

Definition at line 1262 of file coefficient.hpp.

◆ SetAConst()

void mfem::SumCoefficient::SetAConst ( double  A)
inline

Reset the first term in the linear combination as a constant.

Definition at line 1257 of file coefficient.hpp.

◆ SetAlpha()

void mfem::SumCoefficient::SetAlpha ( double  alpha_)
inline

Reset the factor in front of the first term in the linear combination.

Definition at line 1272 of file coefficient.hpp.

◆ SetBCoef()

void mfem::SumCoefficient::SetBCoef ( Coefficient B)
inline

Reset the second term in the linear combination.

Definition at line 1267 of file coefficient.hpp.

◆ SetBeta()

void mfem::SumCoefficient::SetBeta ( double  beta_)
inline

Reset the factor in front of the second term in the linear combination.

Definition at line 1277 of file coefficient.hpp.

◆ SetTime()

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

Set the time for internally stored coefficients.

Reimplemented from mfem::Coefficient.

Definition at line 898 of file coefficient.cpp.


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