1#ifndef DUNE_COPASI_MODEL_INTERPOLATE_HH
2#define DUNE_COPASI_MODEL_INTERPOLATE_HH
6#include <dune/pdelab/common/local_container.hh>
7#include <dune/pdelab/concepts/basis.hh>
9#include <dune/typetree/treecontainer.hh>
11#include <spdlog/spdlog.h>
15#include <unordered_map>
19template<PDELab::Concept::Basis Basis,
class Gr
idFunction>
20 requires Concept::LocalBasisTree<typename Basis::LocalView::Tree>
22interpolate(
const Basis& basis,
24 const std::unordered_map<std::string, GridFunction>&
initial)
26 spdlog::info(
"Set initial state from grid functions");
28 if (basis.entitySet().size(0) == 0) {
32 auto lspace = basis.localView();
34 PDELab::LocalContainerBuffer
lcontainer{ basis, coefficients };
35 std::vector<double>
buff;
40 auto lfuncs = TypeTree::makeTreeContainer(
42 const auto& compartment_basis = basis.subSpace(pop_back(lbasis_node.orderingViewPath()));
43 const auto& component_basis = basis.subSpace(lbasis_node.orderingViewPath());
45 initial.find(fmt::format(
"{}.{}", compartment_basis.name(), component_basis.name()));
46 if (it != end(initial)) {
47 return localFunction(it->second);
61 auto& lfunc = lfuncs[path];
62 if (lbasis_node.size() == 0 or not lfunc) {
67 buff.assign(
fe.size(), 0.);
Definition axis_names.hh:7
constexpr bool is_bitflags_v
Alias for Bitflag indicator.
Definition bit_flags.hh:24