20#ifndef DFTFE_ATOMICCENTEREDNONLOCALOPERATOR_H
21#define DFTFE_ATOMICCENTEREDNONLOCALOPERATOR_H
64 template <
typename ValueType, dftfe::utils::MemorySpace memorySpace>
74 std::shared_ptr<AtomCenteredSphericalFunctionContainer>
75 atomCenteredSphericalFunctionContainer,
76 const MPI_Comm &mpi_comm_parent,
77 const bool memOptMode =
false,
78 const bool floatingNuclearCharges =
true,
79 const bool useGlobalCMatrix =
false,
80 const bool computeIonForces =
false,
81 const bool computeCellStress =
false);
110 &sphericalFunctionKetTimesVectorParFlattened,
126 const bool updateSparsity,
127 const std::vector<double> &kPointWeights,
128 const std::vector<double> &kPointCoordinates,
152 template <
typename ValueTypeSrc>
155 const bool updateSparsity,
156 const std::vector<double> &kPointWeights,
157 const std::vector<double> &kPointCoordinates,
167 const std::shared_ptr<
169 nonLocalOperatorSrc);
170#if defined(DFTFE_WITH_DEVICE)
185 initialiseCellWaveFunctionPointers(
187 &cellWaveFunctionMatrix,
189 const std::vector<nonLocalContractionVectorType>
190 NonLocalContractionVectorType = {
194 freeDeviceVectors(
const std::vector<nonLocalContractionVectorType>
195 NonLocalContractionVectorType = {
206 const std::vector<dftfe::uInt> &
234 std::vector<dftfe::uInt> &
237 std::vector<dftfe::uInt> &
240 std::vector<dftfe::uInt> &
243 const std::vector<ValueType> &
246 const std::vector<ValueType> &
249 const std::map<dftfe::uInt, std::vector<dftfe::uInt>> &
252 const std::vector<dftfe::uInt> &
255 const std::vector<dftfe::uInt> &
262 const std::vector<dftfe::uInt> &
268 const std::map<dftfe::uInt, std::vector<dftfe::uInt>> &
274 const std::vector<dftfe::uInt> &
277 const std::vector<dftfe::uInt> &
280 const std::vector<dftfe::uInt> &
295 PconjtransposePmatrix);
319 &sphericalFunctionKetTimesVectorParFlattened,
320 const bool flagCopyResultsToMatrix =
true);
328 &sphericalFunctionKetTimesVectorParFlattened,
342 &sphericalFunctionKetTimesVectorParFlattened,
343 const bool skipComm =
false,
355 const std::pair<dftfe::uInt, dftfe::uInt> cellRange);
365 const std::pair<dftfe::uInt, dftfe::uInt> cellRange);
375 const std::pair<dftfe::uInt, dftfe::uInt> cellRange);
386 const std::pair<dftfe::uInt, dftfe::uInt> cellRange);
426 &sphericalFunctionKetTimesVectorParFlattened,
427 const bool flagScaleInternalMatrix =
false);
450 &sphericalFunctionKetTimesVectorParFlattened,
462 const std::pair<dftfe::uInt, dftfe::uInt> cellRange);
476 std::vector<ValueType>
483 const std::pair<dftfe::uInt, dftfe::uInt> cellRange)
const;
494 std::vector<ValueType> &entriesPadded,
500 const std::vector<ValueType> &
506 const std::vector<ValueType> &
513 std::vector<dftfe::utils::MemoryStorage<ValueType, memorySpace>>> &
539 &VCconjTransXsphericalFunctionKetTimesVectorParFlattened,
541 &sphericalFunctionKetTimesVectorParFlattened,
542 const std::map<dftfe::uInt, dftfe::uInt> nonlocalAtomIdToGlobalIdMap,
543 std::vector<ValueType> &outputVector);
565 &sphericalFunctionKetTimesVectorParFlattened,
566 const bool flagScaleInternalMatrix =
false);
588 &sphericalFunctionKetTimesVectorParFlattened,
589 const bool flagScaleInternalMatrix =
false);
595 std::shared_ptr<dftfe::linearAlgebra::BLASWrapper<memorySpace>>
597 std::shared_ptr<AtomCenteredSphericalFunctionContainer>
612 std::vector<ValueType>
616 std::map<dftfe::uInt, std::vector<dftfe::uInt>>
629 std::map<dftfe::uInt, std::vector<dftfe::uInt>>
639 std::vector<distributedCPUVec<std::complex<double>>>
646 std::map<std::pair<dftfe::uInt, dftfe::uInt>,
dftfe::uInt>
652 std::map<std::pair<dftfe::uInt, dftfe::uInt>,
dftfe::uInt>
654 std::vector<std::vector<
655 std::vector<dftfe::utils::MemoryStorage<ValueType, memorySpace>>>>
689 std::vector<std::vector<std::vector<ValueType>>>
702 const std::vector<double> &kPointCoordinates);
730 template <
typename ValueTypeSrc>
733 const std::shared_ptr<
743 template <
typename ValueTypeSrc>
746 const std::shared_ptr<
777 std::vector<dftfe::uInt>
790 std::vector<dftfe::utils::MemoryStorage<ValueType, memorySpace>>>
796 std::vector<dftfe::utils::MemoryStorage<ValueType, memorySpace>>
822#if defined(DFTFE_WITH_DEVICE)
830 copyDistributedVectorToPaddedMemoryStorageVectorDevice(
832 &sphericalFunctionKetTimesVectorParFlattened,
844 copyPaddedMemoryStorageVectorToDistributeVectorDevice(
847 &sphericalFunctionKetTimesVectorParFlattened);
851 ValueType *d_wfcStartPointer;
853 std::vector<ValueType **> deviceWfcPointersInCellRange,
854 devicePointerCDaggerInCellRange, devicePointerCDaggerOutTempInCellRange;
855 std::vector<std::vector<ValueType **>> devicePointerDDaggerInCellRange,
856 devicePointerDDaggerOutTempInCellRange,
857 devicePointerDdyadicRDaggerInCellRange,
858 devicePointerDdyadicRDaggerOutTempInCellRange,
859 devicePointerCRDaggerInCellRange, devicePointerCRDaggerOutTempInCellRange;
860 std::vector<ValueType **> hostWfcPointersInCellRange,
861 hostPointerCDaggerInCellRange, hostPointerCDaggerOutTempInCellRange;
862 std::vector<std::vector<ValueType **>> hostPointerDDaggerInCellRange,
863 hostPointerDDaggerOutTempInCellRange,
864 hostPointerDdyadicRDaggerInCellRange,
865 hostPointerDdyadicRDaggerOutTempInCellRange,
866 hostPointerCRDaggerInCellRange, hostPointerCRDaggerOutTempInCellRange;
867 std::vector<ValueType *> d_wfcStartPointerInCellRange;
869 std::vector<dftfe::uInt> d_nonLocalElementsInCellRange;
871 std::vector<dftfe::uInt> d_nonlocalElemIdToLocalElemIdMap;
872 std::vector<std::vector<std::pair<dftfe::uInt, dftfe::uInt>>>
873 d_elementIdToNonLocalElementIdMap;
878 d_sphericalFnTimesVectorDevice;
880 d_sphericalFnTimesWavefunctionMatrix;
882 d_sphericalFnTimesXTimesWavefunctionMatrix;
884 d_sphericalFnTimesGradientWavefunctionMatrix;
886 d_sphericalFnTimesGradientWavefunctionDyadicXMatrix;
891 std::vector<ValueType>
892 d_IntegralFEMShapeFunctionValueTimesAtomicSphericalFunctionConjugate;
894 d_IntegralFEMShapeFunctionValueTimesAtomicSphericalFunctionConjugateDevice;
895 std::vector<ValueType>
896 d_IntegralFEMShapeFunctionValueTimesAtomicSphericalFunctionTranspose;
898 d_IntegralFEMShapeFunctionValueTimesAtomicSphericalFunctionTransposeDevice;
902 std::vector<ValueType>
903 d_IntegralFEMShapeFunctionValueTimesXTimesAtomicSphericalFunctionConjugate;
905 d_IntegralFEMShapeFunctionValueTimesXTimesAtomicSphericalFunctionConjugateDevice;
908 std::vector<ValueType>
909 d_IntegralGradientFEMShapeFunctionValueTimesAtomicSphericalFunctionConjugate;
911 d_IntegralGradientFEMShapeFunctionValueTimesAtomicSphericalFunctionConjugateDevice;
914 std::vector<ValueType>
915 d_IntegralGradientFEMShapeFunctionValueDyadicAtomicSphericalFunctionTimesRConjugate;
917 d_IntegralGradientFEMShapeFunctionValueDyadicAtomicSphericalFunctionTimesRConjugateDevice;
921 d_cellHamMatrixTimesWaveMatrixNonLocalDevice;
923 d_sphericalFnTimesVectorAllCellsDevice;
925 d_sphericalFnTimesXTimesVectorAllCellsDevice;
927 d_sphericalFnTimesGradientVectorAllCellsDevice;
929 d_sphericalFnTimesRDyadicGradientVectorAllCellsDevice;
932 std::vector<dftfe::uInt> d_mapSphericalFnTimesVectorAllCellsReduction;
934 d_mapSphericalFnTimesVectorAllCellsReductionDevice;
938 d_couplingMatrixTimesVectorDevice;
942 std::vector<dftfe::Int> d_sphericalFnIdsPaddedParallelNumberingMap;
944 d_sphericalFnIdsPaddedParallelNumberingMapDevice;
948 std::vector<dftfe::uInt> d_sphericalFnIdsParallelNumberingMap;
950 d_sphericalFnIdsParallelNumberingMapDevice;
955 std::vector<dftfe::Int>
956 d_indexMapFromPaddedNonLocalVecToParallelNonLocalVec;
958 d_indexMapFromPaddedNonLocalVecToParallelNonLocalVecDevice;
void applyAllReduceOnCconjtransX(dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &sphericalFunctionKetTimesVectorParFlattened, const bool skipComm=false, const nonLocalContractionVectorType NonLocalContractionVectorType=nonLocalContractionVectorType::CconjTransX)
copies the results from internal member to sphericalFunctionKetTimesVectorParFlattened,...
bool atomPresentInCellRange(const std::pair< dftfe::uInt, dftfe::uInt > cellRange) const
void initKpoints(const std::vector< double > &kPointWeights, const std::vector< double > &kPointCoordinates)
stores the d_kpointWeights, d_kpointCoordinates. Other data members regarding are computed from conta...
std::vector< ValueType > d_atomCenteredKpointIndexedSphericalFnQuadValues
Definition AtomicCenteredNonLocalOperator.h:610
void applyDDyadicRconjtransOnX(const ValueType *X, const std::pair< dftfe::uInt, dftfe::uInt > cellRange)
computes the results of CconjtransX on the cells of interst specied by cellRange
void applyVCconjtransOnX(const dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &src, const dftfe::uInt kPointIndex, const CouplingStructure couplingtype, const dftfe::utils::MemoryStorage< ValueType, memorySpace > &couplingMatrix, dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &sphericalFunctionKetTimesVectorParFlattened, const bool flagScaleInternalMatrix=false)
completes the VCconjX on nodal vector src. The src vector must have all ghost nodes and constraint no...
void applyDconjtransOnX(const ValueType *X, const std::pair< dftfe::uInt, dftfe::uInt > cellRange)
computes the results of CconjtransX on the cells of interst specied by cellRange
std::vector< dftfe::uInt > d_mapiAtomToDotProd
Definition AtomicCenteredNonLocalOperator.h:799
bool d_reinitialiseKPoint
Definition AtomicCenteredNonLocalOperator.h:683
dftfe::uInt d_totalNumSphericalFunctionsGlobal
Definition AtomicCenteredNonLocalOperator.h:787
dealii::IndexSet d_locallyOwnedAtomCenteredFnIdsCurrentProcess
Definition AtomicCenteredNonLocalOperator.h:650
std::map< dftfe::uInt, std::vector< dftfe::uInt > > d_atomIdToNonTrivialSphericalFnCellStartIndex
map from local nonlocal atomid to vector over cells
Definition AtomicCenteredNonLocalOperator.h:630
dftfe::uInt getTotalAtomInCurrentProcessor() const
std::vector< dftfe::utils::MemoryStorage< ValueType, memorySpace > > d_dotProductAtomicWaveInputWaveTemp
Definition AtomicCenteredNonLocalOperator.h:797
const std::vector< dftfe::uInt > & getSphericalFnTimesVectorFlattenedVectorLocalIds() const
Returns the Flattened vector of sphericalFunctionIDs in order of atomIDs of atoms in processor.
void initialiseFlattenedDataStructure(dftfe::uInt waveFunctionBlockSize, dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &sphericalFunctionKetTimesVectorParFlattened, const nonLocalContractionVectorType NonLocalContractionVectorType=nonLocalContractionVectorType::CconjTransX)
initialises the multivector object, waveFunctionBlockSize and resizes various internal data members....
bool d_useGlobalCMatrix
Definition AtomicCenteredNonLocalOperator.h:785
const std::vector< ValueType > & getCmatrixEntriesConjugate(const dftfe::uInt chargeId, const dftfe::uInt iElemComp) const
Returns C matrix entries for chargeId and it compact support element Id.
std::vector< double > d_kPointWeights
Definition AtomicCenteredNonLocalOperator.h:593
const dftfe::uInt d_n_mpi_processes
Definition AtomicCenteredNonLocalOperator.h:660
std::vector< ValueType > getCmatrixEntries(dftfe::Int kPointIndex, dftfe::uInt atomId, dftfe::Int iElem) const
bool d_AllReduceCompleted
Definition AtomicCenteredNonLocalOperator.h:592
const std::map< dftfe::uInt, std::vector< dftfe::uInt > > & getAtomIdToNonTrivialSphericalFnCellStartIndex() const
Required in configurational forces. Cummulative sphercial Fn Id. The size is numCells in processor.
std::map< dftfe::uInt, std::vector< dftfe::uInt > > d_cellIdToAtomIdsLocalCompactSupportMap
map from cell number to set of non local atom ids (local numbering)
Definition AtomicCenteredNonLocalOperator.h:617
std::vector< dftfe::uInt > d_flattenedNonLocalCellDofIndexToProcessDofIndexVector
Definition AtomicCenteredNonLocalOperator.h:778
void copyPartitionerKPointsAndComputeCMatrixEntries(const bool updateSparsity, const std::vector< double > &kPointWeights, const std::vector< double > &kPointCoordinates, std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, dftfe::utils::MemorySpace::HOST > > basisOperationsPtr, std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > BLASWrapperHostPtr, const dftfe::uInt quadratureIndex, const std::shared_ptr< AtomicCenteredNonLocalOperator< ValueTypeSrc, memorySpace > > nonLocalOperatorSrc)
calls internal function: initialisePartitioner, initialiseKpoint and computeCMatrixEntries
const std::vector< ValueType > & getAtomCenteredKpointTimesSphericalFnTimesDistFromAtomQuadValues() const
std::map< std::pair< dftfe::uInt, dftfe::uInt >, dftfe::uInt > d_AtomCenteredFnIdsNumberingMapCurrentProcess
Definition AtomicCenteredNonLocalOperator.h:653
std::vector< std::vector< std::vector< ValueType > > > d_CRMatrixEntriesConjugate
Definition AtomicCenteredNonLocalOperator.h:687
dftfe::uInt d_numberWaveFunctions
Definition AtomicCenteredNonLocalOperator.h:679
std::vector< dftfe::uInt > d_nonlocalElemIdToCellIdVector
Definition AtomicCenteredNonLocalOperator.h:781
const MPI_Comm d_mpi_communicator
Definition AtomicCenteredNonLocalOperator.h:658
std::vector< dftfe::uInt > d_mapiAtomTosphFuncWaveStart
Definition AtomicCenteredNonLocalOperator.h:803
dftfe::uInt d_locallyOwnedCells
Definition AtomicCenteredNonLocalOperator.h:678
const std::vector< dftfe::uInt > & getAtomIdsInCurrentProcessor() const
std::map< dftfe::uInt, std::vector< dftfe::uInt > > d_listOfiAtomInSpecies
Definition AtomicCenteredNonLocalOperator.h:804
std::set< dftfe::uInt > d_setOfAtomicNumber
Definition AtomicCenteredNonLocalOperator.h:793
dftfe::utils::MemoryStorage< dftfe::uInt, memorySpace > d_iElemNonLocalToElemIndexMap
Definition AtomicCenteredNonLocalOperator.h:675
bool d_computeIonForces
Definition AtomicCenteredNonLocalOperator.h:783
dftfe::uInt d_kPointIndex
Definition AtomicCenteredNonLocalOperator.h:680
void paddingCouplingMatrix(const std::vector< ValueType > &entries, std::vector< ValueType > &entriesPadded, const CouplingStructure couplingtype)
Called only for GPU runs where the coupling matrix has to be padded.
dftfe::uInt d_maxSingleAtomContribution
Definition AtomicCenteredNonLocalOperator.h:671
dealii::IndexSet d_ghostSphericalFunctionIdsCurrentProcess
Definition AtomicCenteredNonLocalOperator.h:662
std::vector< std::vector< std::vector< ValueType > > > d_CMatrixEntriesConjugate
Definition AtomicCenteredNonLocalOperator.h:685
std::vector< dftfe::uInt > d_nonTrivialSphericalFnsCellStartIndex
Definition AtomicCenteredNonLocalOperator.h:624
void computeInnerProductOverSphericalFnsWaveFns(const dftfe::Int vectorDimension, const dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &VCconjTransXsphericalFunctionKetTimesVectorParFlattened, const dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &sphericalFunctionKetTimesVectorParFlattened, const std::map< dftfe::uInt, dftfe::uInt > nonlocalAtomIdToGlobalIdMap, std::vector< ValueType > &outputVector)
Computes the inner products summing over the sphericalFn and WaveFns for each atom.
std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, memorySpace > > d_basisOperatorPtr
Definition AtomicCenteredNonLocalOperator.h:606
std::vector< std::vector< std::vector< ValueType > > > d_CMatrixEntriesTranspose
Definition AtomicCenteredNonLocalOperator.h:686
const std::vector< dftfe::uInt > & getNonTrivialAllCellsSphericalFnAlphaToElemIdMap() const
dftfe::uInt d_totalAtomsInCurrentProc
Definition AtomicCenteredNonLocalOperator.h:664
std::map< dftfe::uInt, dftfe::utils::MemoryStorage< ValueType, dftfe::utils::MemorySpace::HOST > > d_sphericalFnTimesGradientWavefunMatrix
Definition AtomicCenteredNonLocalOperator.h:770
std::vector< distributedCPUVec< double > > d_SphericalFunctionKetTimesVectorPar
Definition AtomicCenteredNonLocalOperator.h:643
void intitialisePartitionerKPointsAndComputeCMatrixEntries(const bool updateSparsity, const std::vector< double > &kPointWeights, const std::vector< double > &kPointCoordinates, std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, dftfe::utils::MemorySpace::HOST > > basisOperationsPtr, std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > BLASWrapperHostPtr, const dftfe::uInt quadratureIndex)
calls internal function: initialisePartitioner, initialiseKpoint and computeCMatrixEntries
dftfe::uInt d_sumNonTrivialSphericalFnOverAllCells
Definition AtomicCenteredNonLocalOperator.h:632
std::map< dftfe::uInt, dftfe::utils::MemoryStorage< ValueType, dftfe::utils::MemorySpace::HOST > > d_sphericalFnTimesWavefunMatrix
Definition AtomicCenteredNonLocalOperator.h:760
dftfe::uInt d_totalLocallyOwnedNodes
Definition AtomicCenteredNonLocalOperator.h:801
std::map< dftfe::uInt, dftfe::utils::MemoryStorage< ValueType, dftfe::utils::MemorySpace::HOST > > d_sphericalFnTimesXTimesWavefunMatrix
Definition AtomicCenteredNonLocalOperator.h:765
std::vector< std::vector< dftfe::utils::MemoryStorage< ValueType, memorySpace > > > d_CMatrixGlobal
Definition AtomicCenteredNonLocalOperator.h:791
const std::vector< dftfe::uInt > & getOwnedAtomIdsInCurrentProcessor() const
const std::vector< ValueType > & getAtomCenteredKpointIndexedSphericalFnQuadValues() const
void initialiseOperatorActionOnX(dftfe::uInt kPointIndex, const nonLocalContractionVectorType NonLocalContractionVectorType=nonLocalContractionVectorType::CconjTransX)
Resizes various internal data members and selects the kpoint of interest.
std::vector< dftfe::uInt > d_nonTrivialSphericalFnPerCell
vector of size num physical cells
Definition AtomicCenteredNonLocalOperator.h:620
void applyCRconjtransOnX(const ValueType *X, const std::pair< dftfe::uInt, dftfe::uInt > cellRange)
computes the results of CRconjtransX on the cells of interst specied by cellRange
std::vector< dftfe::uInt > d_numberCellsAccumNonLocalAtoms
Definition AtomicCenteredNonLocalOperator.h:673
void applyCOnVCconjtransX(dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &Xout)
adds the result of CVCtX onto Xout for both CPU and GPU calls
std::vector< dftfe::uInt > & getAtomWiseNumberCellsInCompactSupport() const
std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< memorySpace > > d_BLASWrapperPtr
Definition AtomicCenteredNonLocalOperator.h:596
void copyCMatrixEntries(const std::shared_ptr< AtomicCenteredNonLocalOperator< ValueTypeSrc, memorySpace > > nonLocalOperatorSrc, std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, dftfe::utils::MemorySpace::HOST > > basisOperationsPtr, const dftfe::uInt quadratureIndex)
std::vector< dftfe::uInt > d_mapiAtomToSpeciesIndex
Definition AtomicCenteredNonLocalOperator.h:795
void copyBackFromDistributedVectorToLocalDataStructure(dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &sphericalFunctionKetTimesVectorParFlattened, const dftfe::utils::MemoryStorage< double, memorySpace > &scalingVector)
After AllReduce function is called this will copy to the nonLocalOperatorClassDatastructure.
void computeCMatrixEntries(std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, dftfe::utils::MemorySpace::HOST > > basisOperationsPtr, std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > BLASWrapperHostPtr, const dftfe::uInt quadratureIndex)
computes the entries in C matrix for CPUs and GPUs. On GPUs the entries are copied to a flattened vec...
dftfe::uInt getGlobalDofAtomIdSphericalFnPair(const dftfe::uInt atomId, const dftfe::uInt alpha) const
void applyVCconjtransOnXCellLevel(const dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &src, const dftfe::uInt kPointIndex, const CouplingStructure couplingtype, const dftfe::utils::MemoryStorage< ValueType, memorySpace > &couplingMatrix, dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &sphericalFunctionKetTimesVectorParFlattened, const bool flagScaleInternalMatrix=false)
completes the VCconjX on nodal vector src. The src vector must have all ghost nodes and constraint no...
std::vector< dftfe::uInt > d_numberCellsForEachAtom
Definition AtomicCenteredNonLocalOperator.h:602
std::shared_ptr< AtomCenteredSphericalFunctionContainer > d_atomCenteredSphericalFunctionContainer
Definition AtomicCenteredNonLocalOperator.h:598
void applyVOnCconjtransX(const CouplingStructure couplingtype, const dftfe::utils::MemoryStorage< ValueType, memorySpace > &couplingMatrix, dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &sphericalFunctionKetTimesVectorParFlattened, const bool flagCopyResultsToMatrix=true)
compute the action of coupling matrix on sphericalFunctionKetTimesVectorParFlattened....
void initialisePartitioner()
creates the partitioner for the distributed vector based on sparsity patten from sphericalFn containe...
dftfe::uInt getTotalNumberOfSphericalFunctionsForAtomId(dftfe::uInt atomId)
Returns number of spherical function for a given nonlocal atom id.
std::vector< dftfe::uInt > d_atomStartIndexGlobal
Definition AtomicCenteredNonLocalOperator.h:786
std::map< dftfe::uInt, dftfe::utils::MemoryStorage< ValueType, dftfe::utils::MemorySpace::HOST > > d_sphericalFnTimesGradientWavefunDyadicXMatrix
Definition AtomicCenteredNonLocalOperator.h:775
bool atomSupportInElement(dftfe::uInt iElem) const
std::vector< dftfe::uInt > d_sphericalFnTimesVectorFlattenedVectorLocalIds
Definition AtomicCenteredNonLocalOperator.h:634
std::vector< dftfe::uInt > d_mapAtomIdToSpeciesIndex
Definition AtomicCenteredNonLocalOperator.h:794
const std::vector< dftfe::uInt > & getNonTrivialSphericalFnsCellStartIndex() const
const dftfe::utils::MemoryStorage< dftfe::uInt, memorySpace > & getFlattenedNonLocalCellDofIndexToProcessDofIndexMap() const
std::vector< std::vector< std::vector< dftfe::utils::MemoryStorage< ValueType, memorySpace > > > > d_CMatrixEntries
Definition AtomicCenteredNonLocalOperator.h:656
const std::vector< dftfe::uInt > & getNonlocalElementToCellIdVector() const
dftfe::utils::MemoryStorage< dftfe::uInt, memorySpace > d_flattenedNonLocalCellDofIndexToProcessDofIndexMap
Definition AtomicCenteredNonLocalOperator.h:780
void applyCconjtransOnX(const dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &X)
computes the results of CconjtransX on nodal X vector
dftfe::uInt d_numberNodesPerElement
Definition AtomicCenteredNonLocalOperator.h:676
bool d_isMallocCalled
Definition AtomicCenteredNonLocalOperator.h:682
std::shared_ptr< const utils::mpi::MPIPatternP2P< dftfe::utils::MemorySpace::HOST > > d_mpiPatternP2P
Definition AtomicCenteredNonLocalOperator.h:601
bool d_floatingNuclearCharges
Definition AtomicCenteredNonLocalOperator.h:782
void applyCconjtransOnX(const ValueType *X, const std::pair< dftfe::uInt, dftfe::uInt > cellRange)
computes the results of CconjtransX on the cells of interst specied by cellRange
std::vector< dftfe::uInt > & getAtomWiseNumberCellsAccumulated() const
dftfe::uInt d_totalNonLocalEntries
Definition AtomicCenteredNonLocalOperator.h:669
dealii::ConditionalOStream pcout
Definition AtomicCenteredNonLocalOperator.h:657
void applyCOnVCconjtransX(ValueType *Xout, const std::pair< dftfe::uInt, dftfe::uInt > cellRange)
adds the result of CVCtX onto Xout for both CPU and GPU calls
std::vector< dftfe::uInt > d_mapIAtomicNumToDotProd
Definition AtomicCenteredNonLocalOperator.h:798
void applyCVCconjtransOnX(const dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &src, const dftfe::uInt kPointIndex, const CouplingStructure couplingtype, const dftfe::utils::MemoryStorage< ValueType, memorySpace > &couplingMatrix, dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &sphericalFunctionKetTimesVectorParFlattened, dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &dst)
completes the action of CVCconjtranspose on nodal vector src. The src vector must have all ghost node...
const std::map< dftfe::uInt, std::vector< dftfe::uInt > > & getCellIdToAtomIdsLocalCompactSupportMap() const
void applyVCconjtransOnXUsingGlobalC(const dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &src, const dftfe::uInt kPointIndex, const CouplingStructure couplingtype, const dftfe::utils::MemoryStorage< ValueType, memorySpace > &couplingMatrix, dftfe::linearAlgebra::MultiVector< ValueType, memorySpace > &sphericalFunctionKetTimesVectorParFlattened, const bool flagScaleInternalMatrix=false)
completes the VCconjX on nodal vector src using global C matrix. The global C matrix mush have been c...
const ValueType * getCconjtansXLocalDataStructure(const dftfe::uInt iAtom) const
Returns the pointer of CTX stored in HOST memory.
std::vector< std::vector< std::vector< ValueType > > > d_DMatrixEntriesConjugate
Definition AtomicCenteredNonLocalOperator.h:688
const dftfe::uInt getTotalNonTrivialSphericalFnsOverAllCells() const
bool isGlobalCMatrix() const
const std::vector< dftfe::uInt > & getNonTrivialSphericalFnsPerCell() const
std::map< std::pair< dftfe::uInt, dftfe::uInt >, dftfe::uInt > d_sphericalFunctionIdsNumberingMapCurrentProcess
Definition AtomicCenteredNonLocalOperator.h:647
std::vector< dftfe::uInt > d_OwnedAtomIdsInCurrentProcessor
Definition AtomicCenteredNonLocalOperator.h:649
std::vector< dftfe::uInt > d_nonTrivialAllCellsSphericalFnAlphaToElemIdMap
Definition AtomicCenteredNonLocalOperator.h:626
std::vector< double > d_kPointCoordinates
Definition AtomicCenteredNonLocalOperator.h:594
AtomicCenteredNonLocalOperator(std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< memorySpace > > BLASWrapperPtr, std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, memorySpace > > basisOperatorPtr, std::shared_ptr< AtomCenteredSphericalFunctionContainer > atomCenteredSphericalFunctionContainer, const MPI_Comm &mpi_comm_parent, const bool memOptMode=false, const bool floatingNuclearCharges=true, const bool useGlobalCMatrix=false, const bool computeIonForces=false, const bool computeCellStress=false)
dftfe::uInt getMaxSingleAtomEntries() const
bool d_memoryOptMode
Definition AtomicCenteredNonLocalOperator.h:681
const std::vector< std::vector< dftfe::utils::MemoryStorage< ValueType, memorySpace > > > & getGlobalCMatrix() const
Returns global C matrix of all atoms.
void copyGlobalCMatrix(const std::shared_ptr< AtomicCenteredNonLocalOperator< ValueTypeSrc, memorySpace > > nonLocalOperatorSrc, std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, dftfe::utils::MemorySpace::HOST > > basisOperationsPtr, const dftfe::uInt quadratureIndex)
dftfe::uInt getLocalIdOfDistributedVec(const dftfe::uInt globalId) const
const std::vector< ValueType > & getCmatrixEntriesTranspose(const dftfe::uInt chargeId, const dftfe::uInt iElemComp) const
Returns C conj matrix entries for chargeId and it compact support element Id.
const dftfe::uInt d_this_mpi_process
Definition AtomicCenteredNonLocalOperator.h:659
dftfe::uInt getTotalNonLocalEntriesCurrentProcessor() const
void computeGlobalCMatrixVector(std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, dftfe::utils::MemorySpace::HOST > > basisOperationsPtr, std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > BLASWrapperHostPtr)
computes Global Cmatrix on HOST.
dealii::IndexSet d_locallyOwnedSphericalFunctionIdsCurrentProcess
Definition AtomicCenteredNonLocalOperator.h:661
std::vector< std::vector< std::vector< ValueType > > > d_DDyadicRMatrixEntriesConjugate
Definition AtomicCenteredNonLocalOperator.h:690
bool d_computeCellStress
Definition AtomicCenteredNonLocalOperator.h:784
void computeCconjtransCMatrix(const dftfe::uInt atomId, std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > BLASWrapperPtr, const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &Dinverse, dftfe::utils::MemoryStorage< ValueType, dftfe::utils::MemorySpace::HOST > PconjtransposePmatrix)
Computes C^{T}D^{-1}C at the global level for atomId. This is required in PAW.
dftfe::uInt getTotalNonLocalElementsInCurrentProcessor() const
std::vector< dftfe::uInt > & getNonLocalElemIdToLocalElemIdMap() const
std::vector< ValueType > d_atomCenteredKpointTimesSphericalFnTimesDistFromAtomQuadValues
Definition AtomicCenteredNonLocalOperator.h:613
dealii::IndexSet d_ghostAtomCenteredFnIdsCurrentProcess
Definition AtomicCenteredNonLocalOperator.h:651
dftfe::uInt d_totalNonlocalElems
Definition AtomicCenteredNonLocalOperator.h:667
Definition FEBasisOperations.h:85
Definition BLASWrapper.h:35
An class template to encapsulate a MultiVector. A MultiVector is a collection of vectors belonging t...
Definition MultiVector.h:127
Definition MemoryStorage.h:33
A class template to store the communication pattern (i.e., which entries/nodes to receive from which ...
Definition MPIPatternP2P.h:57
double number
Definition dftfeDataTypes.h:41
@ HOST
Definition MemorySpaceType.h:34
Definition pseudoPotentialToDftfeConverter.cc:34
nonLocalContractionVectorType
Definition AtomicCenteredNonLocalOperator.h:55
@ CconjTransX
Definition AtomicCenteredNonLocalOperator.h:56
@ DDyadicRconjTransX
Definition AtomicCenteredNonLocalOperator.h:59
@ CRconjTransX
Definition AtomicCenteredNonLocalOperator.h:57
@ DconjTransX
Definition AtomicCenteredNonLocalOperator.h:58
CouplingStructure
Enum class that lists used in the non-local Operator.
Definition AtomicCenteredNonLocalOperator.h:48
@ dense
Definition AtomicCenteredNonLocalOperator.h:50
@ blockDiagonal
Definition AtomicCenteredNonLocalOperator.h:51
@ diagonal
Definition AtomicCenteredNonLocalOperator.h:49
std::uint32_t uInt
Definition TypeConfig.h:10
std::int32_t Int
Definition TypeConfig.h:11