Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Özgür Ozan Sen
ogs
Commits
01e8fc4c
Commit
01e8fc4c
authored
2 years ago
by
Tom Fischer
Committed by
Dmitri Naumov
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[PL/TimeLoop|A/AppLib/Simulation] Use bool successful_time_step.
parent
c33b1b48
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Applications/ApplicationsLib/Simulation.cpp
+1
-1
1 addition, 1 deletion
Applications/ApplicationsLib/Simulation.cpp
ProcessLib/TimeLoop.cpp
+6
-7
6 additions, 7 deletions
ProcessLib/TimeLoop.cpp
ProcessLib/TimeLoop.h
+3
-8
3 additions, 8 deletions
ProcessLib/TimeLoop.h
with
10 additions
and
16 deletions
Applications/ApplicationsLib/Simulation.cpp
+
1
−
1
View file @
01e8fc4c
...
...
@@ -138,7 +138,7 @@ bool Simulation::executeSimulation()
}
}
return
time_loop
.
getNonlinearSolverStatus
().
error_norms_met
;
return
time_loop
.
successful_time_step
;
}
std
::
optional
<
ApplicationsLib
::
TestDefinition
>
Simulation
::
getTestDefinition
()
...
...
This diff is collapsed.
Click to expand it.
ProcessLib/TimeLoop.cpp
+
6
−
7
View file @
01e8fc4c
...
...
@@ -541,8 +541,7 @@ bool TimeLoop::executeTimeStep()
updateDeactivatedSubdomains
(
_per_process_data
,
_current_time
);
_nonlinear_solver_status
=
doNonlinearIteration
(
_current_time
,
_dt
,
timesteps
);
successful_time_step
=
doNonlinearIteration
(
_current_time
,
_dt
,
timesteps
);
INFO
(
"[time] Time step #{:d} took {:g} s."
,
timesteps
,
time_timestep
.
elapsed
());
...
...
@@ -595,11 +594,11 @@ bool TimeLoop::loop()
}
}
return
_nonlinear_solver_status
.
error_norms_met
;
return
successful_time_step
;
}
NumLib
::
NonlinearSolverStatus
TimeLoop
::
doNonlinearIteration
(
double
const
t
,
double
const
dt
,
std
::
size_t
const
timesteps
)
bool
TimeLoop
::
doNonlinearIteration
(
double
const
t
,
double
const
dt
,
std
::
size_t
const
timesteps
)
{
preTimestepForAllProcesses
(
t
,
dt
,
_per_process_data
,
_process_solutions
);
...
...
@@ -628,7 +627,7 @@ NumLib::NonlinearSolverStatus TimeLoop::doNonlinearIteration(
_process_solutions
,
_process_solutions_prev
,
_xdot_vector_ids
);
}
return
nonlinear_solver_status
;
return
nonlinear_solver_status
.
error_norms_met
;
}
static
NumLib
::
NonlinearSolverStatus
solveMonolithicProcess
(
...
...
@@ -899,7 +898,7 @@ TimeLoop::~TimeLoop()
_accepted_steps
+
_rejected_steps
,
_accepted_steps
,
_rejected_steps
);
// output last time step
if
(
_nonlinear_solver_status
.
error_norms_met
)
if
(
successful_time_step
)
{
const
bool
output_initial_condition
=
false
;
outputSolutions
(
output_initial_condition
,
...
...
This diff is collapsed.
Click to expand it.
ProcessLib/TimeLoop.h
+
3
−
8
View file @
01e8fc4c
...
...
@@ -49,16 +49,13 @@ public:
~
TimeLoop
();
bool
executeTimeStep
();
NumLib
::
NonlinearSolverStatus
const
&
getNonlinearSolverStatus
()
const
{
return
_nonlinear_solver_status
;
}
double
endTime
()
const
{
return
_end_time
;
}
double
currentTime
()
const
{
return
_current_time
;
}
bool
successful_time_step
=
false
;
private
:
NumLib
::
NonlinearSolverStatus
doNonlinearIteration
(
double
const
t
,
double
const
dt
,
std
::
size_t
const
timesteps
);
bool
doNonlinearIteration
(
double
const
t
,
double
const
dt
,
std
::
size_t
const
timesteps
);
/**
* This function fills the vector of solutions of coupled processes of
* processes, _solutions_of_coupled_processes, and initializes the vector
...
...
@@ -122,8 +119,6 @@ private:
std
::
unique_ptr
<
Output
>
_output
;
std
::
vector
<
std
::
unique_ptr
<
ProcessData
>>
_per_process_data
;
NumLib
::
NonlinearSolverStatus
_nonlinear_solver_status
;
const
double
_start_time
;
const
double
_end_time
;
double
_current_time
=
_start_time
;
...
...
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