-- 2D LinearBSolver test of a block of graphite with an air cavity. DSA and TG
-- SDM: PWLD
-- Test: WGS groups [0-62] Iteration 53 Residual 5.96018e-07 CONVERGED
-- and WGS groups [63-167] Iteration 59 Residual 5.96296e-07 CONVERGED
num_procs = 4
--############################################### 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=20
L=100
--N=10
--L=200e6
xmin = -L/2
--xmin = 0.0
dx = L/N
for i=1,(N+1) do
k=i-1
nodes[i] = xmin + k*dx
end
--###############################################
Set Material IDs
({ xmin=-10.0,xmax=10.0,ymin=-10.0,ymax=10.0, infz=true })
--############################################### Add materials
materials = {}
--num_groups = 1
-- SIMPLEXS1,num_groups,1.0,0.999)
num_groups = 168
CHI_XSFILE,"xs_graphite_pure.cxs")
CHI_XSFILE,"xs_air50RH.cxs")
src={}
for g=1,num_groups do
src[g] = 0.0
end
src[1] = 1.0
src[1] = 0.0
--############################################### Setup Physics
lbs_block =
{
num_groups = num_groups,
groupsets =
{
{
groups_from_to = {0, 62},
angular_quadrature_handle = pquad0,
angle_aggregation_num_subsets = 1,
groupset_num_subsets = 1,
inner_linear_method = "gmres",
l_abs_tol = 1.0e-6,
l_max_its = 1000,
gmres_restart_interval = 30,
apply_wgdsa = true,
wgdsa_l_abs_tol = 1.0e-2,
},
{
groups_from_to = {63, num_groups-1},
angular_quadrature_handle = pquad0,
angle_aggregation_num_subsets = 1,
groupset_num_subsets = 1,
inner_linear_method = "gmres",
l_abs_tol = 1.0e-6,
l_max_its = 1000,
gmres_restart_interval = 30,
apply_wgdsa = true,
apply_tgdsa = true,
wgdsa_l_abs_tol = 1.0e-2,
},
}
}
lbs_options =
{
scattering_order = 1,
}
lbs.SetOptions(phys1, lbs_options)
--############################################### Initialize and Execute Solver
--############################################### Get field functions
--############################################### Exports
if (master_export == nil) then
end
--############################################### Plots
Pair chiLBSGetScalarFieldFunctionList(int SolverIndex)
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)
Returns chiCreateProductQuadrature(int QuadratureType, varying values)
void chiOptimizeAngularQuadratureForPolarSymmetry(in handle, double normalization)
void chiVolumeMesherSetProperty(int PropertyIndex, varying PropertyValue)
void chiVolumeMesherSetMatIDToAll(int material_id)
void chiSolverExecute(int solver_handle)
void chiSolverInitialize(int solver_handle)
void chiExportMultiFieldFunctionToVTK(table listFFHandles, char BaseName)
void Set(VecDbl &x, const double &val)