Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LDD-for-two-phase-flow-systems
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
David Seus
LDD-for-two-phase-flow-systems
Commits
87047601
Commit
87047601
authored
4 years ago
by
David
Browse files
Options
Downloads
Patches
Plain Diff
revert parallelisation attempts
parent
f4952ce1
Branches
parallelistation_of_subdomain_loop
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LDDsimulation/LDDsimulation.py
+35
-36
35 additions, 36 deletions
LDDsimulation/LDDsimulation.py
Two-phase-Richards/two-patch/TP-R-two-patch-test-case/TP-R-2-patch-realistic.py
+22
-22
22 additions, 22 deletions
...-patch/TP-R-two-patch-test-case/TP-R-2-patch-realistic.py
with
57 additions
and
58 deletions
LDDsimulation/LDDsimulation.py
+
35
−
36
View file @
87047601
...
@@ -466,39 +466,38 @@ class LDDsimulation(object):
...
@@ -466,39 +466,38 @@ class LDDsimulation(object):
# the future.
# the future.
for
sd_index
,
subdomain
in
self
.
subdomain
.
items
():
for
sd_index
,
subdomain
in
self
.
subdomain
.
items
():
# set subdomain iteration to current iteration
# set subdomain iteration to current iteration
# mp.set_start_method('fork')
# # mp.set_start_method('fork')
processQueue
=
mp
.
Queue
()
# processQueue = mp.Queue()
Lsolver_step
=
mp
.
Process
(
# Lsolver_step = mp.Process(
target
=
self
.
run_Lsolver_step
,
# target=self.run_Lsolver_step,
args
=
(
# args=(
iteration
,
# iteration,
sd_index
,
# sd_index,
processQueue
,
# processQueue,
solution_over_iteration_within_timestep
,
# solution_over_iteration_within_timestep,
debug
,
# debug,
analyse_timestep
,
# analyse_timestep,
analyse_condition
,
# analyse_condition,
)
# )
)
# )
Lsolver_step
.
start
()
# Lsolver_step.start()
max_subsequent_error
[
sd_index
-
1
]
=
processQueue
.
get
()
# max_subsequent_error[sd_index-1] = processQueue.get()
print
(
Lsolver_step
.
exitcode
)
# print(Lsolver_step.exitcode)
Lsolver_step
.
join
()
# Lsolver_step.join()
print
(
Lsolver_step
.
exitcode
)
# print(Lsolver_step.exitcode)
# update interface iteration numbers
# # update interface iteration numbers
# for index in subdomain.has_interface:
# # for index in subdomain.has_interface:
# interface = self.interface[index]
# # interface = self.interface[index]
# interface.current_iteration[sd_index] = iteration
# # interface.current_iteration[sd_index] = iteration
# Lsolver_step.terminate()
# # Lsolver_step.terminate()
# self.run_Lsolver_step(
max_subsequent_error
[
sd_index
-
1
]
=
self
.
run_Lsolver_step
(
# iteration=iteration,
iteration
=
iteration
,
# subdomain_index=sd_index,
subdomain_index
=
sd_index
,
# max_subsequent_error=max_subsequent_error,
sol_over_iter_file
=
solution_over_iteration_within_timestep
,
# sol_over_iter_file=solution_over_iteration_within_timestep,
analyse_timestep
=
analyse_timestep
,
# analyse_timestep=analyse_timestep,
analyse_condition
=
analyse_condition
,
# analyse_condition=analyse_condition,
debug
=
debug
# debug=debug
)
# )
# end loop over subdomains
# end loop over subdomains
# stopping criterion for the solver.
# stopping criterion for the solver.
total_subsequent_error
=
np
.
amax
(
max_subsequent_error
)
total_subsequent_error
=
np
.
amax
(
max_subsequent_error
)
...
@@ -522,7 +521,7 @@ class LDDsimulation(object):
...
@@ -522,7 +521,7 @@ class LDDsimulation(object):
self
,
self
,
iteration
:
int
,
iteration
:
int
,
subdomain_index
:
int
,
subdomain_index
:
int
,
processQueue
,
#
processQueue,
sol_over_iter_file
:
tp
.
Dict
[
int
,
tp
.
Type
[
SolutionFile
]],
sol_over_iter_file
:
tp
.
Dict
[
int
,
tp
.
Type
[
SolutionFile
]],
debug
:
bool
=
False
,
debug
:
bool
=
False
,
analyse_timestep
:
bool
=
False
,
analyse_timestep
:
bool
=
False
,
...
@@ -616,8 +615,8 @@ class LDDsimulation(object):
...
@@ -616,8 +615,8 @@ class LDDsimulation(object):
# calculate the maximum over phase of subsequent errors for the
# calculate the maximum over phase of subsequent errors for the
# stopping criterion.
# stopping criterion.
# max_subsequent_error[sd_index-1] = max(subsequent_iter_error.values())
# max_subsequent_error[sd_index-1] = max(subsequent_iter_error.values())
processQueue
.
put
(
max
(
subsequent_iter_error
.
values
()))
#
processQueue.put(max(subsequent_iter_error.values()))
return
max
(
subsequent_iter_error
.
values
())
def
prepare_LDDsolver
(
def
prepare_LDDsolver
(
self
,
self
,
...
...
This diff is collapsed.
Click to expand it.
Two-phase-Richards/two-patch/TP-R-two-patch-test-case/TP-R-2-patch-realistic.py
+
22
−
22
View file @
87047601
...
@@ -38,7 +38,7 @@ thisfile = "TP-R-2-patch-realistic.py"
...
@@ -38,7 +38,7 @@ thisfile = "TP-R-2-patch-realistic.py"
# GENERAL SOLVER CONFIG ######################################################
# GENERAL SOLVER CONFIG ######################################################
# maximal iteration per timestep
# maximal iteration per timestep
max_iter_num
=
5
0
max_iter_num
=
5
FEM_Lagrange_degree
=
1
FEM_Lagrange_degree
=
1
# GRID AND MESH STUDY SPECIFICATIONS #########################################
# GRID AND MESH STUDY SPECIFICATIONS #########################################
...
@@ -46,8 +46,8 @@ mesh_study = False
...
@@ -46,8 +46,8 @@ mesh_study = False
resolutions
=
{
resolutions
=
{
# 1: 1e-5,
# 1: 1e-5,
# 2: 1e-5,
# 2: 1e-5,
#
4: 1e-5,
4
:
1e-5
,
#
8: 1e-5,
8
:
1e-5
,
16
:
5e-6
,
16
:
5e-6
,
# 32: 5e-6,
# 32: 5e-6,
# 64: 2e-6,
# 64: 2e-6,
...
@@ -69,21 +69,21 @@ Lnw1= 0.025
...
@@ -69,21 +69,21 @@ Lnw1= 0.025
Lw2
=
0.025
#/timestep_size
Lw2
=
0.025
#/timestep_size
Lnw2
=
0.025
Lnw2
=
0.025
lambda_w
=
4
4
lambda_w
=
4
lambda_nw
=
4
lambda_nw
=
4
include_gravity
=
False
include_gravity
=
False
debugflag
=
Tru
e
debugflag
=
Fals
e
analyse_condition
=
False
analyse_condition
=
False
# I/O CONFIG #################################################################
# I/O CONFIG #################################################################
# when number_of_timesteps is high, it might take a long time to write all
# when number_of_timesteps is high, it might take a long time to write all
# timesteps to disk. Therefore, you can choose to only write data of every
# timesteps to disk. Therefore, you can choose to only write data of every
# plot_timestep_every timestep to disk.
# plot_timestep_every timestep to disk.
plot_timestep_every
=
4
plot_timestep_every
=
1
# Decide how many timesteps you want analysed. Analysed means, that
# Decide how many timesteps you want analysed. Analysed means, that
# subsequent errors of the L-iteration within the timestep are written out.
# subsequent errors of the L-iteration within the timestep are written out.
number_of_timesteps_to_analyse
=
5
number_of_timesteps_to_analyse
=
1
# fine grained control over data to be written to disk in the mesh study case
# fine grained control over data to be written to disk in the mesh study case
# as well as for a regular simuation for a fixed grid.
# as well as for a regular simuation for a fixed grid.
...
@@ -528,18 +528,18 @@ if __name__ == '__main__':
...
@@ -528,18 +528,18 @@ if __name__ == '__main__':
for
mesh_resolution
,
solver_tol
in
resolutions
.
items
():
for
mesh_resolution
,
solver_tol
in
resolutions
.
items
():
simulation_parameter
.
update
({
"
solver_tol
"
:
solver_tol
})
simulation_parameter
.
update
({
"
solver_tol
"
:
solver_tol
})
hlp
.
info
(
simulation_parameter
[
"
use_case
"
])
hlp
.
info
(
simulation_parameter
[
"
use_case
"
])
#
LDDsim = mp.Process(
LDDsim
=
mp
.
Process
(
#
target=hlp.run_simulation,
target
=
hlp
.
run_simulation
,
#
args=(
args
=
(
#
simulation_parameter,
simulation_parameter
,
#
starttime,
starttime
,
#
mesh_resolution
mesh_resolution
#
)
)
#
)
)
#
LDDsim.start()
LDDsim
.
start
()
#
LDDsim.join()
LDDsim
.
join
()
hlp
.
run_simulation
(
#
hlp.run_simulation(
mesh_resolution
=
mesh_resolution
,
#
mesh_resolution=mesh_resolution,
starttime
=
starttime
,
#
starttime=starttime,
parameter
=
simulation_parameter
#
parameter=simulation_parameter
)
#
)
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