From ed0702dae8fb81a1f4929a39e5b44fc1c416cbb4 Mon Sep 17 00:00:00 2001 From: Emilie Marchandise <emilie.marchandise@uclouvain.be> Date: Tue, 15 Dec 2009 09:23:17 +0000 Subject: [PATCH] --- Solver/TESTCASES/Stommel.lua | 4 ++-- Solver/TESTCASES/WavePulse.lua | 33 +++++++++++++++++---------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Solver/TESTCASES/Stommel.lua b/Solver/TESTCASES/Stommel.lua index 3081a4b5ca..c7f720c307 100644 --- a/Solver/TESTCASES/Stommel.lua +++ b/Solver/TESTCASES/Stommel.lua @@ -1,11 +1,11 @@ -order = 3 + model = GModel() model:load ('stommel_square.msh') print('load..') dg = dgSystemOfEquations (model) -dg:setOrder (order) +dg:setOrder (3) dg:setConservationLaw('ShallowWater2d') diff --git a/Solver/TESTCASES/WavePulse.lua b/Solver/TESTCASES/WavePulse.lua index 46da82fa2d..a4d0074051 100644 --- a/Solver/TESTCASES/WavePulse.lua +++ b/Solver/TESTCASES/WavePulse.lua @@ -1,17 +1,17 @@ --[[ 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) +function initial_condition( _x , _f ) + xyz = fullMatrix(_x) + f = 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) + f:set(i,0,7) + f:set(i,1,0.0) + f:set(i,2,0.0) end end @@ -19,14 +19,14 @@ end Example of a lua program driving the DG code --]] -order = 5 print'*** Loading the mesh and the model ***' myModel = GModel () -myModel:load ('box.geo') -myModel:load ('box.msh') +myModel:load('square.geo') +myModel:mesh(2) + print'*** Create a dg solver ***' DG = dgSystemOfEquations (myModel) -DG:setOrder(order) +DG:setOrder(1) DG:setConservationLaw('WaveEquation') DG:addBoundaryCondition('Border','Wall') @@ -45,11 +45,12 @@ DG:exportSolution('output/solution_000') print'*** solve ***' dt = 0.00125; -for i=1,1000 do +N = 1; +for i=1,N do norm = DG:RK44(dt) print('*** ITER ***',i,norm) if (i % 10 == 0) then - DG:exportSolution(string.format("output/solution-%03d", i)) + DG:exportSolution(string.format("solution-%03d", i)) end end -- GitLab