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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Laura Christine Kühle
Troubled Cell Detection
Commits
f42c5cdc
Commit
f42c5cdc
authored
2 years ago
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Enforced boundary condition on Boxplot folds with decorator.
parent
5b26530e
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
+11
-0
11 additions, 0 deletions
scripts/tcd/Boundary_Condition.py
scripts/tcd/Troubled_Cell_Detector.py
+6
-5
6 additions, 5 deletions
scripts/tcd/Troubled_Cell_Detector.py
with
18 additions
and
6 deletions
Snakefile
+
1
−
1
View file @
f42c5cdc
...
...
@@ -26,7 +26,7 @@ Urgent:
TODO: Refactor Boxplot class -> Done
TODO: Enforce periodic boundary condition for projection with decorator -> Done
TODO: Enforce Boxplot bounds with decorator -> Done
TODO: Enforce Boxplot folds with decorator
TODO: Enforce Boxplot folds with decorator
-> Done
TODO: Enforce boundary for initial condition in exact solution only
TODO: Adapt number of ghost cells based on ANN stencil
TODO: Ensure exact solution is calculated in Equation class
...
...
This diff is collapsed.
Click to expand it.
scripts/tcd/Boundary_Condition.py
+
11
−
0
View file @
f42c5cdc
...
...
@@ -77,3 +77,14 @@ def enforce_boxplot_boundaries(func):
else
:
raise
Exception
(
'
Not implemented!
'
)
return
boxplot_boundary
def
enforce_fold_boundaries
(
func
):
def
fold_boundaries
(
self
,
*
args
,
**
kwargs
):
folds
=
np
.
array
(
func
(
self
,
*
args
,
**
kwargs
))
if
self
.
_mesh
.
boundary
==
'
periodic
'
:
return
folds
%
self
.
_mesh
.
num_cells
else
:
raise
Exception
(
'
Not implemented!
'
)
return
fold_boundaries
This diff is collapsed.
Click to expand it.
scripts/tcd/Troubled_Cell_Detector.py
+
6
−
5
View file @
f42c5cdc
...
...
@@ -10,7 +10,8 @@ from numpy import ndarray
import
torch
from
.
import
ANN_Model
from
.Boundary_Condition
import
enforce_boxplot_boundaries
from
.Boundary_Condition
import
enforce_boxplot_boundaries
,
\
enforce_fold_boundaries
from
.Mesh
import
Mesh
...
...
@@ -357,6 +358,7 @@ class Boxplot(WaveletDetector):
num_overlapping_cells
=
config
.
pop
(
'
num_overlapping_cells
'
,
1
)
self
.
_fold_indices
=
self
.
_compute_folds
(
num_overlapping_cells
)
@enforce_fold_boundaries
def
_compute_folds
(
self
,
num_overlapping_cells
:
int
)
->
ndarray
:
"""
Compute indices for all folds used in Boxplot calculation.
...
...
@@ -375,8 +377,7 @@ class Boxplot(WaveletDetector):
fold_indices
=
np
.
zeros
([
num_folds
,
self
.
_fold_len
+
2
*
num_overlapping_cells
]).
astype
(
np
.
int32
)
for
fold
in
range
(
num_folds
):
fold_indices
[
fold
]
=
np
.
array
(
[
i
%
self
.
_mesh
.
num_cells
for
i
in
range
(
fold_indices
[
fold
]
=
np
.
array
([
i
for
i
in
range
(
fold
*
self
.
_fold_len
-
num_overlapping_cells
,
(
fold
+
1
)
*
self
.
_fold_len
+
num_overlapping_cells
)])
return
fold_indices
...
...
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