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
849dae30
Commit
849dae30
authored
Oct 18, 2020
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Set methods to static if possible.
parent
af5c6294
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
+6
-3
6 additions, 3 deletions
Troubled_Cell_Detector.py
with
6 additions
and
3 deletions
Troubled_Cell_Detector.py
+
6
−
3
View file @
849dae30
...
...
@@ -86,7 +86,8 @@ class TroubledCellDetector(object):
return
max_error
def
_plot_solution_and_approx
(
self
,
grid
,
exact
,
approx
,
color_exact
,
color_approx
):
@staticmethod
def
_plot_solution_and_approx
(
grid
,
exact
,
approx
,
color_exact
,
color_approx
):
print
(
color_exact
,
color_approx
)
plt
.
figure
(
1
)
plt
.
plot
(
grid
[
0
],
exact
[
0
],
color_exact
)
...
...
@@ -95,14 +96,16 @@ class TroubledCellDetector(object):
plt
.
ylabel
(
'
u(x,t)
'
)
plt
.
title
(
'
Solution and Approximation
'
)
def
_plot_semilog_error
(
self
,
grid
,
pointwise_error
):
@staticmethod
def
_plot_semilog_error
(
grid
,
pointwise_error
):
plt
.
figure
(
2
)
plt
.
semilogy
(
grid
[
0
],
pointwise_error
[
0
])
plt
.
xlabel
(
'
x
'
)
plt
.
ylabel
(
'
|u(x,t)-uh(x,t)|
'
)
plt
.
title
(
'
Semilog Error plotted at Evaluation points
'
)
def
_plot_error
(
self
,
grid
,
exact
,
approx
):
@staticmethod
def
_plot_error
(
grid
,
exact
,
approx
):
plt
.
figure
(
3
)
plt
.
plot
(
grid
[
0
],
exact
[
0
]
-
approx
[
0
])
plt
.
xlabel
(
'
X
'
)
...
...
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