Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Feliks Kiszkurno
ogs-feliks
Commits
1e5ecb7d
Commit
1e5ecb7d
authored
1 year ago
by
Christoph Lehmann
Committed by
Dmitri Naumov
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[PL] Bugfix: the last time step is an output step, too
parent
39f0f7fd
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
ProcessLib/TimeLoop.cpp
+10
-4
10 additions, 4 deletions
ProcessLib/TimeLoop.cpp
with
10 additions
and
4 deletions
ProcessLib/TimeLoop.cpp
+
10
−
4
View file @
1e5ecb7d
...
@@ -42,21 +42,27 @@ void updateDeactivatedSubdomains(
...
@@ -42,21 +42,27 @@ void updateDeactivatedSubdomains(
}
}
bool
isOutputStep
(
std
::
vector
<
ProcessLib
::
Output
>
const
&
outputs
,
bool
isOutputStep
(
std
::
vector
<
ProcessLib
::
Output
>
const
&
outputs
,
const
int
timestep
,
const
double
t
)
const
int
timestep
,
const
double
t
,
const
double
end_time
)
{
{
if
(
std
::
abs
(
end_time
-
t
)
<
std
::
numeric_limits
<
double
>::
epsilon
())
{
// the last timestep is an output step
return
true
;
}
return
ranges
::
any_of
(
outputs
,
[
timestep
,
t
](
auto
const
&
output
)
return
ranges
::
any_of
(
outputs
,
[
timestep
,
t
](
auto
const
&
output
)
{
return
output
.
isOutputStep
(
timestep
,
t
);
});
{
return
output
.
isOutputStep
(
timestep
,
t
);
});
}
}
void
preOutputForAllProcesses
(
void
preOutputForAllProcesses
(
int
const
timestep
,
double
const
t
,
double
const
dt
,
int
const
timestep
,
double
const
t
,
double
const
dt
,
const
double
end_time
,
std
::
vector
<
std
::
unique_ptr
<
ProcessLib
::
ProcessData
>>
const
&
std
::
vector
<
std
::
unique_ptr
<
ProcessLib
::
ProcessData
>>
const
&
per_process_data
,
per_process_data
,
std
::
vector
<
GlobalVector
*>
const
&
process_solutions
,
std
::
vector
<
GlobalVector
*>
const
&
process_solutions
,
std
::
vector
<
GlobalVector
*>
const
&
process_solutions_prev
,
std
::
vector
<
GlobalVector
*>
const
&
process_solutions_prev
,
std
::
vector
<
ProcessLib
::
Output
>
const
&
outputs
)
std
::
vector
<
ProcessLib
::
Output
>
const
&
outputs
)
{
{
if
(
!
isOutputStep
(
outputs
,
timestep
,
t
))
if
(
!
isOutputStep
(
outputs
,
timestep
,
t
,
end_time
))
{
{
return
;
return
;
}
}
...
@@ -640,7 +646,7 @@ bool TimeLoop::preTsNonlinearSolvePostTs(double const t, double const dt,
...
@@ -640,7 +646,7 @@ bool TimeLoop::preTsNonlinearSolvePostTs(double const t, double const dt,
// Later on, the timestep_algorithm might reject the timestep. We assume
// Later on, the timestep_algorithm might reject the timestep. We assume
// that this is a rare case, so still, we call preOutput() here. We
// that this is a rare case, so still, we call preOutput() here. We
// don't expect a large overhead from it.
// don't expect a large overhead from it.
preOutputForAllProcesses
(
timesteps
,
t
,
dt
,
_per_process_data
,
preOutputForAllProcesses
(
timesteps
,
t
,
dt
,
_end_time
,
_per_process_data
,
_process_solutions
,
_process_solutions_prev
,
_process_solutions
,
_process_solutions_prev
,
_outputs
);
_outputs
);
...
...
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