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

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 1366 of file coefficient.hpp.

Constructor & Destructor Documentation

◆ SumCoefficient() [1/2]

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

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

Definition at line 1378 of file coefficient.hpp.

◆ SumCoefficient() [2/2]

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

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

Definition at line 1383 of file coefficient.hpp.

Member Function Documentation

◆ Eval()

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

Evaluate the coefficient at ip.

Implements mfem::Coefficient.

Definition at line 1416 of file coefficient.hpp.

◆ GetACoef()

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

Return the first term in the linear combination.

Definition at line 1398 of file coefficient.hpp.

◆ GetAConst()

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

Return the first term in the linear combination.

Definition at line 1393 of file coefficient.hpp.

◆ GetAlpha()

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

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

Definition at line 1408 of file coefficient.hpp.

◆ GetBCoef()

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

Return the second term in the linear combination.

Definition at line 1403 of file coefficient.hpp.

◆ GetBeta()

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

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

Definition at line 1413 of file coefficient.hpp.

◆ SetACoef()

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

Reset the first term in the linear combination.

Definition at line 1396 of file coefficient.hpp.

◆ SetAConst()

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

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

Definition at line 1391 of file coefficient.hpp.

◆ SetAlpha()

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

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

Definition at line 1406 of file coefficient.hpp.

◆ SetBCoef()

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

Reset the second term in the linear combination.

Definition at line 1401 of file coefficient.hpp.

◆ SetBeta()

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

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

Definition at line 1411 of file coefficient.hpp.

◆ SetTime()

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

Set the time for internally stored coefficients.

Reimplemented from mfem::Coefficient.

Definition at line 948 of file coefficient.cpp.


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