|
IPPL API Reference
Independent Parallel Particle Layer C++ API
|
1D vector used in the context of FEM. More...
#include <FEMVector.h>
Inheritance diagram for ippl::FEMVector< T >:
Collaboration diagram for ippl::FEMVector< T >:Classes | |
| struct | Assign |
Struct for assigment operator to be used with FEMVector::unpack(). More... | |
| struct | AssignAdd |
Struct for addition+assignment operator to be used with FEMVector::unpack(). More... | |
Public Types | |
| using | value_type = T |
Dummy type definition in order for the detail::Expression defined operators to work. | |
Public Member Functions | |
| FEMVector (size_t n, std::vector< size_t > neighbors, std::vector< Kokkos::View< size_t * > > sendIdxs, std::vector< Kokkos::View< size_t * > > recvIdxs) | |
| Constructor taking size, neighbors, and halo exchange indices. | |
| KOKKOS_FUNCTION | FEMVector (const FEMVector< T > &other) |
| Copy constructor (shallow). | |
| FEMVector (size_t n) | |
| Constructor only taking size, does not create any MPI/boundary information. | |
| void | fillHalo () |
| Copy values from neighboring ranks into local halo. | |
| void | accumulateHalo () |
| Accumulate halo values in neighbor. | |
| void | setHalo (T setValue) |
Set the halo cells to setValue. | |
| FEMVector< T > & | operator= (T value) |
Set all the values of the vector to value. | |
| template<typename E , size_t N> | |
| FEMVector< T > & | operator= (const detail::Expression< E, N > &expr) |
| Set all the values of this vector to the values of the expression. | |
| FEMVector< T > & | operator= (const FEMVector< T > &v) |
Copy the values from another FEMVector to this one. | |
| KOKKOS_INLINE_FUNCTION T | operator[] (size_t i) const |
Subscript operator to get value at position i. | |
| KOKKOS_INLINE_FUNCTION T | operator() (size_t i) const |
Subscript operator to get value at position i. | |
| const Kokkos::View< T * > & | getView () const |
| Get underlying data view. | |
| size_t | size () const |
| Get the size (number of elements) of the vector. | |
| FEMVector< T > | deepCopy () const |
| Create a deep copy, where all the information of this vector is copied to a new one. | |
| template<typename K > | |
| FEMVector< K > | skeletonCopy () const |
Create a new FEMVector with different data type, but same size and boundary infromation. | |
| void | pack (const Kokkos::View< size_t * > &idxStore) |
Pack data into BoundaryInfo::commBuffer_m for MPI communication. | |
| template<typename Op > | |
| void | unpack (const Kokkos::View< size_t * > &idxStore) |
Unpack data from BoundaryInfo::commBuffer_m into FEMVector::data_m after communication. | |
Public Member Functions inherited from ippl::detail::Expression< FEMVector< T >, sizeof(detail::ViewType< T, 1 >::view_type)> | |
| KOKKOS_INLINE_FUNCTION auto | operator[] (size_t i) const |
Static Public Attributes | |
| static constexpr unsigned | dim = 1 |
Dummy parameter in order for the detail::Expression defined operators to work. | |
Static Public Attributes inherited from ippl::detail::Expression< FEMVector< T >, sizeof(detail::ViewType< T, 1 >::view_type)> | |
| static constexpr unsigned | dim |
1D vector used in the context of FEM.
This class represents a 1D vector which stores elements of type T and provides functionalities to handle halo cells and their exchanges. It can conceptually be though of being a mathemtical vector, and to this extend is used during fem to represent the vectors \(x\), \(b\) when solving the linear system \(Ax = b\).
We use this instead of an ippl::Field, because for basis functions which have DoFs at non-vertex positions a representation as a field is not easily possible.
| T | The datatype which the vector is storing. |
| using ippl::FEMVector< T >::value_type = T |
Dummy type definition in order for the detail::Expression defined operators to work.
In the file IpplOperations.h a bunch of operations are defined, we want to be able to use them with a FEMVector, the problem is that they require the class to define a value_type type. So therefore we define it here.
| ippl::FEMVector< T >::FEMVector | ( | size_t | n, |
| std::vector< size_t > | neighbors, | ||
| std::vector< Kokkos::View< size_t * > > | sendIdxs, | ||
| std::vector< Kokkos::View< size_t * > > | recvIdxs | ||
| ) |
Constructor taking size, neighbors, and halo exchange indices.
Constructor of a FEMVector taking in the size and information about the neighboring MPI ranks.
| n | The size of the vector. |
| neighbors | The ranks of the neighboring MPI tasks. |
| sendIdxs | The indices for which the data should be sent to the MPI neighbors. |
| recvIdxs | The halo cell indices. |
| KOKKOS_FUNCTION ippl::FEMVector< T >::FEMVector | ( | const FEMVector< T > & | other | ) |
Copy constructor (shallow).
Creates a shallow copy of the other vector, by copying the underlying Kokkos::View and boundary infromation.
| other | The other vector we are copying from. |
| ippl::FEMVector< T >::FEMVector | ( | size_t | n | ) |
Constructor only taking size, does not create any MPI/boundary information.
This constructor only takes the size of the vector and allocates the appropriate number of elements, it does not sotre any MPI communication or boundary infromation. This constructor is useful if only a simply vector for arithmetic is needed without the need for any communication.
| void ippl::FEMVector< T >::accumulateHalo | ( | ) |
Accumulate halo values in neighbor.
This function takes the local halo values (which are part of another ranks values) and sums them to these corresponding values of the neighbor ranks.
| FEMVector< T > ippl::FEMVector< T >::deepCopy | ( | ) | const |
Create a deep copy, where all the information of this vector is copied to a new one.
Returns a FEMVector which is an exact copy of this one. All the information (elements, MPI information, etc.) are explicitly copied (i.e. deep copy).
| void ippl::FEMVector< T >::fillHalo | ( | ) |
Copy values from neighboring ranks into local halo.
This function takes the local values which are part of other ranks halos and copies them to the corresponding halo cells of those neighbors.
| const Kokkos::View< T * > & ippl::FEMVector< T >::getView | ( | ) | const |
Get underlying data view.
Returns a constant reference to the underlying data the FEMVector is storing, this corresponds to a Kokkos::View living on the default device.
| KOKKOS_INLINE_FUNCTION T ippl::FEMVector< T >::operator() | ( | size_t | i | ) | const |
Subscript operator to get value at position i.
This function returns the value of the vector at index i, it is equivalent to FEMVector::operator().
| i | The index off the value to retrieve. |
| FEMVector< T > & ippl::FEMVector< T >::operator= | ( | const detail::Expression< E, N > & | expr | ) |
Set all the values of this vector to the values of the expression.
Set the values of this vector to the values of expr
| expr | The expression from which to copy the values |
| FEMVector< T > & ippl::FEMVector< T >::operator= | ( | const FEMVector< T > & | v | ) |
Copy the values from another FEMVector to this one.
Sets the element values of this vector to the ones of v, only the values are set everything else (MPI config, boundaries) are ignored.
| v | The other vector to copy values from. |
| FEMVector< T > & ippl::FEMVector< T >::operator= | ( | T | value | ) |
Set all the values of the vector to value.
Sets all the values in the vector to value this also includes the halo cells.
| value | The value to which the entries should be set. |
| KOKKOS_INLINE_FUNCTION T ippl::FEMVector< T >::operator[] | ( | size_t | i | ) | const |
Subscript operator to get value at position i.
This function returns the value of the vector at index i, it is equivalent to FEMVector::operator().
| i | The index off the value to retrieve. |
| void ippl::FEMVector< T >::pack | ( | const Kokkos::View< size_t * > & | idxStore | ) |
Pack data into BoundaryInfo::commBuffer_m for MPI communication.
This function takes data from the vector accoding to idxStore and stores it inside of BoundaryInfo::commBuffer_m.
| idxStore | A 1D Kokkos view which stores the the indices for FEMVector::data_m which we want to send. |
| void ippl::FEMVector< T >::setHalo | ( | T | setValue | ) |
Set the halo cells to setValue.
| setValue | The value to which the halo cells should be set. |
| FEMVector< K > ippl::FEMVector< T >::skeletonCopy | ( | ) | const |
Create a new FEMVector with different data type, but same size and boundary infromation.
This function is used to create a new FEMVector with same size and boundary infromation, but of different data type. The boundary information is copied over via a deep copy fashion.
| K | The data type of the new vector. |
| void ippl::FEMVector< T >::unpack | ( | const Kokkos::View< size_t * > & | idxStore | ) |
Unpack data from BoundaryInfo::commBuffer_m into FEMVector::data_m after communication.
This function takes data from BoundaryInfo::commBuffer_m and stores it accoding to idxStore in FEMVector::data_m.
| idxStore | A 1D Kokkos view which stores the the indices for FEMVector::data_m to which we want to store. |
| Op | The operator to use in order to update the values in FEMVector::data_m. |
|
staticconstexpr |
Dummy parameter in order for the detail::Expression defined operators to work.
In the file IpplOperations.h a bunch of operations are defined, we want to be able to use them with a FEMVector, the problem is that they require the class to have a dim parameter, therefore we have one here.