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
d8b4a061
Commit
d8b4a061
authored
Jan 17, 2013
by
Sebastian Rettenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quick implementation for dynamic displacements
parent
a9769f3f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
6 deletions
+24
-6
SConstruct
SConstruct
+6
-0
SWE_WavePropagationBlock.cpp
src/SWE_WavePropagationBlock.cpp
+1
-1
SWE_WavePropagationBlock.hh
src/SWE_WavePropagationBlock.hh
+2
-2
swe_mpi.cpp
src/examples/swe_mpi.cpp
+11
-2
SWE_AsagiScenario.hpp
src/scenarios/SWE_AsagiScenario.hpp
+4
-1
No files found.
SConstruct
View file @
d8b4a061
...
@@ -94,6 +94,8 @@ vars.AddVariables(
...
@@ -94,6 +94,8 @@ vars.AddVariables(
allowed_values
=
(
'rusanov'
,
'fwave'
,
'augrie'
,
'hybrid'
,
'fwavevec'
)
allowed_values
=
(
'rusanov'
,
'fwave'
,
'augrie'
,
'hybrid'
,
'fwavevec'
)
),
),
BoolVariable
(
'dynamicDispl'
,
'support dynamic displacement files with ASAGI'
,
False
),
BoolVariable
(
'vectorize'
,
'add pragmas to help vectorization (release only)'
,
True
),
BoolVariable
(
'vectorize'
,
'add pragmas to help vectorization (release only)'
,
True
),
BoolVariable
(
'showVectorization'
,
'show loop vectorization (Intel compiler only)'
,
False
),
BoolVariable
(
'showVectorization'
,
'show loop vectorization (Intel compiler only)'
,
False
),
...
@@ -218,6 +220,10 @@ elif env['solver'] == 'hybrid':
...
@@ -218,6 +220,10 @@ elif env['solver'] == 'hybrid':
env
.
Append
(
CPPDEFINES
=
[
'WAVE_PROPAGATION_SOLVER=0'
])
env
.
Append
(
CPPDEFINES
=
[
'WAVE_PROPAGATION_SOLVER=0'
])
elif
env
[
'solver'
]
==
'fwavevec'
:
elif
env
[
'solver'
]
==
'fwavevec'
:
env
.
Append
(
CPPDEFINES
=
[
'WAVE_PROPAGATION_SOLVER=4'
])
env
.
Append
(
CPPDEFINES
=
[
'WAVE_PROPAGATION_SOLVER=4'
])
# Dynamic displacement?
if
env
[
'dynamicDispl'
]:
env
.
Append
(
CPPDEFINES
=
[
'DYNAMIC_DISPLACEMENTS'
])
# set the precompiler flags for CUDA
# set the precompiler flags for CUDA
if
env
[
'parallelization'
]
in
[
'cuda'
,
'mpi_with_cuda'
]:
if
env
[
'parallelization'
]
in
[
'cuda'
,
'mpi_with_cuda'
]:
...
...
src/SWE_WavePropagationBlock.cpp
View file @
d8b4a061
...
@@ -256,7 +256,7 @@ void SWE_WavePropagationBlock::updateUnknowns(float dt) {
...
@@ -256,7 +256,7 @@ void SWE_WavePropagationBlock::updateUnknowns(float dt) {
* @param i_asagiScenario the corresponding ASAGI-scenario
* @param i_asagiScenario the corresponding ASAGI-scenario
*/
*/
#ifdef DYNAMIC_DISPLACEMENTS
#ifdef DYNAMIC_DISPLACEMENTS
bool
SWE_WavePropagationBlock
::
updateBathymetryWithDynamicDisplacement
(
scenarios
::
Asagi
&
i_asagiScenario
,
const
float
i_time
)
{
bool
SWE_WavePropagationBlock
::
updateBathymetryWithDynamicDisplacement
(
SWE_AsagiScenario
&
i_asagiScenario
,
const
float
i_time
)
{
if
(
!
i_asagiScenario
.
dynamicDisplacementAvailable
(
i_time
))
if
(
!
i_asagiScenario
.
dynamicDisplacementAvailable
(
i_time
))
return
false
;
return
false
;
...
...
src/SWE_WavePropagationBlock.hh
View file @
d8b4a061
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
#include "tools/help.hh"
#include "tools/help.hh"
#include "SWE_Block.hh"
#include "SWE_Block.hh"
#ifdef DYNAMIC_DISPLACEMENTS
#ifdef DYNAMIC_DISPLACEMENTS
#include "scenarios/
Asagi
.hpp"
#include "scenarios/
SWE_AsagiScenario
.hpp"
#endif
#endif
//which wave propagation solver should be used
//which wave propagation solver should be used
...
@@ -136,7 +136,7 @@ class SWE_WavePropagationBlock: public SWE_Block {
...
@@ -136,7 +136,7 @@ class SWE_WavePropagationBlock: public SWE_Block {
//updates the bathymetry with the current displacment values
//updates the bathymetry with the current displacment values
#ifdef DYNAMIC_DISPLACEMENTS
#ifdef DYNAMIC_DISPLACEMENTS
bool
updateBathymetryWithDynamicDisplacement
(
scenarios
::
Asagi
&
i_asagiScenario
,
float
time
);
bool
updateBathymetryWithDynamicDisplacement
(
SWE_AsagiScenario
&
i_asagiScenario
,
float
time
);
#endif
#endif
//get hybrid statistics
//get hybrid statistics
...
...
src/examples/swe_mpi.cpp
View file @
d8b4a061
...
@@ -206,8 +206,8 @@ int main( int argc, char** argv ) {
...
@@ -206,8 +206,8 @@ int main( int argc, char** argv ) {
simulationArea
[
3
]
=
1450000
;
simulationArea
[
3
]
=
1450000
;
SWE_AsagiScenario
l_scenario
(
ASAGI_INPUT_DIR
"tohoku_gebco_ucsb3_500m_hawaii_bath.nc"
,
SWE_AsagiScenario
l_scenario
(
ASAGI_INPUT_DIR
"tohoku_gebco_ucsb3_500m_hawaii_bath.nc"
,
ASAGI_INPUT_DIR
"tohoku_
gebco_ucsb3_500m_hawaii
_displ.nc"
,
ASAGI_INPUT_DIR
"tohoku_
percy_500m
_displ.nc"
,
(
float
)
14400.
,
simulationArea
);
(
float
)
14400.
,
simulationArea
,
true
);
#else
#else
// create a simple artificial scenario
// create a simple artificial scenario
SWE_BathymetryDamBreakScenario
l_scenario
;
SWE_BathymetryDamBreakScenario
l_scenario
;
...
@@ -415,6 +415,8 @@ int main( int argc, char** argv ) {
...
@@ -415,6 +415,8 @@ int main( int argc, char** argv ) {
unsigned
int
l_iterations
=
0
;
unsigned
int
l_iterations
=
0
;
bool
displAvail
=
true
;
// loop over checkpoints
// loop over checkpoints
for
(
int
c
=
1
;
c
<=
l_numberOfCheckPoints
;
c
++
)
{
for
(
int
c
=
1
;
c
<=
l_numberOfCheckPoints
;
c
++
)
{
...
@@ -453,6 +455,10 @@ int main( int argc, char** argv ) {
...
@@ -453,6 +455,10 @@ int main( int argc, char** argv ) {
// determine smallest time step of all blocks
// determine smallest time step of all blocks
MPI_Allreduce
(
&
l_maxTimeStepWidth
,
&
l_maxTimeStepWidthGlobal
,
1
,
MPI_FLOAT
,
MPI_MIN
,
MPI_COMM_WORLD
);
MPI_Allreduce
(
&
l_maxTimeStepWidth
,
&
l_maxTimeStepWidthGlobal
,
1
,
MPI_FLOAT
,
MPI_MIN
,
MPI_COMM_WORLD
);
if
(
displAvail
)
// Minimum available time step in dynamic displacements = 1.65
l_maxTimeStepWidthGlobal
=
std
::
min
(
l_maxTimeStepWidthGlobal
,
1.65
f
);
// reset the cpu time
// reset the cpu time
tools
::
Logger
::
logger
.
resetCpuClockToCurrentTime
();
tools
::
Logger
::
logger
.
resetCpuClockToCurrentTime
();
...
@@ -467,6 +473,9 @@ int main( int argc, char** argv ) {
...
@@ -467,6 +473,9 @@ int main( int argc, char** argv ) {
l_t
+=
l_maxTimeStepWidthGlobal
;
l_t
+=
l_maxTimeStepWidthGlobal
;
l_iterations
++
;
l_iterations
++
;
// Update displacement
displAvail
=
l_wavePropgationBlock
.
updateBathymetryWithDynamicDisplacement
(
l_scenario
,
l_t
);
// print the current simulation time
// print the current simulation time
progressBar
.
clear
();
progressBar
.
clear
();
tools
::
Logger
::
logger
.
printSimulationTime
(
l_t
);
tools
::
Logger
::
logger
.
printSimulationTime
(
l_t
);
...
...
src/scenarios/SWE_AsagiScenario.hpp
View file @
d8b4a061
...
@@ -47,7 +47,7 @@ private:
...
@@ -47,7 +47,7 @@ private:
public
:
public
:
SWE_AsagiGrid
()
SWE_AsagiGrid
()
{
{
_grid
=
asagi
::
Grid
::
create
();
_grid
=
asagi
::
Grid
::
create
(
asagi
::
Grid
::
FLOAT
);
_refCount
=
0
;
_refCount
=
0
;
}
}
...
@@ -240,6 +240,9 @@ class SWE_AsagiScenario: public SWE_Scenario {
...
@@ -240,6 +240,9 @@ class SWE_AsagiScenario: public SWE_Scenario {
//assert(dynamicDisplacement == false);
//assert(dynamicDisplacement == false);
// no assertation for compability
// no assertation for compability
if
(
dynamicDisplacement
)
return
0
;
return
getBathymetryAndDynamicDisplacement
(
i_positionX
,
i_positionY
,
0
);
return
getBathymetryAndDynamicDisplacement
(
i_positionX
,
i_positionY
,
0
);
}
}
...
...
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