18 #ifndef LIBMESH_COMPOSITE_FUNCTION_H 19 #define LIBMESH_COMPOSITE_FUNCTION_H 47 template <
typename Output=Number>
82 const std::vector<unsigned int> & index_map)
84 const unsigned int subfunction_index =
91 unsigned int max_index =
92 *std::max_element(index_map.begin(), index_map.end());
99 for (std::size_t j=0; j != index_map.size(); ++j)
107 std::make_pair(subfunction_index, j);
126 const Real time = 0)
override 135 libmesh_assert_greater_equal (output.
size(),
147 for (
unsigned int j=0; j != temp.
size(); ++j)
168 virtual std::unique_ptr<FunctionBase<Output>>
clone()
const override 173 return std::unique_ptr<FunctionBase<Output>> (returnval);
200 #endif // LIBMESH_COMPOSITE_FUNCTION_H std::vector< std::unique_ptr< FunctionBase< Output > > > subfunctions
virtual unsigned int size() const override
void attach_subfunction(const FunctionBase< Output > &f, const std::vector< unsigned int > &index_map)
CompositeFunction & operator=(CompositeFunction &&)=default
const unsigned int invalid_uint
unsigned int n_components() const
void resize(const unsigned int n)
virtual std::unique_ptr< FunctionBase< Output > > clone() const override
virtual Output operator()(const Point &p, const Real time=0) override
A function that returns a vector whose components are defined by multiple functions.
bool is_time_dependent() const
CompositeFunction()=default
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ~CompositeFunction()=default
std::vector< std::pair< unsigned int, unsigned int > > reverse_index_map
std::vector< std::vector< unsigned int > > index_maps
virtual std::unique_ptr< FunctionBase< Output > > clone() const =0
virtual Output component(unsigned int i, const Point &p, Real time) override
Base class for functors that can be evaluated at a point and (optionally) time.
unsigned int n_subfunctions() const
A geometric point in (x,y,z) space.
virtual void zero() override