DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
|
Categorizes atoms into bins for efficient solution of nuclear electrostatic self-potential. template parameter FEOrderElectro is the finite element polynomial order. More...
#include <vselfBinsManager.h>
Public Member Functions | |
vselfBinsManager (const MPI_Comm &mpi_comm_parent, const MPI_Comm &mpi_comm_domain, const MPI_Comm &mpi_intercomm_kpts, const dftParameters &dftParams) | |
Constructor. | |
void | createAtomBins (std::vector< const dealii::AffineConstraints< double > * > &constraintsVector, const dealii::AffineConstraints< double > &onlyHangingNodeConstraints, const dealii::DoFHandler< 3 > &dofHandler, const dealii::AffineConstraints< double > &constraintMatrix, const std::vector< std::vector< double > > &atomLocations, const std::vector< std::vector< double > > &imagePositions, const std::vector< int > &imageIds, const std::vector< double > &imageCharges, const double radiusAtomBall) |
Categorize atoms into bins based on self-potential ball radius around each atom such that no two atoms in each bin has overlapping balls. | |
void | updateBinsBc (std::vector< const dealii::AffineConstraints< double > * > &constraintsVector, const dealii::AffineConstraints< double > &onlyHangingNodeConstraints, const dealii::DoFHandler< 3 > &dofHandler, const dealii::AffineConstraints< double > &constraintMatrix, const std::vector< std::vector< double > > &atomLocations, const std::vector< std::vector< double > > &imagePositions, const std::vector< int > &imageIds, const std::vector< double > &imageCharges, const bool vselfPerturbationUpdateForStress=false) |
Categorize atoms into bins based on self-potential ball radius around each atom such that no two atoms in each bin has overlapping balls. | |
void | solveVselfInBins (const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, const unsigned int offset, const unsigned int matrixFreeQuadratureIdAX, const dealii::AffineConstraints< double > &hangingPeriodicConstraintMatrix, const std::vector< std::vector< double > > &imagePositions, const std::vector< int > &imageIds, const std::vector< double > &imageCharges, std::vector< std::vector< double > > &localVselfs, std::map< dealii::CellId, std::vector< double > > &bQuadValuesAllAtoms, std::map< dealii::CellId, std::vector< int > > &bQuadAtomIdsAllAtoms, std::map< dealii::CellId, std::vector< int > > &bQuadAtomIdsAllAtomsImages, std::map< dealii::CellId, std::vector< unsigned int > > &bCellNonTrivialAtomIds, std::vector< std::map< dealii::CellId, std::vector< unsigned int > > > &bCellNonTrivialAtomIdsBins, std::map< dealii::CellId, std::vector< unsigned int > > &bCellNonTrivialAtomImageIds, std::vector< std::map< dealii::CellId, std::vector< unsigned int > > > &bCellNonTrivialAtomImageIdsBins, const std::vector< double > &smearingWidths, std::vector< double > &smearedChargeScaling, const unsigned int smearedChargeQuadratureId, const bool useSmearedCharges=false, const bool isVselfPerturbationSolve=false) |
Solve nuclear electrostatic self-potential of atoms in each bin one-by-one. | |
void | solveVselfInBinsPerturbedDomain (const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, const unsigned int mfBaseDofHandlerIndex, const unsigned int matrixFreeQuadratureIdAX, const unsigned int offset, const dealii::AffineConstraints< double > &hangingPeriodicConstraintMatrix, const std::vector< std::vector< double > > &imagePositions, const std::vector< int > &imageIds, const std::vector< double > &imageCharges, const std::vector< double > &smearingWidths, const unsigned int smearedChargeQuadratureId, const bool useSmearedCharges=false) |
Solve nuclear electrostatic self-potential of atoms in each bin in a perturbed domain (used for cell stress calculation) | |
const std::map< int, std::set< int > > & | getAtomIdsBins () const |
get const reference map of binIds and atomIds | |
const std::map< int, std::set< int > > & | getAtomImageIdsBins () const |
get const reference map of binIds and atomIds | |
const std::vector< std::map< dealii::types::global_dof_index, int > > & | getBoundaryFlagsBins () const |
const std::vector< std::map< dealii::types::global_dof_index, int > > & | getBoundaryFlagsBinsOnlyChargeId () const |
const std::vector< std::map< dealii::types::global_dof_index, int > > & | getClosestAtomIdsBins () const |
const std::vector< std::map< dealii::types::global_dof_index, dealii::Point< 3 > > > & | getClosestAtomLocationsBins () const |
const std::vector< distributedCPUVec< double > > & | getVselfFieldBins () const |
get const reference to solved vself fields | |
const std::vector< distributedCPUVec< double > > & | getVselfFieldDerRBins () const |
get const reference to del{vself}/del{R_i} fields | |
const std::vector< distributedCPUVec< double > > & | getPerturbedVselfFieldBins () const |
const std::map< unsigned int, unsigned int > & | getAtomIdBinIdMapLocalAllImages () const |
get const reference to d_atomIdBinIdMapLocalAllImages | |
double | getStoredAdaptiveBallRadius () const |
get stored adaptive ball radius | |
Private Member Functions | |
void | locateAtomsInBins (const dealii::DoFHandler< 3 > &dofHandler) |
locate underlying fem nodes for atoms in bins. | |
void | createAtomBinsSanityCheck (const dealii::DoFHandler< 3 > &dofHandler, const dealii::AffineConstraints< double > &onlyHangingNodeConstraints) |
sanity check for Dirichlet boundary conditions on the vself balls in each bin | |
Private Attributes | |
std::vector< std::vector< double > > | d_atomLocations |
storage for input atomLocations argument in createAtomBins function | |
dftUtils::constraintMatrixInfo< dftfe::utils::MemorySpace::HOST > | d_constraintsOnlyHangingInfo |
storage for optimized constraints handling object | |
std::vector< dealii::AffineConstraints< double > > | d_vselfBinConstraintMatrices |
vector of constraint matrices for vself bins | |
std::map< int, std::set< int > > | d_bins |
map of binIds and atomIds | |
std::map< int, std::set< int > > | d_binsImages |
map of binIds and atomIds and imageIds | |
std::vector< std::map< dealii::types::global_dof_index, int > > | d_boundaryFlag |
map of global dof index and vself solve boundary flag (chargeId or | |
std::vector< std::map< dealii::types::global_dof_index, int > > | d_boundaryFlagOnlyChargeId |
std::vector< std::map< dealii::types::global_dof_index, dealii::Point< 3 > > > | d_dofClosestChargeLocationMap |
map of global dof index to location of closest charge | |
std::vector< std::map< dealii::types::global_dof_index, double > > | d_vselfBinField |
map of global dof index and vself field initial value in each bin | |
std::vector< std::map< dealii::types::global_dof_index, int > > | d_closestAtomBin |
map of global dof index and vself field initial value in each bin | |
std::map< unsigned int, unsigned int > | d_atomIdBinIdMapLocalAllImages |
std::vector< distributedCPUVec< double > > | d_vselfFieldBins |
solved vself solution field for each bin | |
std::vector< distributedCPUVec< double > > | d_vselfFieldDerRBins |
solved del{vself}/del{R_i} solution field for each bin | |
std::vector< distributedCPUVec< double > > | d_vselfFieldPerturbedBins |
std::vector< std::map< dealii::types::global_dof_index, double > > | d_atomsInBin |
double | d_storedAdaptiveBallRadius |
const dftParameters & | d_dftParams |
const MPI_Comm | d_mpiCommParent |
const MPI_Comm | mpi_communicator |
const MPI_Comm | d_mpiInterCommKpts |
const unsigned int | n_mpi_processes |
const unsigned int | this_mpi_process |
dealii::ConditionalOStream | pcout |
Categorizes atoms into bins for efficient solution of nuclear electrostatic self-potential. template parameter FEOrderElectro is the finite element polynomial order.
dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::vselfBinsManager | ( | const MPI_Comm & | mpi_comm_parent, |
const MPI_Comm & | mpi_comm_domain, | ||
const MPI_Comm & | mpi_intercomm_kpts, | ||
const dftParameters & | dftParams ) |
Constructor.
mpi_comm_parent | parent mpi communicator |
mpi_comm_domain | domain decomposition mpi communicator |
void dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::createAtomBins | ( | std::vector< const dealii::AffineConstraints< double > * > & | constraintsVector, |
const dealii::AffineConstraints< double > & | onlyHangingNodeConstraints, | ||
const dealii::DoFHandler< 3 > & | dofHandler, | ||
const dealii::AffineConstraints< double > & | constraintMatrix, | ||
const std::vector< std::vector< double > > & | atomLocations, | ||
const std::vector< std::vector< double > > & | imagePositions, | ||
const std::vector< int > & | imageIds, | ||
const std::vector< double > & | imageCharges, | ||
const double | radiusAtomBall ) |
Categorize atoms into bins based on self-potential ball radius around each atom such that no two atoms in each bin has overlapping balls.
[out] | constraintsVector | constraintsVector to which the vself bins solve constraint matrices will be pushed back |
[in] | dofHandler | DofHandler object |
[in] | constraintMatrix | dealii::AffineConstraints<double> which was used for the total electrostatics solve |
[in] | atomLocations | global atom locations and charge values data |
[in] | imagePositions | image atoms positions data |
[in] | imageIds | image atoms Ids data |
[in] | imageCharges | image atoms charge values data |
[in] | radiusAtomBall | self-potential ball radius |
|
private |
sanity check for Dirichlet boundary conditions on the vself balls in each bin
const std::map< unsigned int, unsigned int > & dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::getAtomIdBinIdMapLocalAllImages | ( | ) | const |
get const reference to d_atomIdBinIdMapLocalAllImages
const std::map< int, std::set< int > > & dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::getAtomIdsBins | ( | ) | const |
get const reference map of binIds and atomIds
const std::map< int, std::set< int > > & dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::getAtomImageIdsBins | ( | ) | const |
get const reference map of binIds and atomIds
const std::vector< std::map< dealii::types::global_dof_index, int > > & dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::getBoundaryFlagsBins | ( | ) | const |
get const reference to map of global dof index and vself solve boundary flag in each bin
const std::vector< std::map< dealii::types::global_dof_index, int > > & dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::getBoundaryFlagsBinsOnlyChargeId | ( | ) | const |
get const reference to map of global dof index and vself solve boundary flag in each bin
const std::vector< std::map< dealii::types::global_dof_index, int > > & dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::getClosestAtomIdsBins | ( | ) | const |
get const reference to map of global dof index and vself field initial value in each bin
const std::vector< std::map< dealii::types::global_dof_index, dealii::Point< 3 > > > & dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::getClosestAtomLocationsBins | ( | ) | const |
get const reference to map of global dof index and vself field initial value in each bin
const std::vector< distributedCPUVec< double > > & dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::getPerturbedVselfFieldBins | ( | ) | const |
perturbation of vself solution field to be used to evaluate the Gateaux derivative of vself field with respect to affine strain components using central finite difference
double dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::getStoredAdaptiveBallRadius | ( | ) | const |
get stored adaptive ball radius
const std::vector< distributedCPUVec< double > > & dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::getVselfFieldBins | ( | ) | const |
get const reference to solved vself fields
const std::vector< distributedCPUVec< double > > & dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::getVselfFieldDerRBins | ( | ) | const |
get const reference to del{vself}/del{R_i} fields
|
private |
locate underlying fem nodes for atoms in bins.
void dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::solveVselfInBins | ( | const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > & | basisOperationsPtr, |
const unsigned int | offset, | ||
const unsigned int | matrixFreeQuadratureIdAX, | ||
const dealii::AffineConstraints< double > & | hangingPeriodicConstraintMatrix, | ||
const std::vector< std::vector< double > > & | imagePositions, | ||
const std::vector< int > & | imageIds, | ||
const std::vector< double > & | imageCharges, | ||
std::vector< std::vector< double > > & | localVselfs, | ||
std::map< dealii::CellId, std::vector< double > > & | bQuadValuesAllAtoms, | ||
std::map< dealii::CellId, std::vector< int > > & | bQuadAtomIdsAllAtoms, | ||
std::map< dealii::CellId, std::vector< int > > & | bQuadAtomIdsAllAtomsImages, | ||
std::map< dealii::CellId, std::vector< unsigned int > > & | bCellNonTrivialAtomIds, | ||
std::vector< std::map< dealii::CellId, std::vector< unsigned int > > > & | bCellNonTrivialAtomIdsBins, | ||
std::map< dealii::CellId, std::vector< unsigned int > > & | bCellNonTrivialAtomImageIds, | ||
std::vector< std::map< dealii::CellId, std::vector< unsigned int > > > & | bCellNonTrivialAtomImageIdsBins, | ||
const std::vector< double > & | smearingWidths, | ||
std::vector< double > & | smearedChargeScaling, | ||
const unsigned int | smearedChargeQuadratureId, | ||
const bool | useSmearedCharges = false, | ||
const bool | isVselfPerturbationSolve = false ) |
Solve nuclear electrostatic self-potential of atoms in each bin one-by-one.
[in] | matrix_free_data | MatrixFree object |
[in] | offset | MatrixFree object starting offset for vself bins solve |
[out] | phiExt | sum of the self-potential fields of all atoms and image atoms |
[in] | phiExtConstraintMatrix | constraintMatrix corresponding to phiExt |
[in] | imagePositions | image atoms positions data |
[in] | imageIds | image atoms Ids data |
[in] | imageCharges | image atoms charge values data * |
[out] | localVselfs | peak self-potential values of atoms in the local processor |
void dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::solveVselfInBinsPerturbedDomain | ( | const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > & | basisOperationsPtr, |
const unsigned int | mfBaseDofHandlerIndex, | ||
const unsigned int | matrixFreeQuadratureIdAX, | ||
const unsigned int | offset, | ||
const dealii::AffineConstraints< double > & | hangingPeriodicConstraintMatrix, | ||
const std::vector< std::vector< double > > & | imagePositions, | ||
const std::vector< int > & | imageIds, | ||
const std::vector< double > & | imageCharges, | ||
const std::vector< double > & | smearingWidths, | ||
const unsigned int | smearedChargeQuadratureId, | ||
const bool | useSmearedCharges = false ) |
Solve nuclear electrostatic self-potential of atoms in each bin in a perturbed domain (used for cell stress calculation)
void dftfe::vselfBinsManager< FEOrder, FEOrderElectro >::updateBinsBc | ( | std::vector< const dealii::AffineConstraints< double > * > & | constraintsVector, |
const dealii::AffineConstraints< double > & | onlyHangingNodeConstraints, | ||
const dealii::DoFHandler< 3 > & | dofHandler, | ||
const dealii::AffineConstraints< double > & | constraintMatrix, | ||
const std::vector< std::vector< double > > & | atomLocations, | ||
const std::vector< std::vector< double > > & | imagePositions, | ||
const std::vector< int > & | imageIds, | ||
const std::vector< double > & | imageCharges, | ||
const bool | vselfPerturbationUpdateForStress = false ) |
Categorize atoms into bins based on self-potential ball radius around each atom such that no two atoms in each bin has overlapping balls.
[out] | constraintsVector | constraintsVector to which the vself bins solve constraint matrices will be pushed back |
[in] | dofHandler | DofHandler object |
[in] | constraintMatrix | dealii::AffineConstraints<double> which was used for the total electrostatics solve |
[in] | atomLocations | global atom locations and charge values data |
[in] | imagePositions | image atoms positions data |
[in] | imageIds | image atoms Ids data |
[in] | imageCharges | image atoms charge values data |
|
private |
Internal data: stores the map of atom Id (only in the local processor) to the vself bin Id. Populated in solve vself in Bins
|
private |
storage for input atomLocations argument in createAtomBins function
|
private |
Map of locally relevant global dof index and the atomic charge in each bin
|
private |
map of binIds and atomIds
|
private |
map of binIds and atomIds and imageIds
|
private |
map of global dof index and vself solve boundary flag (chargeId or
|
private |
map of global dof index and vself solve boundary flag (only chargeId)in each bin
|
private |
map of global dof index and vself field initial value in each bin
|
private |
storage for optimized constraints handling object
|
private |
|
private |
map of global dof index to location of closest charge
|
private |
|
private |
|
private |
Vself ball radius. This is stored after the first call to createAtomBins and reused for subsequent calls
|
private |
vector of constraint matrices for vself bins
|
private |
map of global dof index and vself field initial value in each bin
|
private |
solved vself solution field for each bin
|
private |
solved del{vself}/del{R_i} solution field for each bin
|
private |
perturbation of vself solution field to be used to evaluate the Gateaux derivative of vself field with respect to affine strain components using central finite difference
|
private |
|
private |
|
private |
|
private |