Skip to content
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

Issue 484/498/499/500 -- Implements reading of ispec_is_<medium>, materials, and mass matrices. #501

Merged
merged 7 commits into from
Feb 25, 2025

Conversation

lsawade
Copy link
Collaborator

@lsawade lsawade commented Feb 20, 2025

Description

Implements

  • Implements boolean array reading
  • Struct to hold material parameters
  • Struct to hold mass matrices
  • Struct to hold element_types

Issue Number

closes #484
Closes #498
closes #499
closes #500

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
Copy link
Collaborator Author

lsawade commented Feb 20, 2025

I think I should already be organizing my materials, element_types, etc. in a more meaning full way using the something that resembles the assembly more closely. That is better use of the medium_tags. I will work in a refactor at the end of this once everything is read correctly.

@lsawade lsawade changed the base branch from issue-390 to issue-458 February 20, 2025 19:42
@lsawade lsawade changed the base branch from issue-458 to issue-390 February 20, 2025 19:42
@lsawade
Copy link
Collaborator Author

lsawade commented Feb 20, 2025

I didn't merge the most recent update yet so the file updates were longer than they should have been. I update the PR to only reflect files from after the merge.

Copy link
Collaborator

@Rohit-Kakodkar Rohit-Kakodkar left a comment

Choose a reason for hiding this comment

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

Minor comments.

@@ -221,10 +257,17 @@ subroutine save_arrays_solver_mesh()
! write(IOUT) kappastore
! write(IOUT) mustore

write(IOUT)

! Converting the logical arrays to integer arrays and writing them as ints
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this supposed to be commented? Should we store a single array with different ints depending on the domain type?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Was just following your lead, the arrays are being stored using the save_global_arrays:

call save_global_arrays(nspec, xixstore)
  call save_global_arrays(nspec, xiystore)
  call save_global_arrays(nspec, xizstore)
  call save_global_arrays(nspec, etaxstore)
  call save_global_arrays(nspec, etaystore)
  call save_global_arrays(nspec, etazstore)
  call save_global_arrays(nspec, gammaxstore)
  call save_global_arrays(nspec, gammaystore)
  call save_global_arrays(nspec, gammazstore)
  call save_global_arrays(nspec, jacobianstore)

  ! write test value
  itest = 10000
  write(IOUT) itest

  ! write(IOUT) xixstore
  ! write(IOUT) xiystore
  ! write(IOUT) xizstore
  ! write(IOUT) etaxstore
  ! write(IOUT) etaystore
  ! write(IOUT) etazstore
  ! write(IOUT) gammaxstore
  ! write(IOUT) gammaystore
  ! write(IOUT) gammazstore
  ! write(IOUT) jacobianstore

  call save_global_arrays(nspec, kappastore)
  call save_global_arrays(nspec, mustore)
  ! write(IOUT) kappastore
  ! write(IOUT) mustore

@@ -57,11 +57,6 @@ void specfem::IO::mesh::impl::fortran::dim3::read_array(std::ifstream &stream,
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add doc strings for these functions in utilities.hpp

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I hadn't yet because these kept on changing as aI was debugging! Will add doc strings!


template <specfem::element::medium_tag MediumTag> View1D<int> get_elements();

void print() const;
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do these print functions do? Can you add doc strings?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes I need to add doc strings to everything!

type_real kappa_min = std::numeric_limits<type_real>::max();
type_real kappa_max = std::numeric_limits<type_real>::lowest();

Kokkos::parallel_reduce(
Copy link
Collaborator

Choose a reason for hiding this comment

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

These parallel_reduce kernels need to run on the Host space. The views kappa is a host view.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

whoops, forgot about le execution_space

@lsawade lsawade merged commit 4d285f4 into issue-390 Feb 25, 2025
3 checks passed
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.

4 participants