-
Notifications
You must be signed in to change notification settings - Fork 34
DRAFT: Implementation of Galerkin Quadrature methods #762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| angular_quadrature.def( | ||
| "GetDiscreteToMomentOperator", | ||
| [](const AngularQuadrature& self) { | ||
| const auto& op = self.GetDiscreteToMomentOperator(); | ||
| // Convert to list of lists for Python | ||
| py::list result; | ||
| for (const auto& row : op) { | ||
| py::list py_row; | ||
| for (double val : row) { | ||
| py_row.append(val); | ||
| } | ||
| result.append(py_row); | ||
| } | ||
| return result; | ||
| }, | ||
| "Get the discrete-to-moment operator as a list of lists." | ||
| ); | ||
| angular_quadrature.def( | ||
| "GetMomentToDiscreteOperator", | ||
| [](const AngularQuadrature& self) { | ||
| const auto& op = self.GetMomentToDiscreteOperator(); | ||
| // Convert to list of lists for Python | ||
| py::list result; | ||
| for (const auto& row : op) { | ||
| py::list py_row; | ||
| for (double val : row) { | ||
| py_row.append(val); | ||
| } | ||
| result.append(py_row); | ||
| } | ||
| return result; | ||
| }, | ||
| "Get the moment-to-discrete operator as a list of lists." | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, these functions are not necessary to be exported to Python.
And if you really need to export it, you should export this as a NumPy array The results of these methods are matrices, not lists of lists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm leaving these in for now (updated to be numpy arrays), mostly because I am interested in the structure of the two matrices. If it's preferred to just have it be accessible through direct manipulation of the C++ code, I can remove it.
| : type_(type), | ||
| dimension_(dimension), | ||
| scattering_order_(scattering_order), | ||
| construction_method_(method) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you add the construction_method_ to the constructor, don't forget to update the constructor of derived classes as well.
43e64a0 to
83b5966
Compare
4dcc5f5 to
9ec1483
Compare
1c49ae4 to
53b5d05
Compare
6549aa4 to
80be68b
Compare
3 new angular quadrature types have been introduced, along with corresponding regression tests. 2D Lebedev, a modification of its 3D variant, as well as 2D and 3D GLC Triangular Sets.
Removed GQ2. Removed building D2M and M2D from python binding. Changed D2M/M2D constructors to internally handle methods instead of unique constructors. Moved InvertMatrix method to math.cc for general usage. Optimization changes were made. Added OrthogonalizeHouseholder method. Added basis for GQ3 method. New harmonic_selection_rules file to contain and house the various rules of quadratures.
Cross sections do not yet see the correct moment orders.
Functionality for the process is complete. Works for Lebedev and LDFE sets up to a given limit. Additionally works for Product Quadrature Squares. There are still some minor changes that need to be made, a few random lebedev order's don't have emperically derived harmonic sets yet.
nb_dir -> num_dir
e157729 to
92ca94f
Compare
This PR will add the Galerkin Quadrature methods 1, 2, and 3 into OpenSn to offer another option when forming the scattering source.