|
IPPL API Reference
Independent Parallel Particle Layer C++ API
|
SubFieldLayout provides a layout for a sub-region of a larger field. More...
#include <SubFieldLayout.h>
Inheritance diagram for ippl::SubFieldLayout< Dim >:
Collaboration diagram for ippl::SubFieldLayout< Dim >:Public Types | |
| using | NDIndex_t = NDIndex< Dim > |
| using | view_type = typename detail::ViewType< NDIndex_t, 1 >::view_type |
| using | host_mirror_type = typename view_type::host_mirror_type |
Public Types inherited from ippl::FieldLayout< Dim > | |
| using | NDIndex_t = NDIndex< Dim > |
| using | view_type = typename detail::ViewType< NDIndex_t, 1 >::view_type |
| using | host_mirror_type = typename view_type::host_mirror_type |
| using | rank_list = std::vector< int > |
| using | bounds_list = std::vector< bound_type > |
| using | neighbor_list = std::array< rank_list, detail::countHypercubes(Dim) - 1 > |
| using | neighbor_range_list = std::array< bounds_list, detail::countHypercubes(Dim) - 1 > |
Public Member Functions | |
| SubFieldLayout (const mpi::Communicator &=MPI_COMM_WORLD) | |
| Default constructor, which should only be used if you are going to call 'initialize' soon after (before using in any context) | |
| SubFieldLayout (mpi::Communicator, const NDIndex< Dim > &domain, const NDIndex< Dim > &subDomain, std::array< bool, Dim > decomp, bool isAllPeriodic=false) | |
| Constructor that creates a SubFieldLayout for a sub-region of a larger domain. | |
| SubFieldLayout (mpi::Communicator, const NDIndex< Dim > &domain, std::array< bool, Dim > decomp, bool isAllPeriodic=false) | |
| Constructor for full-domain layout. | |
| virtual | ~SubFieldLayout ()=default |
| Destructor: Everything deletes itself automatically. | |
| void | initialize (const NDIndex< Dim > &domain, const NDIndex< Dim > &subDomain, std::array< bool, Dim > decomp, bool isAllPeriodic=false) |
| Initializes a SubFieldLayout with the sub-domain partitioned in the same way as the original FieldLayout partitiones the full domain. | |
| void | initialize (const NDIndex< Dim > &domain, std::array< bool, Dim > decomp, bool isAllPeriodic=false) |
| Initializes a SubFieldLayout using the domain as both the full domain and sub-domain. | |
| const NDIndex< Dim > & | getOriginDomain () const |
| Return the original domain before sub-region extraction. | |
| template<unsigned Dim2> | |
| bool | operator== (const SubFieldLayout< Dim2 > &x) const |
| Compare SubFieldLayouts to see if they represent the same domain. | |
| template<unsigned Dim2> | |
| bool | operator== (const FieldLayout< Dim2 > &x) const |
| Compare SubFieldLayout to a FieldLayout to see if they represent the same domain. | |
Public Member Functions inherited from ippl::FieldLayout< Dim > | |
| FieldLayout (const mpi::Communicator &=MPI_COMM_WORLD) | |
| FieldLayout (mpi::Communicator, const NDIndex< Dim > &domain, std::array< bool, Dim > decomp, bool isAllPeriodic=false) | |
| void | initialize (const NDIndex< Dim > &domain, std::array< bool, Dim > decomp, bool isAllPeriodic=false) |
| const NDIndex< Dim > & | getDomain () const |
| template<unsigned Dim2> | |
| bool | operator== (const FieldLayout< Dim2 > &x) const |
| bool | operator== (const FieldLayout< Dim > &x) const |
| bool | getDistribution (unsigned int d) const |
| std::array< bool, Dim > | isParallel () const |
| const NDIndex_t & | getLocalNDIndex () const |
| const NDIndex_t & | getLocalNDIndex (int rank) const |
| const host_mirror_type | getHostLocalDomains () const |
| const view_type | getDeviceLocalDomains () const |
| const neighbor_list & | getNeighbors () const |
| const neighbor_range_list & | getNeighborsSendRange () const |
| const neighbor_range_list & | getNeighborsRecvRange () const |
| void | findPeriodicNeighbors (const int nghost, const NDIndex< Dim > &localDomain, NDIndex< Dim > &grown, NDIndex< Dim > &neighborDomain, const int rank, std::map< unsigned int, int > &offsets, unsigned d0=0, unsigned codim=0) |
| void | findNeighbors (int nghost=1) |
| void | addNeighbors (const NDIndex_t &gnd, const NDIndex_t &nd, const NDIndex_t &ndNeighbor, const NDIndex_t &intersect, int nghost, int rank) |
| void | write (std::ostream &=std::cout) const |
| void | updateLayout (const std::vector< NDIndex_t > &domains) |
Additional Inherited Members | |
Static Public Member Functions inherited from ippl::FieldLayout< Dim > | |
| static int | getMatchingIndex (int index) |
Public Attributes inherited from ippl::FieldLayout< Dim > | |
| bool | isAllPeriodic_m |
| mpi::Communicator | comm |
Protected Member Functions inherited from ippl::FieldLayout< Dim > | |
| void | calcWidths () |
Protected Attributes inherited from ippl::FieldLayout< Dim > | |
| NDIndex_t | gDomain_m |
| Global domain. | |
| view_type | dLocalDomains_m |
| Local domains (device view) | |
| host_mirror_type | hLocalDomains_m |
| Local domains (host mirror view) | |
| std::array< bool, Dim > | isParallelDim_m |
| unsigned int | minWidth_m [Dim] |
SubFieldLayout provides a layout for a sub-region of a larger field.
SubFieldLayout extends FieldLayout to handle sub-regions of a larger computational domain. It ensures that the sub-region is partitioned in the same way as the original FieldLayout, maintaining consistent parallel decomposition and neighbor relationships within the sub-region.
| Dim | Number of spatial dimensions |
| ippl::SubFieldLayout< Dim >::SubFieldLayout | ( | const mpi::Communicator & | communicator = MPI_COMM_WORLD | ) |
Default constructor, which should only be used if you are going to call 'initialize' soon after (before using in any context)
Default constructor, which should only be used if you are going to call 'initialize' soon after (before using in any context)
| communicator | MPI communicator to use (defaults to MPI_COMM_WORLD) |
| communicator | MPI communicator to use (defaults to MPI_COMM_WORLD) |
Creates a SubFieldLayout without specifying domains. The layout must be initialized later using the initialize() methods. This constructor is useful when you need to defer the layout configuration until more information is available.
Creates a SubFieldLayout without specifying domains. The layout must be initialized later using the initialize() methods. This constructor is useful when you need to defer the layout configuration until more information is available.
| ippl::SubFieldLayout< Dim >::SubFieldLayout | ( | mpi::Communicator | communicator, |
| const NDIndex< Dim > & | domain, | ||
| const NDIndex< Dim > & | subDomain, | ||
| std::array< bool, Dim > | isParallel, | ||
| bool | isAllPeriodic = false |
||
| ) |
Constructor that creates a SubFieldLayout for a sub-region of a larger domain.
Constructor that creates a SubFieldLayout for a sub-region of a larger domain.
| communicator | MPI communicator to use |
| domain | The full domain that defines the partitioning |
| subDomain | The sub-region within the full domain, which is partitioned in the same way as the fullomain |
| decomp | Array specifying which dimensions should be parallel |
| isAllPeriodic | Whether all dimensions have periodic boundary conditions |
| communicator | MPI communicator to use |
| domain | The full domain that defines the partitioning |
| subDomain | The sub-region within the full domain, which is partitioned in the same way as the fullomain |
| decomp | Array specifying which dimensions should be parallel |
| isAllPeriodic | Whether all dimensions have periodic boundary conditions |
Implementation details: Initializes both the full domain decomposition and the sub-domain layout. The sub-domain must be contained within the full domain. All MPI ranks must have non-empty local domains after intersection with the sub-domain, otherwise an exception will be thrown.
This constructor sets up the parallel decomposition based on the full domain, then restricts the full domain to the specified sub-region while maintaining the same partitioning structure.
Implementation details: Initializes both the full domain decomposition and the sub-domain layout. The sub-domain must be contained within the full domain. All MPI ranks must have non-empty local domains after intersection with the sub-domain, otherwise an exception will be thrown.
This constructor sets up the parallel decomposition based on the full domain, then restricts the full domain to the specified sub-region while maintaining the same partitioning structure.
| ippl::SubFieldLayout< Dim >::SubFieldLayout | ( | mpi::Communicator | communicator, |
| const NDIndex< Dim > & | domain, | ||
| std::array< bool, Dim > | isParallel, | ||
| bool | isAllPeriodic = false |
||
| ) |
Constructor for full-domain layout.
Constructor for full-domain layout.
| communicator | MPI communicator to use |
| domain | The full domain that defines the partitioning and is used as the sub-domain simultaneously |
| decomp | Array specifying which dimensions should be parallel |
| isAllPeriodic | Whether all dimensions have periodic boundary conditions |
| communicator | MPI communicator to use |
| domain | The full domain that defines the partitioning and is used as the sub-domain simultaneously |
| decomp | Array specifying which dimensions should be parallel |
| isAllPeriodic | Whether all dimensions have periodic boundary conditions |
Implementation details: Creates a SubFieldLayout where the sub-domain is the same as the full domain, making it functionally equivalent to a regular FieldLayout.
Implementation details: Creates a SubFieldLayout where the sub-domain is the same as the full domain, making it functionally equivalent to a regular FieldLayout.
|
inline |
Return the original domain before sub-region extraction.
| void ippl::SubFieldLayout< Dim >::initialize | ( | const NDIndex< Dim > & | domain, |
| const NDIndex< Dim > & | subDomain, | ||
| std::array< bool, Dim > | isParallel, | ||
| bool | isAllPeriodic = false |
||
| ) |
Initializes a SubFieldLayout with the sub-domain partitioned in the same way as the original FieldLayout partitiones the full domain.
Initializes a SubFieldLayout with the sub-domain partitioned in the same way as the original FieldLayout partitiones the full domain.
| domain | The full domain to be partitioned |
| subDomain | The sub-region within the full domain |
| decomp | Array specifying which dimensions should be parallel |
| isAllPeriodic | Whether all dimensions have periodic boundary conditions |
| domain | The full domain to be partitioned |
| subDomain | The sub-region within the full domain |
| decomp | Array specifying which dimensions should be parallel |
| isAllPeriodic | Whether all dimensions have periodic boundary conditions |
Implementation details: This method first partitions the full domain for parallel processing, then restricts each rank's local domain to the specified sub-domain.
The sub-domain must be contained within the full domain, and all MPI ranks must have non-empty local domains after intersection with the sub-domain, otherwise an exception will be thrown.
Implementation details: This method first partitions the full domain for parallel processing, then restricts each rank's local domain to the specified sub-domain.
The sub-domain must be contained within the full domain, and all MPI ranks must have non-empty local domains after intersection with the sub-domain, otherwise an exception will be thrown.
| void ippl::SubFieldLayout< Dim >::initialize | ( | const NDIndex< Dim > & | domain, |
| std::array< bool, Dim > | isParallel, | ||
| bool | isAllPeriodic = false |
||
| ) |
Initializes a SubFieldLayout using the domain as both the full domain and sub-domain.
Initializes a SubFieldLayout using the domain as both the full domain and sub-domain.
| domain | The domain to be partitioned |
| decomp | Array specifying which dimensions should be parallel |
| isAllPeriodic | Whether all dimensions have periodic boundary conditions |
| domain | The domain to be partitioned |
| decomp | Array specifying which dimensions should be parallel |
| isAllPeriodic | Whether all dimensions have periodic boundary conditions |
Implementation details: This method initializes the layout to use the entire domain as both the full domain and the sub-domain, making it equivalent to a regular FieldLayout.
Implementation details: This method initializes the layout to use the entire domain as both the full domain and the sub-domain, making it equivalent to a regular FieldLayout.
|
inline |
Compare SubFieldLayout to a FieldLayout to see if they represent the same domain.
| Dim2 | Dimension of the FieldLayout |
| x | The FieldLayout to compare with |
|
inline |
Compare SubFieldLayouts to see if they represent the same domain.
| Dim2 | Dimension of the other SubFieldLayout |
| x | The other SubFieldLayout to compare with |