19 namespace serac::mfem_ext {
55 : mfem::Operator(n), function_(function)
67 : mfem::Operator(h, w), function_(function)
80 std::function<mfem::Operator&(
const mfem::Vector&)> jacobian)
81 : mfem::Operator(n), function_(function), jacobian_(jacobian)
95 std::function<mfem::Operator&(
const mfem::Vector&)> jacobian)
96 : mfem::Operator(h, w), function_(function), jacobian_(jacobian)
106 void Mult(
const mfem::Vector& k, mfem::Vector& y)
const { function_(k, y); };
114 mfem::Operator&
GetGradient(
const mfem::Vector& k)
const {
return jacobian_(k); };
120 std::function<void(
const mfem::Vector&, mfem::Vector&)> function_;
125 std::function<mfem::Operator&(
const mfem::Vector&)> jacobian_;
StdFunctionOperator is a class wrapping mfem::Operator so that the user can use std::function to defi...
StdFunctionOperator(int n, std::function< void(const mfem::Vector &, mfem::Vector &)> function)
Constructor for a square StdFunctionOperator that only defines mfem::Operator::Mult.
StdFunctionOperator(int n)
Default constructor for creating a square uninitialized StdFunctionOperator.
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::Operato...
StdFunctionOperator(int h, int w)
Default constructor for creating a rectangular uninitialized StdFunctionOperator.
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::Ge...
mfem::Operator & GetGradient(const mfem::Vector &k) const
The underlying GetGradient (e.g. residual jacobian evaluation) method.
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.
void Mult(const mfem::Vector &k, mfem::Vector &y) const
The underlying mult (e.g. residual evaluation) method.