DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
dftfe::poissonSolverProblem< FEOrder, FEOrderElectro > Class Template Reference

poisson solver problem class template. template parameter FEOrderElectro is the finite element polynomial order. FEOrder template parameter is used in conjunction with FEOrderElectro to determine the order of the Gauss quadrature rule More...

#include <poissonSolverProblem.h>

Inheritance diagram for dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >:
dftfe::dealiiLinearSolverProblem

Public Member Functions

 poissonSolverProblem (const MPI_Comm &mpi_comm)
 Constructor.
 
void clear ()
 clears all datamembers and reset to original state.
 
void reinit (const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, distributedCPUVec< double > &x, const dealii::AffineConstraints< double > &constraintMatrix, const unsigned int matrixFreeVectorComponent, const unsigned int matrixFreeQuadratureComponentRhsDensity, const unsigned int matrixFreeQuadratureComponentAX, const std::map< dealii::types::global_dof_index, double > &atoms, const std::map< dealii::CellId, std::vector< double > > &smearedChargeValues, const unsigned int smearedChargeQuadratureId, const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &rhoValues, const bool isComputeDiagonalA=true, const bool isComputeMeanValueConstraints=false, const bool smearedNuclearCharges=false, const bool isRhoValues=true, const bool isGradSmearedChargeRhs=false, const unsigned int smearedChargeGradientComponentId=0, const bool storeSmearedChargeRhs=false, const bool reuseSmearedChargeRhs=false, const bool reinitializeFastConstraints=false)
 reinitialize data structures for total electrostatic potential solve.
 
distributedCPUVec< double > & getX ()
 get the reference to x field
 
void vmult (distributedCPUVec< double > &Ax, distributedCPUVec< double > &x)
 Compute A matrix multipled by x.
 
void computeRhs (distributedCPUVec< double > &rhs)
 Compute right hand side vector for the problem Ax = rhs.
 
void precondition_Jacobi (distributedCPUVec< double > &dst, const distributedCPUVec< double > &src, const double omega) const
 Jacobi preconditioning.
 
void distributeX ()
 distribute x to the constrained nodes.
 
void subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
bool operator!= (double val) const
 function needed by dealii to mimic SparseMatrix
 
- Public Member Functions inherited from dftfe::dealiiLinearSolverProblem
 dealiiLinearSolverProblem ()
 Constructor.
 

Private Member Functions

void AX (const dealii::MatrixFree< 3, double > &matrixFreeData, distributedCPUVec< double > &dst, const distributedCPUVec< double > &src, const std::pair< unsigned int, unsigned int > &cell_range) const
 required for the cell_loop operation in dealii's MatrixFree class
 
void computeDiagonalA ()
 Compute the diagonal of A.
 
void computeMeanValueConstraint ()
 Compute mean value constraint which is required in case of fully periodic boundary conditions.
 
void meanValueConstraintDistribute (distributedCPUVec< double > &vec) const
 Mean value constraint distibute.
 
void meanValueConstraintDistributeSlaveToMaster (distributedCPUVec< double > &vec) const
 Mean value constraint distibute slave to master.
 
void meanValueConstraintSetZero (distributedCPUVec< double > &vec) const
 Mean value constraint set zero.
 

Private Attributes

distributedCPUVec< double > d_diagonalA
 storage for diagonal of the A matrix
 
distributedCPUVec< double > d_rhsSmearedCharge
 
const dealii::MatrixFree< 3, double > * d_matrixFreeDataPtr
 pointer to dealii MatrixFree object
 
distributedCPUVec< double > * d_xPtr
 pointer to the x vector being solved for
 
const dealii::AffineConstraints< double > * d_constraintMatrixPtr
 pointer to dealii dealii::AffineConstraints<double> object
 
unsigned int d_matrixFreeVectorComponent
 
unsigned int d_matrixFreeQuadratureComponentRhsDensity
 matrix free quadrature index
 
unsigned int d_matrixFreeQuadratureComponentAX
 matrix free quadrature index
 
const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > * d_rhoValuesPtr
 pointer to electron density cell quadrature data
 
const std::map< dealii::CellId, std::vector< double > > * d_smearedChargeValuesPtr
 pointer to smeared charge cell quadrature data
 
unsigned int d_smearedChargeQuadratureId
 
const std::map< dealii::types::global_dof_index, double > * d_atomsPtr
 
std::vector< double > d_cellShapeFunctionGradientIntegralFlattened
 shape function gradient integral storage
 
distributedCPUVec< double > d_meanValueConstraintVec
 storage for mean value constraint vector
 
bool d_isMeanValueConstraintComputed
 
bool d_isGradSmearedChargeRhs
 
bool d_isStoreSmearedChargeRhs
 
bool d_isReuseSmearedChargeRhs
 
unsigned int d_smearedChargeGradientComponentId
 
dealii::types::global_dof_index d_meanValueConstraintNodeId
 mean value constraints: mean value constrained node
 
unsigned int d_meanValueConstraintProcId
 
dftUtils::constraintMatrixInfo< dftfe::utils::MemorySpace::HOSTd_constraintsInfo
 duplicate constraints object with flattened maps for faster access
 
std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > d_basisOperationsPtr
 
bool d_isFastConstraintsInitialized
 
const MPI_Comm mpi_communicator
 
const unsigned int n_mpi_processes
 
const unsigned int this_mpi_process
 
dealii::ConditionalOStream pcout
 

Additional Inherited Members

- Public Types inherited from dftfe::dealiiLinearSolverProblem
typedef dealii::types::global_dof_index size_type
 typedef declaration needed by dealii
 

Detailed Description

template<unsigned int FEOrder, unsigned int FEOrderElectro>
class dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >

poisson solver problem class template. template parameter FEOrderElectro is the finite element polynomial order. FEOrder template parameter is used in conjunction with FEOrderElectro to determine the order of the Gauss quadrature rule

Author
Shiva Rudraraju, Phani Motamarri, Sambit Das

Constructor & Destructor Documentation

◆ poissonSolverProblem()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::poissonSolverProblem ( const MPI_Comm & mpi_comm)

Constructor.

Member Function Documentation

◆ AX()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
void dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::AX ( const dealii::MatrixFree< 3, double > & matrixFreeData,
distributedCPUVec< double > & dst,
const distributedCPUVec< double > & src,
const std::pair< unsigned int, unsigned int > & cell_range ) const
private

required for the cell_loop operation in dealii's MatrixFree class

◆ clear()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
void dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::clear ( )

clears all datamembers and reset to original state.

◆ computeDiagonalA()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
void dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::computeDiagonalA ( )
private

Compute the diagonal of A.

◆ computeMeanValueConstraint()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
void dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::computeMeanValueConstraint ( )
private

Compute mean value constraint which is required in case of fully periodic boundary conditions.

◆ computeRhs()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
void dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::computeRhs ( distributedCPUVec< double > & rhs)
virtual

Compute right hand side vector for the problem Ax = rhs.

Parameters
rhsvector for the right hand side values

Implements dftfe::dealiiLinearSolverProblem.

◆ distributeX()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
void dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::distributeX ( )
virtual

distribute x to the constrained nodes.

Implements dftfe::dealiiLinearSolverProblem.

◆ getX()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
distributedCPUVec< double > & dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::getX ( )
virtual

get the reference to x field

Returns
reference to x field. Assumes x field data structure is already initialized

Implements dftfe::dealiiLinearSolverProblem.

◆ meanValueConstraintDistribute()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
void dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::meanValueConstraintDistribute ( distributedCPUVec< double > & vec) const
private

Mean value constraint distibute.

◆ meanValueConstraintDistributeSlaveToMaster()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
void dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::meanValueConstraintDistributeSlaveToMaster ( distributedCPUVec< double > & vec) const
private

Mean value constraint distibute slave to master.

◆ meanValueConstraintSetZero()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
void dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::meanValueConstraintSetZero ( distributedCPUVec< double > & vec) const
private

Mean value constraint set zero.

◆ operator!=()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
bool dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::operator!= ( double val) const
inlinevirtual

function needed by dealii to mimic SparseMatrix

Implements dftfe::dealiiLinearSolverProblem.

◆ precondition_Jacobi()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
void dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::precondition_Jacobi ( distributedCPUVec< double > & dst,
const distributedCPUVec< double > & src,
const double omega ) const
virtual

Jacobi preconditioning.

Implements dftfe::dealiiLinearSolverProblem.

◆ reinit()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
void dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::reinit ( const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > & basisOperationsPtr,
distributedCPUVec< double > & x,
const dealii::AffineConstraints< double > & constraintMatrix,
const unsigned int matrixFreeVectorComponent,
const unsigned int matrixFreeQuadratureComponentRhsDensity,
const unsigned int matrixFreeQuadratureComponentAX,
const std::map< dealii::types::global_dof_index, double > & atoms,
const std::map< dealii::CellId, std::vector< double > > & smearedChargeValues,
const unsigned int smearedChargeQuadratureId,
const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > & rhoValues,
const bool isComputeDiagonalA = true,
const bool isComputeMeanValueConstraints = false,
const bool smearedNuclearCharges = false,
const bool isRhoValues = true,
const bool isGradSmearedChargeRhs = false,
const unsigned int smearedChargeGradientComponentId = 0,
const bool storeSmearedChargeRhs = false,
const bool reuseSmearedChargeRhs = false,
const bool reinitializeFastConstraints = false )

reinitialize data structures for total electrostatic potential solve.

For Hartree electrostatic potential solve give an empty map to the atoms parameter.

◆ subscribe()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
void dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::subscribe ( std::atomic< bool > *const validity,
const std::string & identifier = "" ) const
inlinevirtual

function needed by dealii to mimic SparseMatrix for Jacobi preconditioning

Implements dftfe::dealiiLinearSolverProblem.

◆ unsubscribe()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
void dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::unsubscribe ( std::atomic< bool > *const validity,
const std::string & identifier = "" ) const
inlinevirtual

function needed by dealii to mimic SparseMatrix for Jacobi preconditioning

Implements dftfe::dealiiLinearSolverProblem.

◆ vmult()

template<unsigned int FEOrder, unsigned int FEOrderElectro>
void dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::vmult ( distributedCPUVec< double > & Ax,
distributedCPUVec< double > & x )
virtual

Compute A matrix multipled by x.

Implements dftfe::dealiiLinearSolverProblem.

Member Data Documentation

◆ d_atomsPtr

template<unsigned int FEOrder, unsigned int FEOrderElectro>
const std::map<dealii::types::global_dof_index, double>* dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_atomsPtr
private

pointer to map between global dof index in current processor and the atomic charge on that dof

◆ d_basisOperationsPtr

template<unsigned int FEOrder, unsigned int FEOrderElectro>
std::shared_ptr< dftfe::basis:: FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST> > dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_basisOperationsPtr
private

◆ d_cellShapeFunctionGradientIntegralFlattened

template<unsigned int FEOrder, unsigned int FEOrderElectro>
std::vector<double> dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_cellShapeFunctionGradientIntegralFlattened
private

shape function gradient integral storage

◆ d_constraintMatrixPtr

template<unsigned int FEOrder, unsigned int FEOrderElectro>
const dealii::AffineConstraints<double>* dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_constraintMatrixPtr
private

pointer to dealii dealii::AffineConstraints<double> object

◆ d_constraintsInfo

template<unsigned int FEOrder, unsigned int FEOrderElectro>
dftUtils::constraintMatrixInfo<dftfe::utils::MemorySpace::HOST> dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_constraintsInfo
private

duplicate constraints object with flattened maps for faster access

◆ d_diagonalA

template<unsigned int FEOrder, unsigned int FEOrderElectro>
distributedCPUVec<double> dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_diagonalA
private

storage for diagonal of the A matrix

◆ d_isFastConstraintsInitialized

template<unsigned int FEOrder, unsigned int FEOrderElectro>
bool dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_isFastConstraintsInitialized
private

◆ d_isGradSmearedChargeRhs

template<unsigned int FEOrder, unsigned int FEOrderElectro>
bool dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_isGradSmearedChargeRhs
private

◆ d_isMeanValueConstraintComputed

template<unsigned int FEOrder, unsigned int FEOrderElectro>
bool dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_isMeanValueConstraintComputed
private

boolean flag to query if mean value constraint datastructures are precomputed

◆ d_isReuseSmearedChargeRhs

template<unsigned int FEOrder, unsigned int FEOrderElectro>
bool dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_isReuseSmearedChargeRhs
private

◆ d_isStoreSmearedChargeRhs

template<unsigned int FEOrder, unsigned int FEOrderElectro>
bool dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_isStoreSmearedChargeRhs
private

◆ d_matrixFreeDataPtr

template<unsigned int FEOrder, unsigned int FEOrderElectro>
const dealii::MatrixFree<3, double>* dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_matrixFreeDataPtr
private

pointer to dealii MatrixFree object

◆ d_matrixFreeQuadratureComponentAX

template<unsigned int FEOrder, unsigned int FEOrderElectro>
unsigned int dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_matrixFreeQuadratureComponentAX
private

matrix free quadrature index

◆ d_matrixFreeQuadratureComponentRhsDensity

template<unsigned int FEOrder, unsigned int FEOrderElectro>
unsigned int dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_matrixFreeQuadratureComponentRhsDensity
private

matrix free quadrature index

◆ d_matrixFreeVectorComponent

template<unsigned int FEOrder, unsigned int FEOrderElectro>
unsigned int dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_matrixFreeVectorComponent
private

matrix free index required to access the DofHandler and dealii::AffineConstraints<double> objects corresponding to the problem

◆ d_meanValueConstraintNodeId

template<unsigned int FEOrder, unsigned int FEOrderElectro>
dealii::types::global_dof_index dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_meanValueConstraintNodeId
private

mean value constraints: mean value constrained node

◆ d_meanValueConstraintProcId

template<unsigned int FEOrder, unsigned int FEOrderElectro>
unsigned int dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_meanValueConstraintProcId
private

mean value constraints: constrained proc id containing the mean value constrained node

◆ d_meanValueConstraintVec

template<unsigned int FEOrder, unsigned int FEOrderElectro>
distributedCPUVec<double> dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_meanValueConstraintVec
private

storage for mean value constraint vector

◆ d_rhoValuesPtr

template<unsigned int FEOrder, unsigned int FEOrderElectro>
const dftfe::utils::MemoryStorage<double, dftfe::utils::MemorySpace::HOST>* dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_rhoValuesPtr
private

pointer to electron density cell quadrature data

◆ d_rhsSmearedCharge

template<unsigned int FEOrder, unsigned int FEOrderElectro>
distributedCPUVec<double> dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_rhsSmearedCharge
private

storage for smeared charge rhs in case of total potential solve (doesn't change every scf)

◆ d_smearedChargeGradientComponentId

template<unsigned int FEOrder, unsigned int FEOrderElectro>
unsigned int dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_smearedChargeGradientComponentId
private

◆ d_smearedChargeQuadratureId

template<unsigned int FEOrder, unsigned int FEOrderElectro>
unsigned int dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_smearedChargeQuadratureId
private

◆ d_smearedChargeValuesPtr

template<unsigned int FEOrder, unsigned int FEOrderElectro>
const std::map<dealii::CellId, std::vector<double> >* dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_smearedChargeValuesPtr
private

pointer to smeared charge cell quadrature data

◆ d_xPtr

template<unsigned int FEOrder, unsigned int FEOrderElectro>
distributedCPUVec<double>* dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::d_xPtr
private

pointer to the x vector being solved for

◆ mpi_communicator

template<unsigned int FEOrder, unsigned int FEOrderElectro>
const MPI_Comm dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::mpi_communicator
private

◆ n_mpi_processes

template<unsigned int FEOrder, unsigned int FEOrderElectro>
const unsigned int dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::n_mpi_processes
private

◆ pcout

template<unsigned int FEOrder, unsigned int FEOrderElectro>
dealii::ConditionalOStream dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::pcout
private

◆ this_mpi_process

template<unsigned int FEOrder, unsigned int FEOrderElectro>
const unsigned int dftfe::poissonSolverProblem< FEOrder, FEOrderElectro >::this_mpi_process
private

The documentation for this class was generated from the following file: