IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
ippl::OrthogonalRecursiveBisection< Field, Tp > Class Template Reference

#include <OrthogonalRecursiveBisection.h>

Inheritance diagram for ippl::OrthogonalRecursiveBisection< Field, Tp >:
Collaboration diagram for ippl::OrthogonalRecursiveBisection< Field, Tp >:

Public Member Functions

void initialize (FieldLayout< Dim > &fl, mesh_type &mesh, const Field &rho)
template<typename Attrib>
bool binaryRepartition (const Attrib &R, FieldLayout< Dim > &fl, const bool &isFirstRepartition)
int findCutAxis (NDIndex< Dim > &dom)
void perpendicularReduction (std::vector< Tf > &rankWeights, unsigned int cutAxis, NDIndex< Dim > &dom)
int findMedian (std::vector< Tf > &w)
void cutDomain (std::vector< NDIndex< Dim > > &domains, std::vector< int > &procs, int it, int cutAxis, int median)
template<typename Attrib>
void scatterR (const Attrib &r)

Public Attributes

Field bf_m

Private Types

using mesh_type = typename Field::Mesh_t
using Tf = typename Field::value_type

Static Private Attributes

static constexpr unsigned Dim = Field::dim

Detailed Description

template<class Field, class Tp = typename Field::value_type>
class ippl::OrthogonalRecursiveBisection< Field, Tp >

Definition at line 28 of file OrthogonalRecursiveBisection.h.

Member Typedef Documentation

◆ mesh_type

template<class Field, class Tp = typename Field::value_type>
using ippl::OrthogonalRecursiveBisection< Field, Tp >::mesh_type = typename Field::Mesh_t
private

Definition at line 30 of file OrthogonalRecursiveBisection.h.

◆ Tf

template<class Field, class Tp = typename Field::value_type>
using ippl::OrthogonalRecursiveBisection< Field, Tp >::Tf = typename Field::value_type
private

Definition at line 31 of file OrthogonalRecursiveBisection.h.

Member Function Documentation

◆ binaryRepartition()

template<class Field, class Tp>
template<typename Attrib>
bool ippl::OrthogonalRecursiveBisection< Field, Tp >::binaryRepartition ( const Attrib & R,
FieldLayout< Dim > & fl,
const bool & isFirstRepartition )

Performs scatter operation of particle positions in field (weights) and repartitions FieldLayout's global domain

Template Parameters
Attribthe particle attribute type (memory space must be accessible to field memory)
Parameters
RWeights to scatter
flFieldLayout
isFirstRepartitionboolean which tells whether to scatter or not

Definition at line 14 of file OrthogonalRecursiveBisection.hpp.

References bf_m, ippl::FieldLayout< Dim >::comm, cutDomain(), findCutAxis(), findMedian(), ippl::FieldLayout< Dim >::getDomain(), IpplTimings::getTimer(), perpendicularReduction(), scatterR(), ippl::mpi::Communicator::size(), IpplTimings::startTimer(), IpplTimings::stopTimer(), and ippl::FieldLayout< Dim >::updateLayout().

Here is the call graph for this function:

◆ cutDomain()

template<class Field, class Tp>
void ippl::OrthogonalRecursiveBisection< Field, Tp >::cutDomain ( std::vector< NDIndex< Dim > > & domains,
std::vector< int > & procs,
int it,
int cutAxis,
int median )

Splits the domain given by the iterator along the cut axis at the median, the corresponding index will be cut between median and median+1

Parameters
domainsSet of subdomains which will be cut
procsSet of ranks count associated to each subdomain
itIterator
cutAxisIndex of cut axis
medianMedian

Definition at line 241 of file OrthogonalRecursiveBisection.hpp.

References first(), and ippl::NDIndex< Dim >::split().

Referenced by binaryRepartition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findCutAxis()

template<class Field, class Tp>
int ippl::OrthogonalRecursiveBisection< Field, Tp >::findCutAxis ( NDIndex< Dim > & dom)

Find cutting axis as the longest axis of the field layout.

Parameters
domDomain to reduce

Definition at line 125 of file OrthogonalRecursiveBisection.hpp.

References ippl::NDIndex< Dim >::begin(), and ippl::NDIndex< Dim >::end().

Referenced by binaryRepartition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findMedian()

template<class Field, class Tp>
int ippl::OrthogonalRecursiveBisection< Field, Tp >::findMedian ( std::vector< Tf > & w)

Find median of array

Parameters
wArray of real numbers

Definition at line 203 of file OrthogonalRecursiveBisection.hpp.

Referenced by binaryRepartition().

Here is the caller graph for this function:

◆ initialize()

template<class Field, class Tp>
void ippl::OrthogonalRecursiveBisection< Field, Tp >::initialize ( FieldLayout< Dim > & fl,
mesh_type & mesh,
const Field & rho )

Initialize member field with mesh and field layout

Parameters
fl
meshMesh
rhoDensity field

Definition at line 6 of file OrthogonalRecursiveBisection.hpp.

References bf_m.

◆ perpendicularReduction()

template<class Field, class Tp>
void ippl::OrthogonalRecursiveBisection< Field, Tp >::perpendicularReduction ( std::vector< Tf > & rankWeights,
unsigned int cutAxis,
NDIndex< Dim > & dom )

Performs reduction on local field in all dimension except that determined by cutAxis, stores result in res

Parameters
rankWeightsArray giving the result of reduction
cutAxisIndex of cut axis
domDomain to reduce

Definition at line 134 of file OrthogonalRecursiveBisection.hpp.

References ippl::apply(), bf_m, ippl::createRangePolicy(), Dim, first(), ippl::NDIndex< Dim >::first(), and ippl::parallel_reduce().

Referenced by binaryRepartition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scatterR()

template<class Field, class Tp>
template<typename Attrib>
void ippl::OrthogonalRecursiveBisection< Field, Tp >::scatterR ( const Attrib & r)

Scattering of particle positions in field using a CIC method

Template Parameters
Attribthe particle attribute type (memory space must be accessible to field memory)
Parameters
rWeights

Definition at line 258 of file OrthogonalRecursiveBisection.hpp.

References bf_m, Dim, ippl::NDIndex< Dim >::first(), ippl::FieldLayout< Dim >::getLocalNDIndex(), ippl::Mesh< T, Dim >::getMeshSpacing(), and ippl::Mesh< T, Dim >::getOrigin().

Referenced by binaryRepartition().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ bf_m

template<class Field, class Tp = typename Field::value_type>
Field ippl::OrthogonalRecursiveBisection< Field, Tp >::bf_m

◆ Dim

template<class Field, class Tp = typename Field::value_type>
unsigned ippl::OrthogonalRecursiveBisection< Field, Tp >::Dim = Field::dim
staticconstexprprivate

Definition at line 29 of file OrthogonalRecursiveBisection.h.

Referenced by perpendicularReduction(), and scatterR().


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