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
Dmitri Naumov
ogs
Commits
db3e5c62
Commit
db3e5c62
authored
7 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[PL] TimeLoop: Move SingleProcessData in own file.
parent
6bb45d14
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ProcessLib/ProcessData.h
+91
-0
91 additions, 0 deletions
ProcessLib/ProcessData.h
ProcessLib/UncoupledProcessesTimeLoop.cpp
+1
-75
1 addition, 75 deletions
ProcessLib/UncoupledProcessesTimeLoop.cpp
with
92 additions
and
75 deletions
ProcessLib/ProcessData.h
0 → 100644
+
91
−
0
View file @
db3e5c62
/**
* \copyright
* Copyright (c) 2012-2018, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#include
"NumLib/ODESolver/NonlinearSolver.h"
#include
"NumLib/ODESolver/TimeDiscretization.h"
#include
"NumLib/ODESolver/Types.h"
#include
"NumLib/TimeStepping/Algorithms/TimeStepAlgorithm.h"
#include
"ProcessLib/Output/ProcessOutput.h"
#include
"CoupledSolutionsForStaggeredScheme.h"
namespace
ProcessLib
{
class
Process
;
}
namespace
ProcessLib
{
struct
SingleProcessData
{
template
<
NumLib
::
NonlinearSolverTag
NLTag
>
SingleProcessData
(
std
::
unique_ptr
<
NumLib
::
TimeStepAlgorithm
>&&
timestepper_
,
NumLib
::
NonlinearSolver
<
NLTag
>&
nonlinear_solver
,
std
::
unique_ptr
<
NumLib
::
ConvergenceCriterion
>&&
conv_crit_
,
std
::
unique_ptr
<
NumLib
::
TimeDiscretization
>&&
time_disc_
,
Process
&
process_
,
ProcessOutput
&&
process_output_
)
:
timestepper
(
std
::
move
(
timestepper_
)),
nonlinear_solver_tag
(
NLTag
),
nonlinear_solver
(
nonlinear_solver
),
nonlinear_solver_converged
(
true
),
conv_crit
(
std
::
move
(
conv_crit_
)),
time_disc
(
std
::
move
(
time_disc_
)),
process
(
process_
),
process_output
(
std
::
move
(
process_output_
))
{
}
SingleProcessData
(
SingleProcessData
&&
spd
)
:
timestepper
(
std
::
move
(
spd
.
timestepper
)),
nonlinear_solver_tag
(
spd
.
nonlinear_solver_tag
),
nonlinear_solver
(
spd
.
nonlinear_solver
),
nonlinear_solver_converged
(
spd
.
nonlinear_solver_converged
),
conv_crit
(
std
::
move
(
spd
.
conv_crit
)),
time_disc
(
std
::
move
(
spd
.
time_disc
)),
tdisc_ode_sys
(
std
::
move
(
spd
.
tdisc_ode_sys
)),
mat_strg
(
spd
.
mat_strg
),
process
(
spd
.
process
),
process_output
(
std
::
move
(
spd
.
process_output
))
{
spd
.
mat_strg
=
nullptr
;
}
std
::
unique_ptr
<
NumLib
::
TimeStepAlgorithm
>
timestepper
;
//! Flag of skiping time stepping. It is used in the modelling of
//! coupled processes. If the stepping of any process reaches a steady state
//! or the ending time, the flag is set to true.
bool
skip_time_stepping
=
false
;
//! Tag containing the missing type information necessary to cast the
//! other members of this struct to their concrety types.
NumLib
::
NonlinearSolverTag
const
nonlinear_solver_tag
;
NumLib
::
NonlinearSolverBase
&
nonlinear_solver
;
bool
nonlinear_solver_converged
;
std
::
unique_ptr
<
NumLib
::
ConvergenceCriterion
>
conv_crit
;
std
::
unique_ptr
<
NumLib
::
TimeDiscretization
>
time_disc
;
//! type-erased time-discretized ODE system
std
::
unique_ptr
<
NumLib
::
EquationSystem
>
tdisc_ode_sys
;
//! cast of \c tdisc_ode_sys to NumLib::InternalMatrixStorage
NumLib
::
InternalMatrixStorage
*
mat_strg
=
nullptr
;
/// Process ID. It is alway 0 when the monolithic scheme is used or
/// a single process is modelled.
int
process_id
=
0
;
Process
&
process
;
ProcessOutput
process_output
;
};
}
// namespace ProcessLib
This diff is collapsed.
Click to expand it.
ProcessLib/UncoupledProcessesTimeLoop.cpp
+
1
−
75
View file @
db3e5c62
...
...
@@ -21,6 +21,7 @@
#include
"ProcessLib/Output/CreateProcessOutput.h"
#include
"CoupledSolutionsForStaggeredScheme.h"
#include
"ProcessData.h"
//! Sets the EquationSystem for the given nonlinear solver,
//! which is Picard or Newton depending on the NLTag.
...
...
@@ -93,81 +94,6 @@ static void applyKnownSolutions(NumLib::EquationSystem const& eq_sys,
namespace
ProcessLib
{
struct
SingleProcessData
{
template
<
NumLib
::
NonlinearSolverTag
NLTag
>
SingleProcessData
(
std
::
unique_ptr
<
NumLib
::
TimeStepAlgorithm
>&&
timestepper_
,
NumLib
::
NonlinearSolver
<
NLTag
>&
nonlinear_solver
,
std
::
unique_ptr
<
NumLib
::
ConvergenceCriterion
>&&
conv_crit_
,
std
::
unique_ptr
<
NumLib
::
TimeDiscretization
>&&
time_disc_
,
Process
&
process_
,
ProcessOutput
&&
process_output_
);
SingleProcessData
(
SingleProcessData
&&
spd
);
std
::
unique_ptr
<
NumLib
::
TimeStepAlgorithm
>
timestepper
;
//! Flag of skiping time stepping. It is used in the modelling of
//! coupled processes. If the stepping of any process reaches a steady state
//! or the ending time, the flag is set to true.
bool
skip_time_stepping
=
false
;
//! Tag containing the missing type information necessary to cast the
//! other members of this struct to their concrety types.
NumLib
::
NonlinearSolverTag
const
nonlinear_solver_tag
;
NumLib
::
NonlinearSolverBase
&
nonlinear_solver
;
bool
nonlinear_solver_converged
;
std
::
unique_ptr
<
NumLib
::
ConvergenceCriterion
>
conv_crit
;
std
::
unique_ptr
<
NumLib
::
TimeDiscretization
>
time_disc
;
//! type-erased time-discretized ODE system
std
::
unique_ptr
<
NumLib
::
EquationSystem
>
tdisc_ode_sys
;
//! cast of \c tdisc_ode_sys to NumLib::InternalMatrixStorage
NumLib
::
InternalMatrixStorage
*
mat_strg
=
nullptr
;
/// Process ID. It is alway 0 when the monolithic scheme is used or
/// a single process is modelled.
int
process_id
=
0
;
Process
&
process
;
ProcessOutput
process_output
;
};
template
<
NumLib
::
NonlinearSolverTag
NLTag
>
SingleProcessData
::
SingleProcessData
(
std
::
unique_ptr
<
NumLib
::
TimeStepAlgorithm
>&&
timestepper_
,
NumLib
::
NonlinearSolver
<
NLTag
>&
nonlinear_solver
,
std
::
unique_ptr
<
NumLib
::
ConvergenceCriterion
>&&
conv_crit_
,
std
::
unique_ptr
<
NumLib
::
TimeDiscretization
>&&
time_disc_
,
Process
&
process_
,
ProcessOutput
&&
process_output_
)
:
timestepper
(
std
::
move
(
timestepper_
)),
nonlinear_solver_tag
(
NLTag
),
nonlinear_solver
(
nonlinear_solver
),
nonlinear_solver_converged
(
true
),
conv_crit
(
std
::
move
(
conv_crit_
)),
time_disc
(
std
::
move
(
time_disc_
)),
process
(
process_
),
process_output
(
std
::
move
(
process_output_
))
{
}
SingleProcessData
::
SingleProcessData
(
SingleProcessData
&&
spd
)
:
timestepper
(
std
::
move
(
spd
.
timestepper
)),
nonlinear_solver_tag
(
spd
.
nonlinear_solver_tag
),
nonlinear_solver
(
spd
.
nonlinear_solver
),
nonlinear_solver_converged
(
spd
.
nonlinear_solver_converged
),
conv_crit
(
std
::
move
(
spd
.
conv_crit
)),
time_disc
(
std
::
move
(
spd
.
time_disc
)),
tdisc_ode_sys
(
std
::
move
(
spd
.
tdisc_ode_sys
)),
mat_strg
(
spd
.
mat_strg
),
process
(
spd
.
process
),
process_output
(
std
::
move
(
spd
.
process_output
))
{
spd
.
mat_strg
=
nullptr
;
}
template
<
NumLib
::
ODESystemTag
ODETag
>
void
setTimeDiscretizedODESystem
(
SingleProcessData
&
spd
,
...
...
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