Skip to content

1678 cosserat time marching#1768

Open
maxlchien wants to merge 7 commits intoPrincetonUniversity:1675-cosserat-meshfrom
maxlchien:1678-cosserat-time-marching
Open

1678 cosserat time marching#1768
maxlchien wants to merge 7 commits intoPrincetonUniversity:1675-cosserat-meshfrom
maxlchien:1678-cosserat-time-marching

Conversation

@maxlchien
Copy link
Copy Markdown
Collaborator

Description

Adds elastic spin elements to time marching and wavefield computation. Adds cosserat-force as a possible source type in 3D. Cosserat forces are specified by

fx;
fy;
fz;
fc_x;
fc_y;
fc_z;

in contrast to the f, f_c, angle setup for 2D sources.

Adds unit testing for the cosserat sources, and adds a cosserat source to the multiple source test.

Issue Number

#1678

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

@maxlchien maxlchien added the enhancement New feature or request label Apr 1, 2026
Copy link
Copy Markdown
Collaborator

@lsawade lsawade left a comment

Choose a reason for hiding this comment

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

Some changes. Getting really close!

(DIMENSION_TAG(DIM2),
MEDIUM_TAG(ELASTIC_PSV, ELASTIC_SH, ACOUSTIC, POROELASTIC,
ELASTIC_PSV_T),
ELASTIC_PSV_T, ELASTIC_SPIN),
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.

This will have no effect.

because:

DIMENSION_TAG(DIM2)

FOR_EACH_IN_PRODUCT(
(DIMENSION_TAG(DIM2), MEDIUM_TAG(ELASTIC_PSV, ELASTIC_PSV_T, ELASTIC_SH,
ACOUSTIC, POROELASTIC)),
ACOUSTIC, ELASTIC_SPIN, POROELASTIC)),
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.

This will have no effect.

because:

DIMENSION_TAG(DIM2)

Same here.

Comment on lines 32 to 38
int ngroups = 0;
FOR_EACH_IN_PRODUCT(
(DIMENSION_TAG(DIM2), MEDIUM_TAG(ELASTIC_PSV, ELASTIC_PSV_T, ELASTIC_SH,
ACOUSTIC, POROELASTIC)),
ACOUSTIC, ELASTIC_SPIN, POROELASTIC)),
{
if (forward.get_nglob<_medium_tag_>() > 0) {
ngroups++;
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.

same here

Comment on lines 49 to 53
FOR_EACH_IN_PRODUCT(
(DIMENSION_TAG(DIM2), MEDIUM_TAG(ELASTIC_PSV, ELASTIC_PSV_T, ELASTIC_SH,
ACOUSTIC, POROELASTIC)),
ACOUSTIC, ELASTIC_SPIN, POROELASTIC)),
{
// Get the number of GLL points in the medium
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.

same here

Comment on lines 125 to 128
FOR_EACH_IN_PRODUCT(
(DIMENSION_TAG(DIM2), MEDIUM_TAG(ELASTIC_PSV, ELASTIC_SH, ACOUSTIC,
POROELASTIC, ELASTIC_PSV_T)),
POROELASTIC, ELASTIC_PSV_T, ELASTIC_SPIN)),
{
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.

same here

MACRO(8, dimension_tag::dim2, field_type::forward, medium_tag::elastic_sh) \
MACRO(8, dimension_tag::dim2, field_type::forward, \
medium_tag::elastic_psv_t) \
MACRO(8, dimension_tag::dim2, field_type::forward, medium_tag::elastic_spin) \
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
MACRO(8, dimension_tag::dim2, field_type::forward, medium_tag::elastic_spin) \

MACRO(5, dimension_tag::dim2, field_type::forward, medium_tag::elastic_sh) \
MACRO(5, dimension_tag::dim2, field_type::forward, \
medium_tag::elastic_psv_t) \
MACRO(5, dimension_tag::dim2, field_type::forward, medium_tag::elastic_spin) \
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
MACRO(5, dimension_tag::dim2, field_type::forward, medium_tag::elastic_spin) \


bool internal =
specfem::utilities::is_close(this->f, other_source->f) &&
specfem::utilities::is_close(this->fc, other_source->fc) &&
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.

nice catch

Copy link
Copy Markdown
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.

No comments other than things @lsawade already pointed out.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants