-- 1D Diffusion test with
Vacuum BCs.
-- SDM: PWLC
-- Test: Max-value=2.50000
num_procs = 2
-- KBA-partitioning
--############################################### Check num_procs
if (check_num_procs==nil and chi_number_of_processes ~= num_procs) then
chiLog(LOG_0ERROR,
"Incorrect amount of processors. " ..
"Expected "..tostring(num_procs)..
". Pass check_num_procs=false to override if possible.")
os.exit(false)
end
--############################################### Setup mesh
nodes={}
N=100
L=2.0
xmin = 0.0
dx = L/N
for i=1,(N+1) do
k=i-1
nodes[i] = xmin + k*dx
end
({
node_sets = {nodes},
({
nx = 1, ny=1, nz=2,
zcuts = {L/2}
})
})
--###############################################
Set Material IDs
--############################################### Add materials
materials = {}
--############################################### Setup Physics
--############################################### Initialize and Execute Solver
--############################################### Get field functions
--############################################### Line plot
curffi = ffi0;
--############################################### Volume integrations
curffi = ffi1
chiLog(LOG_0,
string.format(
"Max-value=%.5f", maxval))
--############################################### Exports
if (master_export == nil) then
end
if (chi_location_id == 0 and master_export == nil) then
local handle = io.popen("python ZLFFI00.py")
end
Success chiDiffusionInitialize(int SolverHandle)
void chiDiffusionSetProperty(int SolverHandle, string PropertyName, varying Values)
Handle chiDiffusionCreateSolver()
Success chiDiffusionExecute(int SolverHandle)
void chiFFInterpolationExportPython(int FFIHandle, char BaseName)
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)
MaterialHandle chiPhysicsAddMaterial(char Name)
void chiPhysicsMaterialAddProperty(int MaterialHandle, int PropertyIndex)
void chiPhysicsMaterialSetProperty(int MaterialHandle, int PropertyIndex, int OperationIndex, varying Information)
void chiVolumeMesherSetMatIDToAll(int material_id)
void chiVolumeMesherSetupOrthogonalBoundaries()
void chiSolverSetBasicOption(int solver_handle, string option_name, varying option_value)
void chiSolverGetFieldFunctionList(int SolverHandle)
void Set(VecDbl &x, const double &val)