Skip to content

Issue 587 - Adds Point kernels, point_properties for EM#622

Merged
lsawade merged 11 commits into
develfrom
issue-587
Mar 20, 2025
Merged

Issue 587 - Adds Point kernels, point_properties for EM#622
lsawade merged 11 commits into
develfrom
issue-587

Conversation

@lsawade

@lsawade lsawade commented Mar 13, 2025

Copy link
Copy Markdown
Collaborator

Description

  • Updates include/point/properties.hpp
  • Updates include/point/kernel.hpp

Issue Number

Closes #587
Closes #588

Checklist

Please make sure to check developer documentation on specfem docs.

  • I ran the code through pre-commit to check style
  • My code passes all the integration tests
  • I have added sufficient unittests to test my changes
  • I have added/updated documentation for the changes I am proposing
  • I have updated CMakeLists to ensure my code builds
  • My code builds across all platforms

@lsawade lsawade requested review from Rohit-Kakodkar and icui March 13, 2025 20:13
@lsawade lsawade self-assigned this Mar 13, 2025
@Rohit-Kakodkar

Copy link
Copy Markdown
Collaborator

retest this please

@Rohit-Kakodkar Rohit-Kakodkar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Pretty straightforward.

Comment thread include/point/properties.hpp Outdated
*
*/
///@{
DEFINE_POINT_VALUE(mu0, 0) ///< Magnetic permeability @f$ \mu_0 @f$

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the only property you need here is inverse_magnetic_permeability when there is no attenuation. Since we only use that when computing acceleration. See https://github.com/SPECFEM/specfem2d/blob/11e23032568fce4b93b9491a4d1bb7829341b0fb/src/specfem2D/compute_forces_electromagnetic.F90#L181 . You'd also need the conductivity tensor when computing damping see : https://github.com/SPECFEM/specfem2d/blob/11e23032568fce4b93b9491a4d1bb7829341b0fb/src/specfem2D/compute_forces_electromagnetic_conduction.F90#L72

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Storing the rest of them here would increase computation time.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lsawade lsawade Mar 14, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're totally right, I cross checked with the paper, but not with the code.

Looks like we need both permittivity for the mass matrix and conductivity for the
cinductivity computation. But here it may make sense to just compute the when assigning the point properties?

see: invert_mass_matrix.f90#L487

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean assignment? It would make sense to store them within compute/properties as well, right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean assignment? It would make sense to store them within compute/properties as well, right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean assignment? It would make sense to store them within compute/properties as well, right?

@Rohit-Kakodkar Rohit-Kakodkar self-requested a review March 14, 2025 19:16
@Rohit-Kakodkar

Copy link
Copy Markdown
Collaborator

retest this please

@Rohit-Kakodkar Rohit-Kakodkar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor bug

Comment thread include/point/properties.hpp Outdated
*
*/
///@{
DEFINE_POINT_VALUE(mu0, 0) ///< Magnetic permeability @f$ \mu_0 @f$

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean assignment? It would make sense to store them within compute/properties as well, right?

Comment thread include/point/properties.hpp Outdated
*
*/
///@{
DEFINE_POINT_VALUE(mu0, 0) ///< Magnetic permeability @f$ \mu_0 @f$

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean assignment? It would make sense to store them within compute/properties as well, right?

Comment thread include/point/properties.hpp Outdated
*
*/
///@{
DEFINE_POINT_VALUE(mu0, 0) ///< Magnetic permeability @f$ \mu_0 @f$

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean assignment? It would make sense to store them within compute/properties as well, right?

Comment thread include/point/kernels.hpp Outdated
struct kernels<specfem::dimension::type::dim2,
specfem::element::medium_tag::electromagnetic_sv,
specfem::element::property_tag::isotropic, UseSIMD>
: public impl::point_data<10, UseSIMD> {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be 1

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix pushed

@Rohit-Kakodkar

Copy link
Copy Markdown
Collaborator

Youre also missing a include header for Kokkos::abort in point/kernels.hpp

@lsawade lsawade requested review from Rohit-Kakodkar and icui March 18, 2025 17:09

@Rohit-Kakodkar Rohit-Kakodkar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you implementing get_properties tests in the next PR?

@lsawade

lsawade commented Mar 18, 2025

Copy link
Copy Markdown
Collaborator Author

Are you implementing get_properties tests in the next PR?

Yes i need to get rid of 590 first now

@lsawade lsawade merged commit 4c5afd1 into devel Mar 20, 2025
@lsawade lsawade changed the title Issue 587 - Adds Point kernels, point_properties fro EM Issue 587 - Adds Point kernels, point_properties for EM Jun 11, 2025
@lsawade lsawade added the new physics This labels the introduction of new physics to the code label Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new physics This labels the introduction of new physics to the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants