MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::VectorSumCoefficient Class Reference

Vector coefficient defined as the linear combination of two vectors. More...

#include <coefficient.hpp>

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

Public Member Functions

 VectorSumCoefficient (int dim)
 
 VectorSumCoefficient (VectorCoefficient &A, VectorCoefficient &B, real_t alpha_=1.0, real_t beta_=1.0)
 
 VectorSumCoefficient (VectorCoefficient &A_, VectorCoefficient &B_, Coefficient &alpha_, Coefficient &beta_)
 
void SetTime (real_t t)
 Set the time for internally stored coefficients.
 
void SetACoef (VectorCoefficient &A_)
 Reset the first vector coefficient.
 
VectorCoefficientGetACoef () const
 Return the first vector coefficient.
 
void SetBCoef (VectorCoefficient &B_)
 Reset the second vector coefficient.
 
VectorCoefficientGetBCoef () const
 Return the second vector coefficient.
 
void SetAlphaCoef (Coefficient &A_)
 Reset the factor in front of the first vector coefficient.
 
CoefficientGetAlphaCoef () const
 Return the factor in front of the first vector coefficient.
 
void SetBetaCoef (Coefficient &B_)
 Reset the factor in front of the second vector coefficient.
 
CoefficientGetBetaCoef () const
 Return the factor in front of the second vector coefficient.
 
void SetA (const Vector &A_)
 Reset the first vector as a constant.
 
const VectorGetA () const
 Return the first vector constant.
 
void SetB (const Vector &B_)
 Reset the second vector as a constant.
 
const VectorGetB () const
 Return the second vector constant.
 
void SetAlpha (real_t alpha_)
 Reset the factor in front of the first vector coefficient as a constant.
 
real_t GetAlpha () const
 Return the factor in front of the first vector coefficient.
 
void SetBeta (real_t beta_)
 Reset the factor in front of the second vector coefficient as a constant.
 
real_t GetBeta () const
 Return the factor in front of the second vector coefficient.
 
