MFEM  v4.2.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Attributes | List of all members
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< double(const Vector &)> F)
 Define a time-independent coefficient from a std function. More...
 
 FunctionCoefficient (std::function< double(const Vector &, double)> TDF)
 Define a time-dependent coefficient from a std function. More...
 
MFEM_DEPRECATED FunctionCoefficient (double(*f)(Vector &))
 (DEPRECATED) Define a time-independent coefficient from a C-function More...
 
MFEM_DEPRECATED FunctionCoefficient (double(*tdf)(Vector &, double))
 (DEPRECATED) Define a time-dependent coefficient from a C-function More...
 
virtual double Eval (ElementTransformation &T, const IntegrationPoint &ip)
 Evaluate the coefficient at ip. More...
 
- Public Member Functions inherited from mfem::Coefficient
 Coefficient ()
 
void SetTime (double t)
 Set the time for time dependent coefficients. More...
 
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 ~Coefficient ()
 

Protected Attributes

std::function< double(const
Vector &)> 
Function
 
std::function< double(const
Vector &, double)> 
TDFunction
 
- Protected Attributes inherited from mfem::Coefficient
double time
 

Detailed Description

A general function coefficient.

Definition at line 129 of file coefficient.hpp.

Constructor & Destructor Documentation

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

Define a time-independent coefficient from a std function.

Parameters
Ftime-independent std::function

Definition at line 138 of file coefficient.hpp.

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

Define a time-dependent coefficient from a std function.

Parameters
TDFtime-dependent function

Definition at line 144 of file coefficient.hpp.

MFEM_DEPRECATED mfem::FunctionCoefficient::FunctionCoefficient ( double(*)(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 151 of file coefficient.hpp.

MFEM_DEPRECATED mfem::FunctionCoefficient::FunctionCoefficient ( double(*)(Vector &, double)  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 160 of file coefficient.hpp.

Member Function Documentation

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

Evaluate the coefficient at ip.

Implements mfem::Coefficient.

Definition at line 31 of file coefficient.cpp.

Member Data Documentation

std::function<double(const Vector &)> mfem::FunctionCoefficient::Function
protected

Definition at line 132 of file coefficient.hpp.

std::function<double(const Vector &, double)> mfem::FunctionCoefficient::TDFunction
protected

Definition at line 133 of file coefficient.hpp.


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