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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Seus
LDD-for-two-phase-flow-systems
Commits
bc620023
Commit
bc620023
authored
Jun 26, 2020
by
David
Browse files
Options
Downloads
Patches
Plain Diff
add two domain class
parent
ea32fb3a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
LDDsimulation/domainSubstructuring.py
+93
-0
93 additions, 0 deletions
LDDsimulation/domainSubstructuring.py
Two-phase-Richards/two-patch/TP-R-two-patch-test-case/TP-R-2-patch-realistic.py
+8
-64
8 additions, 64 deletions
...-patch/TP-R-two-patch-test-case/TP-R-2-patch-realistic.py
with
101 additions
and
64 deletions
LDDsimulation/domainSubstructuring.py
+
93
−
0
View file @
bc620023
...
@@ -34,6 +34,99 @@ class domainSubstructuring(object):
...
@@ -34,6 +34,99 @@ class domainSubstructuring(object):
"""
Set self._outer_boundary_def_points.
"""
"""
Set self._outer_boundary_def_points.
"""
raise
(
NotImplementedError
())
raise
(
NotImplementedError
())
class
twoSoilLayers
(
domainSubstructuring
):
"""
layered soil substructuring with inner patch.
"""
def
__init__
(
self
):
"""
Layered soil case with inner patch.
"""
super
().
__init__
()
hlp
.
print_once
(
"
\n
Layered Soil with inner Patch:
\n
"
)
# global domain
self
.
__subdomain0_vertices
=
[
df
.
Point
(
-
1.0
,
-
1.0
),
df
.
Point
(
1.0
,
-
1.0
),
df
.
Point
(
1.0
,
1.0
),
df
.
Point
(
-
1.0
,
1.0
)
]
self
.
__interface_def_points
()
self
.
__adjacent_subdomains
()
self
.
__subdomain_def_points
()
self
.
__outer_boundary_def_points
()
def
__interface_def_points
(
self
):
"""
Set self._interface_def_points.
"""
self
.
__interface12_vertices
=
[
df
.
Point
(
-
1.0
,
0.0
),
df
.
Point
(
1.0
,
0.0
)
]
# interface_vertices introduces a global numbering of interfaces.
self
.
interface_def_points
=
[
self
.
__interface12_vertices
,
]
def
__adjacent_subdomains
(
self
):
"""
Set self._adjacent_subdomains.
"""
self
.
adjacent_subdomains
=
[
[
1
,
2
],
]
def
__subdomain_def_points
(
self
):
"""
Set self._subdomain_def_points.
"""
# subdomain1.
self
.
__subdomain1_vertices
=
[
self
.
__interface12_vertices
[
0
],
self
.
__interface12_vertices
[
1
],
self
.
__sub_domain0_vertices
[
2
],
self
.
__sub_domain0_vertices
[
3
]
]
# subdomain2
self
.
__subdomain2_vertices
=
[
self
.
__sub_domain0_vertices
[
0
],
self
.
__sub_domain0_vertices
[
1
],
self
.
__interface12_vertices
[
1
],
self
.
__interface12_vertices
[
0
]]
self
.
subdomain_def_points
=
[
self
.
__subdomain0_vertices
,
self
.
__subdomain1_vertices
,
self
.
__subdomain2_vertices
,
]
def
__outer_boundary_def_points
(
self
):
"""
Set self._outer_boundary_def_points.
"""
# vertex coordinates of the outer boundaries. If it can not be
# specified as a polygon, use an entry per boundary polygon.
# This information is used for defining the Dirichlet boundary
# conditions. If a domain is completely internal, the
# dictionary entry should be 0: None
self
.
__subdomain1_outer_boundary_verts
=
{
0
:
[
self
.
__interface12_vertices
[
1
],
self
.
__sub_domain0_vertices
[
2
],
self
.
__sub_domain0_vertices
[
3
],
self
.
__interface12_vertices
[
0
]]
}
self
.
__subdomain2_outer_boundary_verts
=
{
0
:
[
self
.
__interface12_vertices
[
0
],
self
.
__sub_domain0_vertices
[
0
],
self
.
__sub_domain0_vertices
[
1
],
self
.
__interface12_vertices
[
1
]]
}
# if a subdomain has no outer boundary write None instead, i.e.
# i: None
# if i is the index of the inner subdomain.
self
.
outer_boundary_def_points
=
{
# subdomain number
1
:
self
.
__subdomain1_outer_boundary_verts
,
2
:
self
.
__subdomain2_outer_boundary_verts
,
}
class
layeredSoilInnerPatch
(
domainSubstructuring
):
class
layeredSoilInnerPatch
(
domainSubstructuring
):
"""
layered soil substructuring with inner patch.
"""
"""
layered soil substructuring with inner patch.
"""
...
...
...
...
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
+
8
−
64
View file @
bc620023
...
@@ -42,12 +42,12 @@ max_iter_num = 5
...
@@ -42,12 +42,12 @@ max_iter_num = 5
FEM_Lagrange_degree
=
1
FEM_Lagrange_degree
=
1
# GRID AND MESH STUDY SPECIFICATIONS #########################################
# GRID AND MESH STUDY SPECIFICATIONS #########################################
mesh_study
=
Tru
e
mesh_study
=
Fals
e
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,
...
@@ -135,67 +135,11 @@ else:
...
@@ -135,67 +135,11 @@ else:
# DOMAIN AND INTERFACE #######################################################
# DOMAIN AND INTERFACE #######################################################
# global simulation domain domain
substructuring
=
dss
.
twoSoilLayers
()
sub_domain0_vertices
=
[
df
.
Point
(
-
1.0
,
-
1.0
),
interface_def_points
=
substructuring
.
interface_def_points
df
.
Point
(
1.0
,
-
1.0
),
adjacent_subdomains
=
substructuring
.
adjacent_subdomains
df
.
Point
(
1.0
,
1.0
),
subdomain_def_points
=
substructuring
.
subdomain_def_points
df
.
Point
(
-
1.0
,
1.0
)]
outer_boundary_def_points
=
substructuring
.
outer_boundary_def_points
# interface between subdomain1 and subdomain2
interface12_vertices
=
[
df
.
Point
(
-
1.0
,
0.0
),
df
.
Point
(
1.0
,
0.0
)
]
# subdomain1.
sub_domain1_vertices
=
[
interface12_vertices
[
0
],
interface12_vertices
[
1
],
sub_domain0_vertices
[
2
],
sub_domain0_vertices
[
3
]]
# vertex coordinates of the outer boundaries. If it can not be specified as a
# polygon, use an entry per boundary polygon. This information is used for defining
# the Dirichlet boundary conditions. If a domain is completely internal, the
# dictionary entry should be 0: None
subdomain1_outer_boundary_verts
=
{
0
:
[
interface12_vertices
[
1
],
#
sub_domain0_vertices
[
2
],
sub_domain0_vertices
[
3
],
#
interface12_vertices
[
0
]]
}
# subdomain2
sub_domain2_vertices
=
[
sub_domain0_vertices
[
0
],
sub_domain0_vertices
[
1
],
interface12_vertices
[
1
],
interface12_vertices
[
0
]
]
subdomain2_outer_boundary_verts
=
{
0
:
[
interface12_vertices
[
0
],
#
sub_domain0_vertices
[
0
],
sub_domain0_vertices
[
1
],
interface12_vertices
[
1
]]
}
# list of subdomains given by the boundary polygon vertices.
# Subdomains are given as a list of dolfin points forming
# a closed polygon, such that mshr.Polygon(subdomain_def_points[i]) can be used
# to create the subdomain. subdomain_def_points[0] contains the
# vertices of the global simulation domain and subdomain_def_points[i] contains the
# vertices of the subdomain i.
subdomain_def_points
=
[
sub_domain0_vertices
,
#
sub_domain1_vertices
,
#
sub_domain2_vertices
]
# in the below list, index 0 corresponds to the 12 interface which has index 1
interface_def_points
=
[
interface12_vertices
]
# if a subdomain has no outer boundary write None instead, i.e.
# i: None
# if i is the index of the inner subdomain.
outer_boundary_def_points
=
{
# subdomain number
1
:
subdomain1_outer_boundary_verts
,
2
:
subdomain2_outer_boundary_verts
}
# adjacent_subdomains[i] contains the indices of the subdomains sharing the
# interface i (i.e. given by interface_def_points[i]).
adjacent_subdomains
=
[[
1
,
2
]]
# MODEL CONFIGURATION #########################################################
# MODEL CONFIGURATION #########################################################
isRichards
=
{
isRichards
=
{
...
...
...
...
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
sign in
to comment