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

Octree and Barnes Hut Implementation #20

Merged
merged 27 commits into from
Jan 10, 2024
Merged

Octree and Barnes Hut Implementation #20

merged 27 commits into from
Jan 10, 2024

Conversation

jdinovi
Copy link
Owner

@jdinovi jdinovi commented Jan 5, 2024

  • Implemented Octree class
  • Implemented Barnes-Hut Algorithm
  • Integrated with default configuration of .yml files for initialization
  • Added testing
  • Fixed some automation issues

Might be a little too sick, honestly!

jdinovi and others added 24 commits December 25, 2023 21:24
…ed an envOctree member to the Grav Environment class; added some tests
…floats from doubles; implemented work with Adam's config stuff
…ile; added download of bc in coverage workflow
Adam-Boesky
Adam-Boesky previously approved these changes Jan 6, 2024
Copy link
Collaborator

@Adam-Boesky Adam-Boesky left a comment

Choose a reason for hiding this comment

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

Well done sir


// Get the extreme coordinate locations
std::array<float, 2> extremeXCoords = {0, 0};
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't be zero here. should just be min/max


// Calculate the forces
std::vector<std::array<float, 3>> forces(nParticles); // Vector to hold the forces
float theta = 0.5;
Copy link
Collaborator

Choose a reason for hiding this comment

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

make this a kwarg.

envOctree.updateCoords(extremeXCoords, extremeYCoords, extremeZCoords);

// Build the Octree
envOctree.build(particlePtrs);
Copy link
Collaborator

Choose a reason for hiding this comment

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

steezy

if (internal) {

// Midpoints of coordinates
float mX = (xCoords[0] + xCoords[1]) / 2.;
Copy link
Collaborator

Choose a reason for hiding this comment

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

i like .0 but i guess this is fine

Octree<T>* child5;
Octree<T>* child6;
Octree<T>* child7;
std::shared_ptr<Octree<T>> child0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

do u think u could add like comments for each of the children that just say which octants they refer to? Might be helpful for understanding the logic in octree.cpp

Copy link
Collaborator

@Adam-Boesky Adam-Boesky left a comment

Choose a reason for hiding this comment

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

Bang

@jdinovi jdinovi merged commit 13342aa into main Jan 10, 2024
4 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