Skip to content

Issue 1594 part 3 - Implements Assembly::Attenuation and Assembly::FieldDerivativeStorage#1765

Open
lsawade wants to merge 10 commits intodevelfrom
issue-1594-Part-3
Open

Issue 1594 part 3 - Implements Assembly::Attenuation and Assembly::FieldDerivativeStorage#1765
lsawade wants to merge 10 commits intodevelfrom
issue-1594-Part-3

Conversation

@lsawade
Copy link
Copy Markdown
Collaborator

@lsawade lsawade commented Mar 31, 2026

Description

Implements first iteration of

  • assembly::Attenuation
  • assembly::FieldDerivativeStorage

These are not being used/constructed in the assembly yet. I will create 2 follow up PRs

  1. Create compute_attenuation(...) to be called inside gradient callback in compute_stiffness
  2. Put everything together.

Issue Number

Closes #1594 and closes #1599

Checklist

Please make sure to check developer documentation on specfem docs.

  • I ran the code through pre-commit to check style
  • THE DOCUMENTATION BUILDS WITHOUT WARNINGS/ERRORS
  • I have added labels to the PR (see right hand side of the PR page)
  • 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 and removed request for Rohit-Kakodkar April 1, 2026 13:36
specfem::element::medium_tag::elastic_psv, PropertyTag,
specfem::element::attenuation_tag::constant_isotropic>(mesh_ispec);

material.compute_attenuation_properties(fc.raw(), f0.raw(), band, tau_sigma);
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.

Why are you passing raw values directly? I should that function not have information on units?

The function could return the view tau_sigma

Comment on lines +37 to +38
specfem::element::dimension_tag D, specfem::element::medium_tag M,
specfem::element::property_tag P, specfem::element::attenuation_tag A,
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.

Just want to use typename FieldDerivatives ? and create a container class for field derivatives?

Comment on lines +96 to +97
view_type du_storage;
typename view_type::HostMirror h_du_storage;
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.

Suggested change
view_type du_storage;
typename view_type::HostMirror h_du_storage;
view_type du;
typename view_type::HostMirror h_du;

Comment on lines 5 to +19
@@ -14,7 +15,8 @@ specfem::assembly::impl::domain_properties<specfem::element::dimension_tag::dim2
const bool has_gll_model,
const Kokkos::View<int *, Kokkos::LayoutRight,
Kokkos::DefaultHostExecutionSpace>
property_index_mapping)
property_index_mapping,
std::integral_constant<specfem::element::attenuation_tag, AttenuationTag>)
Copy link
Copy Markdown
Collaborator

@Rohit-Kakodkar Rohit-Kakodkar Apr 1, 2026

Choose a reason for hiding this comment

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

Suggested change
template <specfem::element::medium_tag MediumTag,
specfem::element::property_tag PropertyTag, specfem::element::attenuation_tag AttenuationTag>
specfem::assembly::impl::domain_properties<specfem::element::dimension_tag::dim2, MediumTag,
PropertyTag>::
domain_properties(
const Kokkos::View<int *, Kokkos::DefaultHostExecutionSpace> elements,
const specfem::assembly::mesh<dimension_tag> &mesh, const int ngllz,
const int ngllx,
const specfem::mesh::materials<dimension_tag> &materials,
const bool has_gll_model,
const Kokkos::View<int *, Kokkos::LayoutRight,
Kokkos::DefaultHostExecutionSpace>
property_index_mapping)

Can attenuation tag be directly passed to domain_properties?

template <specfem::element::attenuation_tag T = AttenuationTag,
typename =
std::enable_if_t<T == specfem::element::attenuation_tag::none> >
template <
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.

Seems like this definition is completely changed. Before it was for none, Now its for constant_isotropic


public:
// Getters for computed properties with error handling
type_real get_kappa_scale() const {
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.

Do you require all these values at the same location. Can there be just a single get call?

I find it hard to generalize this interface across different media.

@Rohit-Kakodkar
Copy link
Copy Markdown
Collaborator

The material interface is very verbose. It would be hard to generalize across different media. Other than that, the comments are minor, consistency-related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants