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
f196af66
Commit
f196af66
authored
3 years ago
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Renamed quadrature evaluation points to nodes.
parent
be2f2fa7
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
DG_Approximation.py
+5
-5
5 additions, 5 deletions
DG_Approximation.py
Plotting.py
+2
-2
2 additions, 2 deletions
Plotting.py
Quadrature.py
+19
-19
19 additions, 19 deletions
Quadrature.py
projection_utils.py
+1
-1
1 addition, 1 deletion
projection_utils.py
with
27 additions
and
27 deletions
DG_Approximation.py
+
5
−
5
View file @
f196af66
...
...
@@ -15,8 +15,8 @@ TODO: Ask whether all quadratures depend on freely chosen num_nodes
Urgent:
TODO: Replace getter with property attributes for quadrature -> Done
TODO: Rename eval_points in Quadrature to nodes
TODO:
Make num_nodes
quadrature
argument
TODO: Rename eval_points in Quadrature to nodes
-> Done
TODO:
Improve docstring for
quadrature
TODO: Remove use of DGScheme from ANN_Data_Generator
TODO: Find error in centering for ANN training
TODO: Adapt TCD from Soraya
...
...
@@ -359,11 +359,11 @@ def do_initial_projection(initial_condition, mesh, basis, quadrature,
for
degree
in
range
(
basis
.
polynomial_degree
+
1
):
new_row
.
append
(
np
.
float64
(
sum
(
initial_condition
.
calculate
(
mesh
,
eval_point
+
mesh
.
cell_len
/
2
*
quadrature
.
eval_point
s
[
point
]
-
adjustment
)
*
quadrature
.
node
s
[
point
]
-
adjustment
)
*
basis
.
basis
[
degree
].
subs
(
x
,
quadrature
.
eval_point
s
[
point
])
x
,
quadrature
.
node
s
[
point
])
*
quadrature
.
weights
[
point
]
for
point
in
range
(
quadrature
.
num_
point
s
))))
for
point
in
range
(
quadrature
.
num_
node
s
))))
new_row
=
np
.
array
(
new_row
)
output_matrix
.
append
(
basis
.
inverse_mass_matrix
@
new_row
)
...
...
This diff is collapsed.
Click to expand it.
Plotting.py
+
2
−
2
View file @
f196af66
...
...
@@ -421,7 +421,7 @@ def plot_results(projection: ndarray, troubled_cell_history: list,
grid
,
exact
=
calculate_exact_solution
(
mesh
,
wave_speed
,
final_time
,
quadrature
,
init_cond
)
approx
=
calculate_approximate_solution
(
projection
[:,
1
:
-
1
],
quadrature
.
eval_point
s
,
projection
[:,
1
:
-
1
],
quadrature
.
node
s
,
basis
.
polynomial_degree
,
basis
.
basis
)
# Plot multiwavelet solution (fine and coarse grid)
...
...
@@ -434,7 +434,7 @@ def plot_results(projection: ndarray, troubled_cell_history: list,
coarse_grid
,
coarse_exact
=
calculate_exact_solution
(
coarse_mesh
,
wave_speed
,
final_time
,
quadrature
,
init_cond
)
coarse_approx
=
calculate_approximate_solution
(
coarse_projection
,
quadrature
.
eval_point
s
,
coarse_projection
,
quadrature
.
node
s
,
basis
.
polynomial_degree
,
basis
.
basis
)
plot_solution_and_approx
(
coarse_grid
,
coarse_exact
,
coarse_approx
,
colors
[
'
coarse_exact
'
],
...
...
This diff is collapsed.
Click to expand it.
Quadrature.py
+
19
−
19
View file @
f196af66
...
...
@@ -18,10 +18,10 @@ class Quadrature(ABC):
----------
name : str
String of class name.
num_
eval_point
s : int
Number of evaluation points per cell used for approximation.
eval_point
s : ndarray
E
valuation points per cell used for approximation.
num_
node
s : int
Number of
nodes (
evaluation points
)
per cell used for approximation.
node
s : ndarray
Nodes (e
valuation points
)
per cell used for approximation.
weights : ndarray
Weights used for approximation calculation.
...
...
@@ -46,8 +46,8 @@ class Quadrature(ABC):
Additional parameters for quadrature.
"""
self
.
_num_
eval_point
s
=
None
self
.
_
eval_point
s
=
None
self
.
_num_
node
s
=
None
self
.
_
node
s
=
None
self
.
_weights
=
None
@property
...
...
@@ -56,14 +56,14 @@ class Quadrature(ABC):
return
self
.
__class__
.
__name__
@property
def
num_
point
s
(
self
)
->
int
:
"""
Returns number of evaluation points.
"""
return
self
.
_num_
eval_point
s
def
num_
node
s
(
self
)
->
str
:
"""
Returns number of
nodes (
evaluation points
)
.
"""
return
self
.
_num_
node
s
@property
def
eval_point
s
(
self
)
->
ndarray
:
"""
Returns evaluation points.
"""
return
self
.
_
eval_point
s
def
node
s
(
self
)
->
ndarray
:
"""
Returns
nodes (
evaluation points
)
.
"""
return
self
.
_
node
s
@property
def
weights
(
self
)
->
ndarray
:
...
...
@@ -78,10 +78,10 @@ class Gauss(Quadrature):
----------
name : str
String of class name.
num_
eval_point
s : int
Number of evaluation points per cell used for approximation.
eval_point
s : ndarray
E
valuation points per cell used for approximation.
num_
node
s : int
Number of
nodes (
evaluation points
)
per cell used for approximation.
node
s : ndarray
Nodes (e
valuation points
)
per cell used for approximation.
weights : ndarray
Weights used for approximation calculation.
...
...
@@ -98,11 +98,11 @@ class Gauss(Quadrature):
super
().
_reset
(
config
)
# Unpack necessary configurations
self
.
_num_
eval_point
s
=
config
.
pop
(
'
num_eval_points
'
,
6
)
self
.
_num_
node
s
=
config
.
pop
(
'
num_eval_points
'
,
6
)
self
.
_
eval_point
s
,
self
.
_weights
=
leg
.
leggauss
(
self
.
_num_
eval_point
s
)
self
.
_
node
s
,
self
.
_weights
=
leg
.
leggauss
(
self
.
_num_
node
s
)
@property
def
name
(
self
):
"""
Returns string of class name.
"""
return
self
.
__class__
.
__name__
+
str
(
self
.
_num_
eval_point
s
)
return
self
.
__class__
.
__name__
+
str
(
self
.
_num_
node
s
)
This diff is collapsed.
Click to expand it.
projection_utils.py
+
1
−
1
View file @
f196af66
...
...
@@ -170,7 +170,7 @@ def calculate_exact_solution(
for
cell_center
in
mesh
.
non_ghost_cells
:
eval_points
=
cell_center
+
mesh
.
cell_len
/
2
*
\
quadrature
.
eval_point
s
quadrature
.
node
s
eval_values
=
[]
for
eval_point
in
eval_points
:
...
...
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