Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Michael Migliore
VTK
Commits
076ccd80
Commit
076ccd80
authored
1 year ago
by
Spiros Tsalikis
Browse files
Options
Downloads
Patches
Plain Diff
vtkIOSSWriter: Rename CurrentTimeStep for clarity purposes
parent
5be25a4a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
IO/IOSS/vtkIOSSWriter.cxx
+16
-16
16 additions, 16 deletions
IO/IOSS/vtkIOSSWriter.cxx
with
16 additions
and
16 deletions
IO/IOSS/vtkIOSSWriter.cxx
+
16
−
16
View file @
076ccd80
...
...
@@ -65,7 +65,7 @@ public:
std
::
unique_ptr
<
Ioss
::
Region
>
Region
;
std
::
vector
<
double
>
TimeSteps
;
std
::
vector
<
double
>
TimeStepsToProcess
;
int
CurrentTimeStep
{
0
};
int
CurrentTimeStep
Index
{
0
};
int
RestartIndex
{
0
};
std
::
string
LastMD5
;
...
...
@@ -159,7 +159,7 @@ int vtkIOSSWriter::RequestInformation(vtkInformation* vtkNotUsed(request),
internals
.
TimeSteps
.
clear
();
internals
.
TimeStepsToProcess
.
clear
();
}
internals
.
CurrentTimeStep
=
0
;
internals
.
CurrentTimeStep
Index
=
0
;
return
1
;
}
...
...
@@ -179,11 +179,11 @@ int vtkIOSSWriter::RequestUpdateExtent(vtkInformation* vtkNotUsed(request),
}
auto
&
internals
=
(
*
this
->
Internals
);
if
(
internals
.
CurrentTimeStep
>=
0
&&
internals
.
CurrentTimeStep
<
static_cast
<
int
>
(
internals
.
TimeSteps
.
size
()))
if
(
internals
.
CurrentTimeStep
Index
>=
0
&&
internals
.
CurrentTimeStep
Index
<
static_cast
<
int
>
(
internals
.
TimeSteps
.
size
()))
{
info
->
Set
(
vtkStreamingDemandDrivenPipeline
::
UPDATE_TIME_STEP
(),
internals
.
TimeSteps
[
internals
.
CurrentTimeStep
]);
internals
.
TimeSteps
[
internals
.
CurrentTimeStep
Index
]);
}
else
{
...
...
@@ -205,21 +205,21 @@ int vtkIOSSWriter::RequestData(vtkInformation* request,
auto
&
internals
=
(
*
this
->
Internals
);
if
(
!
internals
.
TimeSteps
.
empty
())
{
const
auto
&
currentTime
=
internals
.
TimeSteps
[
internals
.
CurrentTimeStep
];
const
auto
&
currentTime
=
internals
.
TimeSteps
[
internals
.
CurrentTimeStep
Index
];
// check if timestep should be processed or skipped
const
bool
processTimeStep
=
std
::
find
(
internals
.
TimeStepsToProcess
.
begin
(),
internals
.
TimeStepsToProcess
.
end
(),
currentTime
)
!=
internals
.
TimeStepsToProcess
.
end
();
if
(
!
processTimeStep
)
{
++
internals
.
CurrentTimeStep
;
if
(
static_cast
<
size_t
>
(
internals
.
CurrentTimeStep
)
<
internals
.
TimeSteps
.
size
())
++
internals
.
CurrentTimeStep
Index
;
if
(
static_cast
<
size_t
>
(
internals
.
CurrentTimeStep
Index
)
<
internals
.
TimeSteps
.
size
())
{
request
->
Set
(
vtkStreamingDemandDrivenPipeline
::
CONTINUE_EXECUTING
(),
1
);
}
else
{
internals
.
CurrentTimeStep
=
0
;
internals
.
CurrentTimeStep
Index
=
0
;
request
->
Remove
(
vtkStreamingDemandDrivenPipeline
::
CONTINUE_EXECUTING
());
}
return
1
;
...
...
@@ -228,14 +228,14 @@ int vtkIOSSWriter::RequestData(vtkInformation* request,
this
->
WriteData
();
++
internals
.
CurrentTimeStep
;
if
(
static_cast
<
size_t
>
(
internals
.
CurrentTimeStep
)
<
internals
.
TimeSteps
.
size
())
++
internals
.
CurrentTimeStep
Index
;
if
(
static_cast
<
size_t
>
(
internals
.
CurrentTimeStep
Index
)
<
internals
.
TimeSteps
.
size
())
{
request
->
Set
(
vtkStreamingDemandDrivenPipeline
::
CONTINUE_EXECUTING
(),
1
);
}
else
{
internals
.
CurrentTimeStep
=
0
;
internals
.
CurrentTimeStep
Index
=
0
;
request
->
Remove
(
vtkStreamingDemandDrivenPipeline
::
CONTINUE_EXECUTING
());
}
return
1
;
...
...
@@ -282,10 +282,10 @@ void vtkIOSSWriter::WriteData()
structureChanged
=
globalStructureChanged
;
}
if
(
internals
.
CurrentTimeStep
==
this
->
TimeStepRange
[
0
]
||
structureChanged
)
if
(
internals
.
CurrentTimeStep
Index
==
this
->
TimeStepRange
[
0
]
||
structureChanged
)
{
internals
.
RestartIndex
=
internals
.
CurrentTimeStep
==
this
->
TimeStepRange
[
0
]
?
0
:
(
internals
.
RestartIndex
+
1
);
internals
.
CurrentTimeStep
Index
==
this
->
TimeStepRange
[
0
]
?
0
:
(
internals
.
RestartIndex
+
1
);
Ioss
::
PropertyManager
properties
;
// if I use "8" here, then I get the following error:
...
...
@@ -324,11 +324,11 @@ void vtkIOSSWriter::WriteData()
}
auto
inputInfo
=
inputDO
->
GetInformation
();
const
double
time
=
inputInfo
->
Has
(
vtkDataObject
::
DATA_TIME_STEP
())
const
double
currentTimeStep
=
inputInfo
->
Has
(
vtkDataObject
::
DATA_TIME_STEP
())
?
inputInfo
->
Get
(
vtkDataObject
::
DATA_TIME_STEP
())
:
0.0
;
model
.
Transient
(
*
internals
.
Region
,
/*time=*/
time
);
model
.
Transient
(
*
internals
.
Region
,
/*time=*/
currentTimeStep
);
}
//----------------------------------------------------------------------------
...
...
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