-- SDM: PWLD
-- Test: Max-value=2.50000
num_procs = 4
--Also tests integrating with a lua-function
--############################################### 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=32
L=2.0
xmin = -1.0
dx = L/N
for i=1,(N+1) do
k=i-1
nodes[i] = xmin + k*dx
end
--###############################################
Set Material IDs
e_bndry = "0"
w_bndry = "1"
n_bndry = "2"
s_bndry = "3"
--############################################### Add materials
materials = {}
if ((prop.is_empty ~=nil) and (not prop.is_empty)) then
print("
Property table populated, value="..tostring(prop.value))
end
--############################################### Setup Physics
--############################################### Set boundary conditions
--############################################### Initialize and Execute Solver
--############################################### Get field functions
--############################################### Slice plot
--############################################### Volume integrations
curffi = ffi1
chiLog(LOG_0,
string.format(
"Max-value=%.5f", maxval))
--==========================================
xwing=2.0
function IntegrateMaterialVolume(ff_value,mat_id)
return xwing
end
curffi = ffi2
--==========================================
--############################################### Exports
if (master_export == nil) then
end
--############################################### Plots
if (chi_location_id == 0 and master_export == nil) then
local handle = io.popen("python ZPFFI00.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)
Lua chiPhysicsMaterialGetProperty(int MaterialHandle, int PropertyIndex)
void chiPhysicsMaterialSetProperty(int MaterialHandle, int PropertyIndex, int OperationIndex, varying Information)
void chiVolumeMesherSetProperty(int PropertyIndex, varying PropertyValue)
void chiSolverSetBasicOption(int solver_handle, string option_name, varying option_value)
void chiSolverGetFieldFunctionList(int SolverHandle)
void chiExportFieldFunctionToVTK(int FFHandle, char BaseName)
void Set(VecDbl &x, const double &val)