Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
7a237a0d
Commit
7a237a0d
authored
Jun 25, 2021
by
Martin Schneider
Browse files
[metadata] Define brackets operator for metadata class
parent
8d3a42f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/common/metadata.hh
View file @
7a237a0d
...
...
@@ -95,6 +95,12 @@ public:
return
tree_
;
}
/*!
* \brief returns the object with id of the json tree
*/
auto
&
operator
[]
(
std
::
string
id
)
{
return
getTree
()[
id
];
}
template
<
class
T
>
static
std
::
string
className
(
const
T
&
c
,
bool
hideTemplates
)
{
...
...
@@ -128,7 +134,7 @@ void print(const Collector& collector)
template
<
class
Collector
,
class
TypeTag
,
DiffMethod
diffmethod
,
bool
isImplicit
>
void
collectMetaData
(
Collector
&
collector
,
const
FVAssembler
<
TypeTag
,
diffmethod
,
isImplicit
>&
a
,
bool
hideTemplates
=
true
)
{
auto
&
obj
=
collector
.
getTree
()
[
"Assembler"
];
auto
&
obj
=
collector
[
"Assembler"
];
obj
[
"Type"
]
=
Metadata
::
className
(
a
,
hideTemplates
);
obj
[
"Stationary"
]
=
a
.
isStationaryProblem
();
}
...
...
@@ -137,7 +143,7 @@ template<class Collector, class GridGeometry>
auto
collectMetaData
(
Collector
&
collector
,
const
GridGeometry
&
gg
,
bool
hideTemplates
=
true
)
->
typename
std
::
enable_if_t
<
decltype
(
isValid
(
Detail
::
isGridGeometry
())(
gg
))
::
value
,
void
>
{
auto
&
obj
=
collector
.
getTree
()
[
"GridGeometry"
];
auto
&
obj
=
collector
[
"GridGeometry"
];
obj
[
"Type"
]
=
Metadata
::
className
(
gg
,
hideTemplates
);
obj
[
"GridView"
][
"Type"
]
=
Metadata
::
className
(
gg
.
gridView
(),
hideTemplates
);
obj
[
"IsPeriodic"
]
=
gg
.
isPeriodic
();
...
...
@@ -153,7 +159,7 @@ template<class Collector, class GridVariables>
auto
collectMetaData
(
Collector
&
collector
,
const
GridVariables
&
gv
,
bool
hideTemplates
=
true
)
->
typename
std
::
enable_if_t
<
decltype
(
isValid
(
Detail
::
isGridVariables
())(
gv
))
::
value
,
void
>
{
auto
&
obj
=
collector
.
getTree
()
[
"GridVariables"
];
auto
&
obj
=
collector
[
"GridVariables"
];
obj
[
"Type"
]
=
Metadata
::
className
(
gv
,
hideTemplates
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment