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
cbcf57bf
Commit
cbcf57bf
authored
4 years ago
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Included 'check_wavelet()' for all cases in 'build_training_data().
parent
97f71771
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ANN_Training_Data_Generator.py
+2
-8
2 additions, 8 deletions
ANN_Training_Data_Generator.py
DG_Approximation.py
+7
-4
7 additions, 4 deletions
DG_Approximation.py
with
9 additions
and
12 deletions
ANN_Training_Data_Generator.py
+
2
−
8
View file @
cbcf57bf
...
@@ -133,15 +133,9 @@ class TrainingDataGenerator(object):
...
@@ -133,15 +133,9 @@ class TrainingDataGenerator(object):
quadrature_config
=
{
'
num_eval_points
'
:
polynomial_degree
+
1
})
quadrature_config
=
{
'
num_eval_points
'
:
polynomial_degree
+
1
})
if
initial_condition
.
is_smooth
():
if
initial_condition
.
is_smooth
():
basis_coeffs
=
dg_scheme
.
build_training_data
(
0
,
initial_condition
)
input_data
[
i
]
=
dg_scheme
.
build_training_data
(
0
,
initial_condition
)
else
:
else
:
basis_coeffs
=
dg_scheme
.
build_training_data
(
centers
[
1
],
initial_condition
)
input_data
[
i
]
=
dg_scheme
.
build_training_data
(
centers
[
1
],
initial_condition
)
data_center
=
dg_scheme
.
check_wavelet
(
basis_coeffs
,
self
.
_quadrature_center
,
0
)
data_left
=
dg_scheme
.
check_wavelet
(
basis_coeffs
,
self
.
_quadrature_left
,
polynomial_degree
)
data_right
=
dg_scheme
.
check_wavelet
(
basis_coeffs
,
self
.
_quadrature_right
,
polynomial_degree
)
input_data
[
i
]
=
np
.
array
(
list
(
zip
(
data_center
[:,
0
],
data_left
[:,
1
],
data_center
[:,
1
],
data_right
[:,
1
],
data_center
[:,
2
])))
# Update Function ID
# Update Function ID
if
(
i
%
num_function_samples
==
num_function_samples
-
1
)
and
(
function_id
!=
len
(
initial_conditions
)
-
1
):
if
(
i
%
num_function_samples
==
num_function_samples
-
1
)
and
(
function_id
!=
len
(
initial_conditions
)
-
1
):
...
...
This diff is collapsed.
Click to expand it.
DG_Approximation.py
+
7
−
4
View file @
cbcf57bf
...
@@ -8,6 +8,8 @@ TODO: Replace loops with list comprehension if feasible
...
@@ -8,6 +8,8 @@ TODO: Replace loops with list comprehension if feasible
TODO: Write documentation for all methods
TODO: Write documentation for all methods
TODO: Contemplate how to make shock tubes comparable
TODO: Contemplate how to make shock tubes comparable
TODO: Fix bug in approximation -> Done (used num_grid_cells instead of cell_len for cfl_number in last step)
TODO: Fix bug in approximation -> Done (used num_grid_cells instead of cell_len for cfl_number in last step)
TODO: Include check_wavelet() for all cases in build_training_data() -> Done
TODO: Fix data_left/right/center to create data with an x-point stencil
"""
"""
import
numpy
as
np
import
numpy
as
np
...
@@ -188,8 +190,9 @@ class DGScheme(object):
...
@@ -188,8 +190,9 @@ class DGScheme(object):
if
initial_condition
is
None
:
if
initial_condition
is
None
:
initial_condition
=
self
.
_init_cond
initial_condition
=
self
.
_init_cond
projection
=
self
.
_do_initial_projection
(
initial_condition
,
adjustment
)
projection
=
self
.
_do_initial_projection
(
initial_condition
,
adjustment
)
return
projection
[:,
1
:
-
1
]
def
check_wavelet
(
self
,
projection
,
quadrature
,
polynomial_degree
):
data_center
=
self
.
_detector
.
calculate_approximate_solution
(
projection
[:,
1
:
-
1
],
[
0
],
0
)
projection
=
self
.
_detector
.
calculate_approximate_solution
(
projection
,
quadrature
,
polynomial_degree
)
data_left
=
self
.
_detector
.
calculate_approximate_solution
(
projection
[:,
1
:
-
1
],
[
-
1
],
self
.
_polynomial_degree
)
return
projection
data_right
=
self
.
_detector
.
calculate_approximate_solution
(
projection
[:,
1
:
-
1
],
[
1
],
self
.
_polynomial_degree
)
return
np
.
array
(
list
(
zip
(
data_center
[:,
0
],
data_left
[:,
1
],
data_center
[:,
1
],
data_right
[:,
1
],
data_center
[:,
2
])))
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