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

Multipop pressure anistropy #1061

Merged
merged 3 commits into from
Nov 13, 2024
Merged

Conversation

lkotipal
Copy link
Contributor

Continuation of #1022, support storing off-diagonal pressure in populations and use minimum of all pops and total for refinement.
Redo of #1052.

Copy link
Contributor

@ursg ursg left a comment

Choose a reason for hiding this comment

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

The back- and forth handling of P as a matrix, then a bunch of floats, then an array is a bit unpretty.

But actually it is less unpretty than before.

@lkotipal
Copy link
Contributor Author

The back- and forth handling of P as a matrix, then a bunch of floats, then an array is a bit unpretty.

But actually it is less unpretty than before.

Considering changing a whole bunch of these variables to std::vectors for nicer initialization. I'm not sure whether there's any actual reason to use std::array, really.

@lkotipal lkotipal marked this pull request as ready for review November 13, 2024 09:11
Eigen::Matrix3d rot = Eigen::Quaterniond::FromTwoVectors(Eigen::Vector3d{myB[0], myB[1], myB[2]}, Eigen::Vector3d{0, 0, 1}).normalized().toRotationMatrix();
Real Panisotropy {calculateAnisotropy(rot, myPressure)};
for (const auto& pop : cell->get_populations()) {
// TODO I hate this. Change all this crap to std::vectors?
Copy link
Contributor

Choose a reason for hiding this comment

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

I still think that, instead of adding this comment, you should just change it. :)

std::array<Real, 6> popP = *reinterpret_cast<std::array<Real, 6> *>(pop.P);

Should do the trick, shouldn't it?

@ursg ursg merged commit bccab6b into fmihpc:dev Nov 13, 2024
15 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.

2 participants