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
488e7054
Commit
488e7054
authored
Mar 20, 2019
by
David Seus
Browse files
Options
Downloads
Patches
Plain Diff
add domainPatch._calc_dof_indices_of_interfaces(self)
parent
54a7c58b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
domainPatch.py
+37
-0
37 additions, 0 deletions
domainPatch.py
with
37 additions
and
0 deletions
domainPatch.py
+
37
−
0
View file @
488e7054
...
@@ -137,6 +137,9 @@ class DomainPatch(df.SubDomain):
...
@@ -137,6 +137,9 @@ class DomainPatch(df.SubDomain):
# timestep size, tau in the paper
# timestep size, tau in the paper
self
.
timestep
=
timestep
self
.
timestep
=
timestep
### Class variables set by methods
### Class variables set by methods
# dictionary holding the dof indices corresponding to an interface of
# given interface. see self._calc_dof_indices_of_interfaces()
self
.
dof_indices_of_interface
=
dict
()
# measures are set by self._init_measures()
# measures are set by self._init_measures()
self
.
iteration_number
=
0
self
.
iteration_number
=
0
self
.
dx
=
None
self
.
dx
=
None
...
@@ -154,10 +157,24 @@ class DomainPatch(df.SubDomain):
...
@@ -154,10 +157,24 @@ class DomainPatch(df.SubDomain):
self
.
_init_dof_and_vertex_maps
()
self
.
_init_dof_and_vertex_maps
()
self
.
_init_boundary_markers
()
self
.
_init_boundary_markers
()
self
.
_init_measures
()
self
.
_init_measures
()
self
.
_calc_dof_indices_of_interfaces
()
# END constructor
# END constructor
#### PUBLIC METHODS
#### PUBLIC METHODS
def
write_pressure_to_interfaces
(
self
):
"""
save the interface values of self.pressure to all neighbouring interfaces
"""
if
self
.
isRichards
:
for
ind
in
has_interface
:
interface
[
ind
].
write_dofs
(
from_function
=
self
.
pressure
,
#
interface_dofs
=
dofs_on_interface1
,
#
dof_to_vert_map
=
self
.
dof2vertex
[
'
wetting
'
],
#
local_to_parent_vertex_map
=
self
.
parent_mesh_index
,
#
phase
=
'
wetting
'
,
#
subdomain_ind
=
self
.
subdomain_index
)
else
:
def
govering_problem
(
self
,
phase
:
str
,
iter_num
:
int
=
0
)
->
tp
.
Dict
[
str
,
fl
.
Form
]:
def
govering_problem
(
self
,
phase
:
str
,
iter_num
:
int
=
0
)
->
tp
.
Dict
[
str
,
fl
.
Form
]:
"""
return the governing form ant right hand side as a dictionary
"""
"""
return the governing form ant right hand side as a dictionary
"""
# define measures
# define measures
...
@@ -238,6 +255,7 @@ class DomainPatch(df.SubDomain):
...
@@ -238,6 +255,7 @@ class DomainPatch(df.SubDomain):
self.vertex2dof
self.vertex2dof
"""
"""
mesh_data
=
self
.
mesh
.
data
()
mesh_data
=
self
.
mesh
.
data
()
# local to parent vertex index map
self
.
parent_mesh_index
=
mesh_data
.
array
(
'
parent_vertex_indices
'
,
0
)
self
.
parent_mesh_index
=
mesh_data
.
array
(
'
parent_vertex_indices
'
,
0
)
if
self
.
isRichards
:
if
self
.
isRichards
:
self
.
dof2vertex
=
{
#
self
.
dof2vertex
=
{
#
...
@@ -281,6 +299,25 @@ class DomainPatch(df.SubDomain):
...
@@ -281,6 +299,25 @@ class DomainPatch(df.SubDomain):
# measure over the interfaces
# measure over the interfaces
self
.
ds
=
df
.
Measure
(
'
ds
'
,
domain
=
self
.
mesh
,
subdomain_data
=
self
.
boundary_marker
)
self
.
ds
=
df
.
Measure
(
'
ds
'
,
domain
=
self
.
mesh
,
subdomain_data
=
self
.
boundary_marker
)
def
_calc_dof_indices_of_interfaces
(
self
):
"""
calculate dof indices
"""
V
=
self
.
function_space
marker
=
self
.
boundary_marker
for
ind
in
has_interface
:
self
.
_dof_indices_of_interface
.
update
(
#
{
ind
:
dict
()}
)
if
self
.
isRichards
:
self
.
_dof_indices_of_interface
[
ind
].
update
(
#
{
'
wetting
'
:
self
.
interface
[
ind
].
dofs_on_interface
(
V
[
'
wetting
'
],
marker
,
ind
)}
)
else
:
self
.
_dof_indices_of_interface
[
ind
].
update
(
#
{
'
wetting
'
:
self
.
interface
[
ind
].
dofs_on_interface
(
V
[
'
wetting
'
],
marker
,
ind
),
#
'
nonwetting
'
:
self
.
interface
[
ind
].
dofs_on_interface
(
V
[
'
nonwetting
'
],
marker
,
ind
)}
)
# END is_Richards
# END is_Richards
# END OF CLASS DomainPatch
# END OF CLASS DomainPatch
...
...
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