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
c5ed7277
Commit
c5ed7277
authored
2 years ago
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Vectorized 'update_right_hand_side()' for Burgers.
parent
75c2b724
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Snakefile
+2
-0
2 additions, 0 deletions
Snakefile
scripts/tcd/Equation.py
+1
-36
1 addition, 36 deletions
scripts/tcd/Equation.py
with
3 additions
and
36 deletions
Snakefile
+
2
−
0
View file @
c5ed7277
...
...
@@ -26,6 +26,7 @@ TODO: Ask why implicit solver is always over the interval [0,1] with 200 cells
TODO: Ask about reasoning behind height_adjustment and stretch_factor
Urgent:
TODO: Move code to other Git
TODO: Mark Burgers' equation as inviscid -> Done
TODO: Make sure CFL number is absolute value -> Done
TODO: Make sure only ghost cells are limited for Dirichlet boundary -> Done
...
...
@@ -39,6 +40,7 @@ TODO: Vectorize 'burgers_volume_integral()'
TODO: Vectorize 'burgers_local_Lax_Friedrich()'
TODO: Vectorize 'burgers_boundary_matrix()'
TODO: Vectorize '_calculate_boundary_points()'
TODO: Vectorize 'update_right_hand_side()' for Burgers -> Done
TODO: Try to extract calculation of matrices for the volume integral and flux
for Burgers
TODO: Rework/refactor implicit solver
...
...
This diff is collapsed.
Click to expand it.
scripts/tcd/Equation.py
+
1
−
36
View file @
c5ed7277
...
...
@@ -614,44 +614,9 @@ class Burgers(Equation):
Matrix of right-hand side.
"""
pass
volume_integral_matrix
=
self
.
_burgers_volume_integral
(
projection
)
boundary_matrix
=
self
.
_burgers_boundary_matrix
(
projection
)
# Initialize vector and set first entry to accommodate for ghost cell
right_hand_side
=
[
0
]
for
j
in
range
(
self
.
_mesh
.
num_cells
):
right_hand_side
.
append
(
2
*
(
volume_integral_matrix
[:,
j
+
1
]
+
boundary_matrix
[:,
j
+
1
]))
# Set ghost cells to respective value
# (Periodic, Updated to Dirichlet in enforce_boundary_condition
# for DiscontinuousConstant problem)
right_hand_side
[
0
]
=
right_hand_side
[
self
.
_mesh
.
num_cells
]
right_hand_side
.
append
(
right_hand_side
[
1
])
return
np
.
transpose
(
right_hand_side
)
# right_hand_side = np.zeros_like(projection)
# if self._wave_speed > 0:
# right_hand_side[:, self._mesh.num_ghost_cells:
# -self._mesh.num_ghost_cells] = \
# 2 * (self._flux_matrix @
# projection[:, self._mesh.num_ghost_cells-1:
# -self._mesh.num_ghost_cells-1] +
# self._volume_integral_matrix @
# projection[:, self._mesh.num_ghost_cells:
# -self._mesh.num_ghost_cells])
# else:
# right_hand_side[:, self._mesh.num_ghost_cells:
# -self._mesh.num_ghost_cells] = \
# 2 * (self._flux_matrix @
# projection[:, self._mesh.num_ghost_cells+1:] +
# self._volume_integral_matrix @
# projection[:, self._mesh.num_ghost_cells:
# -self._mesh.num_ghost_cells])
#
# return right_hand_side
return
2
*
(
volume_integral_matrix
+
boundary_matrix
)
def
_burgers_volume_integral
(
self
,
projection
):
basis_vector
=
self
.
_basis
.
basis
...
...
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