DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
|
This class forms the interface for interpolating data to an arbitrary set of points. This class is compatible with MPI, where the partitioning of cells and the points need not be compatible. As in the points need not lie within the cells assigned to the processor. More...
#include <InterpolateCellWiseDataToPoints.h>
Public Member Functions | |
InterpolateCellWiseDataToPoints (const std::vector< std::shared_ptr< const dftfe::utils::Cell< 3 > > > &srcCells, std::vector< std::shared_ptr< InterpolateFromCellToLocalPoints< memorySpace > > > interpolateLocalObj, const std::vector< std::vector< double > > &targetPts, const std::vector< unsigned int > &numDofsPerElem, const unsigned int verbosity, const MPI_Comm &mpiComm) | |
This constructor computes the mapping between the targetPts and srcCells. In case of incompatible partitioning, some targetPts can lie outside the cells assigned to the processor. In that case, the unmapped points are sent to other processors. Similarly it receives points from other processors and checks if any of them lies within its cells. Once all the points that lie within its cells are found, they are then passed to interpolateLocalObj, which provides the functionality to interpolate to those points. | |
void | interpolateSrcDataToTargetPoints (const std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< memorySpace > > &BLASWrapperPtr, const dftfe::linearAlgebra::MultiVector< T, memorySpace > &inputVec, const unsigned int numberOfVectors, const dftfe::utils::MemoryStorage< dftfe::global_size_type, memorySpace > &mapVecToCells, dftfe::utils::MemoryStorage< T, memorySpace > &outputData, const unsigned int blockSizeOfInputData, const unsigned int blockSizeOfOutputData, const unsigned int startIndexOfInputData, bool resizeData=false) |
This function interpolates from the data to the points passed to the constructor. The function copies the nodal data to cell wise data and then interpolates to all the points that lie within that cell. Then they are copied to the output vector. At the end a mpi call is performed to gather the value of points that do not lie within processor from othe processors. | |
void | interpolateSrcDataToTargetPoints (const std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > &BLASWrapperPtr, const distributedCPUVec< T > &inputVec, const unsigned int numberOfVectors, const dftfe::utils::MemoryStorage< dftfe::global_size_type, dftfe::utils::MemorySpace::HOST > &mapVecToCells, dftfe::utils::MemoryStorage< T, dftfe::utils::MemorySpace::HOST > &outputData, const unsigned int blockSizeOfInputData, const unsigned int blockSizeOfOutputData, const unsigned int startIndexOfInputData, bool resizeData=false) |
The function is same as above but set to dealii:distributed::Vector. | |
Private Member Functions | |
void | checkIfAllPointsAreFound (const std::vector< std::vector< double > > &targetPts) |
This class forms the interface for interpolating data to an arbitrary set of points. This class is compatible with MPI, where the partitioning of cells and the points need not be compatible. As in the points need not lie within the cells assigned to the processor.
dftfe::InterpolateCellWiseDataToPoints< T, memorySpace >::InterpolateCellWiseDataToPoints | ( | const std::vector< std::shared_ptr< const dftfe::utils::Cell< 3 > > > & | srcCells, |
std::vector< std::shared_ptr< InterpolateFromCellToLocalPoints< memorySpace > > > | interpolateLocalObj, | ||
const std::vector< std::vector< double > > & | targetPts, | ||
const std::vector< unsigned int > & | numDofsPerElem, | ||
const unsigned int | verbosity, | ||
const MPI_Comm & | mpiComm ) |
This constructor computes the mapping between the targetPts and srcCells. In case of incompatible partitioning, some targetPts can lie outside the cells assigned to the processor. In that case, the unmapped points are sent to other processors. Similarly it receives points from other processors and checks if any of them lies within its cells. Once all the points that lie within its cells are found, they are then passed to interpolateLocalObj, which provides the functionality to interpolate to those points.
[in] | srcCells | Cells that are assigned to the processor |
[in] | interpolateLocalObj | Class that can take in a Cell and provide the functionality to interpolate to points that lie within that Cell. |
[in] | targetPts | The set of points onto which the data needs to be interpolated |
[in] | numDofsPerElem | The number of basis function that is non-zero overlap with each cell. This is set to be a vector so that different cells can have different number of basis functions. |
[in] | mpiComm | The mpi communicator which has been used for the domain decomposition |
|
private |
void dftfe::InterpolateCellWiseDataToPoints< T, memorySpace >::interpolateSrcDataToTargetPoints | ( | const std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > & | BLASWrapperPtr, |
const distributedCPUVec< T > & | inputVec, | ||
const unsigned int | numberOfVectors, | ||
const dftfe::utils::MemoryStorage< dftfe::global_size_type, dftfe::utils::MemorySpace::HOST > & | mapVecToCells, | ||
dftfe::utils::MemoryStorage< T, dftfe::utils::MemorySpace::HOST > & | outputData, | ||
const unsigned int | blockSizeOfInputData, | ||
const unsigned int | blockSizeOfOutputData, | ||
const unsigned int | startIndexOfInputData, | ||
bool | resizeData = false ) |
The function is same as above but set to dealii:distributed::Vector.
[in] | BLASWrapperPtr | BLAS Wrapper that provides the handle to the linear algebra routines |
[in] | inputVec | The input data. The input data should be of size locally_owned*numberOfVectors |
[in] | numberOfVectors | The number of vectors (blockSize) in the input data |
[in] | mapVecToCells | The mapping that tells the nodal data to the cell wise data |
[out] | outputData | The output where the nodal data is interpolated to the points. The memory layout of outputData is as follows - the memory is stored in the same order as the target points. In addition to the target points, there are ghost points which are points that lie within its cells but lie in cells assigned to a different processor. |
[in] | resizeData | The output data should be of size (locally owned + ghost)*numberOfVectors If the flag resizeData is set to true, outputData is resized appropriately. |
void dftfe::InterpolateCellWiseDataToPoints< T, memorySpace >::interpolateSrcDataToTargetPoints | ( | const std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< memorySpace > > & | BLASWrapperPtr, |
const dftfe::linearAlgebra::MultiVector< T, memorySpace > & | inputVec, | ||
const unsigned int | numberOfVectors, | ||
const dftfe::utils::MemoryStorage< dftfe::global_size_type, memorySpace > & | mapVecToCells, | ||
dftfe::utils::MemoryStorage< T, memorySpace > & | outputData, | ||
const unsigned int | blockSizeOfInputData, | ||
const unsigned int | blockSizeOfOutputData, | ||
const unsigned int | startIndexOfInputData, | ||
bool | resizeData = false ) |
This function interpolates from the data to the points passed to the constructor. The function copies the nodal data to cell wise data and then interpolates to all the points that lie within that cell. Then they are copied to the output vector. At the end a mpi call is performed to gather the value of points that do not lie within processor from othe processors.
[in] | BLASWrapperPtr | BLAS Wrapper that provides the handle to the linear algebra routines |
[in] | inputVec | The input data. The input data should be of size locally_owned*numberOfVectors |
[in] | numberOfVectors | The number of vectors (blockSize) in the input data |
[in] | mapVecToCells | The mapping that tells the nodal data to the cell wise data |
[out] | outputData | The output where the nodal data is interpolated to the points. The memory layout of outputData is as follows - the memory is stored in the same order as the target points. In addition to the target points, there are ghost points which are points that lie within its cells but lie in cells assigned to a different processor. |
[in] | resizeData | The output data should be of size (locally owned + ghost)*numberOfVectors If the flag resizeData is set to true, outputData is resized appropriately. |
|
private |
|
private |
TODO check if M=8 is optimal.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |