Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
cd6c5192
There was an error fetching the commit references. Please try again later.
Commit
cd6c5192
authored
8 years ago
by
Tomáš Oberhuber
Browse files
Options
Downloads
Patches
Plain Diff
Fixing Lax-Fridrichs scheme for CUDA.
parent
8110508d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/advection/tnl-run-advection1
+0
-24
0 additions, 24 deletions
examples/advection/tnl-run-advection1
src/TNL/Operators/Advection/LaxFridrichs.h
+6
-6
6 additions, 6 deletions
src/TNL/Operators/Advection/LaxFridrichs.h
with
6 additions
and
30 deletions
examples/advection/tnl-run-advection1
deleted
100644 → 0
+
0
−
24
View file @
8110508d
#!/usr/bin/env bash
tnl-grid-setup
--dimensions
2
\
--origin-x
0.0
\
--origin-y
0.0
\
--proportions-x
10.0
\
--proportions-y
10.0
\
--size-x
500
\
--size-y
500
\
#tnl-init --test-function sin-wave \
# --output-file init.tnl
./advection
--time-discretisation
explicit
\
--time-step
1.0e-3
\
--boundary-conditions-constant
0
\
--discrete-solver
euler
\
--snapshot-period
0.1
\
--final-time
1.0
\
--artifical-viscosity
0.2
\
--begin
sin_square
\
--advection-speedX
2.0
\
--advection-speedY
2.0
\
tnl-view
--mesh
mesh.tnl
--input-files
*
tnl
This diff is collapsed.
Click to expand it.
src/TNL/Operators/Advection/LaxFridrichs.h
+
6
−
6
View file @
cd6c5192
...
...
@@ -99,7 +99,7 @@ class LaxFridrichs< Meshes::Grid< 1, MeshReal, Device, MeshIndex >, Real, Index,
const
IndexType
&
west
=
neighbourEntities
.
template
getEntityIndex
<
-
1
>();
typedef
Functions
::
FunctionAdapter
<
MeshType
,
VelocityFunctionType
>
FunctionAdapter
;
return
(
0.5
/
this
->
tau
)
*
this
->
artificialViscosity
*
(
u
[
west
]
-
2.0
*
u
[
center
]
+
u
[
east
]
)
-
FunctionAdapter
::
getValue
(
this
->
velocityField
.
getData
()[
0
],
entity
,
time
)
*
(
u
[
east
]
-
u
[
west
]
)
*
hxInverse
*
0.5
;
FunctionAdapter
::
getValue
(
this
->
velocityField
.
template
getData
<
DeviceType
>
()[
0
],
entity
,
time
)
*
(
u
[
east
]
-
u
[
west
]
)
*
hxInverse
*
0.5
;
}
protected
:
...
...
@@ -196,8 +196,8 @@ class LaxFridrichs< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, Real, Index,
typedef
Functions
::
FunctionAdapter
<
MeshType
,
VelocityFunctionType
>
FunctionAdapter
;
return
(
0.25
/
this
->
tau
)
*
this
->
artificialViscosity
*
(
u
[
west
]
+
u
[
east
]
+
u
[
north
]
+
u
[
south
]
-
4.0
*
u
[
center
]
)
-
0.5
*
(
FunctionAdapter
::
getValue
(
this
->
velocityField
.
getData
()[
0
],
entity
,
time
)
*
(
u
[
east
]
-
u
[
west
]
)
*
hxInverse
+
FunctionAdapter
::
getValue
(
this
->
velocityField
.
getData
()[
1
],
entity
,
time
)
*
(
u
[
north
]
-
u
[
south
]
)
*
hyInverse
);
0.5
*
(
FunctionAdapter
::
getValue
(
this
->
velocityField
.
template
getData
<
DeviceType
>
()[
0
],
entity
,
time
)
*
(
u
[
east
]
-
u
[
west
]
)
*
hxInverse
+
FunctionAdapter
::
getValue
(
this
->
velocityField
.
template
getData
<
DeviceType
>
()[
1
],
entity
,
time
)
*
(
u
[
north
]
-
u
[
south
]
)
*
hyInverse
);
}
protected
:
...
...
@@ -296,9 +296,9 @@ class LaxFridrichs< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, Real, Index,
typedef
Functions
::
FunctionAdapter
<
MeshType
,
VelocityFunctionType
>
FunctionAdapter
;
return
(
0.25
/
this
->
tau
)
*
this
->
artificialViscosity
*
(
u
[
west
]
+
u
[
east
]
+
u
[
north
]
+
u
[
south
]
+
u
[
up
]
+
u
[
down
]
-
6.0
*
u
[
center
]
)
-
0.5
*
(
FunctionAdapter
::
getValue
(
this
->
velocityField
.
getData
()[
0
],
entity
,
time
)
*
(
u
[
east
]
-
u
[
west
]
)
*
hxInverse
+
FunctionAdapter
::
getValue
(
this
->
velocityField
.
getData
()[
1
],
entity
,
time
)
*
(
u
[
north
]
-
u
[
south
]
)
*
hyInverse
+
FunctionAdapter
::
getValue
(
this
->
velocityField
.
getData
()[
2
],
entity
,
time
)
*
(
u
[
up
]
-
u
[
down
]
)
*
hzInverse
);
0.5
*
(
FunctionAdapter
::
getValue
(
this
->
velocityField
.
template
getData
<
DeviceType
>
()[
0
],
entity
,
time
)
*
(
u
[
east
]
-
u
[
west
]
)
*
hxInverse
+
FunctionAdapter
::
getValue
(
this
->
velocityField
.
template
getData
<
DeviceType
>
()[
1
],
entity
,
time
)
*
(
u
[
north
]
-
u
[
south
]
)
*
hyInverse
+
FunctionAdapter
::
getValue
(
this
->
velocityField
.
template
getData
<
DeviceType
>
()[
2
],
entity
,
time
)
*
(
u
[
up
]
-
u
[
down
]
)
*
hzInverse
);
}
protected
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment