StdFunctionOperator is a class wrapping mfem::Operator so that the user can use std::function to define the implementations of mfem::Operator::Mult and mfem::Operator::GetGradient.
More...
#include <stdfunction_operator.hpp>
|
| StdFunctionOperator (int n) |
| Default constructor for creating a square uninitialized StdFunctionOperator. More...
|
|
| StdFunctionOperator (int h, int w) |
| Default constructor for creating a rectangular uninitialized StdFunctionOperator. More...
|
|
| StdFunctionOperator (int n, std::function< void(const mfem::Vector &, mfem::Vector &)> function) |
| Constructor for a square StdFunctionOperator that only defines mfem::Operator::Mult. More...
|
|
| StdFunctionOperator (int h, int w, std::function< void(const mfem::Vector &, mfem::Vector &)> function) |
| Constructor for a rectangular StdFunctionOperator that only defines mfem::Operator::Mult. More...
|
|
| StdFunctionOperator (int n, std::function< void(const mfem::Vector &, mfem::Vector &)> function, std::function< mfem::Operator &(const mfem::Vector &)> jacobian) |
| Constructor for a square StdFunctionOperator that defines mfem::Operator::Mult and mfem::Operator::GetGradient. More...
|
|
| StdFunctionOperator (int h, int w, std::function< void(const mfem::Vector &, mfem::Vector &)> function, std::function< mfem::Operator &(const mfem::Vector &)> jacobian) |
| Constructor for a rectangular StdFunctionOperator that defines mfem::Operator::Mult and mfem::Operator::GetGradient. More...
|
|
void | Mult (const mfem::Vector &k, mfem::Vector &y) const |
| The underlying mult (e.g. residual evaluation) method. More...
|
|
mfem::Operator & | GetGradient (const mfem::Vector &k) const |
| The underlying GetGradient (e.g. residual jacobian evaluation) method. More...
|
|
StdFunctionOperator is a class wrapping mfem::Operator so that the user can use std::function to define the implementations of mfem::Operator::Mult and mfem::Operator::GetGradient.
The main benefit of this approach is that lambda capture lists allow for a flexible inline representation of the overloaded functions, without having to manually define a separate functor class.
Definition at line 31 of file stdfunction_operator.hpp.
◆ StdFunctionOperator() [1/6]
serac::mfem_ext::StdFunctionOperator::StdFunctionOperator |
( |
int |
n | ) |
|
|
inline |
◆ StdFunctionOperator() [2/6]
serac::mfem_ext::StdFunctionOperator::StdFunctionOperator |
( |
int |
h, |
|
|
int |
w |
|
) |
| |
|
inline |
◆ StdFunctionOperator() [3/6]
serac::mfem_ext::StdFunctionOperator::StdFunctionOperator |
( |
int |
n, |
|
|
std::function< void(const mfem::Vector &, mfem::Vector &)> |
function |
|
) |
| |
|
inline |
Constructor for a square StdFunctionOperator that only defines mfem::Operator::Mult.
- Parameters
-
[in] | n | The size fo the operator |
[in] | function | The function that defines the mult (typically residual evaluation) method |
Definition at line 54 of file stdfunction_operator.hpp.
◆ StdFunctionOperator() [4/6]
serac::mfem_ext::StdFunctionOperator::StdFunctionOperator |
( |
int |
h, |
|
|
int |
w, |
|
|
std::function< void(const mfem::Vector &, mfem::Vector &)> |
function |
|
) |
| |
|
inline |
Constructor for a rectangular StdFunctionOperator that only defines mfem::Operator::Mult.
- Parameters
-
[in] | h | The height of the operator |
[in] | w | The width of the operator |
[in] | function | The function that defines the mult (typically residual evaluation) method |
Definition at line 66 of file stdfunction_operator.hpp.
◆ StdFunctionOperator() [5/6]
serac::mfem_ext::StdFunctionOperator::StdFunctionOperator |
( |
int |
n, |
|
|
std::function< void(const mfem::Vector &, mfem::Vector &)> |
function, |
|
|
std::function< mfem::Operator &(const mfem::Vector &)> |
jacobian |
|
) |
| |
|
inline |
Constructor for a square StdFunctionOperator that defines mfem::Operator::Mult and mfem::Operator::GetGradient.
- Parameters
-
[in] | n | The size of the operator |
[in] | function | The function that defines the mult (typically residual evaluation) method |
[in] | jacobian | The function that defines the GetGradient (typically residual jacobian evaluation) method |
Definition at line 79 of file stdfunction_operator.hpp.
◆ StdFunctionOperator() [6/6]
serac::mfem_ext::StdFunctionOperator::StdFunctionOperator |
( |
int |
h, |
|
|
int |
w, |
|
|
std::function< void(const mfem::Vector &, mfem::Vector &)> |
function, |
|
|
std::function< mfem::Operator &(const mfem::Vector &)> |
jacobian |
|
) |
| |
|
inline |
Constructor for a rectangular StdFunctionOperator that defines mfem::Operator::Mult and mfem::Operator::GetGradient.
- Parameters
-
[in] | h | The height of the operator |
[in] | w | The width of the operator |
[in] | function | The function that defines the mult (typically residual evaluation) method |
[in] | jacobian | The function that defines the GetGradient (typically residual jacobian evaluation) method |
Definition at line 94 of file stdfunction_operator.hpp.
◆ GetGradient()
mfem::Operator& serac::mfem_ext::StdFunctionOperator::GetGradient |
( |
const mfem::Vector & |
k | ) |
const |
|
inline |
The underlying GetGradient (e.g. residual jacobian evaluation) method.
- Parameters
-
[in] | k | The current state input vector |
- Returns
- A non-owning reference to the gradient operator
Definition at line 114 of file stdfunction_operator.hpp.
◆ Mult()
void serac::mfem_ext::StdFunctionOperator::Mult |
( |
const mfem::Vector & |
k, |
|
|
mfem::Vector & |
y |
|
) |
| const |
|
inline |
The underlying mult (e.g. residual evaluation) method.
- Parameters
-
[in] | k | state input vector |
[out] | y | output residual vector |
Definition at line 106 of file stdfunction_operator.hpp.
The documentation for this class was generated from the following file: