Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
1dfd9ab6
Commit
1dfd9ab6
authored
5 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[params] Revert some useless changes done in
6916b934
parent
f0684675
No related branches found
No related tags found
1 merge request
!1633
Fix/params
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/common/parameters.hh
+9
-22
9 additions, 22 deletions
dumux/common/parameters.hh
with
9 additions
and
22 deletions
dumux/common/parameters.hh
+
9
−
22
View file @
1dfd9ab6
...
@@ -218,7 +218,7 @@ public:
...
@@ -218,7 +218,7 @@ public:
//! prints all used and unused parameters
//! prints all used and unused parameters
static
void
print
()
static
void
print
()
{
{
getTree
_
().
reportAll
();
getTree
().
reportAll
();
}
}
//! Parse command line arguments into a parameter tree
//! Parse command line arguments into a parameter tree
...
@@ -303,25 +303,18 @@ public:
...
@@ -303,25 +303,18 @@ public:
return
parameterFileName
;
return
parameterFileName
;
}
}
DUNE_DEPRECATED_MSG
(
"getTree is deprecated and will be removed after 3.1"
)
static
const
LoggingParameterTree
&
getTree
()
{
return
getTree_
();
}
private
:
/*!
/*!
* \brief Get the parameter tree
* \brief Get the parameter tree
*
*
* The logging parameter tree recording which parameters are used during the simulation
* The logging parameter tree recording which parameters are used during the simulation
* \note Once this has been called the first time, you cannot modify the parameter tree anymore
*/
*/
static
const
LoggingParameterTree
&
getTree
_
()
static
const
LoggingParameterTree
&
getTree
()
{
{
static
LoggingParameterTree
tree
(
paramTree_
(),
defaultParamTree_
());
static
LoggingParameterTree
tree
(
paramTree_
(),
defaultParamTree_
());
return
tree
;
return
tree
;
}
}
private
:
//! the actual internal parameter tree storing all user-specfied runtime parameters
//! the actual internal parameter tree storing all user-specfied runtime parameters
static
Dune
::
ParameterTree
&
paramTree_
()
static
Dune
::
ParameterTree
&
paramTree_
()
{
{
...
@@ -408,12 +401,6 @@ private:
...
@@ -408,12 +401,6 @@ private:
for
(
const
auto
&
subKey
:
source
.
getSubKeys
())
for
(
const
auto
&
subKey
:
source
.
getSubKeys
())
mergeTreeImpl_
(
target
,
source
.
sub
(
subKey
),
overwrite
,
prefix
+
subKey
);
mergeTreeImpl_
(
target
,
source
.
sub
(
subKey
),
overwrite
,
prefix
+
subKey
);
}
}
// be friends with the accesors
template
<
typename
T
,
typename
...
Args
>
friend
T
getParam
(
Args
&&
...
args
);
template
<
typename
T
,
typename
...
Args
>
friend
T
getParamFromGroup
(
Args
&&
...
args
);
friend
bool
hasParam
(
const
std
::
string
&
param
);
friend
bool
hasParamInGroup
(
const
std
::
string
&
paramGroup
,
const
std
::
string
&
param
);
};
};
/*!
/*!
...
@@ -440,7 +427,7 @@ void setParam(Dune::ParameterTree& params,
...
@@ -440,7 +427,7 @@ void setParam(Dune::ParameterTree& params,
*/
*/
template
<
typename
T
,
typename
...
Args
>
template
<
typename
T
,
typename
...
Args
>
T
getParam
(
Args
&&
...
args
)
T
getParam
(
Args
&&
...
args
)
{
return
Parameters
::
getTree
_
().
template
get
<
T
>(
std
::
forward
<
Args
>
(
args
)...
);
}
{
return
Parameters
::
getTree
().
template
get
<
T
>(
std
::
forward
<
Args
>
(
args
)...
);
}
/*!
/*!
* \ingroup Common
* \ingroup Common
...
@@ -450,23 +437,23 @@ T getParam(Args&&... args)
...
@@ -450,23 +437,23 @@ T getParam(Args&&... args)
*/
*/
template
<
typename
T
,
typename
...
Args
>
template
<
typename
T
,
typename
...
Args
>
T
getParamFromGroup
(
Args
&&
...
args
)
T
getParamFromGroup
(
Args
&&
...
args
)
{
return
Parameters
::
getTree
_
().
template
getFromGroup
<
T
>(
std
::
forward
<
Args
>
(
args
)...
);
}
{
return
Parameters
::
getTree
().
template
getFromGroup
<
T
>(
std
::
forward
<
Args
>
(
args
)...
);
}
/*!
/*!
* \ingroup Common
* \ingroup Common
* \brief Check whether a key exists in the parameter tree
* \brief Check whether a key exists in the parameter tree
* \note Once this has been called the first time, you cannot modify the parameter tree anymore
* \note Once this has been called the first time, you cannot modify the parameter tree anymore
*/
*/
bool
hasParam
(
const
std
::
string
&
param
)
inline
bool
hasParam
(
const
std
::
string
&
param
)
{
return
Parameters
::
getTree
_
().
hasKey
(
param
);
}
{
return
Parameters
::
getTree
().
hasKey
(
param
);
}
/*!
/*!
* \ingroup Common
* \ingroup Common
* \brief Check whether a key exists in the parameter tree with a model group prefix
* \brief Check whether a key exists in the parameter tree with a model group prefix
* \note Once this has been called the first time, you cannot modify the parameter tree anymore
* \note Once this has been called the first time, you cannot modify the parameter tree anymore
*/
*/
bool
hasParamInGroup
(
const
std
::
string
&
paramGroup
,
const
std
::
string
&
param
)
inline
bool
hasParamInGroup
(
const
std
::
string
&
paramGroup
,
const
std
::
string
&
param
)
{
return
Parameters
::
getTree
_
().
hasKeyInGroup
(
param
,
paramGroup
);
}
{
return
Parameters
::
getTree
().
hasKeyInGroup
(
param
,
paramGroup
);
}
}
// namespace Dumux
}
// namespace Dumux
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment