Fix for dynamic displacements and wall/outflow boundaries

parent 8090ae66
...@@ -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(scenarios ...@@ -269,6 +269,9 @@ bool SWE_WavePropagationBlock::updateBathymetryWithDynamicDisplacement(scenarios
); );
} }
} }
setBoundaryBathymetry();
return true; return true;
} }
#endif #endif
......
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