Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Troubled Cell Detection
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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Laura Christine Kühle
Troubled Cell Detection
Commits
2914a07b
Commit
2914a07b
authored
3 years ago
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Improved figure identifiers.
parent
53c9e96e
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
Troubled_Cell_Detector.py
+10
-10
10 additions, 10 deletions
Troubled_Cell_Detector.py
with
10 additions
and
10 deletions
Troubled_Cell_Detector.py
+
10
−
10
View file @
2914a07b
...
...
@@ -78,7 +78,7 @@ class TroubledCellDetector(object):
print
(
'
maximum error =
'
,
max_error
)
def
_plot_shock_tube
(
self
,
troubled_cell_history
,
time_history
):
plt
.
figure
(
6
)
plt
.
figure
(
'
shock_tube
'
)
for
pos
in
range
(
len
(
time_history
)):
current_cells
=
troubled_cell_history
[
pos
]
for
cell
in
current_cells
:
...
...
@@ -106,7 +106,7 @@ class TroubledCellDetector(object):
@staticmethod
def
_plot_solution_and_approx
(
grid
,
exact
,
approx
,
color_exact
,
color_approx
):
print
(
color_exact
,
color_approx
)
plt
.
figure
(
1
)
plt
.
figure
(
'
exact_and_approx
'
)
plt
.
plot
(
grid
[
0
],
exact
[
0
],
color_exact
)
plt
.
plot
(
grid
[
0
],
approx
[
0
],
color_approx
)
plt
.
xlabel
(
'
x
'
)
...
...
@@ -115,7 +115,7 @@ class TroubledCellDetector(object):
@staticmethod
def
_plot_semilog_error
(
grid
,
pointwise_error
):
plt
.
figure
(
2
)
plt
.
figure
(
'
semilog_error
'
)
plt
.
semilogy
(
grid
[
0
],
pointwise_error
[
0
])
plt
.
xlabel
(
'
x
'
)
plt
.
ylabel
(
'
|u(x,t)-uh(x,t)|
'
)
...
...
@@ -123,7 +123,7 @@ class TroubledCellDetector(object):
@staticmethod
def
_plot_error
(
grid
,
exact
,
approx
):
plt
.
figure
(
3
)
plt
.
figure
(
'
error
'
)
plt
.
plot
(
grid
[
0
],
exact
[
0
]
-
approx
[
0
])
plt
.
xlabel
(
'
X
'
)
plt
.
ylabel
(
'
u(x,t)-uh(x,t)
'
)
...
...
@@ -183,16 +183,16 @@ class TroubledCellDetector(object):
os
.
makedirs
(
self
.
_plot_dir
+
'
/shock_tube
'
)
# Save plots
plt
.
figure
(
1
)
plt
.
figure
(
'
exact_and_approx
'
)
plt
.
savefig
(
self
.
_plot_dir
+
'
/exact_and_approx/
'
+
name
+
'
.pdf
'
)
plt
.
figure
(
2
)
plt
.
figure
(
'
semilog_error
'
)
plt
.
savefig
(
self
.
_plot_dir
+
'
/semilog_error/
'
+
name
+
'
.pdf
'
)
plt
.
figure
(
3
)
plt
.
figure
(
'
error
'
)
plt
.
savefig
(
self
.
_plot_dir
+
'
/error/
'
+
name
+
'
.pdf
'
)
plt
.
figure
(
6
)
plt
.
figure
(
'
shock_tube
'
)
plt
.
savefig
(
self
.
_plot_dir
+
'
/shock_tube/
'
+
name
+
'
.pdf
'
)
...
...
@@ -295,7 +295,7 @@ class WaveletDetector(TroubledCellDetector):
for
degree
in
range
(
self
.
_polynomial_degree
+
1
)],
axis
=
0
)
projected_wavelet_coeffs
=
np
.
sum
(
wavelet_projection
,
axis
=
0
)
plt
.
figure
(
4
)
plt
.
figure
(
'
coeff_details
'
)
plt
.
plot
(
fine_mesh
,
projected_fine
-
projected_coarse
,
'
m-.
'
)
plt
.
plot
(
fine_mesh
,
projected_wavelet_coeffs
,
'
y
'
)
plt
.
legend
([
'
Fine-Coarse
'
,
'
Wavelet Coeff
'
])
...
...
@@ -342,7 +342,7 @@ class WaveletDetector(TroubledCellDetector):
if
not
os
.
path
.
exists
(
self
.
_plot_dir
+
'
/coeff_details
'
):
os
.
makedirs
(
self
.
_plot_dir
+
'
/coeff_details
'
)
plt
.
figure
(
4
)
plt
.
figure
(
'
coeff_details
'
)
plt
.
savefig
(
self
.
_plot_dir
+
'
/coeff_details/
'
+
name
+
'
.pdf
'
)
def
_plot_coarse_mesh
(
self
,
projection
):
...
...
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