Dune::Copasi
Loading...
Searching...
No Matches
functor_factory_parser.hh
Go to the documentation of this file.
1#ifndef DUNE_COPASI_MODEL_LOCAL_EQUATIONS_FUNCTOR_FACTORY_PARSER_HH
2#define DUNE_COPASI_MODEL_LOCAL_EQUATIONS_FUNCTOR_FACTORY_PARSER_HH
3
6
7#include <memory>
8
9namespace Dune::Copasi {
10
11template<std::size_t dim>
13{
14public:
18
22
24 std::shared_ptr<const ParserContext> parser_context = nullptr)
25 : FunctorFactory<dim>()
26 , _parser_type{ parser_type }
27 , _parser_context{ std::move(parser_context) }
28 {
29 }
30
33
36
37 ~FunctorFactoryParser() override = default;
38
39 [[nodiscard]] ScalarFunctor make_scalar(std::string_view /*prefix*/,
40 const ParameterTree& /*config*/,
41 const LocalDomain<dim>& /*local_domain*/,
42 int /*codim*/ = 0) const override;
43
44 [[nodiscard]] VectorFunctor make_vector(std::string_view /*prefix*/,
45 const ParameterTree& /*config*/,
46 const LocalDomain<dim>& /*local_domain*/,
47 int /*codim*/ = 0) const override;
48
49 [[nodiscard]] TensorApplyFunctor make_tensor_apply( std::string_view /*prefix*/,
50 const ParameterTree& /*config*/,
51 const LocalDomain<dim>& /*local_domain*/,
52 int /*codim*/ = 0) const override;
53
54 std::shared_ptr<const ParserContext> parser_context() const { return _parser_context; };
55
56private:
57 [[nodiscard]] ScalarFunctor parse_scalar_expression(const ParameterTree& /*config*/,
58 const LocalDomain<dim>& /*local_values*/,
59 int /*codim*/) const;
60
61 ParserType _parser_type;
62 std::shared_ptr<const ParserContext> _parser_context;
63};
64
65} // namespace Dune::Copasi
66
67#ifndef DUNE_COPASI_PRECOMPILED_MODE
69#endif
70
71#endif // DUNE_COPASI_MODEL_LOCAL_EQUATIONS_FUNCTOR_FACTORY_PARSER_HH
Definition functor_factory.hh:24
fu2::unique_function< Vector(Vector) const noexcept > TensorApplyFunctor
Definition functor_factory.hh:32
fu2::unique_function< Vector() const noexcept > VectorFunctor
Definition functor_factory.hh:31
fu2::unique_function< Scalar() const noexcept > ScalarFunctor
Definition functor_factory.hh:30
Definition functor_factory_parser.hh:13
FunctorFactoryParser(FunctorFactoryParser &&)=delete
ScalarFunctor make_scalar(std::string_view, const ParameterTree &, const LocalDomain< dim > &, int=0) const override
Definition functor_factory_parser.impl.hh:26
FunctorFactoryParser(ParserType parser_type=default_parser, std::shared_ptr< const ParserContext > parser_context=nullptr)
Definition functor_factory_parser.hh:23
FunctorFactoryParser(const FunctorFactoryParser &)=delete
FieldVector< double, dim > Vector
Definition functor_factory_parser.hh:16
typename FunctorFactory< dim >::ScalarFunctor ScalarFunctor
Definition functor_factory_parser.hh:19
VectorFunctor make_vector(std::string_view, const ParameterTree &, const LocalDomain< dim > &, int=0) const override
Definition functor_factory_parser.impl.hh:36
FieldMatrix< double, dim, dim > Tensor
Definition functor_factory_parser.hh:17
FieldVector< double, 1 > Scalar
Definition functor_factory_parser.hh:15
FunctorFactoryParser & operator=(const FunctorFactoryParser &)=delete
std::shared_ptr< const ParserContext > parser_context() const
Definition functor_factory_parser.hh:54
TensorApplyFunctor make_tensor_apply(std::string_view, const ParameterTree &, const LocalDomain< dim > &, int=0) const override
Definition functor_factory_parser.impl.hh:65
typename FunctorFactory< dim >::VectorFunctor VectorFunctor
Definition functor_factory_parser.hh:20
~FunctorFactoryParser() override=default
typename FunctorFactory< dim >::TensorApplyFunctor TensorApplyFunctor
Definition functor_factory_parser.hh:21
FunctorFactoryParser & operator=(FunctorFactoryParser &&)=delete
Definition axis_names.hh:7
const ParserType default_parser
constexpr bool is_bitflags_v
Alias for Bitflag indicator.
Definition bit_flags.hh:24
ParserType
Definition factory.hh:12
Definition local_domain.hh:15