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
dd951870
There was an error fetching the commit references. Please try again later.
Commit
dd951870
authored
10 years ago
by
Tomáš Oberhuber
Browse files
Options
Downloads
Patches
Plain Diff
Writing heat equation EOC test script.
parent
46715b6e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/heat-equation/tnl-run-heat-equation-eoc-test
+141
-74
141 additions, 74 deletions
examples/heat-equation/tnl-run-heat-equation-eoc-test
with
141 additions
and
74 deletions
examples/heat-equation/tnl-run-heat-equation-eoc-test
+
141
−
74
View file @
dd951870
#!/bin/bash
dofSize
=
64
dimension
=
2
proportions
=
1
solverName
=
"tnl-heat-equation-eoc-test"
device
=
"host"
dimensions
=
"1D 2D 3D"
sizes1D
=
"16 32 64 128 256 512"
sizes2D
=
"16 32 64 128 256 512"
sizes3D
=
"16 32 64 128"
testFunctions
=
"exp-bump"
snapshotPeriod
=
0.1
finalTime
=
1
analyticFunction
=
"exp-bump"
timeFunction
=
"cosinus"
setupTestFunction
()
{
testFunction
=
$1
if
test
x
${
testFunction
}
=
"xexp-bump"
;
then
origin
=
-1
.0
proportions
=
2.0
amplitude
=
1.0
waveLength
=
1.0
waveLengthX
=
1.0
waveLengthY
=
1.0
waveLengthZ
=
1.0
wavesNumber
=
0.0
wavesNumberX
=
0.0
wavesNumberY
=
0.0
wavesNumberZ
=
0.0
phase
=
0.0
phaseX
=
0.0
phaseY
=
0.0
phaseZ
=
0.0
sigma
=
0.5
fi
}
amplitude
=
1.0
waveLength
=
1.0
waveLengthX
=
1.0
waveLengthY
=
1.0
waveLengthZ
=
1.0
wavesNumber
=
0.0
wavesNumberX
=
0.0
wavesNumberY
=
0.0
wavesNumberZ
=
0.0
phase
=
0.0
phaseX
=
0.0
phaseY
=
0.0
phaseZ
=
0.0
sigma
=
1.0
setupGrid
()
{
dimensions
=
$1
gridSize
=
$2
tnl-grid-setup
--dimensions
${
dimensions
}
\
--origin-x
${
origin
}
\
--origin-y
${
origin
}
\
--origin-z
${
origin
}
\
--proportions-x
${
proportions
}
\
--proportions-y
${
proportions
}
\
--proportions-z
${
proportions
}
\
--size-x
${
gridSize
}
\
--size-y
${
gridSize
}
\
--size-z
${
gridSize
}
}
tnl-grid-setup
--dimensions
${
dimension
}
\
--proportions-x
${
proportions
}
\
--proportions-y
${
proportions
}
\
--proportions-z
${
proportions
}
\
--origin-x
0
\
--origin-y
0
\
--origin-z
0
\
--size-x
${
dofSize
}
\
--size-y
${
dofSize
}
\
--size-z
${
dofSize
}
\
setInitialCondition
()
{
testFunction
=
$1
tnl-init
--function
${
testFunction
}
\
--output-file
init.tnl
\
--amplitude
${
amplitude
}
\
--wave-length
${
waveLength
}
\
--wave-length-x
${
waveLengthX
}
\
--wave-length-y
${
waveLengthY
}
\
--wave-length-z
${
waveLengthZ
}
\
--waves-number
${
wavesNumber
}
\
--waves-number-x
${
wavesNumberX
}
\
--waves-number-y
${
wavesNumberY
}
\
--waves-number-z
${
wavesNumberZ
}
\
--phase
${
phase
}
\
--phase-x
${
phaseX
}
\
--phase-y
${
phaseY
}
\
--phase-z
${
phaseZ
}
\
--sigma
${
sigma
}
}
solve
()
{
timeDiscretisation
=
$1
discreteSolver
=
$2
${
solverName
}
--mesh
mesh.tnl
\
--time-discretisation
${
timeDiscretisation
}
\
--discrete-solver
${
discreteSolver
}
\
--test-function
${
testFunction
}
\
--amplitude
${
amplitude
}
\
--wave-length
${
waveLength
}
\
--wave-length-x
${
waveLengthX
}
\
--wave-length-y
${
waveLengthY
}
\
--wave-length-z
${
waveLengthZ
}
\
--waves-number
${
wavesNumber
}
\
--waves-number-x
${
wavesNumberX
}
\
--waves-number-y
${
wavesNumberY
}
\
--waves-number-z
${
wavesNumberZ
}
\
--phase
${
phase
}
\
--phase-x
${
phaseX
}
\
--phase-y
${
phaseY
}
\
--phase-z
${
phaseZ
}
\
--sigma
${
sigma
}
\
--snapshot-period
${
snapshotPeriod
}
\
--final-time
${
finalTime
}
}
tnl-discrete
--mesh
mesh.tnl
\
--function
${
analyticFunction
}
\
--output-file
u-ini.tnl
\
--amplitude
${
amplitude
}
\
--wave-length
${
waveLength
}
\
--wave-length-x
${
waveLengthX
}
\
--wave-length-y
${
waveLengthY
}
\
--wave-length-z
${
waveLengthZ
}
\
--waves-number
${
wavesNumber
}
\
--waves-number-x
${
wavesNumberX
}
\
--waves-number-y
${
wavesNumberY
}
\
--waves-number-z
${
wavesNumberZ
}
\
--phase
${
phase
}
\
--phase-x
${
phaseX
}
\
--phase-y
${
phaseY
}
\
--phase-z
${
phaseZ
}
\
--sigma
${
sigma
}
\
computeError
()
{
tnl-diff
--mesh
mesh.tnl
\
--input-files
numericalSolution-
*
.tnl analyticSolution-
*
.tnl
\
--mode
halves
\
--output-file
${
dofSize
}
-dofs
}
./heat-equation
--dimensions
${
dimension
}
\
--time-discretisation
explicit
\
--discrete-solver
merson
\
--time-function
${
timeFunction
}
\
--analytic-space-function
${
analyticFunction
}
\
--amplitude
${
amplitude
}
\
--wave-length
${
waveLength
}
\
--wave-length-x
${
waveLengthX
}
\
--wave-length-y
${
waveLengthY
}
\
--wave-length-z
${
waveLengthZ
}
\
--waves-number
${
wavesNumber
}
\
--waves-number-x
${
wavesNumberX
}
\
--waves-number-y
${
wavesNumberY
}
\
--waves-number-z
${
wavesNumberZ
}
\
--phase
${
phase
}
\
--phase-x
${
phaseX
}
\
--phase-y
${
phaseY
}
\
--phase-z
${
phaseZ
}
\
--sigma
${
sigma
}
\
--snapshot-period
0.05
\
--final-time
1.0
\
--solution-convergence-test
1
\
runTest
()
{
for
testFunction
in
${
testFunctions
}
;
do
mkdir
-p
${
testFunction
}
cd
${
testFunction
}
setupTestFunction
${
testFunction
}
for
dim
in
${
dimensions
}
;
do
mkdir
-p
$dim
cd
${
dim
}
if
test
$dim
=
1D
;
then
sizes
=
$sizes1D
fi
if
test
$dim
=
2D
;
then
sizes
=
$sizes2D
fi
if
test
$dim
=
3D
;
then
sizes
=
$sizes3D
fi
for
size
in
$sizes
;
do
mkdir
-p
$size
cd
$size
setupGrid
$dim
$size
setInitialCondition
$testFunction
solve explicit merson
cd
..
done
rm
u-ini.tnl
cd
..
done
cd
..
done
}
tnl-diff
--mesh
mesh.tnl
\
--input-files
numericalSolution-
*
.tnl analyticSolution-
*
.tnl
\
--mode
halves
\
--output-file
${
dofSize
}
-dofs
\
runTest
rm
*
.tnl
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