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
1a7d40dc
Commit
1a7d40dc
authored
Oct 4, 2022
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Added option to select plotting colors.
parent
17aba6ff
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
DG_Approximation.py
+16
-15
16 additions, 15 deletions
DG_Approximation.py
Plotting.py
+6
-2
6 additions, 2 deletions
Plotting.py
workflows/approximation.smk
+2
-1
2 additions, 1 deletion
workflows/approximation.smk
with
24 additions
and
18 deletions
DG_Approximation.py
+
16
−
15
View file @
1a7d40dc
...
...
@@ -24,28 +24,23 @@ TODO: Discuss name for quadrature mesh (now: grid)
Urgent:
TODO: Added sign change in stiffness and boundary matrix to accommodate
negative wave speed -> Done
TODO: Force input_size for each ANN model to be stencil length
TODO: Induce shift in IC class
TODO: Unify print commands (f vs no f)
TODO: Add method and error info to Mesh
TODO: Add use of discontinuity position to all ICs
TODO: Change maximum training degree to 6
TODO: Change minimum training mesh size to 2^5
TODO: Enforce shift to be positive for two-sided Heaviside
TODO: Remove option to choose training domain
TODO: Fix VisibleDeprecationWarning for ndarray encoding
TODO: Give option to select plotting color
TODO: Unify print commands (f vs no f) -> Done
TODO: Add method and error info to Mesh -> Done
TODO: Add use of discontinuity position to all ICs -> Done
TODO: Change maximum training degree to 6 -> Done
TODO: Change minimum training mesh size to 2^5 -> Done
TODO: Enforce shift to be positive for two-sided Heaviside -> Done
TODO: Remove option to choose training domain -> Done
TODO: Fix VisibleDeprecationWarning for ndarray decoding -> Done
TODO: Give option to select plotting color -> Done
TODO: Move scripts into separate directory
TODO: Outsource run commands in SM rules into separate files
TODO: Move plot_approximation_results() into plotting script
TODO: Introduce env files for each SM rule
TODO: Restructure directories
TODO: Add images to report
TODO: Add verbose output
Critical, but not urgent:
TODO: Restructure
'
calculate_approximate_solution()
'
TODO: Rework Theoretical TC for efficiency
TODO: Rework Theoretical TC
D
for efficiency
TODO: Extract object initialization from DGScheme
TODO: Replace loops with list comprehension if feasible
TODO: Replace loops/list comprehension with vectorization if feasible
...
...
@@ -68,6 +63,12 @@ TODO: Add a default model state
TODO: Look into validators for variable checks
Not feasible yet or doc-related:
TODO: Replace pop() with get() for dictionary access
TODO: Induce shift in IC class
TODO: Force input_size for each ANN model to be stencil length
TODO: Restructure directories
TODO: Add images to report
TODO: Add verbose output
TODO: Adjust definitions of each IC to be dependent on domain
TODO: Add README for ANN training
TODO: Give detailed description of wavelet detection
...
...
This diff is collapsed.
Click to expand it.
Plotting.py
+
6
−
2
View file @
1a7d40dc
...
...
@@ -314,7 +314,7 @@ def plot_evaluation_results(evaluation_file: str, directory: str,
def
plot_approximation_results
(
data_file
:
str
,
directory
:
str
,
plot_name
:
str
,
quadrature
:
Quadrature
,
colors
:
dict
,
quadrature
:
Quadrature
,
init_cond
:
InitialCondition
)
->
None
:
"""
Plots given approximation results.
...
...
@@ -329,6 +329,8 @@ def plot_approximation_results(data_file: str, directory: str, plot_name: str,
Path to directory in which plots will be saved.
plot_name : str
Name of plot.
colors: dict
Dictionary of colors used for plots.
quadrature: Quadrature object
Quadrature used for evaluation.
init_cond : InitialCondition object
...
...
@@ -344,10 +346,12 @@ def plot_approximation_results(data_file: str, directory: str, plot_name: str,
for
key
in
approx_stats
.
keys
()}
approx_stats
[
'
basis
'
]
=
OrthonormalLegendre
(
**
approx_stats
[
'
basis
'
])
approx_stats
[
'
mesh
'
]
=
Mesh
(
**
approx_stats
[
'
mesh
'
])
print
([
key
for
key
in
approx_stats
.
keys
()])
# Plot exact/approximate results, errors, shock tubes,
# and any detector-dependant plots
plot_results
(
quadrature
=
quadrature
,
init_cond
=
init_cond
,
**
approx_stats
)
plot_results
(
quadrature
=
quadrature
,
init_cond
=
init_cond
,
colors
=
colors
,
**
approx_stats
)
# Set paths for plot files if not existing already
if
not
os
.
path
.
exists
(
directory
):
...
...
This diff is collapsed.
Click to expand it.
workflows/approximation.smk
+
2
−
1
View file @
1a7d40dc
...
...
@@ -85,9 +85,10 @@ rule plot_approximation_results:
quadrature = getattr(Quadrature, detector_dict.pop(
'quadrature', 'Gauss'))(detector_dict.pop(
'quadrature_config', {}))
colors = detector_dict.pop('colors', None)
plot_approximation_results(directory=params.plot_dir,
plot_name=wildcards.scheme,
plot_name=wildcards.scheme,
colors=colors,
data_file=params.plot_dir+'/'+wildcards.scheme,
quadrature=quadrature, init_cond=init_cond)
...
...
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