-
Notifications
You must be signed in to change notification settings - Fork 17
Documentation update - Assembly fields #1440
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: devel
Are you sure you want to change the base?
Conversation
Adds documentation for assembly fields
core/specfem/assembly/fields/data_access/atomic_add_on_device.hpp
Outdated
Show resolved
Hide resolved
Co-authored-by: Congyue Cui <[email protected]>
Co-authored-by: Congyue Cui <[email protected]>
Co-authored-by: Congyue Cui <[email protected]>
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.
Pull request overview
This PR adds comprehensive Doxygen documentation for the assembly fields module in SPECFEM++, including detailed descriptions for field storage classes, simulation field containers, and data access functions.
Key changes:
- Added complete documentation for
field_impl,base_field, and field management classes - Enhanced RST documentation structure with new files for implementation details
- Added usage examples and detailed parameter descriptions for all data access functions (load, store, add operations)
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
docs/sections/api/specfem/assembly/fields/fields.rst |
Updated RST structure to include dimension-specific implementations and corrected doxygen group reference |
docs/sections/api/specfem/assembly/fields/field_impl.rst |
New documentation file for field implementation details |
docs/sections/api/specfem/assembly/fields/base_field.rst |
New documentation file for base field class |
core/specfem/assembly/fields/impl/field_impl.hpp |
Added comprehensive class and method documentation for field implementation |
core/specfem/assembly/fields/fields.hpp |
Enhanced documentation for the main fields container with usage examples |
core/specfem/assembly/fields/dim3/simulation_field.hpp |
Added detailed 3D simulation field documentation |
core/specfem/assembly/fields/dim2/simulation_field.hpp |
Added detailed 2D simulation field documentation |
core/specfem/assembly/fields/data_access/store_on_host.hpp |
Expanded documentation with usage examples for host-side storage |
core/specfem/assembly/fields/data_access/store_on_device.hpp |
Expanded documentation with usage examples for device-side storage |
core/specfem/assembly/fields/data_access/load_on_host.hpp |
Expanded documentation with usage examples for host-side loading |
core/specfem/assembly/fields/data_access/load_on_device.hpp |
Expanded documentation with usage examples for device-side loading |
core/specfem/assembly/fields/data_access/atomic_add_on_device.hpp |
Enhanced atomic operation documentation with usage examples |
core/specfem/assembly/fields/data_access/add_on_device.hpp |
Added defgroup definition and improved documentation with examples |
core/specfem/assembly/fields.hpp |
Added brief documentation for simulation_field forward declaration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * displacement(0) = computed_disp_x; | ||
| * displacement(1) = computed_disp_z; | ||
| * velocity(0) = computed_vel_x; |
Copilot
AI
Dec 4, 2025
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.
In the code example, the variable name displacement is used but the accessor is named disp. The example should be consistent: either use disp(0) = ... or rename the accessor variable to displacement.
| * displacement(0) = computed_disp_x; | |
| * displacement(1) = computed_disp_z; | |
| * velocity(0) = computed_vel_x; | |
| * disp(0) = computed_disp_x; | |
| * disp(1) = computed_disp_z; | |
| * vel(0) = computed_vel_x; |
| * auto disp_x = displacement(0); | ||
| * auto disp_z = displacement(1); |
Copilot
AI
Dec 4, 2025
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.
In the code example, the variable name displacement is used to access values but the accessor is named disp. The example should be consistent: use disp(0) instead of displacement(0).
| * auto disp_x = displacement(0); | |
| * auto disp_z = displacement(1); | |
| * auto disp_x = disp(0); | |
| * auto disp_z = disp(1); |
| * displacement(0) += delta_disp_x; | ||
| * displacement(1) += delta_disp_z; |
Copilot
AI
Dec 4, 2025
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.
In the code example, the variable name displacement is used to set values but the accessor is named disp. The example should be consistent: use disp(0) += ... instead of displacement(0) += ....
| * displacement(0) += delta_disp_x; | |
| * displacement(1) += delta_disp_z; | |
| * disp(0) += delta_disp_x; | |
| * disp(1) += delta_disp_z; |
| * displacement(0) += delta_disp_x; | ||
| * displacement(1) += delta_disp_z; |
Copilot
AI
Dec 4, 2025
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.
In the code example, the variable name displacement is used to update values but the accessor is named disp. The example should be consistent: use disp(0) += ... instead of displacement(0) += ....
| * displacement(0) += delta_disp_x; | |
| * displacement(1) += delta_disp_z; | |
| * disp(0) += delta_disp_x; | |
| * disp(1) += delta_disp_z; |
| * auto elastic_field = | ||
| * field.get_field<specfem::element::medium_tag::elastic_psv>(); auto | ||
| * displacement = elastic_field.displacement; |
Copilot
AI
Dec 4, 2025
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.
In the code example, the variable name displacement is used to access field values but the accessor variable is named elastic_field. The example should use elastic_field.get_field() or similar to properly demonstrate field access.
| * auto elastic_field = | |
| * field.get_field<specfem::element::medium_tag::elastic_psv>(); auto | |
| * displacement = elastic_field.displacement; | |
| * auto elastic_field = field.get_field<specfem::element::medium_tag::elastic_psv>(); | |
| * auto displacement = elastic_field.displacement; | |
| * // Now you can use displacement for further computations |
| * std::cout << "Displacement X: " << displacement(0) << std::endl; | ||
| * std::cout << "Displacement Z: " << displacement(1) << std::endl; |
Copilot
AI
Dec 4, 2025
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.
In the code example, the variable name displacement is used in the std::cout statement but the accessor is named disp. The example should be consistent: use disp(0) instead of displacement(0).
| * std::cout << "Displacement X: " << displacement(0) << std::endl; | |
| * std::cout << "Displacement Z: " << displacement(1) << std::endl; | |
| * std::cout << "Displacement X: " << disp(0) << std::endl; | |
| * std::cout << "Displacement Z: " << disp(1) << std::endl; |
| * auto elastic_field = | ||
| * field.get_field<specfem::element::medium_tag::elastic>(); auto displacement | ||
| * = elastic_field.displacement; |
Copilot
AI
Dec 4, 2025
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.
In the code example, the variable name displacement is used but is not defined in the example. The example should show how to properly access displacement from elastic_field.
| * auto elastic_field = | |
| * field.get_field<specfem::element::medium_tag::elastic>(); auto displacement | |
| * = elastic_field.displacement; | |
| * auto const& elastic_field = | |
| * field.get_field<specfem::element::medium_tag::elastic>(); | |
| * auto const& displacement = elastic_field.displacement; |
| * Public interface for accumulating values into simulation fields on default compute device (GPU when compiled with GPU enabled) | ||
| * devices. This function provides a unified interface for adding values to |
Copilot
AI
Dec 4, 2025
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.
This line appears incomplete with "devices. This function" - there's an awkward break. The sentence should flow directly without the word "devices" appearing standalone.
| * Public interface for accumulating values into simulation fields on default compute device (GPU when compiled with GPU enabled) | |
| * devices. This function provides a unified interface for adding values to | |
| * Public interface for accumulating values into simulation fields on the default compute device (GPU when compiled with GPU enabled). This function provides a unified interface for adding values to |
| using displacement_base_type::get_value; | ||
| using mass_inverse_base_type::get_value; | ||
| using velocity_base_type::get_value; | ||
| // Import get_value methods from all base field types for unified access |
Copilot
AI
Dec 4, 2025
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.
The comment "Import get_value methods from all base field types for unified access" could be more precise. Consider: "Bring get_value methods from base classes into scope for unified field access".
| // Import get_value methods from all base field types for unified access | |
| // Bring get_value methods from base classes into scope for unified field access |
| * displacement(0) = initial_disp_x; | ||
| * displacement(1) = initial_disp_z; |
Copilot
AI
Dec 4, 2025
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.
In the code example, the variable name displacement is used but the accessor is named disp. The example should be consistent: either use disp(0) = ... or rename the accessor variable to displacement.
| * displacement(0) = initial_disp_x; | |
| * displacement(1) = initial_disp_z; | |
| * disp(0) = initial_disp_x; | |
| * disp(1) = initial_disp_z; |
Description
Please describe the changes/features in this pull request.
Adds documentation for assembly fields
Issue Number
If there is an issue created for these changes, link it here
Checklist
Please make sure to check developer documentation on specfem docs.