peclet-amr 0.2.0
Block-local-Morton AMR octree + collocated cut-cell Navier–Stokes solver (header-only C++20, Kokkos + MPI)
Loading...
Searching...
No Matches
peclet::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 Octree & octree () const

Detailed Description

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

Definition at line 30 of file barnes_hut.hpp.

Member Typedef Documentation

◆ Octree

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

Definition at line 32 of file barnes_hut.hpp.

◆ M

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

Definition at line 33 of file barnes_hut.hpp.

◆ Code

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

Definition at line 34 of file barnes_hut.hpp.

◆ Coord

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

Definition at line 35 of file barnes_hut.hpp.

Member Function Documentation

◆ build()

template<int Dim = 3, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::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 39 of file barnes_hut.hpp.

◆ acceleration()

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

Approximate acceleration on particle pi.

Definition at line 102 of file barnes_hut.hpp.

Referenced by accelerations().

◆ accelerations()

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

Definition at line 108 of file barnes_hut.hpp.

References acceleration().

◆ accelerationDirect()

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

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

Definition at line 116 of file barnes_hut.hpp.

◆ octree()

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

Definition at line 124 of file barnes_hut.hpp.


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