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

poisson solver problem class template. template parameter FEOrderElectro is the finite element polynomial order for electrostatics More...

#include <kerkerSolverProblem.h>

Inheritance diagram for dftfe::kerkerSolverProblem< FEOrderElectro >:
dftfe::dealiiLinearSolverProblem

Public Member Functions

 kerkerSolverProblem (const MPI_Comm &mpi_comm_parent, const MPI_Comm &mpi_comm_domain)
 Constructor.
 
void init (std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, dealii::AffineConstraints< double > &constraintMatrix, distributedCPUVec< double > &x, double kerkerMixingParameter, const unsigned int matrixFreeVectorComponent, const unsigned int matrixFreeQuadratureComponent)
 initialize the matrix-free data structures
 
void reinit (distributedCPUVec< double > &x, const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadPointValues)
 reinitialize data structures .
 
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.
 

Private Attributes

distributedCPUVec< double > d_diagonalA
 storage for diagonal of the A matrix
 
distributedCPUVec< double > * d_xPtr
 pointer to the x vector being solved for
 
double d_gamma
 
unsigned int d_matrixFreeVectorComponent
 
unsigned int d_matrixFreeQuadratureComponent
 matrix free quadrature index
 
const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > * d_residualQuadValuesPtr
 pointer to electron density cell and grad residual data
 
const dealii::DoFHandler< 3 > * d_dofHandlerPRefinedPtr
 
const dealii::AffineConstraints< double > * d_constraintMatrixPRefinedPtr
 
const dealii::MatrixFree< 3, double > * d_matrixFreeDataPRefinedPtr
 
std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > d_basisOperationsPtr
 
const MPI_Comm d_mpiCommParent
 
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 FEOrderElectro>
class dftfe::kerkerSolverProblem< FEOrderElectro >

poisson solver problem class template. template parameter FEOrderElectro is the finite element polynomial order for electrostatics

Author
Phani Motamarri

Constructor & Destructor Documentation

◆ kerkerSolverProblem()

template<unsigned int FEOrderElectro>
dftfe::kerkerSolverProblem< FEOrderElectro >::kerkerSolverProblem ( const MPI_Comm & mpi_comm_parent,
const MPI_Comm & mpi_comm_domain )

Constructor.

Member Function Documentation

◆ AX()

template<unsigned int FEOrderElectro>
void dftfe::kerkerSolverProblem< 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

◆ computeDiagonalA()

template<unsigned int FEOrderElectro>
void dftfe::kerkerSolverProblem< FEOrderElectro >::computeDiagonalA ( )
private

Compute the diagonal of A.

◆ computeRhs()

template<unsigned int FEOrderElectro>
void dftfe::kerkerSolverProblem< 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 FEOrderElectro>
void dftfe::kerkerSolverProblem< FEOrderElectro >::distributeX ( )
virtual

distribute x to the constrained nodes.

Implements dftfe::dealiiLinearSolverProblem.

◆ getX()

template<unsigned int FEOrderElectro>
distributedCPUVec< double > & dftfe::kerkerSolverProblem< 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.

◆ init()

template<unsigned int FEOrderElectro>
void dftfe::kerkerSolverProblem< FEOrderElectro >::init ( std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > & basisOperationsPtr,
dealii::AffineConstraints< double > & constraintMatrix,
distributedCPUVec< double > & x,
double kerkerMixingParameter,
const unsigned int matrixFreeVectorComponent,
const unsigned int matrixFreeQuadratureComponent )

initialize the matrix-free data structures

Parameters
matrixFreeDatastructure to hold quadrature rule, constraints vector and appropriate dofHandler
constraintMatrixto hold constraints in the given problem
xvector to be initialized using matrix-free object

◆ operator!=()

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

function needed by dealii to mimic SparseMatrix

Implements dftfe::dealiiLinearSolverProblem.

◆ precondition_Jacobi()

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

Jacobi preconditioning.

Implements dftfe::dealiiLinearSolverProblem.

◆ reinit()

template<unsigned int FEOrderElectro>
void dftfe::kerkerSolverProblem< FEOrderElectro >::reinit ( distributedCPUVec< double > & x,
const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > & quadPointValues )

reinitialize data structures .

Parameters
xvector to store initial guess and solution
gradResidualValuesstores the gradient of difference of input electron-density and output electron-density
kerkerMixingParameterused in Kerker mixing scheme which usually represents Thomas Fermi wavevector (k_{TF}**2).

◆ subscribe()

template<unsigned int FEOrderElectro>
void dftfe::kerkerSolverProblem< 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 FEOrderElectro>
void dftfe::kerkerSolverProblem< 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 FEOrderElectro>
void dftfe::kerkerSolverProblem< FEOrderElectro >::vmult ( distributedCPUVec< double > & Ax,
distributedCPUVec< double > & x )
virtual

Compute A matrix multipled by x.

Implements dftfe::dealiiLinearSolverProblem.

Member Data Documentation

◆ d_basisOperationsPtr

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

◆ d_constraintMatrixPRefinedPtr

template<unsigned int FEOrderElectro>
const dealii::AffineConstraints<double>* dftfe::kerkerSolverProblem< FEOrderElectro >::d_constraintMatrixPRefinedPtr
private

◆ d_diagonalA

template<unsigned int FEOrderElectro>
distributedCPUVec<double> dftfe::kerkerSolverProblem< FEOrderElectro >::d_diagonalA
private

storage for diagonal of the A matrix

◆ d_dofHandlerPRefinedPtr

template<unsigned int FEOrderElectro>
const dealii::DoFHandler<3>* dftfe::kerkerSolverProblem< FEOrderElectro >::d_dofHandlerPRefinedPtr
private

◆ d_gamma

template<unsigned int FEOrderElectro>
double dftfe::kerkerSolverProblem< FEOrderElectro >::d_gamma
private

◆ d_matrixFreeDataPRefinedPtr

template<unsigned int FEOrderElectro>
const dealii::MatrixFree<3, double>* dftfe::kerkerSolverProblem< FEOrderElectro >::d_matrixFreeDataPRefinedPtr
private

◆ d_matrixFreeQuadratureComponent

template<unsigned int FEOrderElectro>
unsigned int dftfe::kerkerSolverProblem< FEOrderElectro >::d_matrixFreeQuadratureComponent
private

matrix free quadrature index

◆ d_matrixFreeVectorComponent

template<unsigned int FEOrderElectro>
unsigned int dftfe::kerkerSolverProblem< FEOrderElectro >::d_matrixFreeVectorComponent
private

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

◆ d_mpiCommParent

template<unsigned int FEOrderElectro>
const MPI_Comm dftfe::kerkerSolverProblem< FEOrderElectro >::d_mpiCommParent
private

◆ d_residualQuadValuesPtr

template<unsigned int FEOrderElectro>
const dftfe::utils::MemoryStorage<double, dftfe::utils::MemorySpace::HOST>* dftfe::kerkerSolverProblem< FEOrderElectro >::d_residualQuadValuesPtr
private

pointer to electron density cell and grad residual data

◆ d_xPtr

template<unsigned int FEOrderElectro>
distributedCPUVec<double>* dftfe::kerkerSolverProblem< FEOrderElectro >::d_xPtr
private

pointer to the x vector being solved for

◆ mpi_communicator

template<unsigned int FEOrderElectro>
const MPI_Comm dftfe::kerkerSolverProblem< FEOrderElectro >::mpi_communicator
private

◆ n_mpi_processes

template<unsigned int FEOrderElectro>
const unsigned int dftfe::kerkerSolverProblem< FEOrderElectro >::n_mpi_processes
private

◆ pcout

template<unsigned int FEOrderElectro>
dealii::ConditionalOStream dftfe::kerkerSolverProblem< FEOrderElectro >::pcout
private

◆ this_mpi_process

template<unsigned int FEOrderElectro>
const unsigned int dftfe::kerkerSolverProblem< FEOrderElectro >::this_mpi_process
private

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