diff --git a/Solver/TESTCASES/Stommel.lua b/Solver/TESTCASES/Stommel.lua index 3081a4b5ca300549eeb611698a96bf4023437ce8..c7f720c3074173b24f5d4d3425ef61d58f2ad4d3 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 46da82fa2d967ba40aeb909c8a366aa29f6f446f..a4d007405150394d830d82fe476e6b90feec1252 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