Chi-Tech
test/framework/tutorials/tutorial_93_raytracing.lua
--############################################### Setup mesh
if (nmesh==nil) then nmesh = 11 end
nodes={}
N=nmesh
L=11.0
xmin = -L/2
dx = L/N
for i=1,(N+1) do
k=i-1
nodes[i] = xmin + k*dx
end
meshgen1 = chi_mesh.OrthogonalMeshGenerator.Create({ node_sets = {nodes,nodes} })
--############################################### Set Material IDs
chi_unit_tests.chiSimTest93_RayTracing()
--###############################################
--############################################### Add materials
materials = {}
materials[1] = chiPhysicsAddMaterial("Test Material");
chiPhysicsMaterialAddProperty(materials[1],TRANSPORT_XSECTIONS)
num_groups = 1
TRANSPORT_XSECTIONS,
SIMPLEXS0,1,0.27)
----############################################### Setup Physics
--solver_name = "LBS"
--phys1 = chiLBSCreateSolver(solver_name)
--
----========== Groups
--grp = {}
--for g=1,num_groups do
-- grp[g] = chiLBSCreateGroup(phys1)
--end
--
----========== ProdQuad
--pquad = chiCreateProductQuadrature(GAUSS_LEGENDRE_CHEBYSHEV,12*2*4, 12*4)
--
----========== Groupset def
--gs0 = chiLBSCreateGroupset(phys1)
--cur_gs = gs0
--chiLBSGroupsetAddGroups(phys1,cur_gs,0,num_groups-1)
--chiLBSGroupsetSetQuadrature(phys1,cur_gs,pquad)
--chiLBSGroupsetSetIterativeMethod(phys1,cur_gs,KRYLOV_RICHARDSON)
--chiLBSGroupsetSetResidualTolerance(phys1,cur_gs,1.0e-6)
--
----############################################### Set boundary conditions
--
----############################################### Add point source
--src={}
--for g=1,num_groups do
-- src[g] = 0.0
--end
--src[1] = 1.0
--chiLBSAddPointSource(phys1, 0.0, 0.0, 0.0, src)
--
----############################################### Set solver properties
--chiLBSSetProperty(phys1,DISCRETIZATION_METHOD,PWLD)
--chiLBSSetProperty(phys1,SCATTERING_ORDER,0)
--
----############################################### Initialize and Execute Solver
--############################################### Setup Physics
solver_name = "LBS"
pquad = chiCreateProductQuadrature(GAUSS_LEGENDRE_CHEBYSHEV,12*2*4, 12*4)
lbs_block =
{
name = solver_name,
num_groups = num_groups,
groupsets =
{
{
groups_from_to = {0, num_groups-1},
angular_quadrature_handle = pquad,
inner_linear_method = "richardson",
l_abs_tol = 1.0e-6,
l_max_its = 0,
}
},
options = {scattering_order = 0, field_function_prefix = solver_name}
}
phys1 = lbs.DiscreteOrdinatesSolver.Create(lbs_block)
--############################################### Add point source
src={}
for g=1,num_groups do
src[g] = 0.0
end
src[1] = 1.0
chiLBSAddPointSource(phys1, 0.0, 0.0, 0.0, src)
--############################################### Initialize and Execute Solver
ss_solver = lbs.SteadyStateSolver.Create({lbs_solver_handle = phys1})
chiSolverExecute(ss_solver)
chiExportMultiFieldFunctionToVTK({ff_m0[1]},"SimTest_93_LBS_"..solver_name)
if (chi_location_id == 0) then
os.execute("rm SimTest_93*")
end
virtual void Execute()
void chiLBSSetProperty(int SolverIndex, int PropertyIndex)
void chiLBSAddPointSource(int SolverIndex, double Location_x, double Location_y, double Location_z, table Strength)
Pair chiLBSGetScalarFieldFunctionList(int SolverIndex)
void chiLBSGroupsetAddGroups(int SolverIndex, int GroupsetIndex, int FromIndex, int ToIndex)
void chiLBSGroupsetSetQuadrature(int SolverIndex, int GroupsetIndex, int QuadratureIndex)
void chiLBSCreateGroup(int SolverIndex, int GroupId)
void chiLBSGroupsetSetMaxIterations(int SolverIndex, int GroupsetIndex, int Numiter)
void chiLBSGroupsetSetAngleAggDiv(int SolverIndex, int GroupsetIndex, int NumDiv)
void chiLBSGroupsetSetGroupSubsets(int SolverIndex, int GroupsetIndex, int NumDiv)
void chiLBSGroupsetSetResidualTolerance(int SolverIndex, int GroupsetIndex, float ResidualTol)
void chiLBSGroupsetSetIterativeMethod(int SolverIndex, int GroupsetIndex, int IterativeMethod)
void chiLBSCreateGroupset(int SolverIndex)
void chiLBSGroupsetSetGMRESRestartIntvl(int SolverIndex, int GroupsetIndex, int Intvl)
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 chiVolumeMesherSetMatIDToAll(int material_id)
void chiVolumeMesherSetupOrthogonalBoundaries()
void chiMPIBarrier()
void chiSolverExecute(int solver_handle)
void chiSolverInitialize(int solver_handle)
Definition: lua_functions.c:92
void chiExportMultiFieldFunctionToVTK(table listFFHandles, char BaseName)
void Set(VecDbl &x, const double &val)