|
libMesh
|
A function that returns a vector whose components are defined by multiple functions. More...
#include <composite_function.h>
Public Member Functions | |
| CompositeFunction ()=default | |
| CompositeFunction (CompositeFunction &&)=default | |
| This class can be default move constructed and assigned. More... | |
| CompositeFunction & | operator= (CompositeFunction &&)=default |
| CompositeFunction (const CompositeFunction &)=delete | |
| This class contains unique_ptr members so it can't be default copied or assigned. More... | |
| CompositeFunction & | operator= (const CompositeFunction &)=delete |
| virtual | ~CompositeFunction ()=default |
| The subfunctions vector is automatically cleaned up. More... | |
| void | attach_subfunction (const FunctionBase< Output > &f, const std::vector< unsigned int > &index_map) |
| Attach a new subfunction, along with a map from the indices of the attached subfunction to the indices of the composed function. More... | |
| virtual Output | operator() (const Point &p, const Real time=0) override |
| 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 |
| virtual std::unique_ptr< FunctionBase< Output > > | clone () const override |
| unsigned int | n_subfunctions () const |
| unsigned int | n_components () const |
| virtual void | init () |
| The actual initialization process. More... | |
| virtual void | clear () |
| Clears the function. More... | |
| 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 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 Attributes | |
| std::vector< std::unique_ptr< FunctionBase< Output > > > | subfunctions |
| std::vector< std::vector< unsigned int > > | index_maps |
| std::vector< std::pair< unsigned int, unsigned int > > | reverse_index_map |
A function that returns a vector whose components are defined by multiple functions.
A function which is defined by composing the result of different functions into a single vector. All overridden virtual functions are documented in function_base.h.
Function which is a function of another function.
Definition at line 49 of file composite_function.h.
|
explicitdefault |
Referenced by libMesh::CompositeFunction< Output >::clone().
|
default |
This class can be default move constructed and assigned.
|
delete |
This class contains unique_ptr members so it can't be default copied or assigned.
|
virtualdefault |
The subfunctions vector is automatically cleaned up.
|
inline |
Attach a new subfunction, along with a map from the indices of the attached subfunction to the indices of the composed function.
The composed function will return a vector whose value at index index_map[i] is the value of the attached function at index i, i.e., (*this)(x, t)(index_map[i]) will return f(x, t)(i).
Definition at line 82 of file composite_function.h.
References libMesh::FunctionBase< Output >::_is_time_dependent, libMesh::FunctionBase< Output >::clone(), libMesh::CompositeFunction< Output >::index_maps, libMesh::index_range(), libMesh::invalid_uint, libMesh::FunctionBase< Output >::is_time_dependent(), libMesh::CompositeFunction< Output >::reverse_index_map, and libMesh::CompositeFunction< Output >::subfunctions.
Referenced by libMesh::CompositeFunction< Output >::clone(), CompositeFunctionTest::testRemap(), and CompositeFunctionTest::testTimeDependence().
|
inlinevirtualinherited |
Clears the function.
Reimplemented in libMesh::MeshFunction, libMesh::AnalyticFunction< Output >, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< T >, libMesh::MeshlessInterpolationFunction, libMesh::MeshlessInterpolationFunction, and ExampleOneFunction.
Definition at line 91 of file function_base.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 169 of file composite_function.h.
References libMesh::CompositeFunction< Output >::attach_subfunction(), libMesh::CompositeFunction< Output >::CompositeFunction(), libMesh::CompositeFunction< Output >::index_maps, libMesh::index_range(), and libMesh::CompositeFunction< Output >::subfunctions.
|
inlineoverridevirtual |
i at coordinate p and time time.Reimplemented from libMesh::FunctionBase< Output >.
Definition at line 153 of file composite_function.h.
References libMesh::invalid_uint, libMesh::CompositeFunction< Output >::reverse_index_map, and libMesh::CompositeFunction< Output >::subfunctions.
Referenced by libMesh::CompositeFunction< Output >::operator()().
|
inlinevirtualinherited |
The actual initialization process.
Reimplemented in libMesh::MeshFunction, libMesh::AnalyticFunction< Output >, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< T >, libMesh::MeshlessInterpolationFunction, libMesh::MeshlessInterpolationFunction, and ExampleOneFunction.
Definition at line 86 of file function_base.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(), CompositeFunctionTest::testTimeDependence(), and ParsedFunctionTest::testTimeDependence().
|
inline |
Definition at line 182 of file composite_function.h.
References libMesh::CompositeFunction< Output >::reverse_index_map.
|
inline |
Definition at line 177 of file composite_function.h.
References libMesh::CompositeFunction< Output >::subfunctions.
|
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 132 of file composite_function.h.
References libMesh::CompositeFunction< Output >::index_maps, libMesh::index_range(), libMesh::DenseVector< T >::resize(), libMesh::CompositeFunction< Output >::reverse_index_map, libMesh::DenseVector< T >::size(), libMesh::CompositeFunction< Output >::subfunctions, and libMesh::DenseVector< T >::zero().
|
inlineoverridevirtual |
p and time time, which defaults to zero.Pure virtual, so you have to override it.
Implements libMesh::FunctionBase< Output >.
Definition at line 126 of file composite_function.h.
References libMesh::CompositeFunction< Output >::component().
|
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.
|
default |
|
delete |
|
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.
|
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 192 of file composite_function.h.
Referenced by libMesh::CompositeFunction< Output >::attach_subfunction(), libMesh::CompositeFunction< Output >::clone(), and libMesh::CompositeFunction< Output >::operator()().
|
private |
|
private |
Definition at line 189 of file composite_function.h.
Referenced by libMesh::CompositeFunction< Output >::attach_subfunction(), libMesh::CompositeFunction< Output >::clone(), libMesh::CompositeFunction< Output >::component(), libMesh::CompositeFunction< Output >::n_subfunctions(), and libMesh::CompositeFunction< Output >::operator()().
1.8.16