Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
c443a606
Commit
c443a606
authored
15 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
Lua input files for gmshlua
parent
c303cfb9
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
Solver/TESTCASES/WavePulse.lua
+58
-0
58 additions, 0 deletions
Solver/TESTCASES/WavePulse.lua
Solver/TESTCASES/square.geo
+12
-0
12 additions, 0 deletions
Solver/TESTCASES/square.geo
with
70 additions
and
0 deletions
Solver/TESTCASES/WavePulse.lua
0 → 100644
+
58
−
0
View file @
c443a606
--[[
Function for initial conditions
--]]
function
initial_condition
(
x
,
f
)
XYZ
=
fullMatrix
(
x
)
FCT
=
fullMatrix
(
f
)
for
i
=
0
,
XYZ
:
size1
()
-
1
do
X
=
XYZ
:
get
(
i
,
0
)
-
.
5
Y
=
XYZ
:
get
(
i
,
1
)
-
.
5
Z
=
XYZ
:
get
(
i
,
2
)
VALUE
=
math.exp
(
-
40
*
(
X
*
X
+
Y
*
Y
+
Z
*
Z
));
FCT
:
set
(
i
,
0
,
VALUE
)
FCT
:
set
(
i
,
1
,
0
.
0
)
FCT
:
set
(
i
,
2
,
0
.
0
)
end
end
--[[
Example of a lua program driving the DG code
--]]
order
=
1
print
'*** Loading the mesh and the model ***'
myModel
=
GModel
()
myModel
:
load
(
'square.geo'
)
myModel
:
load
(
'square.msh'
)
print
'*** Create a dg solver ***'
DG
=
dgSystemOfEquations
(
myModel
)
DG
:
setOrder
(
order
)
DG
:
setConservationLaw
(
'WaveEquation'
)
DG
:
addBoundaryCondition
(
'Border'
,
'Wall'
)
DG
:
setup
()
initialCondition
=
createFunction
.
lua
(
3
,
'initial_condition'
,
'XYZ'
)
print
'*** setting the initial solution ***'
DG
:
L2Projection
(
initialCondition
)
print
'*** export ***'
DG
:
exportSolution
(
'solution_0'
)
print
'*** solve ***'
dt
=
0
.
005
;
for
i
=
1
,
1000
do
norm
=
DG
:
RK44
(
dt
)
print
(
'*** ITER ***'
,
i
,
norm
)
if
(
i
%
10
==
0
)
then
AA
=
string.format
(
"solution-%03d"
,
i
)
DG
:
exportSolution
(
AA
)
end
end
print
'*** done ***'
This diff is collapsed.
Click to expand it.
Solver/TESTCASES/square.geo
0 → 100644
+
12
−
0
View file @
c443a606
Point
(
1
)
=
{
0.0
,
0.0
,
0
,
.03
};
Point
(
2
)
=
{
1
,
0.0
,
0
,
.03
};
Point
(
3
)
=
{
1
,
1
,
0
,
.03
};
Point
(
4
)
=
{
0
,
1
,
0
,
.03
};
Line
(
1
)
=
{
4
,
3
};
Line
(
2
)
=
{
3
,
2
};
Line
(
3
)
=
{
2
,
1
};
Line
(
4
)
=
{
1
,
4
};
Line
Loop
(
5
)
=
{
2
,
3
,
4
,
1
};
Plane
Surface
(
6
)
=
{
5
};
Physical
Line
(
"Border"
)
=
{
1
,
2
,
3
,
4
};
Physical
Surface
(
"Inside"
)
=
{
6
};
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