version 3.11-dev
Loading...
Searching...
No Matches
problemwithspatialparams.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_COMMON_PROBLEM_WITH_SPATIAL_PARAMS_HH
13#define DUMUX_COMMON_PROBLEM_WITH_SPATIAL_PARAMS_HH
14
15#include <memory>
16
19
20namespace Dumux::Experimental {
21
26template<class TypeTag, class BaseProblem = Problem<TypeTag>>
28: public BaseProblem
29{
30 using ParentType = BaseProblem;
31 using GridDiscretization = GetPropType<TypeTag, Properties::GridGeometry>;
32
33public:
35
42 ProblemWithSpatialParams(std::shared_ptr<const GridDiscretization> gridDiscretization,
43 const std::string& paramGroup = "")
44 : ParentType(gridDiscretization, paramGroup)
45 , spatialParams_(std::make_shared<SpatialParams>(gridDiscretization))
46 {}
47
54 ProblemWithSpatialParams(std::shared_ptr<const GridDiscretization> gridDiscretization,
55 std::shared_ptr<SpatialParams> spatialParams,
56 const std::string& paramGroup = "")
57 : ParentType(gridDiscretization, paramGroup)
58 , spatialParams_(spatialParams)
59 {}
60
63 { return *spatialParams_; }
64
67 { return *spatialParams_; }
68
69private:
71 std::shared_ptr<SpatialParams> spatialParams_;
72};
73
74} // end namespace Dumux::Experimental
75
76#endif
const std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition common/problem.hh:304
const GridDiscretization & gridDiscretization() const
The grid discretization.
Definition common/problem.hh:300
ProblemWithSpatialParams(std::shared_ptr< const GridDiscretization > gridDiscretization, const std::string &paramGroup="")
Constructor.
Definition problemwithspatialparams.hh:42
GetPropType< TypeTag, Properties::SpatialParams > SpatialParams
Definition problemwithspatialparams.hh:34
ProblemWithSpatialParams(std::shared_ptr< const GridDiscretization > gridDiscretization, std::shared_ptr< SpatialParams > spatialParams, const std::string &paramGroup="")
Constructor.
Definition problemwithspatialparams.hh:54
const SpatialParams & spatialParams() const
Return a reference to the underlying spatial parameters.
Definition problemwithspatialparams.hh:62
SpatialParams & spatialParams()
Return a reference to the underlying spatial parameters.
Definition problemwithspatialparams.hh:66
Base class for all standard finite volume or finite element problems.
Defines all properties used in Dumux.
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:296
Definition assembly/assembler.hh:44