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

Reflection move sampler #72

Open
wants to merge 2 commits into
base: dev-minor
Choose a base branch
from
Open

Reflection move sampler #72

wants to merge 2 commits into from

Conversation

misiekc
Copy link
Collaborator

@misiekc misiekc commented Feb 5, 2025

No description provided.

reflection relative to a given plane in labolatory reference frame. It is realized by rotation and reflects particle primary axis
@misiekc misiekc requested a review from PKua007 February 5, 2025 11:48
Copy link
Owner

@PKua007 PKua007 left a comment

Choose a reason for hiding this comment

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

Functionally it looks ok, but it would do with the optimizations and cosmetic changes I've described in per-line comments.


void setStepSize(const std::string &, double) override { }

void setupForShapeTraits(const ShapeTraits &shapeTraits) override {
Copy link
Owner

Choose a reason for hiding this comment

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

You can save only the primary axis instead of storing the pointer to ShapeGeometry.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

primary axis should be recalculated each time due to particle rotation, thus there is no advantage of storing it in terms of calculation time. On the other hand, storing a pinter takes less memory than storing a vector

Copy link
Owner

@PKua007 PKua007 Feb 15, 2025

Choose a reason for hiding this comment

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

We don't have to worry about the memory footprint of a single instance of the class. The problem is that ShapeGeometry::getPrimaryAxis is a virtual function called repeatedly in a critical code path, which prevents many optimization that compiler can do.

reflection relative to a given plane in labolatory reference frame. It is realized by rotation and reflects particle primary axis
@misiekc misiekc requested a review from PKua007 February 14, 2025 08:00
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