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
42d1883c
Commit
42d1883c
authored
Jan 21, 2013
by
Sebastian Rettenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for dynamic displacements and wall/outflow boundaries
parent
8090ae66
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
21 deletions
+40
-21
SWE_Block.cpp
src/SWE_Block.cpp
+34
-21
SWE_Block.hh
src/SWE_Block.hh
+3
-0
SWE_WavePropagationBlock.cpp
src/SWE_WavePropagationBlock.cpp
+3
-0
No files found.
src/SWE_Block.cpp
View file @
42d1883c
...
...
@@ -343,29 +343,42 @@ void SWE_Block::setOutflowBoundaries() {
void
SWE_Block
::
setBoundaryType
(
const
BoundaryEdge
i_edge
,
const
BoundaryType
i_boundaryType
,
const
SWE_Block1D
*
i_inflow
)
{
boundary
[
i_edge
]
=
i_boundaryType
;
neighbour
[
i_edge
]
=
i_inflow
;
boundary
[
i_edge
]
=
i_boundaryType
;
neighbour
[
i_edge
]
=
i_inflow
;
// set bathymetry values in the ghost layer, if necessary
if
(
boundary
[
BND_LEFT
]
==
OUTFLOW
||
boundary
[
BND_LEFT
]
==
WALL
)
{
memcpy
(
b
[
0
],
b
[
1
],
sizeof
(
float
)
*
(
ny
+
2
));
}
if
(
boundary
[
BND_RIGHT
]
==
OUTFLOW
||
boundary
[
BND_RIGHT
]
==
WALL
)
{
memcpy
(
b
[
nx
+
1
],
b
[
nx
],
sizeof
(
float
)
*
(
ny
+
2
));
}
if
(
boundary
[
BND_BOTTOM
]
==
OUTFLOW
||
boundary
[
BND_BOTTOM
]
==
WALL
)
{
for
(
int
i
=
0
;
i
<=
nx
+
1
;
i
++
)
{
b
[
i
][
0
]
=
b
[
i
][
1
];
}
}
if
(
boundary
[
BND_TOP
]
==
OUTFLOW
||
boundary
[
BND_TOP
]
==
WALL
)
{
for
(
int
i
=
0
;
i
<=
nx
+
1
;
i
++
)
{
b
[
i
][
ny
+
1
]
=
b
[
i
][
ny
];
}
}
if
(
i_boundaryType
==
OUTFLOW
||
i_boundaryType
==
WALL
)
// One of the boundary was changed to OUTFLOW or WALL
// -> Update the bathymetry for this boundary
setBoundaryBathymetry
();
}
// synchronize after an external update of the bathymetry
synchBathymetryAfterWrite
();
/**
* 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
if
(
boundary
[
BND_LEFT
]
==
OUTFLOW
||
boundary
[
BND_LEFT
]
==
WALL
)
{
memcpy
(
b
[
0
],
b
[
1
],
sizeof
(
float
)
*
(
ny
+
2
));
}
if
(
boundary
[
BND_RIGHT
]
==
OUTFLOW
||
boundary
[
BND_RIGHT
]
==
WALL
)
{
memcpy
(
b
[
nx
+
1
],
b
[
nx
],
sizeof
(
float
)
*
(
ny
+
2
));
}
if
(
boundary
[
BND_BOTTOM
]
==
OUTFLOW
||
boundary
[
BND_BOTTOM
]
==
WALL
)
{
for
(
int
i
=
0
;
i
<=
nx
+
1
;
i
++
)
{
b
[
i
][
0
]
=
b
[
i
][
1
];
}
}
if
(
boundary
[
BND_TOP
]
==
OUTFLOW
||
boundary
[
BND_TOP
]
==
WALL
)
{
for
(
int
i
=
0
;
i
<=
nx
+
1
;
i
++
)
{
b
[
i
][
ny
+
1
]
=
b
[
i
][
ny
];
}
}
// synchronize after an external update of the bathymetry
synchBathymetryAfterWrite
();
}
// /**
...
...
src/SWE_Block.hh
View file @
42d1883c
...
...
@@ -232,6 +232,9 @@ class SWE_Block {
SWE_Block
();
virtual
~
SWE_Block
();
// Sets the bathymetry on outflow and wall boundaries
void
setBoundaryBathymetry
();
// synchronisation Methods
virtual
void
synchAfterWrite
();
virtual
void
synchWaterHeightAfterWrite
();
...
...
src/SWE_WavePropagationBlock.cpp
View file @
42d1883c
...
...
@@ -269,6 +269,9 @@ bool SWE_WavePropagationBlock::updateBathymetryWithDynamicDisplacement(scenarios
);
}
}
setBoundaryBathymetry
();
return
true
;
}
#endif
...
...
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