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
12a0f85d
Commit
12a0f85d
authored
3 years ago
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Applied self-referencing in Mesh.
parent
c5958fde
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
projection_utils.py
+2
-2
2 additions, 2 deletions
projection_utils.py
with
2 additions
and
2 deletions
projection_utils.py
+
2
−
2
View file @
12a0f85d
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
"""
"""
from
__future__
import
annotations
from
functools
import
cache
from
functools
import
cache
from
typing
import
Tuple
from
typing
import
Tuple
import
numpy
as
np
import
numpy
as
np
...
@@ -100,7 +101,7 @@ class Mesh:
...
@@ -100,7 +101,7 @@ class Mesh:
'
right_bound
'
:
self
.
_right_bound
,
'
right_bound
'
:
self
.
_right_bound
,
'
num_ghost_cells
'
:
self
.
_num_ghost_cells
}
'
num_ghost_cells
'
:
self
.
_num_ghost_cells
}
def
random_stencil
(
self
,
stencil_length
:
int
)
->
'
Mesh
'
:
def
random_stencil
(
self
,
stencil_length
:
int
)
->
Mesh
:
"""
Return random stencil.
"""
Return random stencil.
Build mesh with given number of cell centers around a random point
Build mesh with given number of cell centers around a random point
...
@@ -116,7 +117,6 @@ class Mesh:
...
@@ -116,7 +117,6 @@ class Mesh:
point
=
np
.
random
.
uniform
(
self
.
_left_bound
,
self
.
_right_bound
)
point
=
np
.
random
.
uniform
(
self
.
_left_bound
,
self
.
_right_bound
)
# Adjust grid spacing to be within interval if necessary
# Adjust grid spacing to be within interval if necessary
# creation
grid_spacing
=
self
.
cell_len
grid_spacing
=
self
.
cell_len
while
point
-
stencil_length
/
2
*
grid_spacing
<
self
.
_left_bound
\
while
point
-
stencil_length
/
2
*
grid_spacing
<
self
.
_left_bound
\
or
point
+
stencil_length
/
2
*
grid_spacing
>
self
.
_right_bound
:
or
point
+
stencil_length
/
2
*
grid_spacing
>
self
.
_right_bound
:
...
...
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