Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
dune-vtk
Commits
13ce7b24
Commit
13ce7b24
authored
Sep 01, 2018
by
Praetorius, Simon
Browse files
cleanup pvdwriter interface
parent
6d5cc076
Changes
5
Show whitespace changes
Inline
Side-by-side
dune/vtk/pvdwriter.hh
View file @
13ce7b24
...
...
@@ -29,7 +29,7 @@ namespace Dune
}
/// Write the attached data to the file
void
write
(
double
time
,
std
::
string
const
&
fn
)
const
;
void
write
Timestep
(
double
time
,
std
::
string
const
&
fn
)
const
;
/// Attach point data to the writer, \see VtkFunction for possible arguments
template
<
class
Function
,
class
...
Args
>
...
...
dune/vtk/pvdwriter.impl.hh
View file @
13ce7b24
...
...
@@ -9,7 +9,7 @@ namespace Dune {
template
<
class
W
>
void
PvdWriter
<
W
>
::
write
(
double
time
,
std
::
string
const
&
fn
)
const
::
write
Timestep
(
double
time
,
std
::
string
const
&
fn
)
const
{
auto
p
=
filesystem
::
path
(
fn
);
auto
name
=
p
.
stem
();
...
...
dune/vtk/vtktimeserieswriter.hh
View file @
13ce7b24
...
...
@@ -53,7 +53,7 @@ namespace Dune
}
/// Write the attached data to the file with \ref Vtk::FormatTypes and \ref Vtk::DataTypes
void
writeTimestep
(
double
time
,
std
::
string
const
&
fn
);
void
writeTimestep
(
double
time
,
std
::
string
const
&
fn
)
const
;
/// Writes all timesteps to single timeseries file.
// NOTE: requires an aforging call to \ref writeTimestep
...
...
@@ -79,10 +79,10 @@ namespace Dune
VtkWriter
vtkWriter_
;
filesystem
::
path
tmpDir_
;
bool
initialized_
=
false
;
mutable
bool
initialized_
=
false
;
// block size of attached data
std
::
vector
<
std
::
uint64_t
>
blocks_
;
mutable
std
::
vector
<
std
::
uint64_t
>
blocks_
;
mutable
std
::
string
filenameMesh_
;
mutable
std
::
vector
<
std
::
pair
<
double
,
std
::
string
>>
timesteps_
;
...
...
dune/vtk/vtktimeserieswriter.impl.hh
View file @
13ce7b24
...
...
@@ -118,6 +118,7 @@ void VtkTimeseriesWriter<W>
assert
(
ec
==
0
);
}
timesteps_
.
clear
();
initialized_
=
false
;
}
}
// end namespace Dune
src/pvdwriter.cc
View file @
13ce7b24
...
...
@@ -44,7 +44,7 @@ void write (std::string prefix, GridView const& gridView)
pvdWriter
.
addPointData
(
p1Analytic
,
"p1"
);
pvdWriter
.
addCellData
(
p1Analytic
,
"p0"
);
for
(
double
t
=
0.0
;
t
<
10.0
;
t
+=
1.0
)
{
pvdWriter
.
write
(
t
,
prefix
+
"_"
+
std
::
to_string
(
GridView
::
dimensionworld
)
+
"d_ascii.vtu"
);
pvdWriter
.
write
Timestep
(
t
,
prefix
+
"_"
+
std
::
to_string
(
GridView
::
dimensionworld
)
+
"d_ascii.vtu"
);
}
}
...
...
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