|
libMesh
|
A Function generated (via FParser) by parsing a mathematical expression. More...
#include <parsed_function.h>
Public Member Functions | |
| ParsedFunction (const std::string &expression, const std::vector< std::string > *additional_vars=nullptr, const std::vector< Output > *initial_vals=nullptr) | |
| ParsedFunction & | operator= (const ParsedFunction &)=delete |
| This class cannot be (default) copy assigned because the underlying FunctionParserADBase class does not define a custom copy assignment operator, and manually manages memory. More... | |
| ParsedFunction (const ParsedFunction &)=default | |
| The remaining special functions can be defaulted for this class. More... | |
| ParsedFunction (ParsedFunction &&)=default | |
| ParsedFunction & | operator= (ParsedFunction &&)=default |
| virtual | ~ParsedFunction ()=default |
| void | reparse (const std::string &expression) |
| Re-parse with new expression. More... | |
| virtual Output | operator() (const Point &p, const Real time=0) override |
| virtual bool | has_derivatives () |
| Query if the automatic derivative generation was successful. More... | |
| virtual Output | dot (const Point &p, const Real time=0) |
| virtual OutputGradient | gradient (const Point &p, const Real time=0) |
| virtual void | operator() (const Point &p, const Real time, DenseVector< Output > &output) override |
| Evaluation function for time-dependent vector-valued functions. More... | |
| virtual Output | component (unsigned int i, const Point &p, Real time) override |
| const std::string & | expression () |
| virtual Output & | getVarAddress (const std::string &variable_name) |
| virtual std::unique_ptr< FunctionBase< Output > > | clone () const override |
| Output | get_inline_value (const std::string &inline_var_name) const |
| void | set_inline_value (const std::string &inline_var_name, Output newval) |
| Changes the value of an inline variable. More... | |
| ParsedFunction (const std::string &, const std::vector< std::string > *=nullptr, const std::vector< Output > *=nullptr) | |
| ParsedFunction (ParsedFunction &&)=delete | |
| When !LIBMESH_HAVE_FPARSER, this class is not implemented, so let's make that explicit by deleting the special functions. More... | |
| ParsedFunction (const ParsedFunction &)=delete | |
| ParsedFunction & | operator= (const ParsedFunction &)=delete |
| ParsedFunction & | operator= (ParsedFunction &&)=delete |
| virtual | ~ParsedFunction ()=default |
| virtual Output | operator() (const Point &, const Real=0) |
| virtual void | operator() (const Point &, const Real, DenseVector< Output > &) |
| Evaluation function for time-dependent vector-valued functions. More... | |
| virtual void | init () |
| The actual initialization process. More... | |
| virtual void | clear () |
| Clears the function. More... | |
| virtual Output & | getVarAddress (const std::string &) |
| virtual std::unique_ptr< FunctionBase< Output > > | clone () const |
| void | operator() (const Point &p, DenseVector< Output > &output) |
| Evaluation function for time-independent vector-valued functions. More... | |
| bool | initialized () const |
| void | set_is_time_dependent (bool is_time_dependent) |
| Function to set whether this is a time-dependent function or not. More... | |
| bool | is_time_dependent () const |
Protected Member Functions | |
| void | partial_reparse (const std::string &expression) |
| Re-parse with minor changes to expression. More... | |
| std::size_t | find_name (const std::string &varname, const std::string &expr) const |
| Helper function for parsing out variable names. More... | |
| bool | expression_is_time_dependent (const std::string &expression) const |
Protected Attributes | |
| const FunctionBase * | _master |
Const pointer to our master, initialized to nullptr. More... | |
| bool | _initialized |
When init() was called so that everything is ready for calls to operator() (...), then this bool is true. More... | |
| bool | _is_time_dependent |
| Cache whether or not this function is actually time-dependent. More... | |
Private Member Functions | |
| void | set_spacetime (const Point &p, const Real time=0) |
| Set the _spacetime argument vector. More... | |
| Output | eval (FunctionParserADBase< Output > &parser, const std::string &libmesh_dbg_var(function_name), unsigned int libmesh_dbg_var(component_idx)) const |
| Evaluate the ith FunctionParser and check the result. More... | |
Private Attributes | |
| std::string | _expression |
| std::vector< std::string > | _subexpressions |
| std::vector< FunctionParserADBase< Output > > | parsers |
| std::vector< Output > | _spacetime |
| std::vector< FunctionParserADBase< Output > > | dx_parsers |
| std::vector< FunctionParserADBase< Output > > | dy_parsers |
| std::vector< FunctionParserADBase< Output > > | dz_parsers |
| std::vector< FunctionParserADBase< Output > > | dt_parsers |
| bool | _valid_derivatives |
| std::string | variables |
| std::vector< std::string > | _additional_vars |
| std::vector< Output > | _initial_vals |
| Output | _dummy |
A Function generated (via FParser) by parsing a mathematical expression.
All overridden virtual functions are documented in function_base.h.
A Function defined by a std::string.
Definition at line 60 of file parsed_function.h.
|
inlineexplicit |
Definition at line 211 of file parsed_function.h.
|
default |
The remaining special functions can be defaulted for this class.
|
default |
|
virtualdefault |
|
inline |
Definition at line 718 of file parsed_function.h.
|
delete |
When !LIBMESH_HAVE_FPARSER, this class is not implemented, so let's make that explicit by deleting the special functions.
|
delete |
|
virtualdefault |
|
inlinevirtual |
Clears the function.
Reimplemented from libMesh::FunctionBase< Output >.
Definition at line 744 of file parsed_function.h.
Referenced by libMesh::ParsedFunction< T >::partial_reparse().
|
inlinevirtual |
The new copy should be as "deep" as necessary to allow independent destruction and simultaneous evaluations of the copies in different threads.
Implements libMesh::FunctionBase< Output >.
Definition at line 746 of file parsed_function.h.
|
inlineoverridevirtual |
The new copy should be as "deep" as necessary to allow independent destruction and simultaneous evaluations of the copies in different threads.
Implements libMesh::FunctionBase< Output >.
Definition at line 358 of file parsed_function.h.
|
inlineoverridevirtual |
i at coordinate p and time time. Reimplemented from libMesh::FunctionBase< Output >.
Definition at line 323 of file parsed_function.h.
|
inlinevirtual |
Definition at line 271 of file parsed_function.h.
|
inlineprivate |
Evaluate the ith FunctionParser and check the result.
Definition at line 654 of file parsed_function.h.
|
inline |
Definition at line 121 of file parsed_function.h.
|
inlineprotected |
true if the expression is time-dependent, false otherwise. Definition at line 618 of file parsed_function.h.
|
inlineprotected |
|
inline |
Definition at line 368 of file parsed_function.h.
Referenced by libMesh::ParsedFunctionParameter< T >::get(), ParsedFunctionTest::testInlineGetter(), and ParsedFunctionTest::testInlineSetter().
|
inlinevirtual |
Definition at line 745 of file parsed_function.h.
|
inlinevirtual |
Definition at line 342 of file parsed_function.h.
|
inlinevirtual |
Definition at line 280 of file parsed_function.h.
|
inlinevirtual |
Query if the automatic derivative generation was successful.
Definition at line 105 of file parsed_function.h.
|
inlinevirtual |
The actual initialization process.
Reimplemented from libMesh::FunctionBase< Output >.
Definition at line 743 of file parsed_function.h.
|
inlineinherited |
true when this object is properly initialized and ready for use, false otherwise. Definition at line 205 of file function_base.h.
|
inlineinherited |
true when the function this object represents is actually time-dependent, false otherwise. Definition at line 219 of file function_base.h.
Referenced by libMesh::CompositeFunction< Output >::attach_subfunction(), ParsedFunctionTest::testTimeDependence(), and CompositeFunctionTest::testTimeDependence().
|
inlinevirtual |
Evaluation function for time-dependent vector-valued functions.
Sets output values in the passed-in output DenseVector.
Pure virtual, so you have to override it.
Implements libMesh::FunctionBase< Output >.
Definition at line 739 of file parsed_function.h.
|
inlinevirtual |
p and time time, which defaults to zero.Pure virtual, so you have to override it.
Implements libMesh::FunctionBase< Output >.
Definition at line 735 of file parsed_function.h.
|
inlineoverridevirtual |
Evaluation function for time-dependent vector-valued functions.
Sets output values in the passed-in output DenseVector.
Pure virtual, so you have to override it.
Implements libMesh::FunctionBase< Output >.
Definition at line 300 of file parsed_function.h.
|
inlineoverridevirtual |
p and time time, which defaults to zero.Pure virtual, so you have to override it.
Implements libMesh::FunctionBase< Output >.
Definition at line 262 of file parsed_function.h.
|
inlineinherited |
Evaluation function for time-independent vector-valued functions.
Sets output values in the passed-in output DenseVector.
Definition at line 240 of file function_base.h.
|
delete |
This class cannot be (default) copy assigned because the underlying FunctionParserADBase class does not define a custom copy assignment operator, and manually manages memory.
|
delete |
|
default |
|
delete |
|
inlineprotected |
|
inline |
|
inline |
Changes the value of an inline variable.
Definition at line 442 of file parsed_function.h.
Referenced by libMesh::ParsedFunctionParameter< T >::set(), and ParsedFunctionTest::testInlineSetter().
|
inlineinherited |
Function to set whether this is a time-dependent function or not.
This is intended to be only used by subclasses who cannot natively determine time-dependence. In such a case, this function should be used immediately following construction.
Definition at line 212 of file function_base.h.
|
inlineprivate |
|
private |
Definition at line 202 of file parsed_function.h.
|
private |
Definition at line 751 of file parsed_function.h.
Referenced by libMesh::ParsedFunction< T >::getVarAddress().
|
private |
Definition at line 184 of file parsed_function.h.
Referenced by libMesh::ParsedFunction< T >::expression().
|
private |
Definition at line 203 of file parsed_function.h.
|
protectedinherited |
When init() was called so that everything is ready for calls to operator() (...), then this bool is true.
Definition at line 179 of file function_base.h.
Referenced by libMesh::AnalyticFunction< Output >::AnalyticFunction(), libMesh::ConstFunction< Output >::ConstFunction(), and libMesh::WrappedFunction< Output >::WrappedFunction().
|
protectedinherited |
Cache whether or not this function is actually time-dependent.
Definition at line 184 of file function_base.h.
Referenced by libMesh::CompositeFunction< Output >::attach_subfunction(), and libMesh::ConstFunction< Output >::ConstFunction().
|
protectedinherited |
Const pointer to our master, initialized to nullptr.
There may be cases where multiple functions are required, but to save memory, one master handles some centralized data.
Definition at line 173 of file function_base.h.
|
private |
Definition at line 187 of file parsed_function.h.
|
private |
Definition at line 185 of file parsed_function.h.
|
private |
Definition at line 198 of file parsed_function.h.
Referenced by libMesh::ParsedFunction< T >::has_derivatives().
|
private |
Definition at line 197 of file parsed_function.h.
|
private |
Definition at line 190 of file parsed_function.h.
|
private |
Definition at line 192 of file parsed_function.h.
|
private |
Definition at line 195 of file parsed_function.h.
|
private |
Definition at line 186 of file parsed_function.h.
|
private |
Definition at line 201 of file parsed_function.h.
1.8.16