virtual void Eval (Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
 Evaluate the coefficient at ip.
 
virtual void Eval (DenseMatrix &M, ElementTransformation &T, const IntegrationRule &ir)
 Evaluate the vector coefficient in the element described by T at all points of ir, storing the result in M.
 
- Public Member Functions inherited from mfem::VectorCoefficient
 VectorCoefficient (int vd)
 Initialize the VectorCoefficient with vector dimension vd.
 
real_t GetTime ()
 Get the time for time dependent coefficients.
 
int GetVDim ()
 Returns dimension of the vector.
 
virtual void Project (QuadratureFunction &qf)
 Fill the QuadratureFunction qf by evaluating the coefficient at the quadrature points.
 
virtual ~VectorCoefficient ()
 

Additional Inherited Members

- Protected Attributes inherited from mfem::VectorCoefficient
int vdim
 
real_t time
 

Detailed Description

Vector coefficient defined as the linear combination of two vectors.

Definition at line 1765 of file coefficient.hpp.

Constructor & Destructor Documentation

◆ VectorSumCoefficient() [1/3]

mfem::VectorSumCoefficient::VectorSumCoefficient ( int dim)

Constructor with no coefficients. To be used with the various "Set" methods

Definition at line 1044 of file coefficient.cpp.

◆ VectorSumCoefficient() [2/3]

mfem::VectorSumCoefficient::VectorSumCoefficient ( VectorCoefficient & A,
VectorCoefficient & B,
real_t alpha_ = 1.0,
real_t beta_ = 1.0 )

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

Definition at line 1054 of file coefficient.cpp.

◆ VectorSumCoefficient() [3/3]

mfem::VectorSumCoefficient::VectorSumCoefficient ( VectorCoefficient & A_,
VectorCoefficient & B_,
Coefficient & alpha_,
Coefficient & beta_ )

Constructor with scalar coefficients. Result is alpha_ * A_ + beta_ * B_

Definition at line 1068 of file coefficient.cpp.

Member Function Documentation

◆ Eval() [1/2]

void mfem::VectorCoefficient::Eval ( DenseMatrix & M,
ElementTransformation & T,
const IntegrationRule & ir )
virtual

Evaluate the vector coefficient in the element described by T at all points of ir, storing the result in M.

The dimensions of M are GetVDim() by ir.GetNPoints() and they must be set by the implementation of this method.

The general implementation provided by the base class (using the Eval method for one IntegrationPoint at a time) can be overloaded for more efficient implementation.

Note
The IntegrationPoint associated with T is not used, and this method will generally modify this IntegrationPoint associated with T.

Reimplemented from mfem::VectorCoefficient.

Definition at line 605 of file coefficient.cpp.

◆ Eval() [2/2]

void mfem::VectorSumCoefficient::Eval ( Vector & V,
ElementTransformation & T,
const IntegrationPoint & ip )
virtual

Evaluate the coefficient at ip.

Implements mfem::VectorCoefficient.

Definition at line 1094 of file coefficient.cpp.

◆ GetA()

const Vector & mfem::VectorSumCoefficient::GetA ( ) const
inline

Return the first vector constant.

Definition at line 1823 of file coefficient.hpp.

◆ GetACoef()

VectorCoefficient * mfem::VectorSumCoefficient::GetACoef ( ) const
inline

Return the first vector coefficient.

Definition at line 1803 of file coefficient.hpp.

◆ GetAlpha()

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

Return the factor in front of the first vector coefficient.

Definition at line 1833 of file coefficient.hpp.

◆ GetAlphaCoef()

Coefficient * mfem::VectorSumCoefficient::GetAlphaCoef ( ) const
inline

Return the factor in front of the first vector coefficient.

Definition at line 1813 of file coefficient.hpp.

◆ GetB()

const Vector & mfem::VectorSumCoefficient::GetB ( ) const
inline

Return the second vector constant.

Definition at line 1828 of file coefficient.hpp.

◆ GetBCoef()

VectorCoefficient * mfem::VectorSumCoefficient::GetBCoef ( ) const
inline

Return the second vector coefficient.

Definition at line 1808 of file coefficient.hpp.

◆ GetBeta()

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

Return the factor in front of the second vector coefficient.

Definition at line 1838 of file coefficient.hpp.

◆ GetBetaCoef()

Coefficient * mfem::VectorSumCoefficient::GetBetaCoef ( ) const
inline

Return the factor in front of the second vector coefficient.

Definition at line 1818 of file coefficient.hpp.

◆ SetA()

void mfem::VectorSumCoefficient::SetA ( const Vector & A_)
inline

Reset the first vector as a constant.

Definition at line 1821 of file coefficient.hpp.

◆ SetACoef()

void mfem::VectorSumCoefficient::SetACoef ( VectorCoefficient & A_)
inline

Reset the first vector coefficient.

Definition at line 1801 of file coefficient.hpp.

◆ SetAlpha()

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

Reset the factor in front of the first vector coefficient as a constant.

Definition at line 1831 of file coefficient.hpp.

◆ SetAlphaCoef()

void mfem::VectorSumCoefficient::SetAlphaCoef ( Coefficient & A_)
inline

Reset the factor in front of the first vector coefficient.

Definition at line 1811 of file coefficient.hpp.

◆ SetB()

void mfem::VectorSumCoefficient::SetB ( const Vector & B_)
inline

Reset the second vector as a constant.

Definition at line 1826 of file coefficient.hpp.

◆ SetBCoef()

void mfem::VectorSumCoefficient::SetBCoef ( VectorCoefficient & B_)
inline

Reset the second vector coefficient.

Definition at line 1806 of file coefficient.hpp.

◆ SetBeta()

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

Reset the factor in front of the second vector coefficient as a constant.

Definition at line 1836 of file coefficient.hpp.

◆ SetBetaCoef()

void mfem::VectorSumCoefficient::SetBetaCoef ( Coefficient & B_)
inline

Reset the factor in front of the second vector coefficient.

Definition at line 1816 of file coefficient.hpp.

◆ SetTime()

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

Set the time for internally stored coefficients.

Reimplemented from mfem::VectorCoefficient.

Definition at line 1085 of file coefficient.cpp.


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