--############################################### Setup mesh
nodes={}
N=40
L=1
xmin = 0
dx = L/N
for i=1,(N+1) do
k=i-1
nodes[i] = xmin + k*dx
end
--###############################################
Set Material IDs
-- governing law: -(u_xx + u_yy) = q, on domain [0,1]x[0,1]
-- when the exact solution is chosen u(x,y) = sin(pi.x) * sin(pi.y)
-- this automatically gives:
-- volumetric source term: q(,x) = 2*pi*pi * sin(pi.x) * sin(pi.y)
-- the factor 2 is the dim of the problem
function D_coef(i,x,y,z)
return 1.0
end
function Q_ext(i,x,y,z)
return 2.*math.pi*math.pi * math.sin(math.pi*x) * math.sin(math.pi*y)
end
function Sigma_a(i,x,y,z)
return 0.0
end
function MMS_phi(i,x,y,z)
return math.sin(math.pi*x) * math.sin(math.pi*y)
end
-- xmin,xmax,ymin,ymax,zmin,zmax
e_bndry = 0
w_bndry = 1
n_bndry = 2
s_bndry = 3
--############################################### Call Lua Sim Test
chiSimTest_IP_MMS_L2error() --simtest_IP_MMS_L2_handle becomes available here
--############################################### Export VTU
if (master_export == nil) then
end
----############################################### Volume integrations
--
--
chiLog(LOG_0,
string.format(
"Max-value=%.6f", maxval))
Handle chiFFInterpolationCreate(int FFITypeIndex)
void chiFFInterpolationExecute(int FFIHandle)
void chiFFInterpolationGetValue(int FFIHandle)
void chiFFInterpolationInitialize(int FFIHandle)
Handle chiFFInterpolationSetProperty(int FFIHandle, int PropertyIndex)
void chiLog(int LogType, char LogMsg)
void chiVolumeMesherSetProperty(int PropertyIndex, varying PropertyValue)
void chiVolumeMesherSetMatIDToAll(int material_id)
void chiExportFieldFunctionToVTK(int FFHandle, char BaseName)
void Set(VecDbl &x, const double &val)