-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add output for subvolumes #184
base: main
Are you sure you want to change the base?
Conversation
95997cc
to
84e3a78
Compare
@@ -114,8 +114,7 @@ void elasticWaveExample( const std::string filename ) | |||
// Outputs | |||
// ==================================================== | |||
// Output x-displacement along the x-axis | |||
createDisplacementProfile( MPI_COMM_WORLD, "displacement_profile.txt", | |||
*particles, num_cells[0], 0 ); | |||
createDisplacementProfile( "displacement_profile.txt", *particles, 0 ); |
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.
Two questions:
(1) "0" is for axis. Does the function automatically output displacement magnitude by default?
(2) We are not passing "num_cells[0]" now as input. Is it automatically computed?
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.
No, that function is createDisplacementMagnitudeProfile
, used in one of the thermal examples. And the function was rewritten in a way that's it's no longer needed
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.
Do you mean written in a way that "num_cells[0]" is no longer needed?
Region( const double profile_dim, const ArrayType dx ) | ||
{ | ||
_dims = getDim( profile_dim ); | ||
_dx[0] = dx[_dims[0]] / 2.0; |
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.
Notation here is confusing. On the left we have "dx" but on the right "dx/2"
Also dx[0] may not be dx along the x-direction.
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.
Suggestion? I'm just using dx to represent any dimension and avoiding doing the division for every particle
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.
(1) For the comment: On the left we have "dx" but on the right "dx/2", perhaps using:
_half_dx[0] = dx[_dims[0]] / 2.0;
or
_halfdx[0] = dx[_dims[0]] / 2.0;
(2) For the comment: Also dx[0] may not be dx along the x-direction, I am not sure. Perhaps adding a comment above line 144. Something like:
// In this case, _dx[0] and _dx[1] do not necessarily refer to the x- and y-directions.
Note the comment would change based on (1) above.
} | ||
|
||
// Given a dimension, returns the other two | ||
Kokkos::Array<int, 2> getDim( const int x ) |
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.
Notation here could be confusing, since x is dimension not position. Similarly, yz may not be related to the zy plane.
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.
Suggestion? As the comment says, given one dimsion, return the other two
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.
How about:
// Given a dimension, returns the other two dimensions
Kokkos::Array<int, 2> getOtherDims( const int dim )
{
Kokkos::Array<int, 2> otherDims;
otherDims[0] = (dim + 1) % 3;
otherDims[1] = (dim + 2) % 3;
return otherDims;
}
// FIXME: not in order. | ||
auto measure_profile = KOKKOS_LAMBDA( const int b ) | ||
{ | ||
auto p = indices( b ); |
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.
How do these lines work exactly?
auto p = indices( b );
profile( b, 0 ) = x( p, profile_dim );
profile( b, 1 ) = user( p );
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.
I don't understand what you're asking really. Get a particle index and extract the position and whatever user quantity was requested
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.
What would be an example for "b" here?
Closes #183