Commit ab82b8eb authored by Sebastian Rettenberger's avatar Sebastian Rettenberger

Merge branch 'master' into dynamic_displ

parents c701ffb6 42d1883c
...@@ -281,6 +281,9 @@ if 'libSDLDir' in env: ...@@ -281,6 +281,9 @@ if 'libSDLDir' in env:
if env['writeNetCDF'] == True: if env['writeNetCDF'] == True:
env.Append(CPPDEFINES=['WRITENETCDF']) env.Append(CPPDEFINES=['WRITENETCDF'])
env.Append(LIBS=['netcdf']) env.Append(LIBS=['netcdf'])
# define MPI_INCLUDED, if writeNetCDF is used together with MPI
if env['parallelization'] != 'none' and env['parallelization'] != 'cuda':
env.Append(CPPDEFINES=['MPI_INCLUDED'])
# set netCDF location # set netCDF location
if 'netCDFDir' in env: if 'netCDFDir' in env:
env.Append(CPPPATH=[env['netCDFDir']+'/include']) env.Append(CPPPATH=[env['netCDFDir']+'/include'])
......
...@@ -346,6 +346,19 @@ void SWE_Block::setBoundaryType( const BoundaryEdge i_edge, ...@@ -346,6 +346,19 @@ void SWE_Block::setBoundaryType( const BoundaryEdge i_edge,
boundary[i_edge] = i_boundaryType; boundary[i_edge] = i_boundaryType;
neighbour[i_edge] = i_inflow; neighbour[i_edge] = i_inflow;
if (i_boundaryType == OUTFLOW || i_boundaryType == WALL)
// One of the boundary was changed to OUTFLOW or WALL
// -> Update the bathymetry for this boundary
setBoundaryBathymetry();
}
/**
* Sets the bathymetry on OUTFLOW or WALL boundaries.
* Should be called very time a boundary is changed to a OUTFLOW or
* WALL boundary <b>or</b> the bathymetry changes.
*/
void SWE_Block::setBoundaryBathymetry()
{
// set bathymetry values in the ghost layer, if necessary // set bathymetry values in the ghost layer, if necessary
if( boundary[BND_LEFT] == OUTFLOW || boundary[BND_LEFT] == WALL ) { if( boundary[BND_LEFT] == OUTFLOW || boundary[BND_LEFT] == WALL ) {
memcpy(b[0], b[1], sizeof(float)*(ny+2)); memcpy(b[0], b[1], sizeof(float)*(ny+2));
......
...@@ -232,6 +232,9 @@ class SWE_Block { ...@@ -232,6 +232,9 @@ class SWE_Block {
SWE_Block(); SWE_Block();
virtual ~SWE_Block(); virtual ~SWE_Block();
// Sets the bathymetry on outflow and wall boundaries
void setBoundaryBathymetry();
// synchronisation Methods // synchronisation Methods
virtual void synchAfterWrite(); virtual void synchAfterWrite();
virtual void synchWaterHeightAfterWrite(); virtual void synchWaterHeightAfterWrite();
......
...@@ -269,6 +269,9 @@ bool SWE_WavePropagationBlock::updateBathymetryWithDynamicDisplacement(SWE_Asagi ...@@ -269,6 +269,9 @@ bool SWE_WavePropagationBlock::updateBathymetryWithDynamicDisplacement(SWE_Asagi
); );
} }
} }
setBoundaryBathymetry();
return true; return true;
} }
#endif #endif
......
...@@ -32,6 +32,12 @@ ...@@ -32,6 +32,12 @@
#include <cstring> #include <cstring>
#include <string> #include <string>
#include <vector> #include <vector>
// Needed for NetCDF
#ifdef USEMPI
#include <mpi.h>
#endif
#include <netcdf.h> #include <netcdf.h>
#include "writer/Writer.hh" #include "writer/Writer.hh"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment