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
0c229f02
Commit
0c229f02
authored
Oct 11, 2012
by
Sebastian Rettenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix opengl version
parent
4536f332
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
9 deletions
+53
-9
swe_opengl.cpp
src/examples/swe_opengl.cpp
+1
-1
simulation.cu
src/opengl/simulation.cu
+3
-4
SWE_simple_scenarios.h
src/scenarios/SWE_simple_scenarios.h
+49
-4
No files found.
src/examples/swe_opengl.cpp
View file @
0c229f02
src/opengl/simulation.cu
View file @
0c229f02
...
...
@@ -243,11 +243,10 @@ void Simulation::calculateWaterSurface(float3* destBuffer) {
if (isFirstStep == 1) {
isFirstStep = 0;
} else {
//splash->simulateConstTimestep();
// curTime = splash->simulate(curTime, curTime + 5*splash->getMaxTimestep());
float dt = splash->getMaxTimestep();
splash->setGhostLayer();
splash->simulateTimestep(dt);
splash->computeNumericalFluxes();
float dt = splash->getMaxTimestep();
splash->updateUnknowns(dt);
curTime += dt;
}
// splash->updateVisBuffer(destBuffer, wAverage, wScale, wOffset);
...
...
src/scenarios/SWE_simple_scenarios.h
View file @
0c229f02
...
...
@@ -40,11 +40,33 @@ class SWE_RadialDamBreakScenario : public SWE_Scenario {
public
:
float
getBathymetry
(
float
x
,
float
y
)
{
return
-
250
.
f
;
};
float
getWaterHeight
(
float
x
,
float
y
)
{
return
(
sqrt
(
(
x
-
0
.
5
f
)
*
(
x
-
0
.
5
f
)
+
(
y
-
0
.
5
f
)
*
(
y
-
0
.
5
f
)
)
<
0
.
1
f
)
?
10
.
5
f
:
1
0
.
0
f
;
return
(
sqrt
(
(
x
-
500
.
f
)
*
(
x
-
500
.
f
)
+
(
y
-
500
.
f
)
*
(
y
-
500
.
f
)
)
<
100
.
f
)
?
261
.
f
:
26
0
.
0
f
;
};
virtual
float
endSimulation
()
{
return
(
float
)
15
;
};
virtual
BoundaryType
getBoundaryType
(
BoundaryEdge
edge
)
{
return
OUTFLOW
;
};
/** Get the boundary positions
*
* @param i_edge which edge
* @return value in the corresponding dimension
*/
float
getBoundaryPos
(
BoundaryEdge
i_edge
)
{
if
(
i_edge
==
BND_LEFT
)
return
(
float
)
0
;
else
if
(
i_edge
==
BND_RIGHT
)
return
(
float
)
1000
;
else
if
(
i_edge
==
BND_BOTTOM
)
return
(
float
)
0
;
else
return
(
float
)
1000
;
};
};
/**
...
...
@@ -56,7 +78,7 @@ class SWE_BathymetryDamBreakScenario : public SWE_Scenario {
public
:
float
getBathymetry
(
float
x
,
float
y
)
{
return
(
std
::
sqrt
(
(
x
-
500
.
f
)
*
(
x
-
500
.
f
)
+
(
y
-
500
.
f
)
*
(
y
-
500
.
f
)
)
<
50
.
f
)
?
-
25
0
.
f
:
-
260
.
f
;
return
(
std
::
sqrt
(
(
x
-
500
.
f
)
*
(
x
-
500
.
f
)
+
(
y
-
500
.
f
)
*
(
y
-
500
.
f
)
)
<
50
.
f
)
?
-
25
5
.
f
:
-
260
.
f
;
};
virtual
float
endSimulation
()
{
return
(
float
)
15
;
};
...
...
@@ -119,8 +141,31 @@ class SWE_SplashingPoolScenario : public SWE_Scenario {
public
:
float
getWaterHeight
(
float
x
,
float
y
)
{
return
10
.
0
f
+
(
1
.
0
f
-
(
x
+
y
));};
float
endSimulation
()
{
return
1
.
0
f
;
};
float
getBathymetry
(
float
x
,
float
y
)
{
return
-
250
.
f
;
};
float
getWaterHeight
(
float
x
,
float
y
)
{
return
260
.
0
f
+
(
1
.
0
f
-
(
x
+
y
)
/
1000
);
};
virtual
float
endSimulation
()
{
return
(
float
)
15
;
};
/** Get the boundary positions
*
* @param i_edge which edge
* @return value in the corresponding dimension
*/
float
getBoundaryPos
(
BoundaryEdge
i_edge
)
{
if
(
i_edge
==
BND_LEFT
)
return
(
float
)
0
;
else
if
(
i_edge
==
BND_RIGHT
)
return
(
float
)
1000
;
else
if
(
i_edge
==
BND_BOTTOM
)
return
(
float
)
0
;
else
return
(
float
)
1000
;
};
};
...
...
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