Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Aland, Sebastian
amdis
Commits
5857b717
Commit
5857b717
authored
May 04, 2013
by
Praetorius, Simon
Browse files
FileWriter now support output after regular time intervals
parent
7cb51bdd
Changes
4
Show whitespace changes
Inline
Side-by-side
AMDiS/src/ProblemStat.cc
View file @
5857b717
AMDiS/src/io/FileWriter.cc
View file @
5857b717
...
...
@@ -68,8 +68,15 @@ namespace AMDiS {
{
FUNCNAME
(
"FileWriterTemplated<T>::writeFiles()"
);
if
(
timeModulo
>
0.0
)
{
if
((
adaptInfo
->
getTime
()
<
lastWriteTime
+
timeModulo
)
&&
!
force
)
return
;
}
else
{
if
((
adaptInfo
->
getTimestepNumber
()
%
tsModulo
!=
0
)
&&
!
force
)
return
;
}
lastWriteTime
=
adaptInfo
->
getTime
();
// Containers, which store the data to be written;
std
::
vector
<
DataCollector
<>*>
dataCollectors
(
solutionVecs
.
size
());
...
...
AMDiS/src/io/FileWriter.h
View file @
5857b717
...
...
@@ -123,6 +123,11 @@ namespace AMDiS {
Flag
traverseFlag
=
Mesh
::
CALL_LEAF_EL
,
bool
(
*
writeElem
)(
ElInfo
*
)
=
NULL
);
vector
<
pair
<
double
,
string
>
>&
getParaviewAnimationFrames
()
{
return
paraviewAnimationFrames
;
}
protected:
/// Initialization of the filewriter.
void
initialize
();
...
...
@@ -203,6 +208,10 @@ namespace AMDiS {
/// Timestep modulo: write only every tsModulo-th timestep!
int
tsModulo
;
/// Time modulo: write at first iteration after lastWriteTime + timeModulo
double
timeModulo
;
double
lastWriteTime
;
/// Stores a set of pairs of timepoint and filename to write a ParaView
/// animation file.
vector
<
pair
<
double
,
string
>
>
paraviewAnimationFrames
;
...
...
AMDiS/src/io/FileWriter.hh
View file @
5857b717
...
...
@@ -120,6 +120,8 @@ namespace AMDiS {
indexLength
=
5
;
indexDecimals
=
3
;
tsModulo
=
1
;
timeModulo
=
-
1.0
;
lastWriteTime
=
0.0
;
nTmpSolutions
=
0
;
paraviewAnimationFrames
.
resize
(
0
),
compression
=
NONE
;
...
...
@@ -148,6 +150,7 @@ namespace AMDiS {
Parameters
::
get
(
name
+
"->index length"
,
indexLength
);
Parameters
::
get
(
name
+
"->index decimals"
,
indexDecimals
);
Parameters
::
get
(
name
+
"->write every i-th timestep"
,
tsModulo
);
Parameters
::
get
(
name
+
"->write after timestep"
,
timeModulo
);
Parameters
::
get
(
name
+
"->Povray format"
,
writePovrayFormat
);
Parameters
::
get
(
name
+
"->Povray template"
,
povrayTemplate
);
...
...
@@ -176,8 +179,15 @@ namespace AMDiS {
{
FUNCNAME
(
"FileWriterTemplated<T>::writeFiles()"
);
if
(
timeModulo
>
0.0
)
{
if
((
adaptInfo
->
getTime
()
<
lastWriteTime
+
timeModulo
)
&&
!
force
)
return
;
}
else
{
if
((
adaptInfo
->
getTimestepNumber
()
%
tsModulo
!=
0
)
&&
!
force
)
return
;
}
lastWriteTime
=
adaptInfo
->
getTime
();
// Containers, which store the data to be written;
std
::
vector
<
DataCollector
<
T
>*>
dataCollectors
(
solutionVecs
.
size
());
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment