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 elastic utilities #5284
Add elastic utilities #5284
Conversation
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.
Very nice! In particular, I kept thinking that we ought to have tests for this, and then what do you know, there are tests at the bottom of the patch!
There are different ways of representing 3x3x3x3 tensors as 6x6 matrices, and the same applies to 3x3 tensors as vector of size 6. Voigt notation is one. Take a look at https://en.wikipedia.org/wiki/Voigt_notation.
I think it would be useful to annotate each function how exactly you want that representation to act -- perhaps by linking to the Wikipedia article.
include/aspect/utilities.h
Outdated
|
||
|
||
/** | ||
* Rotate a 6x6 voigt matrix with an other 3D 4th |
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.
incomplet
include/aspect/utilities.h
Outdated
* Rotate a 6x6 voigt matrix with an other 3D 4th | ||
*/ | ||
SymmetricTensor<2,6> | ||
rotate_6x6_matrix(const SymmetricTensor<2,6> &input_tensor, const Tensor<2,3> &rotation_tensor); |
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.
same here
include/aspect/utilities.h
Outdated
rotate_6x6_matrix(const SymmetricTensor<2,6> &input_tensor, const Tensor<2,3> &rotation_tensor); | ||
|
||
/** | ||
* Transform a 4th order tensor into a 6x6 matrix |
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.
Period at the end of the sentence for all of the doc strings of all of these functions.
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.
A few more comments.
Co-authored-by: Rene Gassmoeller <rene.gassmoeller@mailbox.org> Co-authored-by: Wolfgang Bangerth <bangerth@colostate.edu>
Thanks for the reviews. I have addressed you comments. |
As mentioned earlier today, there seems to be a trend for functions of the form |
I have changed the names |
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 dont mind the name change, but the new names do not seem consistent to me.
*/ | ||
SymmetricTensor<4,3> | ||
rotate_full_stiffness_tensor(const Tensor<2,3> &rotation_tensor, const SymmetricTensor<4,3> &input_tensor); | ||
|
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.
Check the number of empty lines between all the functions in the header.
include/aspect/utilities.h
Outdated
transform_voigt_stiffness_vector_to_voigt_stiffness_matrix(const Tensor<1,21> &input_tensor); | ||
|
||
/** | ||
* Transform a 4th order full stiffness tensor into a 21D Voigt stiffness vector. | ||
* See https://en.wikipedia.org/wiki/Voigt_notation for more info on the Voigt notation. | ||
*/ | ||
Tensor<1,21> | ||
transform_full_stiffness_tensor_to_voigt_stiffness_vector(const SymmetricTensor<4,3> &input); |
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.
why are these two not also to_voigt_stiffness_matrix
and to_voigt_stiffness_vector
?
6e5f50c
to
f7a4ae5
Compare
f7a4ae5
to
0122a9a
Compare
sorry about that, I fixed it. |
This pull request splits the tensor functions out of #4987 and #5116 and puts it in the utilities function in a new Tensors namespace.