Chi-Tech
test_framework_tutorials_pwlc_test2_lua.h
Go to the documentation of this file.
1/** \page test_framework_tutorials_pwlc_test2_lua test/framework/tutorials/pwlc_test2.lua
2\ingroup LuaInputExamples
3
4\code
5--############################################### Setup mesh
6if (nmesh==nil) then nmesh = 10 end
7
8nodes={}
9N=nmesh
10L=2.0
11xmin = -L/2
12dx = L/N
13for i=1,(N+1) do
14 k=i-1
15 nodes[i] = xmin + k*dx
16end
17
18meshgen1 = chi_mesh.OrthogonalMeshGenerator.Create({ node_sets = {nodes,nodes} })
19chi_mesh.MeshGenerator.Execute(meshgen1)
20
21--############################################### Set Material IDs
22chiVolumeMesherSetMatIDToAll(0)
23
24function MMS_phi(x,y,z)
25 return math.cos(math.pi*x) + math.cos(math.pi*y)
26end
27function MMS_q(x,y,z)
28 return math.pi*math.pi * (math.cos(math.pi*x)+math.cos(math.pi*y))
29end
30
31chi_unit_tests.chiSimTest04_PWLC()
32chiMPIBarrier()
33if (chi_location_id == 0) then
34 os.execute("rm CodeTut4_PWLC*")
35end\endcode
36*/
37
38