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
2d16e0bc
Commit
2d16e0bc
authored
2 years ago
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Enforced number of mesh cells to be an exponential of 2.
parent
ac49fe3b
Branches
Branches containing commit
No related tags found
Loading
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
projection_utils.py
+6
-2
6 additions, 2 deletions
projection_utils.py
with
6 additions
and
2 deletions
projection_utils.py
+
6
−
2
View file @
2d16e0bc
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
from
__future__
import
annotations
from
__future__
import
annotations
from
functools
import
cache
from
functools
import
cache
from
typing
import
Tuple
from
typing
import
Tuple
import
math
import
numpy
as
np
import
numpy
as
np
from
numpy
import
ndarray
from
numpy
import
ndarray
from
sympy
import
Symbol
from
sympy
import
Symbol
...
@@ -46,8 +47,8 @@ class Mesh:
...
@@ -46,8 +47,8 @@ class Mesh:
Parameters
Parameters
----------
----------
num_grid_cells : int
num_grid_cells : int
Number of cells in the mesh (ghost cells notwithstanding).
Usually
Number of cells in the mesh (ghost cells notwithstanding).
Has
exponential of 2.
to be an
exponential of 2.
num_ghost_cells : int
num_ghost_cells : int
Number of ghost cells on each side of the mesh.
Number of ghost cells on each side of the mesh.
left_bound : float
left_bound : float
...
@@ -56,6 +57,9 @@ class Mesh:
...
@@ -56,6 +57,9 @@ class Mesh:
Right boundary of the mesh interval.
Right boundary of the mesh interval.
"""
"""
self
.
_num_grid_cells
=
num_grid_cells
self
.
_num_grid_cells
=
num_grid_cells
if
not
math
.
log
(
self
.
_num_grid_cells
,
2
).
is_integer
():
raise
ValueError
(
'
The number of cells in the mesh has to be an
'
'
exponential of 2
'
)
self
.
_num_ghost_cells
=
num_ghost_cells
self
.
_num_ghost_cells
=
num_ghost_cells
self
.
_left_bound
=
left_bound
self
.
_left_bound
=
left_bound
self
.
_right_bound
=
right_bound
self
.
_right_bound
=
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