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
c0bb51db
Commit
c0bb51db
authored
Oct 11, 2020
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Made sure 'self.cfl_number' is not changed. Removed unnecessary comments.
parent
03b05725
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
DG_Approximation.py
+5
-15
5 additions, 15 deletions
DG_Approximation.py
with
5 additions
and
15 deletions
DG_Approximation.py
+
5
−
15
View file @
c0bb51db
...
...
@@ -9,7 +9,7 @@ TODO: Double-check everything!
TODO: Replace loops with list comprehension if feasible
TODO: Combine initial projection and approx solution somehow
-> Done (decided against it because they are in different files now)
TODO: Investigate why there are no weights in approx calc
TODO: Investigate why there are no weights in approx calc
-> Ask
TODO: Change order of methods
TODO: Change code to not include self. but global variables; NO, do private
\
or better protected instance variables instead
...
...
@@ -25,6 +25,7 @@ TODO: Check instance variables in DG_Approximation -> Done
TODO: Improve saving of plots
TODO: Extend color options
TODO: Implement type check for all kwargs and configs
TODO: Make sure that self.cfl_number is not changed -> Done
"""
import
numpy
as
np
...
...
@@ -122,12 +123,13 @@ class DGScheme(object):
time_history
=
[]
while
current_time
<
self
.
final_time
:
# Adjust for last cell
cfl_number
=
self
.
cfl_number
if
current_time
+
time_step
>
self
.
final_time
:
time_step
=
self
.
final_time
-
current_time
self
.
cfl_number
=
self
.
wave_speed
*
time_step
/
self
.
num_grid_cells
cfl_number
=
self
.
wave_speed
*
time_step
/
self
.
num_grid_cells
# Update projection
projection
,
troubled_cells
=
self
.
update_scheme
.
step
(
projection
,
self
.
cfl_number
,
current_time
)
projection
,
troubled_cells
=
self
.
update_scheme
.
step
(
projection
,
cfl_number
,
current_time
)
iteration
+=
1
...
...
@@ -143,17 +145,6 @@ class DGScheme(object):
if
self
.
verbose
:
plt
.
show
()
# What is that??? What is it for?
# troubled_cells = self.update_scheme.get_troubled_cell_history()
# wavelet = self.update_scheme.get_wavelet_coeffs(
# self.projection[:, 1: -1])
#
# return approx
#
# return self.projection[:, 1:-1], self.mesh[2:-2], troubled_cells, \
# wavelet
def
save_plots
(
self
):
name
=
self
.
init_cond
.
get_name
()
+
'
__
'
+
self
.
detector
.
get_name
()
+
'
__
'
+
self
.
limiter
.
get_name
()
\
+
'
__
'
+
self
.
update_scheme
.
get_name
()
+
'
__
'
+
self
.
quadrature
.
get_name
()
+
'
__final_time_
'
\
...
...
@@ -237,7 +228,6 @@ class DGScheme(object):
for
cell
in
range
(
self
.
num_grid_cells
):
new_row
=
[]
eval_point
=
self
.
left_bound
+
(
cell
+
0.5
)
*
self
.
cell_len
# former to line above: currentX
for
degree
in
range
(
self
.
polynom_degree
+
1
):
new_entry
=
sum
(
self
.
init_cond
.
calculate
(
eval_point
...
...
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