Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Lambert Theisen
fenicsR13
Commits
47f9699a
Commit
47f9699a
authored
Aug 11, 2019
by
Lambert Theisen
Browse files
Ad rescale_pressure keyword
- Should be disabled when using inflow model because pressure is determined uniquely
parent
46bb5407
Pipeline
#170321
passed with stages
in 9 minutes and 11 seconds
Changes
17
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/input.py
View file @
47f9699a
...
...
@@ -100,6 +100,10 @@ class Input:
"type"
:
"boolean"
,
"required"
:
True
},
"rescale_pressure"
:
{
"type"
:
"boolean"
,
"required"
:
True
},
}
},
"case_name"
:
{
...
...
src/solver.py
View file @
47f9699a
...
...
@@ -76,6 +76,7 @@ class Solver:
)
self
.
exact_solution
=
self
.
params
[
"convergence_study"
][
"exact_solution"
]
self
.
rescale_p
=
self
.
params
[
"convergence_study"
][
"rescale_pressure"
]
self
.
output_folder
=
self
.
params
[
"case_name"
]
+
"/"
self
.
var_ranks
=
{
"theta"
:
0
,
...
...
@@ -412,13 +413,14 @@ class Solver:
)
=
sol
.
split
()
if
self
.
mode
==
"stress"
or
self
.
mode
==
"coupled"
:
# Scale pressure to have zero mean
p_i
=
df
.
interpolate
(
self
.
sol
[
"p"
],
self
.
fspaces
[
"p"
])
mean_p_value
=
self
.
calc_sf_mean
(
p_i
)
mean_p_fct
=
df
.
Function
(
self
.
fspaces
[
"p"
])
mean_p_fct
.
assign
(
df
.
Constant
(
mean_p_value
))
p_i
.
assign
(
p_i
-
mean_p_fct
)
self
.
sol
[
"p"
]
=
p_i
if
self
.
rescale_p
:
# Scale pressure to have zero mean
p_i
=
df
.
interpolate
(
self
.
sol
[
"p"
],
self
.
fspaces
[
"p"
])
mean_p_value
=
self
.
calc_sf_mean
(
p_i
)
mean_p_fct
=
df
.
Function
(
self
.
fspaces
[
"p"
])
mean_p_fct
.
assign
(
df
.
Constant
(
mean_p_value
))
p_i
.
assign
(
p_i
-
mean_p_fct
)
self
.
sol
[
"p"
]
=
p_i
def
load_exact_solution
(
self
):
"Writes exact solution"
...
...
tests/coupled/inputs/1_coeffs_nosources_norot_inflow_p1p1p1p1p1_stab.yml
View file @
47f9699a
...
...
@@ -12,9 +12,9 @@ meshes:
-
../mesh/ring3.h5
-
../mesh/ring4.h5
-
../mesh/ring5.h5
#
- ../mesh/ring6.h5 # fails on Macbook 8GB
# - ../mesh/ring7.h5 #
fails on iMac 24GB,
works on iMac 48GB
# - ../mesh/ring
6
.h5
-
../mesh/ring6.h5
# fails on Macbook 8GB
# - ../mesh/ring7.h5 # works on iMac 48GB
# - ../mesh/ring
8
.h5
elements
:
theta
:
...
...
@@ -88,3 +88,4 @@ convergence_study:
exact_solution
:
esols/1_coeffs_nosources_norot_inflow.cpp
plot
:
True
write_systemmatrix
:
False
rescale_pressure
:
False
tests/coupled/inputs/1_coeffs_sources_rot_p1p1p1p1p1_stab.yml
View file @
47f9699a
...
...
@@ -88,3 +88,4 @@ convergence_study:
exact_solution
:
esols/1_coeffs_sources_rot.cpp
plot
:
False
write_systemmatrix
:
False
rescale_pressure
:
True
tests/coupled/inputs/1_coeffs_sources_rot_p2p2p2p2p2_stab.yml
View file @
47f9699a
...
...
@@ -90,3 +90,4 @@ convergence_study:
exact_solution
:
esols/1_coeffs_sources_rot.cpp
plot
:
False
write_systemmatrix
:
False
rescale_pressure
:
True
tests/heat/inputs/01_coeffs_p1p1_stab.yml
View file @
47f9699a
...
...
@@ -86,3 +86,4 @@ convergence_study:
exact_solution
:
esols/01_coeffs.cpp
plot
:
False
# to avoid error exit code due to $DISPLAY
write_systemmatrix
:
False
rescale_pressure
:
True
tests/heat/inputs/01_coeffs_p1p2_nostab.yml
View file @
47f9699a
...
...
@@ -86,3 +86,4 @@ convergence_study:
exact_solution
:
esols/01_coeffs.cpp
plot
:
False
# to avoid error exit code due to $DISPLAY
write_systemmatrix
:
False
rescale_pressure
:
True
tests/heat/inputs/01_coeffs_p2p2_stab.yml
View file @
47f9699a
...
...
@@ -88,3 +88,4 @@ convergence_study:
exact_solution
:
esols/01_coeffs.cpp
plot
:
False
# to avoid error exit code due to $DISPLAY
write_systemmatrix
:
False
rescale_pressure
:
True
tests/heat/inputs/01_nocoeffs_p1p2_nostab.yml
View file @
47f9699a
...
...
@@ -86,3 +86,4 @@ convergence_study:
exact_solution
:
esols/01_nocoeffs.cpp
plot
:
False
# to avoid error exit code due to $DISPLAY
write_systemmatrix
:
False
rescale_pressure
:
True
tests/heat/inputs/10_coeffs_p2p2_stab.yml
View file @
47f9699a
...
...
@@ -86,3 +86,4 @@ convergence_study:
exact_solution
:
esols/10_coeffs.cpp
plot
:
False
# to avoid error exit code due to $DISPLAY
write_systemmatrix
:
False
rescale_pressure
:
True
tests/mesh/create_meshes.py
View file @
47f9699a
...
...
@@ -32,5 +32,5 @@ def create_mesh(exponent):
return
(
mesh
,
subdomains
,
boundaries
)
for
p
in
range
(
4
+
1
,
7
+
1
):
for
p
in
range
(
5
,
7
+
1
):
create_mesh
(
p
)
tests/stress/inputs/01_nosource_rot_p1p1p1_stab.yml
View file @
47f9699a
...
...
@@ -88,3 +88,4 @@ convergence_study:
exact_solution
:
esols/01_nosource_rot.cpp
plot
:
False
write_systemmatrix
:
False
rescale_pressure
:
True
tests/stress/inputs/01_source_norot_p1p1p1_stab.yml
View file @
47f9699a
...
...
@@ -88,3 +88,4 @@ convergence_study:
exact_solution
:
esols/01_source_norot.cpp
plot
:
False
write_systemmatrix
:
False
rescale_pressure
:
True
tests/stress/inputs/01_source_rot_p1p1p1_stab.yml
View file @
47f9699a
...
...
@@ -88,3 +88,4 @@ convergence_study:
exact_solution
:
esols/01_source_rot.cpp
plot
:
False
write_systemmatrix
:
False
rescale_pressure
:
True
tests/stress/inputs/01_source_rot_p1p2p4_nostab.yml
View file @
47f9699a
...
...
@@ -88,3 +88,4 @@ convergence_study:
exact_solution
:
esols/01_source_rot.cpp
plot
:
False
write_systemmatrix
:
False
rescale_pressure
:
True
tests/stress/inputs/01_source_rot_p2p2p2_stab.yml
View file @
47f9699a
...
...
@@ -88,3 +88,4 @@ convergence_study:
exact_solution
:
esols/01_source_rot.cpp
plot
:
False
write_systemmatrix
:
False
rescale_pressure
:
True
tests/stress/inputs/10_source_rot_p1p1p1_stab.yml
View file @
47f9699a
...
...
@@ -88,3 +88,4 @@ convergence_study:
exact_solution
:
esols/10_source_rot.cpp
plot
:
False
write_systemmatrix
:
False
rescale_pressure
:
True
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment