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
5b26530e
Commit
5b26530e
authored
2 years ago
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Enforced boundary condition on Boxplot bounds with decorator.
parent
e036e917
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
Snakefile
+1
-1
1 addition, 1 deletion
Snakefile
scripts/tcd/Boundary_Condition.py
+12
-9
12 additions, 9 deletions
scripts/tcd/Boundary_Condition.py
scripts/tcd/Troubled_Cell_Detector.py
+2
-6
2 additions, 6 deletions
scripts/tcd/Troubled_Cell_Detector.py
with
15 additions
and
16 deletions
Snakefile
+
1
−
1
View file @
5b26530e
...
...
@@ -25,7 +25,7 @@ TODO: Discuss how wavelet details should be plotted
Urgent:
TODO: Refactor Boxplot class -> Done
TODO: Enforce periodic boundary condition for projection with decorator -> Done
TODO: Enforce Boxplot bounds with decorator
TODO: Enforce Boxplot bounds with decorator
-> Done
TODO: Enforce Boxplot folds with decorator
TODO: Enforce boundary for initial condition in exact solution only
TODO: Adapt number of ghost cells based on ANN stencil
...
...
This diff is collapsed.
Click to expand it.
scripts/tcd/Boundary_Condition.py
+
12
−
9
View file @
5b26530e
...
...
@@ -3,17 +3,9 @@
@author: Laura C. Kühle
"""
# from typing import Tuple
# from abc import ABC, abstractmethod
# import numpy as np
import
numpy
as
np
from
numpy
import
ndarray
# from .Basis_Function import Basis
# from .Initial_Condition import InitialCondition
# from .Mesh import Mesh
# from .projection_utils import do_initial_projection
# from .Quadrature import Quadrature
def
periodic_boundary
(
projection
:
ndarray
,
num_ghost_cells
:
int
)
->
ndarray
:
"""
Enforce boundary condition.
...
...
@@ -74,3 +66,14 @@ def enforce_boundary(num_ghost_cells=None):
raise
Exception
(
'
Not implemented!
'
)
return
boundary
return
_enforce_boundary
def
enforce_boxplot_boundaries
(
func
):
def
boxplot_boundary
(
self
,
*
args
,
**
kwargs
):
bounds
=
np
.
array
(
func
(
self
,
*
args
,
**
kwargs
))
if
self
.
_mesh
.
boundary
==
'
periodic
'
:
return
tuple
(
periodic_boundary
(
projection
=
bounds
,
num_ghost_cells
=
1
))
else
:
raise
Exception
(
'
Not implemented!
'
)
return
boxplot_boundary
This diff is collapsed.
Click to expand it.
scripts/tcd/Troubled_Cell_Detector.py
+
2
−
6
View file @
5b26530e
...
...
@@ -10,6 +10,7 @@ from numpy import ndarray
import
torch
from
.
import
ANN_Model
from
.Boundary_Condition
import
enforce_boxplot_boundaries
from
.Mesh
import
Mesh
...
...
@@ -423,6 +424,7 @@ class Boxplot(WaveletDetector):
return
troubled_cells
@enforce_boxplot_boundaries
def
_compute_bounds
(
self
,
coeffs
:
ndarray
)
->
Tuple
[
ndarray
,
ndarray
]:
"""
Compute lower and upper bound for Boxplot outliers.
...
...
@@ -455,12 +457,6 @@ class Boxplot(WaveletDetector):
upper_bounds
[
1
:
-
1
]
=
third_quartiles
+
self
.
_whisker_len
*
(
third_quartiles
-
first_quartiles
)
# Adjust bounds to capture periodic boundary
lower_bounds
[
0
]
=
lower_bounds
[
-
2
]
lower_bounds
[
-
1
]
=
lower_bounds
[
1
]
upper_bounds
[
0
]
=
upper_bounds
[
-
2
]
upper_bounds
[
-
1
]
=
upper_bounds
[
1
]
return
lower_bounds
,
upper_bounds
...
...
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