Skip to content

Commit c18cb6e

Browse files
committed
Added in syntax fixes for tests
Waiting for response and gold file values.
1 parent 2f7e2bd commit c18cb6e

5 files changed

Lines changed: 83 additions & 145 deletions

File tree

framework/math/quadratures/angular/triangle_quadrature.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@ TriangleQuadrature::TriangleInit()
143143
if (normal > 0.0)
144144
for (double& w : weights_)
145145
w *= normal / weight_sum;
146-
147-
// AngularQuadrature::OptimizeForPolarSymmetry(4.0 * M_PI);
148146
}
149147

150148
void

test/modules/linear_boltzmann_solvers/transport_steady/tests.json

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,34 @@
201201
],
202202
"skip": "Working on a solution - Jan"
203203
},
204+
{
205+
"file": "transport_2d_triangular_P0.lua",
206+
"comment": "2D LinearBSolver Test isotropic scatter with triangular quadrature",
207+
"num_procs": 1,
208+
"checks": [
209+
{
210+
"type": "FloatCompare",
211+
"key": "max-grp0(latest)",
212+
"wordnum" : 4,
213+
"gold": 0.0,
214+
"abs_tol": 1.0e-6
215+
}
216+
]
217+
},
218+
{
219+
"file": "transport_2d_triangular_P0_GQ3.lua",
220+
"comment": "2D LinearBSolver Test isotropic scatter with triangular quadrature method 3",
221+
"num_procs": 1,
222+
"checks": [
223+
{
224+
"type": "FloatCompare",
225+
"key": "max-grp0(latest)",
226+
"wordnum" : 4,
227+
"gold": 0.0,
228+
"abs_tol": 1.0e-6
229+
}
230+
]
231+
},
204232
{
205233
"file": "transport_3d_1a_extruder.lua",
206234
"comment": "3D LinearBSolver Test - PWLD",
@@ -451,5 +479,21 @@
451479
"abs_tol": 1.0e-9
452480
}
453481
]
454-
}
482+
},
483+
{
484+
"file": "transport_3d_triangular_P0.lua",
485+
"comment": "3D LinearBSolver Test isotropic scatter with triangular quadrature",
486+
"num_procs": 8,
487+
"weight_class" : "intermediate",
488+
"checks": [
489+
{
490+
"type": "FloatCompare",
491+
"key": "max-grp0(latest)",
492+
"wordnum" : 4,
493+
"gold": 0.0,
494+
"abs_tol": 1.0e-6
495+
}
496+
]
497+
}
498+
455499
]

test/modules/linear_boltzmann_solvers/transport_steady/transport_2d_triangular_P0.lua

Lines changed: 13 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
-- 2D LinearBSolver Vacuum with isotropic incident, triangular set
2-
-- SDM: PWLD
3-
-- Test:
1+
-- 2D LinearBSolver vacuum with isotropic source distributed and incident, triangular set
42
num_procs = 1
53

6-
--############################################### Check num_procs
74
if (check_num_procs==nil and number_of_processes ~= num_procs) then
85
log.Log(LOG_0ERROR,"Incorrect amount of processors. " ..
96
"Expected "..tostring(num_procs)..
107
". Pass check_num_procs=false to override if possible.")
118
os.exit(false)
129
end
1310

14-
--############################################### Setup mesh
1511
nodes = {}
1612
N = 65
1713
ds = 500.0 / N
@@ -20,44 +16,34 @@ for i = 0, N do
2016
end
2117
meshgen1 = mesh.OrthogonalMeshGenerator.Create({ node_sets = { nodes, nodes } })
2218
mesh.MeshGenerator.Execute(meshgen1)
23-
24-
--############################################### Set Material IDs
2519
vol0 = logvol.RPPLogicalVolume.Create({ infx = true, infy = true, infz = true })
2620
mesh.SetMaterialIDFromLogicalVolume(vol0, 0)
27-
--############################################### Add materials
2821
materials = {}
2922
materials[1] = mat.AddMaterial("Test Material");
30-
3123
mat.AddProperty(materials[1], TRANSPORT_XSECTIONS)
32-
3324
mat.AddProperty(materials[1], ISOTROPIC_MG_SOURCE)
34-
3525
num_groups = 1
3626
mat.SetProperty(materials[1], TRANSPORT_XSECTIONS, OPENSN_XSFILE, "simple_scatter.xs")
37-
3827
src = {}
3928
for g = 1, num_groups do
4029
src[g] = 0.0
4130
end
42-
--src[1] = 1.0
31+
src[1] = 1.0
4332
mat.SetProperty(materials[1], ISOTROPIC_MG_SOURCE, FROM_ARRAY, src)
4433

4534
method = 0
4635
scattering_order = 0
4736
sn = 8
4837
moments = 0
49-
50-
pquad = aquad.CreateTriangleQuadrature(method, sn)
51-
aquad.OptimizeForPolarSymmetry(pquad,4.0*math.pi)
52-
53-
--========== Groupset def
38+
tquad = aquad.CreateTriangleQuadrature(method, sn)
39+
aquad.OptimizeForPolarSymmetry(tquad,4.0*math.pi)
5440

5541
lbs_block = {
5642
num_groups = num_groups,
5743
groupsets = {
5844
{
5945
groups_from_to = { 0, 0 },
60-
angular_quadrature_handle = pquad,
46+
angular_quadrature_handle = tquad,
6147
angle_aggregation_type = "single",
6248
angle_aggregation_num_subsets = 1,
6349
groupset_num_subsets = 1,
@@ -82,44 +68,18 @@ lbs_options = {
8268

8369
phys1 = lbs.DiscreteOrdinatesSolver.Create(lbs_block)
8470
lbs.SetOptions(phys1, lbs_options)
85-
86-
--========== Solvers
8771
ss_solver = lbs.SteadyStateSolver.Create({ lbs_solver_handle = phys1 })
88-
8972
solver.Initialize(ss_solver)
9073
solver.Execute(ss_solver)
91-
92-
--############################################### Setup Output
93-
ss_solver = lbs.SteadyStateSolver.Create({ lbs_solver_handle = phys1 })
94-
95-
solver.Initialize(ss_solver)
96-
solver.Execute(ss_solver)
97-
98-
--############################################### Get field functions
9974
fflist, count = lbs.GetScalarFieldFunctionList(phys1)
100-
101-
--############################################### Slice plot
102-
--slice2 = fieldfunc.FFInterpolationCreate(SLICE)
103-
--fieldfunc.SetProperty(slice2, SLICE_POINT, 0.0, 0.0, 0.025)
104-
--fieldfunc.SetProperty(slice2, ADD_FIELDFUNCTION, fflist[1])
105-
106-
--fieldfunc.Initialize(slice2)
107-
--fieldfunc.Execute(slice2)
108-
109-
--############################################### Volume integrations
110-
--ffi1 = fieldfunc.FFInterpolationCreate(VOLUME)
111-
--curffi = ffi1
112-
--fieldfunc.SetProperty(curffi, OPERATION, OP_MAX)
113-
--fieldfunc.SetProperty(curffi, LOGICAL_VOLUME, vol0)
114-
--fieldfunc.SetProperty(curffi, ADD_FIELDFUNCTION, fflist[1])
115-
116-
--fieldfunc.Initialize(curffi)
117-
--fieldfunc.Execute(curffi)
118-
--maxval = fieldfunc.GetValue(curffi)
119-
120-
--log.Log(LOG_0, string.format("Max-value1=%.5f", maxval))
121-
122-
--############################################### Exports
75+
pp1 = post.CellVolumeIntegralPostProcessor.Create
76+
({
77+
name="max-grp0",
78+
field_function = fflist[1],
79+
compute_volume_average = true,
80+
print_numeric_format = "scientific"
81+
})
82+
post.Execute({ pp1 })
12383
if master_export == nil then
12484
fieldfunc.ExportToVTKMulti(fflist,"ZPhi")
12585
end

test/modules/linear_boltzmann_solvers/transport_steady/transport_2d_triangular_P0_GQ3.lua

Lines changed: 11 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
-- 2D LinearBSolver Vacuum with isotropic incident, triangular set, Henyey-GS Forward peaked cross-sections
2-
-- SDM: PWLD
3-
-- Test:
42
num_procs = 1
53

6-
--############################################### Check num_procs
74
if (check_num_procs==nil and number_of_processes ~= num_procs) then
85
log.Log(LOG_0ERROR,"Incorrect amount of processors. " ..
96
"Expected "..tostring(num_procs)..
107
". Pass check_num_procs=false to override if possible.")
118
os.exit(false)
129
end
1310

14-
--############################################### Setup mesh
1511
nodes = {}
1612
N = 65
1713
ds = 1.0 / N
@@ -20,44 +16,27 @@ for i = 0, N do
2016
end
2117
meshgen1 = mesh.OrthogonalMeshGenerator.Create({ node_sets = { nodes, nodes } })
2218
mesh.MeshGenerator.Execute(meshgen1)
23-
24-
--############################################### Set Material IDs
2519
vol0 = logvol.RPPLogicalVolume.Create({ infx = true, infy = true, infz = true })
2620
mesh.SetMaterialIDFromLogicalVolume(vol0, 0)
27-
--############################################### Add materials
2821
materials = {}
2922
materials[1] = mat.AddMaterial("Test Material");
30-
3123
mat.AddProperty(materials[1], TRANSPORT_XSECTIONS)
32-
33-
mat.AddProperty(materials[1], ISOTROPIC_MG_SOURCE)
34-
3524
num_groups = 1
3625
mat.SetProperty(materials[1], TRANSPORT_XSECTIONS, OPENSN_XSFILE, "xs_Henyey_GS_p4.xs")
3726

38-
src = {}
39-
for g = 1, num_groups do
40-
src[g] = 0.0
41-
end
42-
--src[1] = 1.0
43-
mat.SetProperty(materials[1], ISOTROPIC_MG_SOURCE, FROM_ARRAY, src)
44-
4527
method = 3
4628
scattering_order = 0
4729
sn = 8
4830
moments = 0
49-
50-
pquad = aquad.CreateTriangleQuadrature(method, sn,scattering_order)
51-
aquad.OptimizeForPolarSymmetry(pquad,4.0*math.pi)
52-
53-
--========== Groupset def
31+
tquad = aquad.CreateTriangleQuadrature(method, sn,scattering_order)
32+
aquad.OptimizeForPolarSymmetry(tquad,4.0*math.pi)
5433

5534
lbs_block = {
5635
num_groups = num_groups,
5736
groupsets = {
5837
{
5938
groups_from_to = { 0, 0 },
60-
angular_quadrature_handle = pquad,
39+
angular_quadrature_handle = tquad,
6140
angle_aggregation_type = "single",
6241
angle_aggregation_num_subsets = 1,
6342
groupset_num_subsets = 1,
@@ -82,44 +61,18 @@ lbs_options = {
8261

8362
phys1 = lbs.DiscreteOrdinatesSolver.Create(lbs_block)
8463
lbs.SetOptions(phys1, lbs_options)
85-
86-
--========== Solvers
87-
ss_solver = lbs.SteadyStateSolver.Create({ lbs_solver_handle = phys1 })
88-
89-
solver.Initialize(ss_solver)
90-
solver.Execute(ss_solver)
91-
92-
--############################################### Setup Output
9364
ss_solver = lbs.SteadyStateSolver.Create({ lbs_solver_handle = phys1 })
94-
9565
solver.Initialize(ss_solver)
9666
solver.Execute(ss_solver)
97-
98-
--############################################### Get field functions
9967
fflist, count = lbs.GetScalarFieldFunctionList(phys1)
100-
101-
--############################################### Slice plot
102-
--slice2 = fieldfunc.FFInterpolationCreate(SLICE)
103-
--fieldfunc.SetProperty(slice2, SLICE_POINT, 0.0, 0.0, 0.025)
104-
--fieldfunc.SetProperty(slice2, ADD_FIELDFUNCTION, fflist[1])
105-
106-
--fieldfunc.Initialize(slice2)
107-
--fieldfunc.Execute(slice2)
108-
109-
--############################################### Volume integrations
110-
--ffi1 = fieldfunc.FFInterpolationCreate(VOLUME)
111-
--curffi = ffi1
112-
--fieldfunc.SetProperty(curffi, OPERATION, OP_MAX)
113-
--fieldfunc.SetProperty(curffi, LOGICAL_VOLUME, vol0)
114-
--fieldfunc.SetProperty(curffi, ADD_FIELDFUNCTION, fflist[1])
115-
116-
--fieldfunc.Initialize(curffi)
117-
--fieldfunc.Execute(curffi)
118-
--maxval = fieldfunc.GetValue(curffi)
119-
120-
--log.Log(LOG_0, string.format("Max-value1=%.5f", maxval))
121-
122-
--############################################### Exports
68+
pp1 = post.CellVolumeIntegralPostProcessor.Create
69+
({
70+
name="max-grp0",
71+
field_function = fflist[1],
72+
compute_volume_average = true,
73+
print_numeric_format = "scientific"
74+
})
75+
post.Execute({ pp1 })
12376
if master_export == nil then
12477
fieldfunc.ExportToVTKMulti(fflist,"ZPhi")
12578
end

0 commit comments

Comments
 (0)