|
libMesh
|
A Function generated (via FParser) by parsing a mathematical expression. More...
#include <parsed_function.h>
Public Member Functions | |
| ParsedFunction (std::string expression, const std::vector< std::string > *additional_vars=nullptr, const std::vector< Output > *initial_vals=nullptr) | |
| ParsedFunction (const ParsedFunction &) | |
| Constructors. More... | |
| ParsedFunction & | operator= (const ParsedFunction &) |
| ParsedFunction (ParsedFunction &&)=default | |
| ParsedFunction & | operator= (ParsedFunction &&)=default |
| virtual | ~ParsedFunction ()=default |
| void | reparse (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 (std::string_view variable_name) |
| virtual std::unique_ptr< FunctionBase< Output > > | clone () const override |
| Output | get_inline_value (std::string_view inline_var_name) const |
| void | set_inline_value (std::string_view inline_var_name, Output newval) |
| Changes the value of an inline variable. More... | |
| ParsedFunction (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 (std::string_view) |
| 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 (std::string expression) |
| Re-parse with minor changes to expression. More... | |
| std::size_t | find_name (std::string_view varname, std::string_view expr) const |
| Helper function for parsing out variable names. More... | |
| bool | expression_is_time_dependent (std::string_view 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, std::string_view 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< std::unique_ptr< FunctionParserADBase< Output > > > | parsers |
| std::vector< Output > | _spacetime |
| std::vector< std::unique_ptr< FunctionParserADBase< Output > > > | dx_parsers |
| std::vector< std::unique_ptr< FunctionParserADBase< Output > > > | dy_parsers |
| std::vector< std::unique_ptr< FunctionParserADBase< Output > > > | dz_parsers |
| std::vector< std::unique_ptr< 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.
Definition at line 60 of file parsed_function.h.
|
inlineexplicit |
Definition at line 197 of file parsed_function.h.
|
inline |
Constructors.
Definition at line 216 of file parsed_function.h.
|
default |
|
virtualdefault |
|
inline |
Definition at line 738 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 764 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 375 of file parsed_function.h.
|
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 766 of file parsed_function.h.
|
inlineoverridevirtual |
i at coordinate p and time time. Reimplemented from libMesh::FunctionBase< Output >.
Definition at line 340 of file parsed_function.h.
|
inlinevirtual |
Definition at line 288 of file parsed_function.h.
|
inlineprivate |
Evaluate the ith FunctionParser and check the result.
Definition at line 672 of file parsed_function.h.
|
inline |
Definition at line 107 of file parsed_function.h.
|
inlineprotected |
true if the expression is time-dependent, false otherwise. Definition at line 636 of file parsed_function.h.
|
inlineprotected |
|
inline |
Definition at line 385 of file parsed_function.h.
Referenced by libMesh::ParsedFunctionParameter< T >::get(), ParsedFunctionTest::testInlineGetter(), and ParsedFunctionTest::testInlineSetter().
|
inlinevirtual |
Definition at line 359 of file parsed_function.h.
|
inlinevirtual |
Definition at line 765 of file parsed_function.h.
|
inlinevirtual |
Definition at line 297 of file parsed_function.h.
|
inlinevirtual |
Query if the automatic derivative generation was successful.
Definition at line 91 of file parsed_function.h.
|
inlinevirtual |
The actual initialization process.
Reimplemented from libMesh::FunctionBase< Output >.
Definition at line 763 of file parsed_function.h.
|
inlineinherited |
true when this object is properly initialized and ready for use, false otherwise. Definition at line 210 of file function_base.h.
Referenced by libMesh::MeshFunction::MeshFunction().
|
inlineinherited |
true when the function this object represents is actually time-dependent, false otherwise. Definition at line 224 of file function_base.h.
Referenced by libMesh::CompositeFunction< Output >::attach_subfunction(), CompositeFunctionTest::testTimeDependence(), and ParsedFunctionTest::testTimeDependence().
|
inlineoverridevirtual |
p and time time, which defaults to zero.Pure virtual, so you have to override it.
Implements libMesh::FunctionBase< Output >.
Definition at line 279 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 317 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 245 of file function_base.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 755 of file parsed_function.h.
|
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 759 of file parsed_function.h.
|
inline |
Definition at line 236 of file parsed_function.h.
|
default |
|
delete |
|
delete |
|
inlineprotected |
Re-parse with minor changes to expression.
Definition at line 522 of file parsed_function.h.
|
inline |
Re-parse with new expression.
Definition at line 248 of file parsed_function.h.
|
inline |
Changes the value of an inline variable.
Definition at line 458 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 217 of file function_base.h.
|
inlineprivate |
Set the _spacetime argument vector.
Definition at line 652 of file parsed_function.h.
|
private |
Definition at line 188 of file parsed_function.h.
|
private |
Definition at line 771 of file parsed_function.h.
Referenced by libMesh::ParsedFunction< T >::getVarAddress().
|
private |
Definition at line 170 of file parsed_function.h.
Referenced by libMesh::ParsedFunction< T >::expression().
|
private |
Definition at line 189 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 184 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 189 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 178 of file function_base.h.
|
private |
Definition at line 173 of file parsed_function.h.
|
private |
Definition at line 171 of file parsed_function.h.
|
private |
Definition at line 184 of file parsed_function.h.
Referenced by libMesh::ParsedFunction< T >::has_derivatives().
|
private |
Definition at line 183 of file parsed_function.h.
|
private |
Definition at line 176 of file parsed_function.h.
|
private |
Definition at line 178 of file parsed_function.h.
|
private |
Definition at line 181 of file parsed_function.h.
|
private |
Definition at line 172 of file parsed_function.h.
|
private |
Definition at line 187 of file parsed_function.h.
1.8.14