MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::Coefficient Class Referenceabstract

Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormIntegrator, LinearFormIntegrator, and NonlinearFormIntegrator classes to represent the physical coefficients in the PDEs that are being discretized. This class can also be used in a more general way to represent functions that don't necessarily belong to a FE space, e.g., to project onto GridFunctions to use as initial conditions, exact solutions, etc. See, e.g., ex4 or ex22 for these uses. More...

#include <coefficient.hpp>

Inheritance diagram for mfem::Coefficient:
[legend]

Public Member Functions

 Coefficient ()
 
virtual void SetTime (real_t t)
 Set the time for time dependent coefficients.
 
real_t GetTime ()
 Get the time for time dependent coefficients.
 
virtual real_t Eval (ElementTransformation &T, const IntegrationPoint &ip)=0
 Evaluate the coefficient in the element described by T at the point ip.
 
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 ()
 

Protected Attributes

real_t time
 

Detailed Description

Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormIntegrator, LinearFormIntegrator, and NonlinearFormIntegrator classes to represent the physical coefficients in the PDEs that are being discretized. This class can also be used in a more general way to represent functions that don't necessarily belong to a FE space, e.g., to project onto GridFunctions to use as initial conditions, exact solutions, etc. See, e.g., ex4 or ex22 for these uses.

Definition at line 41 of file coefficient.hpp.

Constructor & Destructor Documentation

◆ Coefficient()

mfem::Coefficient::Coefficient ( )
inline

Definition at line 47 of file coefficient.hpp.

◆ ~Coefficient()

virtual mfem::Coefficient::~Coefficient ( )
inlinevirtual

Definition at line 79 of file coefficient.hpp.

Member Function Documentation

◆ Eval() [1/2]

virtual real_t mfem::Coefficient::Eval ( ElementTransformation & T,
const IntegrationPoint & ip )
pure virtual

Evaluate the coefficient in the element described by T at the point ip.

Note
When this method is called, the caller must make sure that the IntegrationPoint associated with T is the same as ip. This can be achieved by calling T.SetIntPoint(&ip).

Implemented in Combo_Level_Set_Coefficient, Dist_Level_Set_Coefficient, mfem::CartesianCoefficient, mfem::common::PProductCoefficient, mfem::ConstantCoefficient, mfem::CylindricalAzimuthalCoefficient, mfem::CylindricalRadialCoefficient, mfem::DeltaCoefficient, mfem::DeterminantCoefficient, mfem::DiffMappedGridFunctionCoefficient, mfem::DivergenceGridFunctionCoefficient, mfem::electromagnetics::JouleHeatingCoefficient, mfem::electromagnetics::MeshDependentCoefficient, mfem::electromagnetics::ScaledGFCoefficient, mfem::ExtrudeCoefficient, mfem::FunctionCoefficient, mfem::GradComponentCoeff, mfem::GridFunctionCoefficient, mfem::InnerProductCoefficient, mfem::MappedGridFunctionCoefficient, mfem::NormalGradCoeff, mfem::NormalGradComponentCoeff, mfem::PmlCoefficient, mfem::PowerCoefficient, mfem::ProductCoefficient, mfem::PWCoefficient, mfem::PWConstCoefficient, mfem::QuadratureFunctionCoefficient, mfem::RatioCoefficient, mfem::RestrictedCoefficient, mfem::ShiftedFunctionCoefficient, mfem::SIMPInterpolationCoefficient, mfem::SphericalAzimuthalCoefficient, mfem::SphericalPolarCoefficient, mfem::SphericalRadialCoefficient, mfem::StrainEnergyDensityCoefficient, mfem::SumCoefficient, mfem::TransformedCoefficient, and mfem::VectorRotProductCoefficient.

◆ Eval() [2/2]

real_t mfem::Coefficient::Eval ( ElementTransformation & T,
const IntegrationPoint & ip,
real_t t )
inline

Evaluate the coefficient in the element described by T at the point ip at time t.

Note
When this method is called, the caller must make sure that the IntegrationPoint associated with T is the same as ip. This can be achieved by calling T.SetIntPoint(&ip).

Definition at line 68 of file coefficient.hpp.

◆ GetTime()

real_t mfem::Coefficient::GetTime ( )
inline

Get the time for time dependent coefficients.

Definition at line 53 of file coefficient.hpp.

◆ Project()

void mfem::Coefficient::Project ( QuadratureFunction & qf)
virtual

Fill the QuadratureFunction qf by evaluating the coefficient at the quadrature points.

Reimplemented in mfem::ConstantCoefficient, mfem::GridFunctionCoefficient, and mfem::QuadratureFunctionCoefficient.

Definition at line 51 of file coefficient.cpp.

◆ SetTime()

Member Data Documentation

◆ time

real_t mfem::Coefficient::time
protected

Definition at line 44 of file coefficient.hpp.


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