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
9c44dfde
Commit
9c44dfde
authored
6 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[io][loadsolution] Remane loadFromVtuFile->loadSolutionFromVtuFile
parent
910a16ef
No related branches found
No related tags found
1 merge request
!1039
Feature/restart from vtk
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/io/loadsolution.hh
+14
-11
14 additions, 11 deletions
dumux/io/loadsolution.hh
with
14 additions
and
11 deletions
dumux/io/loadsolution.hh
+
14
−
11
View file @
9c44dfde
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
namespace
Dumux
{
namespace
Dumux
{
namespace
Detail
{
//! helper struct detecting if a PrimaryVariables object has a state() function
//! helper struct detecting if a PrimaryVariables object has a state() function
struct
hasState
struct
hasState
{
{
...
@@ -46,16 +47,18 @@ struct hasState
...
@@ -46,16 +47,18 @@ struct hasState
{}
{}
};
};
}
// end namespace Detail
/*!
/*!
* \ingroup InputOutput
* \ingroup InputOutput
* \brief helper function to read from a file into a solution vector
* \brief helper function to read from a file into a solution vector
*/
*/
template
<
class
SolutionVector
,
class
PvNamesFunc
>
template
<
class
SolutionVector
,
class
PvNamesFunc
>
auto
loadFromVtuFile
(
const
std
::
string
fileName
,
auto
load
Solution
FromVtuFile
(
const
std
::
string
fileName
,
const
VTUReader
::
DataType
&
dataType
,
const
VTUReader
::
DataType
&
dataType
,
PvNamesFunc
&&
pvNamesFunc
,
PvNamesFunc
&&
pvNamesFunc
,
SolutionVector
&
sol
)
SolutionVector
&
sol
)
->
typename
std
::
enable_if_t
<!
decltype
(
isValid
(
hasState
())(
sol
[
0
]))
::
value
,
void
>
->
typename
std
::
enable_if_t
<!
decltype
(
isValid
(
Detail
::
hasState
())(
sol
[
0
]))
::
value
,
void
>
{
{
VTUReader
vtu
(
fileName
);
VTUReader
vtu
(
fileName
);
using
PrimaryVariables
=
typename
SolutionVector
::
block_type
;
using
PrimaryVariables
=
typename
SolutionVector
::
block_type
;
...
@@ -78,11 +81,11 @@ auto loadFromVtuFile(const std::string fileName,
...
@@ -78,11 +81,11 @@ auto loadFromVtuFile(const std::string fileName,
* \brief helper function to read from a file into a solution vector
* \brief helper function to read from a file into a solution vector
*/
*/
template
<
class
SolutionVector
,
class
PvNamesFunc
>
template
<
class
SolutionVector
,
class
PvNamesFunc
>
auto
loadFromVtuFile
(
const
std
::
string
fileName
,
auto
load
Solution
FromVtuFile
(
const
std
::
string
fileName
,
const
VTUReader
::
DataType
&
dataType
,
const
VTUReader
::
DataType
&
dataType
,
PvNamesFunc
&&
pvNamesFunc
,
PvNamesFunc
&&
pvNamesFunc
,
SolutionVector
&
sol
)
SolutionVector
&
sol
)
->
typename
std
::
enable_if_t
<
decltype
(
isValid
(
hasState
())(
sol
[
0
]))
::
value
,
void
>
->
typename
std
::
enable_if_t
<
decltype
(
isValid
(
Detail
::
hasState
())(
sol
[
0
]))
::
value
,
void
>
{
{
VTUReader
vtu
(
fileName
);
VTUReader
vtu
(
fileName
);
const
auto
vec
=
vtu
.
readData
<
std
::
vector
<
int
>>
(
"phase presence"
,
dataType
);
const
auto
vec
=
vtu
.
readData
<
std
::
vector
<
int
>>
(
"phase presence"
,
dataType
);
...
@@ -160,7 +163,7 @@ void loadSolution(const std::string& fileName,
...
@@ -160,7 +163,7 @@ void loadSolution(const std::string& fileName,
{
{
const
auto
dataType
=
FVGridGeometry
::
discMethod
==
DiscretizationMethod
::
box
const
auto
dataType
=
FVGridGeometry
::
discMethod
==
DiscretizationMethod
::
box
?
VTUReader
::
DataType
::
pointData
:
VTUReader
::
DataType
::
cellData
;
?
VTUReader
::
DataType
::
pointData
:
VTUReader
::
DataType
::
cellData
;
loadFromVtuFile
(
fileName
,
dataType
,
pvNamesFunc
,
sol
);
load
Solution
FromVtuFile
(
fileName
,
dataType
,
pvNamesFunc
,
sol
);
}
}
else
else
DUNE_THROW
(
Dune
::
NotImplemented
,
"loadSolution for extension "
<<
extension
);
DUNE_THROW
(
Dune
::
NotImplemented
,
"loadSolution for extension "
<<
extension
);
...
...
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