From f9f6f7937b746cf858121313d12d13cd3b416a85 Mon Sep 17 00:00:00 2001
From: Jonathan Lambrechts <jonathan.lambrechts@uclouvain.be>
Date: Thu, 18 Mar 2010 09:35:30 +0000
Subject: [PATCH] dg : test 1D

---
 Solver/TESTCASES/Aorta.lua   | 28 +++++++++++++++++++++++-----
 Solver/TESTCASES/Stommel.lua |  2 +-
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/Solver/TESTCASES/Aorta.lua b/Solver/TESTCASES/Aorta.lua
index 4f475146d6..cc7fb4fbff 100644
--- a/Solver/TESTCASES/Aorta.lua
+++ b/Solver/TESTCASES/Aorta.lua
@@ -3,6 +3,7 @@
 --]]
 
 
+x = os.clock()
 function initial_condition( xyz , f )
   for i=0,xyz:size1()-1 do
      f:set (i, 0, 3.14)
@@ -12,22 +13,35 @@ end
 
 PI = 3.14159
 T= 0.05
+t=0
 Amax = 3.15
 
 function inlet( FCT )
-    FCT:set(0,0,Amax*math.sin(2*PI*t/T)*math.step(T/2-t)) 
-    FCT:set(0,1, 0) 
+  FCT:set(0,0,Amax*math.sin(2*PI*t/T)) 
+  FCT:set(0,1, 0) 
 end
 
+--[[
+function pressureLawShallowWater (solution, bathymetry, f)
+  for i=0,f:size1()-1 do
+     f:set (i, 0, bathymetry:get(i,0))
+  end
+end
+--]]
+
 xyz = functionCoordinates.get()
 
 --[[ 
      Example of a lua program driving the DG code
 --]]
 
+order=2
+options = gmshOptions()
 model = GModel()
-model:load ('aorta.msh')
-order=3
+model:load ('aorta.geo')
+options:numberSet('Mesh',-1,'ElementOrder',order)
+model:mesh(1)
+model:save('aorta.msh')
 dimension=1
 
 -- boundary condition
@@ -35,7 +49,9 @@ inlet_bc = functionLua(2, 'inlet')
 law = dgConservationLawShallowWater1d()
 law:addBoundaryCondition('Inlet',law:newOutsideValueBoundary(inlet_bc))
 law:addBoundaryCondition('Outlet',law:newBoundaryWall())
-law:setBathymetry(functionConstant({0}))
+bathymetry = functionConstant({0})
+law:setBathymetry(bathymetry)
+--law:setPressureLaw(functionLua(1,'pressureLaw',{functionSolution.get(), bathymetry}))
 law:setLinearDissipation(functionConstant({0}))
 
 groups = dgGroupCollection(model, dimension, order)
@@ -44,6 +60,7 @@ groups:buildGroupsOfInterfaces()
 rk=dgRungeKutta()
 limiter = dgSlopeLimiter(law)
 
+print'*** print projetion ***'
 -- build solution vector
 FS = functionLua(2, 'initial_condition', {xyz})
 solution = dgDofContainer(groups, law:getNbFields())
@@ -57,6 +74,7 @@ print'*** solve ***'
 CFL = 0.2;
 for i=1,9000 do 
     dt = CFL * rk:computeInvSpectralRadius(law,solution);  
+    t = t+dt
     norm = rk:iterate44(law,dt,solution)
     if (i % 100 == 0) then 
        print('|ITER|',i,'|NORM|',norm,'|DT|',dt,'|CPU|',os.clock() - x)
diff --git a/Solver/TESTCASES/Stommel.lua b/Solver/TESTCASES/Stommel.lua
index 26be9b8cf9..465fca544b 100644
--- a/Solver/TESTCASES/Stommel.lua
+++ b/Solver/TESTCASES/Stommel.lua
@@ -1,6 +1,6 @@
 model = GModel()
 model:load ('stommel_square.msh')
-order=1
+order = 2
 dimension = 2
 
 CFunctions =[[
-- 
GitLab