core
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
Loading...
Searching...
No Matches
peclet::core::amr::BarnesHut< Dim, Bits > Class Template Reference

#include <barnes_hut.hpp>

Public Types

using Octree = BlockOctree< Dim, Bits >
 
using M = typename Octree::M
 
using Code = typename Octree::Code
 
using Coord = typename Octree::Coord
 

Public Member Functions

void build (const std::vector< Vec< Dim > > &pos, const std::vector< double > &mass, const AmrGeometry< Dim > &geo, unsigned lmax, double theta, double soft=1e-3)
 Build the tree from particle positions (+ masses) inside the world box described by geo (origin + h0; the box spans 2^lmax fine cells per axis).
 
Vec< Dim > acceleration (Index pi) const
 Approximate acceleration on particle pi.
 
std::vector< Vec< Dim > > accelerations () const
 
Vec< Dim > accelerationDirect (Index pi) const
 Direct O(N^2) reference acceleration on particle pi (for validation).
 
const Octreeoctree () const
 

Detailed Description

template<int Dim = 3, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
class peclet::core::amr::BarnesHut< Dim, Bits >

Definition at line 32 of file barnes_hut.hpp.

Member Typedef Documentation

◆ Octree

template<int Dim = 3, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
using peclet::core::amr::BarnesHut< Dim, Bits >::Octree = BlockOctree<Dim, Bits>

Definition at line 34 of file barnes_hut.hpp.

◆ M

template<int Dim = 3, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
using peclet::core::amr::BarnesHut< Dim, Bits >::M = typename Octree::M

Definition at line 35 of file barnes_hut.hpp.

◆ Code

template<int Dim = 3, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
using peclet::core::amr::BarnesHut< Dim, Bits >::Code = typename Octree::Code

Definition at line 36 of file barnes_hut.hpp.

◆ Coord

template<int Dim = 3, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
using peclet::core::amr::BarnesHut< Dim, Bits >::Coord = typename Octree::Coord

Definition at line 37 of file barnes_hut.hpp.

Member Function Documentation

◆ build()

template<int Dim = 3, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::core::amr::BarnesHut< Dim, Bits >::build ( const std::vector< Vec< Dim > > &  pos,
const std::vector< double > &  mass,
const AmrGeometry< Dim > &  geo,
unsigned  lmax,
double  theta,
double  soft = 1e-3 
)
inline

Build the tree from particle positions (+ masses) inside the world box described by geo (origin + h0; the box spans 2^lmax fine cells per axis).

Definition at line 41 of file barnes_hut.hpp.

References peclet::core::amr::BlockOctree< Dim, Bits >::code(), peclet::core::amr::BlockOctree< Dim, Bits >::init(), peclet::core::amr::BlockOctree< Dim, Bits >::level(), peclet::core::amr::BlockOctree< Dim, Bits >::numLeaves(), and peclet::core::amr::BlockOctree< Dim, Bits >::refineIf().

◆ acceleration()

template<int Dim = 3, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
Vec< Dim > peclet::core::amr::BarnesHut< Dim, Bits >::acceleration ( Index  pi) const
inline

Approximate acceleration on particle pi.

Definition at line 104 of file barnes_hut.hpp.

Referenced by peclet::core::amr::BarnesHut< Dim, Bits >::accelerations().

◆ accelerations()

template<int Dim = 3, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
std::vector< Vec< Dim > > peclet::core::amr::BarnesHut< Dim, Bits >::accelerations ( ) const
inline

◆ accelerationDirect()

template<int Dim = 3, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
Vec< Dim > peclet::core::amr::BarnesHut< Dim, Bits >::accelerationDirect ( Index  pi) const
inline

Direct O(N^2) reference acceleration on particle pi (for validation).

Definition at line 118 of file barnes_hut.hpp.

◆ octree()

template<int Dim = 3, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
const Octree & peclet::core::amr::BarnesHut< Dim, Bits >::octree ( ) const
inline

Definition at line 126 of file barnes_hut.hpp.


The documentation for this class was generated from the following file: