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
a3ff28e2
Commit
a3ff28e2
authored
6 years ago
by
Bernd Flemisch
Committed by
Timo Koch
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[io][vtk] read switched primary variable names from input file
parent
9fa5b610
No related branches found
No related tags found
1 merge request
!1039
Feature/restart from vtk
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dumux/io/loadsolution.hh
+16
-4
16 additions, 4 deletions
dumux/io/loadsolution.hh
test/porousmediumflow/2p2c/implicit/test_2p2c_fv.input
+5
-0
5 additions, 0 deletions
test/porousmediumflow/2p2c/implicit/test_2p2c_fv.input
with
21 additions
and
4 deletions
dumux/io/loadsolution.hh
+
16
−
4
View file @
a3ff28e2
...
@@ -126,8 +126,20 @@ auto loadSolutionFromVtuFile(const std::string fileName,
...
@@ -126,8 +126,20 @@ auto loadSolutionFromVtuFile(const std::string fileName,
template
<
class
ModelTraits
,
class
FluidSystem
>
template
<
class
ModelTraits
,
class
FluidSystem
>
std
::
string
primaryVariableName
(
int
pvIdx
,
int
state
)
std
::
string
primaryVariableName
(
int
pvIdx
,
int
state
)
{
{
if
(
haveParam
(
"LoadSolution.PrimaryVariableNames"
))
using
std
::
pow
;
DUNE_THROW
(
Dune
::
NotImplemented
,
"reading PrimaryVariableNames from input file"
);
static
auto
numStates
=
pow
(
2
,
ModelTraits
::
numPhases
())
-
1
;
const
auto
paramNameWithState
=
"LoadSolution.PriVarNamesState"
+
std
::
to_string
(
state
);
if
(
haveParam
(
"LoadSolution.PriVarNames"
))
{
DUNE_THROW
(
Dune
::
NotImplemented
,
"please provide LoadSolution.PriVarNamesState1..."
<<
numStates
<<
" or remove LoadSolution.PriVarNames to use default names"
);
}
else
if
(
haveParam
(
paramNameWithState
))
{
const
auto
pvNames
=
getParam
<
std
::
vector
<
std
::
string
>>
(
paramNameWithState
);
return
pvNames
[
pvIdx
];
}
else
else
return
ModelTraits
::
template
primaryVariableName
<
FluidSystem
>(
pvIdx
,
state
);
return
ModelTraits
::
template
primaryVariableName
<
FluidSystem
>(
pvIdx
,
state
);
}
}
...
@@ -139,9 +151,9 @@ std::string primaryVariableName(int pvIdx, int state)
...
@@ -139,9 +151,9 @@ std::string primaryVariableName(int pvIdx, int state)
template
<
class
ModelTraits
>
template
<
class
ModelTraits
>
std
::
string
primaryVariableName
(
int
pvIdx
)
std
::
string
primaryVariableName
(
int
pvIdx
)
{
{
if
(
haveParam
(
"LoadSolution.Pri
maryVariable
Names"
))
if
(
haveParam
(
"LoadSolution.Pri
Var
Names"
))
{
{
static
auto
pvNames
=
getParam
<
std
::
vector
<
std
::
string
>>
(
"LoadSolution.Pri
maryVariable
Names"
);
static
auto
pvNames
=
getParam
<
std
::
vector
<
std
::
string
>>
(
"LoadSolution.Pri
Var
Names"
);
return
pvNames
[
pvIdx
];
return
pvNames
[
pvIdx
];
}
}
else
else
...
...
This diff is collapsed.
Click to expand it.
test/porousmediumflow/2p2c/implicit/test_2p2c_fv.input
+
5
−
0
View file @
a3ff28e2
...
@@ -19,3 +19,8 @@ PressureLow = 1e5 # [Pa] lower pressure limit for tabularization
...
@@ -19,3 +19,8 @@ PressureLow = 1e5 # [Pa] lower pressure limit for tabularization
PressureHigh = 3e7 # [Pa] upper pressure limit for tabularization
PressureHigh = 3e7 # [Pa] upper pressure limit for tabularization
TemperatureLow = 312.15 # [Pa] lower temperature limit for tabularization
TemperatureLow = 312.15 # [Pa] lower temperature limit for tabularization
TemperatureHigh = 314.15 # [Pa] upper temperature limit for tabularization
TemperatureHigh = 314.15 # [Pa] upper temperature limit for tabularization
[LoadSolution]
PriVarNamesState1 = pw x_w^N2
PriVarNamesState2 = pw x_n^H2O
PriVarNamesState3 = pw Sn
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