Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
SWE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gaurav Kukreja
SWE
Commits
d4c3b1b3
Commit
d4c3b1b3
authored
Aug 03, 2012
by
Alexander Breuer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an optional time step computation for teaching purposes.
parent
df26b0be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
SWE_WavePropagationBlockCuda.hh
src/SWE_WavePropagationBlockCuda.hh
+3
-3
swe_wavepropagation.cpp
src/examples/swe_wavepropagation.cpp
+6
-0
No files found.
src/SWE_WavePropagationBlockCuda.hh
View file @
d4c3b1b3
...
@@ -78,9 +78,9 @@ class SWE_WavePropagationBlockCuda: public SWE_BlockCUDA {
...
@@ -78,9 +78,9 @@ class SWE_WavePropagationBlockCuda: public SWE_BlockCUDA {
float
simulate
(
float
,
float
);
float
simulate
(
float
,
float
);
// TODO: not implemented, max time step reduction is done in each call of computeNumericalFluxes(...)
// TODO: not implemented, max time step reduction is done in each call of computeNumericalFluxes(...)
void
computeMaxTimestep
()
{
//
void computeMaxTimestep() {
assert
(
false
);
//
assert(false);
};
//
};
// compute the numerical fluxes (net-update formulation here).
// compute the numerical fluxes (net-update formulation here).
void
computeNumericalFluxes
();
void
computeNumericalFluxes
();
...
...
src/examples/swe_wavepropagation.cpp
View file @
d4c3b1b3
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include <cassert>
#include <cassert>
#include <cstdlib>
#include <cstdlib>
#include <string>
#include <string>
#include <iostream>
#include "../tools/help.hh"
#include "../tools/help.hh"
#include "../SWE_Block.hh"
#include "../SWE_Block.hh"
...
@@ -217,6 +218,11 @@ int main( int argc, char** argv ) {
...
@@ -217,6 +218,11 @@ int main( int argc, char** argv ) {
while
(
l_t
<
l_checkPoints
[
c
]
)
{
while
(
l_t
<
l_checkPoints
[
c
]
)
{
// set values in ghost cells:
// set values in ghost cells:
l_wavePropgationBlock
.
setGhostLayer
();
l_wavePropgationBlock
.
setGhostLayer
();
// approximate the maximum time step
// TODO: This calculation should be replaced by the usage of the wave speeds occuring during the flux computation
// Remark: The code is executed on the CPU, therefore a "valid result" depends on the CPU-GPU-synchronization.
// l_wavePropgationBlock.computeMaxTimestep();
// compute numerical flux on each edge
// compute numerical flux on each edge
l_wavePropgationBlock
.
computeNumericalFluxes
();
l_wavePropgationBlock
.
computeNumericalFluxes
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment