• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Open-Sn / opensn / 21738357923

06 Feb 2026 02:45AM UTC coverage: 74.553% (+0.6%) from 73.983%
21738357923

push

github

web-flow
Merge pull request #921 from wdhawkins/update_quick_install_doc

Updating quick install instructions.

19363 of 25972 relevant lines covered (74.55%)

59700221.09 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.32
/python/lib/aquad.cc
1
// SPDX-FileCopyrightText: 2025 The OpenSn Authors <https://open-sn.github.io/opensn/>
2
// SPDX-License-Identifier: MIT
3

4
#include "python/lib/py_wrappers.h"
5
#include "framework/math/quadratures/angular/angular_quadrature.h"
6
#include "framework/math/quadratures/angular/curvilinear_product_quadrature.h"
7
#include "framework/math/quadratures/angular/product_quadrature.h"
8
#include "framework/math/quadratures/angular/triangular_quadrature.h"
9
#include "framework/math/quadratures/angular/sldfe_sq_quadrature.h"
10
#include "framework/math/quadratures/angular/lebedev_quadrature.h"
11
#include <pybind11/stl.h>
12
#include <memory>
13
#include <stdexcept>
14

15
namespace opensn
16
{
17

18
// Wrap quadrature point
19
void
20
WrapQuadraturePointPhiTheta(py::module& aquad)
603✔
21
{
22
  // clang-format off
23
  py::class_<QuadraturePointPhiTheta> quad_pt_phi_theta(aquad,
603✔
24
    "QuadraturePointPhiTheta",
25
    R"(
26
    Angular quadrature point.
27

28
    Wrapper of :cpp:class:`opensn::QuadraturePointPhiTheta`.
29
    )"
30
  );
603✔
31
  quad_pt_phi_theta.def_readonly(
603✔
32
    "phi",
33
    &QuadraturePointPhiTheta::phi,
34
    "Azimuthal angle."
35
  );
36
  quad_pt_phi_theta.def_readonly(
603✔
37
    "theta",
38
    &QuadraturePointPhiTheta::theta,
39
    "Polar angle."
40
  );
41
  quad_pt_phi_theta.def(
603✔
42
    "__repr__",
43
    [](QuadraturePointPhiTheta& self)
603✔
44
    {
45
      std::ostringstream os;
×
46
      os << "QuadraturePointPhiTheta(phi=" << self.phi << ", theta=" << self.theta << ")";
×
47
      return os.str();
×
48
    }
×
49
  );
50
  // clang-format on
51
}
603✔
52

53
// Wrap angular quadrature
54
void
55
WrapQuadrature(py::module& aquad)
603✔
56
{
57
  // clang-format off
58
  // angular quadrature
59
  auto angular_quadrature = py::class_<AngularQuadrature, std::shared_ptr<AngularQuadrature>>(
603✔
60
    aquad,
61
    "AngularQuadrature",
62
    R"(
63
    Angular quadrature.
64

65
    Wrapper of :cpp:class:`opensn::AngularQuadrature`.
66
    )"
67
  );
603✔
68
  angular_quadrature.def_readonly(
603✔
69
    "abscissae",
70
    &AngularQuadrature::abscissae,
71
    "Vector of polar and azimuthal angles."
72
  );
73
  angular_quadrature.def_readonly(
603✔
74
    "weights",
75
    &AngularQuadrature::weights,
76
    "Quadrature weights."
77
  );
78
  angular_quadrature.def_readonly(
603✔
79
    "omegas",
80
    &AngularQuadrature::omegas,
81
    "Vector of direction vectors."
82
  );
83
  // clang-format on
84
}
603✔
85

86
// Wrap product qudrature
87
void
88
WrapProductQuadrature(py::module& aquad)
603✔
89
{
90
  // clang-format off
91
  // product quadrature
92
  auto product_quadrature = py::class_<ProductQuadrature, std::shared_ptr<ProductQuadrature>,
603✔
93
                                       AngularQuadrature>(
94
    aquad,
95
    "ProductQuadrature",
96
    R"(
97
    Product quadrature.
98

99
    Wrapper of :cpp:class:`opensn::ProductQuadrature`.
100
    )"
101
  );
603✔
102

103
  // Gauss-Legendre 1D slab product quadrature
104
  auto angular_quadrature_gl_prod_1d_slab = py::class_<GLProductQuadrature1DSlab,
603✔
105
                                                       std::shared_ptr<GLProductQuadrature1DSlab>,
106
                                                       ProductQuadrature>(
107
    aquad,
108
    "GLProductQuadrature1DSlab",
109
    R"(
110
    Gauss-Legendre quadrature for 1D, slab geometry.
111

112
    Wrapper of :cpp:class:`opensn::GLProductQuadrature1DSlab`.
113
    )"
114
  );
603✔
115
  angular_quadrature_gl_prod_1d_slab.def(
1,206✔
116
    py::init(
603✔
117
      [](py::kwargs& params)
87✔
118
      {
119
        static const std::vector<std::string> required_keys = {"n_polar", "scattering_order"};
962✔
120
        static const std::vector<std::pair<std::string, py::object>> optional_keys = {{"verbose", py::bool_(false)}};
387✔
121
        return construct_from_kwargs<GLProductQuadrature1DSlab, unsigned int, unsigned int, bool>(params, required_keys, optional_keys);
87✔
122
      }
150✔
123
    ),
124
    R"(
125
    Construct a Gauss-Legendre product quadrature for 1D, slab geometry.
126

127
    Parameters
128
    ----------
129
    n_polar: int
130
        Number of polar angles.
131
    scattering_order: int
132
        Maximum scattering order supported by the angular quadrature.
133
    verbose: bool, default=False
134
        Verbosity.
135
    )"
136
  );
137

138
  // Gauss-Legendre-Chebyshev 2D XY product quadrature
139
  auto angular_quadrature_glc_prod_2d_xy = py::class_<GLCProductQuadrature2DXY,
603✔
140
                                                      std::shared_ptr<GLCProductQuadrature2DXY>,
141
                                                      ProductQuadrature>(
142
    aquad,
143
    "GLCProductQuadrature2DXY",
144
    R"(
145
    Gauss-Legendre-Chebyshev quadrature for 2D, XY geometry.
146

147
    Wrapper of :cpp:class:`opensn::GLCProductQuadrature2DXY`.
148
    )"
149
  );
603✔
150
  angular_quadrature_glc_prod_2d_xy.def(
1,206✔
151
    py::init(
603✔
152
      [](py::kwargs& params)
149✔
153
      {
154
        static const std::vector<std::string> required_keys = {"n_polar", "n_azimuthal", "scattering_order"};
298✔
155
        static const std::vector<std::pair<std::string, py::object>> optional_keys = {{"verbose", py::bool_(false)}};
745✔
156
        return construct_from_kwargs<GLCProductQuadrature2DXY, unsigned int, unsigned int, unsigned int, bool>(params, required_keys, optional_keys);
149✔
157
      }
298✔
158
    ),
159
    R"(
160
    Construct a Gauss-Legendre-Chebyshev product quadrature for 2D, XY geometry.
161

162
    Parameters
163
    ----------
164
    n_polar: int
165
        Number of polar angles.
166
    n_azimuthal: int
167
        Number of azimuthal angles.
168
    scattering_order: int
169
        Maximum scattering order supported by the angular quadrature.
170
    verbose: bool, default=False
171
        Verbosity.
172
    )"
173
  );
174

175
  // Gauss-Legendre-Chebyshev 3D XYZ product quadrature
176
  auto angular_quadrature_glc_prod_3d_xyz = py::class_<GLCProductQuadrature3DXYZ,
603✔
177
                                                       std::shared_ptr<GLCProductQuadrature3DXYZ>,
178
                                                       ProductQuadrature>(
179
    aquad,
180
    "GLCProductQuadrature3DXYZ",
181
    R"(
182
    Gauss-Legendre-Chebyshev quadrature for 3D, XYZ geometry.
183

184
    Wrapper of :cpp:class:`opensn::GLCProductQuadrature3DXYZ`.
185
    )"
186
  );
603✔
187
  angular_quadrature_glc_prod_3d_xyz.def(
1,206✔
188
    py::init(
603✔
189
      [](py::kwargs& params)
238✔
190
      {
191
        static const std::vector<std::string> required_keys = {"n_polar", "n_azimuthal", "scattering_order"};
468✔
192
        static const std::vector<std::pair<std::string, py::object>> optional_keys = {{"verbose", py::bool_(false)}};
1,158✔
193
        return construct_from_kwargs<GLCProductQuadrature3DXYZ, unsigned int, unsigned int, unsigned int, bool>(params, required_keys, optional_keys);
238✔
194
      }
460✔
195
    ),
196
    R"(
197
    Construct a Gauss-Legendre-Chebyshev product quadrature for 3D, XYZ geometry.
198

199
    Parameters
200
    ----------
201
    n_polar: int
202
        Number of polar angles.
203
    n_azimuthal: int
204
        Number of azimuthal angles.
205
    scattering_order: int
206
        Maximum scattering order supported by the angular quadrature.
207
    verbose: bool, default=False
208
        Verbosity.
209
    )"
210
  );
211
  // clang-format on
212
}
603✔
213

214
// Wrap triangular quadrature
215
void
216
WrapTriangularQuadrature(py::module& aquad)
603✔
217
{
218
  // clang-format off
219
  // triangular quadrature base class
220
  auto triangular_quadrature = py::class_<TriangularQuadrature, std::shared_ptr<TriangularQuadrature>,
603✔
221
                                          AngularQuadrature>(
222
    aquad,
223
    "TriangularQuadrature",
224
    R"(
225
    Triangular quadrature base class.
226

227
    Unlike product quadratures which have a fixed number of azimuthal angles per polar level,
228
    triangular quadratures have a varying number of azimuthal angles that decreases
229
    as the polar angle moves away from the equatorial plane.
230

231
    Wrapper of :cpp:class:`opensn::TriangularQuadrature`.
232
    )"
233
  );
603✔
234

235
  // Triangular GLC 3D XYZ quadrature
236
  auto angular_quadrature_triangular_glc_3d_xyz = py::class_<GLCTriangularQuadrature3DXYZ,
603✔
237
                                                             std::shared_ptr<GLCTriangularQuadrature3DXYZ>,
238
                                                             TriangularQuadrature>(
239
    aquad,
240
    "GLCTriangularQuadrature3DXYZ",
241
    R"(
242
    Triangular Gauss-Legendre-Chebyshev quadrature for 3D, XYZ geometry.
243

244
    For each polar level away from the equator, there is 1 less azimuthal angle
245
    per octant. The maximum number of azimuthal angles (at the equator) is
246
    automatically computed as 2 * n_polar.
247

248
    Wrapper of :cpp:class:`opensn::GLCTriangularQuadrature3DXYZ`.
249
    )"
250
  );
603✔
251
  angular_quadrature_triangular_glc_3d_xyz.def(
1,206✔
252
    py::init(
603✔
253
      [](py::kwargs& params)
1✔
254
      {
255
        static const std::vector<std::string> required_keys = {"n_polar", "scattering_order"};
2✔
256
        static const std::vector<std::pair<std::string, py::object>> optional_keys = {{"verbose", py::bool_(false)}};
5✔
257
        return construct_from_kwargs<GLCTriangularQuadrature3DXYZ, unsigned int, unsigned int, bool>(params, required_keys, optional_keys);
1✔
258
      }
2✔
259
    ),
260
    R"(
261
    Construct a Triangular Gauss-Legendre-Chebyshev quadrature for 3D, XYZ geometry.
262

263
    Parameters
264
    ----------
265
    n_polar: int
266
        Number of polar angles. The maximum number of azimuthal angles (at the equator)
267
        is automatically computed as ``2 * n_polar``.
268
    scattering_order: int
269
        Maximum scattering order supported by the angular quadrature.
270
    verbose: bool, default=False
271
        Verbosity.
272
    )"
273
  );
274

275
  // Triangular GLC 2D XY quadrature
276
  auto angular_quadrature_triangular_glc_2d_xy = py::class_<GLCTriangularQuadrature2DXY,
603✔
277
                                                            std::shared_ptr<GLCTriangularQuadrature2DXY>,
278
                                                            TriangularQuadrature>(
279
    aquad,
280
    "GLCTriangularQuadrature2DXY",
281
    R"(
282
    Triangular Gauss-Legendre-Chebyshev quadrature for 2D, XY geometry.
283

284
    Only includes points in the upper hemisphere (z >= 0).
285

286
    Wrapper of :cpp:class:`opensn::GLCTriangularQuadrature2DXY`.
287
    )"
288
  );
603✔
289
  angular_quadrature_triangular_glc_2d_xy.def(
1,206✔
290
    py::init(
603✔
291
      [](py::kwargs& params)
1✔
292
      {
293
        static const std::vector<std::string> required_keys = {"n_polar", "scattering_order"};
2✔
294
        static const std::vector<std::pair<std::string, py::object>> optional_keys = {{"verbose", py::bool_(false)}};
5✔
295
        return construct_from_kwargs<GLCTriangularQuadrature2DXY, unsigned int, unsigned int, bool>(params, required_keys, optional_keys);
1✔
296
      }
2✔
297
    ),
298
    R"(
299
    Construct a Triangular Gauss-Legendre-Chebyshev quadrature for 2D, XY geometry.
300

301
    Parameters
302
    ----------
303
    n_polar: int
304
        Number of polar angles (only upper hemisphere will be used). The maximum
305
        number of azimuthal angles (at the equator) is automatically computed as 2 * n_polar.
306
    scattering_order: int
307
        Maximum scattering order supported by the angular quadrature.
308
    verbose: bool, default=False
309
        Verbosity.
310
    )"
311
  );
312
  // clang-format on
313
}
603✔
314

315
// Wrap curvilinear product quadrature
316
void
317
WrapCurvilinearProductQuadrature(py::module& aquad)
603✔
318
{
319
  // clang-format off
320
  // curvilinear product quadrature
321
  auto curvilinear_product_quadrature = py::class_<CurvilinearProductQuadrature,
603✔
322
                                                   std::shared_ptr<CurvilinearProductQuadrature>,
323
                                                   ProductQuadrature>(
324
    aquad,
325
    "CurvilinearProductQuadrature",
326
    R"(
327
    Curvilinear product quadrature.
328

329
    Wrapper of :cpp:class:`opensn::CurvilinearProductQuadrature`.
330
    )"
331
  );
603✔
332

333
  // Gauss-Legendre-Chebyshev 2D RZ curvilinear product quadrature
334
  auto curvilinear_quadrature_glc_2d_rz = py::class_<GLCProductQuadrature2DRZ,
603✔
335
                                                     std::shared_ptr<GLCProductQuadrature2DRZ>,
336
                                                     CurvilinearProductQuadrature>(
337
    aquad,
338
    "GLCProductQuadrature2DRZ",
339
    R"(
340
    Gauss-Legendre-Chebyshev product quadrature for 2D, RZ geometry.
341

342
    Wrapper of :cpp:class:`opensn::GLCProductQuadrature2DRZ`.
343
    )"
344
  );
603✔
345
  curvilinear_quadrature_glc_2d_rz.def(
1,206✔
346
    py::init(
603✔
347
      [](py::kwargs& params)
8✔
348
      {
349
        static const std::vector<std::string> required_keys = {"n_polar", "n_azimuthal", "scattering_order"};
16✔
350
        static const std::vector<std::pair<std::string, py::object>> optional_keys = {{"verbose", py::bool_(false)}};
40✔
351
        return construct_from_kwargs<GLCProductQuadrature2DRZ, unsigned int, unsigned int, unsigned int, bool>(params, required_keys, optional_keys);
8✔
352
      }
16✔
353
    ),
354
    R"(
355
    Construct a Gauss-Legendre Chebyshev product quadrature for 2D, RZ geometry.
356

357
    Parameters
358
    ----------
359
    n_polar: int
360
        Number of polar angles.
361
    n_azimuthal: int
362
        Number of azimuthal angles.
363
    scattering_order: int
364
        Maximum scattering order supported by the angular quadrature.
365
    verbose: bool, default=False
366
        Verbosity.
367
    )"
368
  );
369
  // clang-format on
370
}
603✔
371

372
// Wrap SLDFES quadrature
373
void
374
WrapSLDFEsqQuadrature(py::module& aquad)
603✔
375
{
376
  // clang-format off
377
  // Simplified LDFEsq quadrature
378
  auto sldfesq_quadrature_3d_xyz = py::class_<SLDFEsqQuadrature3DXYZ,
603✔
379
                                              std::shared_ptr<SLDFEsqQuadrature3DXYZ>,
380
                                              AngularQuadrature>(
381
    aquad,
382
    "SLDFEsqQuadrature3DXYZ",
383
    R"(
384
    Piecewise-linear finite element quadrature using quadrilaterals.
385

386
    Wrapper of :cpp:class:`opensn::SLDFEsqQuadrature3DXYZ`.
387
    )"
388
  );
603✔
389
  sldfesq_quadrature_3d_xyz.def(
1,206✔
390
    py::init(
603✔
391
      [](py::kwargs& params)
8✔
392
      {
393
        static const std::vector<std::string> required_keys = {"level", "scattering_order"};
14✔
394
        auto [level, scattering_order] = extract_args_tuple<int, int>(params, required_keys);
8✔
395
        return std::make_shared<SLDFEsqQuadrature3DXYZ>(level, scattering_order);
8✔
396
      }
397
    ),
398
    R"(
399
    Generates uniform spherical quadrilaterals from the subdivision of an inscribed cube.
400

401
    Parameters
402
    ----------
403
    level: int
404
        Number of subdivisions of the inscribed cube.
405
    scattering_order: int
406
        Maximum scattering order supported by the angular quadrature.
407
    )"
408
  );
409
  sldfesq_quadrature_3d_xyz.def(
1,206✔
410
    "LocallyRefine",
411
    &SLDFEsqQuadrature3DXYZ::LocallyRefine,
1,206✔
412
    R"(
413
    Locally refines the cells.
414

415
    Parameters
416
    ----------
417
    ref_dir: pyopensn.math.Vector3
418
        Reference direction :math:`\vec{r}`.
419
    cone_size: float
420
        Cone size (in radians) :math:`\theta`.
421
    dir_as_plane_normal: bool, default=False
422
        If true, interpret SQ-splitting as when :math:`|\omega \cdot \vec{r}| < \sin(\theta)`.
423
        Otherwise, SQs will be split if :math:`\omega \cdot \vec{r} > \cos(\theta)`.
424
    )",
425
    py::arg("ref_dir"),
1,206✔
426
    py::arg("cone_size"),
603✔
427
    py::arg("dir_as_plane_normal") = false
603✔
428
  );
429
  sldfesq_quadrature_3d_xyz.def(
603✔
430
    "PrintQuadratureToFile",
431
    &SLDFEsqQuadrature3DXYZ::PrintQuadratureToFile,
1,206✔
432
    R"(
433
    Prints the quadrature to file.
434

435
    Parameters
436
    ----------
437
    file_base: str
438
        File base name.
439
    )",
440
    py::arg("file_base")
603✔
441
  );
442

443
  // 2D SLDFEsq quadrature
444
  auto sldfesq_quadrature_2d_xy = py::class_<SLDFEsqQuadrature2DXY,
603✔
445
                                             std::shared_ptr<SLDFEsqQuadrature2DXY>,
446
                                             AngularQuadrature>(
447
    aquad,
448
    "SLDFEsqQuadrature2DXY",
449
    R"(
450
    Two-dimensional variant of the piecewise-linear finite element quadrature.
451

452
    This quadrature is created from the 3D SLDFEsq set by removing directions with negative
453
    xi.
454

455
    Wrapper of :cpp:class:`opensn::SLDFEsqQuadrature2DXY`.
456
    )"
457
  );
603✔
458
  sldfesq_quadrature_2d_xy.def(
1,206✔
459
    py::init(
603✔
460
      [](py::kwargs& params)
4✔
461
      {
462
        static const std::vector<std::string> required_keys = {"level", "scattering_order"};
8✔
463
        auto [level, scattering_order] = extract_args_tuple<int, int>(params, required_keys);
4✔
464
        return std::make_shared<SLDFEsqQuadrature2DXY>(level, scattering_order);
4✔
465
      }
466
    ),
467
    R"(
468
    Generates a 2D SLDFEsq quadrature by removing directions with negative xi.
469

470
    Parameters
471
    ----------
472
    level: int
473
        Number of subdivisions of the inscribed cube.
474
    scattering_order: int
475
        Maximum scattering order supported by the angular quadrature.
476
    )"
477
  );
478
  sldfesq_quadrature_2d_xy.def(
1,206✔
479
    "LocallyRefine",
480
    &SLDFEsqQuadrature2DXY::LocallyRefine,
1,206✔
481
    R"(
482
    Locally refines the cells.
483

484
    Parameters
485
    ----------
486
    ref_dir: pyopensn.math.Vector3
487
        Reference direction :math:`\vec{r}`.
488
    cone_size: float
489
        Cone size (in radians) :math:`\theta`.
490
    dir_as_plane_normal: bool, default=False
491
        If true, interpret SQ-splitting as when :math:`|\omega \cdot \vec{r}| < \sin(\theta)`.
492
        Otherwise, SQs will be split if :math:`\omega \cdot \vec{r} > \cos(\theta)`.
493
    )",
494
    py::arg("ref_dir"),
1,206✔
495
    py::arg("cone_size"),
603✔
496
    py::arg("dir_as_plane_normal") = false
603✔
497
  );
498
  sldfesq_quadrature_2d_xy.def(
603✔
499
    "PrintQuadratureToFile",
500
    &SLDFEsqQuadrature2DXY::PrintQuadratureToFile,
1,206✔
501
    R"(
502
    Prints the quadrature to file.
503

504
    Parameters
505
    ----------
506
    file_base: str
507
        File base name.
508
    )",
509
    py::arg("file_base")
603✔
510
  );
511
  // clang-format on
512
}
603✔
513

514
// Wrap Lebedev quadrature
515
void
516
WrapLebedevQuadrature(py::module& aquad)
603✔
517
{
518
  // clang-format off
519
  // Lebedev 3D XYZ quadrature
520
  auto angular_quadrature_lebedev_3d_xyz = py::class_<LebedevQuadrature3DXYZ,
603✔
521
                                                     std::shared_ptr<LebedevQuadrature3DXYZ>,
522
                                                     AngularQuadrature>(
523
    aquad,
524
    "LebedevQuadrature3DXYZ",
525
    R"(
526
    Lebedev quadrature for 3D, XYZ geometry.
527

528
    This quadrature provides high-order accuracy for spherical integration with
529
    symmetric distribution of points on the sphere.
530

531
    Wrapper of :cpp:class:`opensn::LebedevQuadrature3DXYZ`.
532
    )"
533
  );
603✔
534

535
  angular_quadrature_lebedev_3d_xyz.def(
1,206✔
536
    py::init(
603✔
537
      [](py::kwargs& params)
6✔
538
      {
539
        static const std::vector<std::string> required_keys = {"quadrature_order", "scattering_order"};
11✔
540
        static const std::vector<std::pair<std::string, py::object>> optional_keys = {{"verbose", py::bool_(false)}};
26✔
541
        return construct_from_kwargs<LebedevQuadrature3DXYZ, unsigned int, unsigned int, bool>(params, required_keys, optional_keys);
6✔
542
      }
10✔
543
    ),
544
    R"(
545
    Constructs a Lebedev quadrature for 3D, XYZ geometry.
546

547
    Parameters
548
    ----------
549
    quadrature_order: int
550
        The order of the quadrature.
551
    scattering_order: int
552
        Maximum scattering order supported by the angular quadrature.
553
    verbose: bool, default=False
554
        Whether to print verbose output during initialization.
555
    )"
556
  );
557

558
  // Lebedev 2D XY quadrature
559
  auto angular_quadrature_lebedev_2d_xy = py::class_<LebedevQuadrature2DXY,
603✔
560
                                                     std::shared_ptr<LebedevQuadrature2DXY>,
561
                                                     AngularQuadrature>(
562
    aquad,
563
    "LebedevQuadrature2DXY",
564
    R"(
565
    Lebedev quadrature for 2D, XY geometry.
566

567
    This is a 2D version of the Lebedev quadrature that only includes points
568
    in the upper hemisphere (z >= 0). Points on the equator (z = 0) have their
569
    weights halved since they are shared between hemispheres.
570

571
    Wrapper of :cpp:class:`opensn::LebedevQuadrature2DXY`.
572
    )"
573
  );
603✔
574

575
  angular_quadrature_lebedev_2d_xy.def(
1,206✔
576
    py::init(
603✔
577
      [](py::kwargs& params)
2✔
578
      {
579
        static const std::vector<std::string> required_keys = {"quadrature_order", "scattering_order"};
3✔
580
        static const std::vector<std::pair<std::string, py::object>> optional_keys = {{"verbose", py::bool_(false)}};
6✔
581
        return construct_from_kwargs<LebedevQuadrature2DXY, unsigned int, unsigned int, bool>(params, required_keys, optional_keys);
2✔
582
      }
2✔
583
    ),
584
    R"(
585
    Constructs a Lebedev quadrature for 2D, XY geometry.
586

587
    Parameters
588
    ----------
589
    quadrature_order: int
590
        The order of the quadrature.
591
    scattering_order: int
592
        Maximum scattering order supported by the angular quadrature.
593
    verbose: bool, default=False
594
        Whether to print verbose output during initialization.
595
    )"
596
  );
597
  // clang-format on
598
}
603✔
599

600
// Wrap the angular quadrature components of OpenSn
601
void
602
py_aquad(py::module& pyopensn)
63✔
603
{
604
  py::module aquad = pyopensn.def_submodule("aquad", "Angular quadrature module.");
63✔
605
  WrapQuadraturePointPhiTheta(aquad);
63✔
606
  WrapQuadrature(aquad);
63✔
607
  WrapProductQuadrature(aquad);
63✔
608
  WrapTriangularQuadrature(aquad);
63✔
609
  WrapCurvilinearProductQuadrature(aquad);
63✔
610
  WrapSLDFEsqQuadrature(aquad);
63✔
611
  WrapLebedevQuadrature(aquad);
63✔
612
}
63✔
613

614
} // namespace opensn
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc