Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
code
pugs
Commits
ada900c4
Commit
ada900c4
authored
4 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Improve output period management
parent
af4ba50f
No related branches found
No related tags found
1 merge request
!79
Utils/gitlab
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/output/GnuplotWriter.cpp
+2
-2
2 additions, 2 deletions
src/output/GnuplotWriter.cpp
src/output/WriterBase.cpp
+3
-2
3 additions, 2 deletions
src/output/WriterBase.cpp
src/output/WriterBase.hpp
+1
-0
1 addition, 0 deletions
src/output/WriterBase.hpp
with
6 additions
and
4 deletions
src/output/GnuplotWriter.cpp
+
2
−
2
View file @
ada900c4
...
...
@@ -102,8 +102,8 @@ GnuplotWriter::_writeCellValue(const CellValue<DataType>& cell_value, CellId cel
template
<
typename
DataType
,
ItemType
item_type
>
void
GnuplotWriter
::
_writeValue
(
const
ItemValue
<
DataType
,
item_type
>&
item_value
,
CellId
cell_id
,
NodeId
node_id
,
[[
maybe_unused
]]
CellId
cell_id
,
[[
maybe_unused
]]
NodeId
node_id
,
std
::
ostream
&
fout
)
const
{
if
constexpr
(
item_type
==
ItemType
::
cell
)
{
...
...
This diff is collapsed.
Click to expand it.
src/output/WriterBase.cpp
+
3
−
2
View file @
ada900c4
...
...
@@ -172,7 +172,7 @@ WriterBase::getLastTime() const
}
WriterBase
::
WriterBase
(
const
std
::
string
&
base_filename
,
const
double
&
time_period
)
:
m_base_filename
{
base_filename
},
m_time_period
{
time_period
}
:
m_base_filename
{
base_filename
},
m_time_period
{
time_period
}
,
m_next_time
{
0
}
{}
void
...
...
@@ -183,7 +183,8 @@ WriterBase::writeIfNeeded(const std::vector<std::shared_ptr<const NamedDiscreteF
if
(
time
==
last_time
)
return
;
// output already performed
if
(
time
>=
last_time
+
m_time_period
)
{
if
(
time
>=
m_next_time
)
{
m_next_time
+=
m_time_period
;
this
->
write
(
named_discrete_function_list
,
time
);
m_saved_times
.
push_back
(
time
);
}
...
...
This diff is collapsed.
Click to expand it.
src/output/WriterBase.hpp
+
1
−
0
View file @
ada900c4
...
...
@@ -13,6 +13,7 @@ class WriterBase : public IWriter
protected:
const
std
::
string
m_base_filename
;
const
double
m_time_period
;
mutable
double
m_next_time
;
mutable
std
::
vector
<
double
>
m_saved_times
;
...
...
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