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

A general function coefficient. More...

#include <coefficient.hpp>

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

Public Member Functions

FunctionCoefficient (std::function< real_t(const Vector &)> F)
Define a time-independent coefficient from a std function.

FunctionCoefficient (std::function< real_t(const Vector &, real_t)> TDF)
Define a time-dependent coefficient from a std function.

MFEM_DEPRECATED FunctionCoefficient (real_t(*f)(Vector &))
(DEPRECATED) Define a time-independent coefficient from a C-function

MFEM_DEPRECATED FunctionCoefficient (real_t(*tdf)(Vector &, real_t))
(DEPRECATED) Define a time-dependent coefficient from a C-function

virtual real_t Eval (ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.

Public Member Functions inherited from mfem::Coefficient
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.

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

virtual ~Coefficient ()

Protected Attributes

std::function< real_t(const Vector &)> Function

std::function< real_t(const Vector &, real_t)> TDFunction

Protected Attributes inherited from mfem::Coefficient
real_t time

Detailed Description

A general function coefficient.

Definition at line 219 of file coefficient.hpp.

◆ FunctionCoefficient() [1/4]

 mfem::FunctionCoefficient::FunctionCoefficient ( std::function< real_t(const Vector &)> F )
inline

Define a time-independent coefficient from a std function.

Parameters
 F time-independent std::function

Definition at line 228 of file coefficient.hpp.

◆ FunctionCoefficient() [2/4]

 mfem::FunctionCoefficient::FunctionCoefficient ( std::function< real_t(const Vector &, real_t)> TDF )
inline

Define a time-dependent coefficient from a std function.

Parameters
 TDF time-dependent function

Definition at line 234 of file coefficient.hpp.

◆ FunctionCoefficient() [3/4]

 MFEM_DEPRECATED mfem::FunctionCoefficient::FunctionCoefficient ( real_t(*)(Vector &) f )
inline

(DEPRECATED) Define a time-independent coefficient from a C-function

Deprecated:
Use the method where the C-function, f, uses a const Vector argument instead of Vector.

Definition at line 241 of file coefficient.hpp.

◆ FunctionCoefficient() [4/4]

 MFEM_DEPRECATED mfem::FunctionCoefficient::FunctionCoefficient ( real_t(*)(Vector &, real_t) tdf )
inline

(DEPRECATED) Define a time-dependent coefficient from a C-function

Deprecated:
Use the method where the C-function, tdf, uses a const Vector argument instead of Vector.

Definition at line 250 of file coefficient.hpp.

◆ Eval()

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

Evaluate the coefficient at ip.

Implements mfem::Coefficient.

Definition at line 129 of file coefficient.cpp.

◆ Function

 std::function mfem::FunctionCoefficient::Function
protected

Definition at line 222 of file coefficient.hpp.

◆ TDFunction

 std::function mfem::FunctionCoefficient::TDFunction
protected

Definition at line 223 of file coefficient.hpp.

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