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
9325ca8d
Commit
9325ca8d
authored
2 years ago
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Reworked ModifiedMinMod limiter for efficiency.
parent
204ea3d3
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
scripts/tcd/Limiter.py
+6
-12
6 additions, 12 deletions
scripts/tcd/Limiter.py
with
6 additions
and
12 deletions
scripts/tcd/Limiter.py
+
6
−
12
View file @
9325ca8d
...
@@ -218,11 +218,8 @@ class ModifiedMinMod(MinMod):
...
@@ -218,11 +218,8 @@ class ModifiedMinMod(MinMod):
Attributes
Attributes
----------
----------
cell_len : float
threshold : float
Length of a cell in mesh.
Threshold up to which a cell slope does not require limiting.
mod_factor : float
Factor determining whether cell slope is significantly high enough for
modification.
Methods
Methods
-------
-------
...
@@ -247,11 +244,9 @@ class ModifiedMinMod(MinMod):
...
@@ -247,11 +244,9 @@ class ModifiedMinMod(MinMod):
super
().
_reset
(
config
)
super
().
_reset
(
config
)
# Unpack necessary configurations
# Unpack necessary configurations
# cell_len = config.pop('cell_len')
cell_len
=
config
.
pop
(
'
cell_len
'
)
# mod_factor = config.pop('mod_factor', 0)
mod_factor
=
config
.
pop
(
'
mod_factor
'
,
0
)
# self._threshold = mod_factor * cell_len**2
self
.
_threshold
=
mod_factor
*
cell_len
**
2
self
.
_cell_len
=
config
.
pop
(
'
cell_len
'
)
self
.
_mod_factor
=
config
.
pop
(
'
mod_factor
'
,
0
)
def
get_name
(
self
):
def
get_name
(
self
):
"""
Returns string of class name concatenated with the erase-degree.
"""
"""
Returns string of class name concatenated with the erase-degree.
"""
...
@@ -275,8 +270,7 @@ class ModifiedMinMod(MinMod):
...
@@ -275,8 +270,7 @@ class ModifiedMinMod(MinMod):
Flag whether cell should be adjusted.
Flag whether cell should be adjusted.
"""
"""
# if abs(cell_slope) <= self._threshold:
if
abs
(
cell_slope
)
<=
self
.
_threshold
:
if
abs
(
cell_slope
)
<=
self
.
_mod_factor
*
self
.
_cell_len
**
2
:
return
True
return
True
return
super
().
_determine_modification
(
projection
,
cell
,
cell_slope
)
return
super
().
_determine_modification
(
projection
,
cell
,
cell_slope
)
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