Commit 7c1310dc authored by Santiago Ospina De Los Ríos's avatar Santiago Ospina De Los Ríos 🇨🇴

[Richards] Add copy constructor to parameterization

parent 0139cf86
......@@ -78,7 +78,7 @@ private:
/// Need this gruesome typedef because 'map::value_type' has const key
using Cache = std::tuple<std::shared_ptr<Parameterization>, Scaling>;
using ConstCache = std::tuple<const std::shared_ptr<const Parameterization>, const Scaling>;
using ConstCache = std::tuple<std::shared_ptr<const Parameterization>, Scaling>;
/// Configuration file tree
const Dune::ParameterTree& _config;
/// Grid view of the coarsest grid configuration (level 0)
......@@ -108,7 +108,30 @@ private:
/// Create this object and load the data.
/// Copy constructor for flow parameters.
/** Create a level grid view of level 0, create a mapper on it, and store
* the config tree.
FlowParameters (
const FlowParameters& flow_param
// copy parameterization map
for(const auto& [index, tuple] : flow_param._param) {
const auto& [p, sk] = tuple;
// make a hard copy of parameterization
std::shared_ptr<RichardsParameterization<Traits>> _p = p->clone();
/// Copy constructor
/** Create a level grid view of level 0, create a mapper on it, and store
* the config tree.
* \param config Configuration file tree
......@@ -134,8 +157,8 @@ public:
/// Return normalized gravity vector
const Vector& gravity() const { return _gravity; }
/// Return the current cache
const ConstCache& cache() const
/// Return a copy of the current cache with constant parameterization
ConstCache cache() const
return _cache;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment