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
ff8fba4b
Commit
ff8fba4b
authored
2 years ago
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Introduced 'training_data_mode' to allow forbidden mesh size during ANN training.
parent
c6c21a11
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
+12
-5
12 additions, 5 deletions
projection_utils.py
with
12 additions
and
5 deletions
projection_utils.py
+
12
−
5
View file @
ff8fba4b
...
@@ -41,7 +41,8 @@ class Mesh:
...
@@ -41,7 +41,8 @@ class Mesh:
"""
"""
def
__init__
(
self
,
num_grid_cells
:
int
,
num_ghost_cells
:
int
,
def
__init__
(
self
,
num_grid_cells
:
int
,
num_ghost_cells
:
int
,
left_bound
:
float
,
right_bound
:
float
)
->
None
:
left_bound
:
float
,
right_bound
:
float
,
training_data_mode
:
bool
=
False
)
->
None
:
"""
Initialize Mesh.
"""
Initialize Mesh.
Parameters
Parameters
...
@@ -55,11 +56,16 @@ class Mesh:
...
@@ -55,11 +56,16 @@ class Mesh:
Left boundary of the mesh interval.
Left boundary of the mesh interval.
right_bound : float
right_bound : float
Right boundary of the mesh interval.
Right boundary of the mesh interval.
training_data_mode : bool, optional
Flag indicating whether the mesh is used for training data
generation. Default: False.
"""
"""
self
.
_num_grid_cells
=
num_grid_cells
self
.
_num_grid_cells
=
num_grid_cells
if
not
training_data_mode
:
if
not
math
.
log
(
self
.
_num_grid_cells
,
2
).
is_integer
():
if
not
math
.
log
(
self
.
_num_grid_cells
,
2
).
is_integer
():
raise
ValueError
(
'
The number of cells in the mesh has to be
an
'
raise
ValueError
(
'
The number of cells in the mesh has to be
'
'
exponential of 2
'
)
'
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
...
@@ -130,7 +136,8 @@ class Mesh:
...
@@ -130,7 +136,8 @@ class Mesh:
# Return new mesh instance
# Return new mesh instance
return
Mesh
(
left_bound
=
point
-
stencil_length
/
2
*
grid_spacing
,
return
Mesh
(
left_bound
=
point
-
stencil_length
/
2
*
grid_spacing
,
right_bound
=
point
+
stencil_length
/
2
*
grid_spacing
,
right_bound
=
point
+
stencil_length
/
2
*
grid_spacing
,
num_grid_cells
=
stencil_length
,
num_ghost_cells
=
2
)
num_grid_cells
=
stencil_length
,
num_ghost_cells
=
2
,
training_data_mode
=
True
)
def
calculate_approximate_solution
(
def
calculate_approximate_solution
(
...
...
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