DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
dftfe::nonlinearSolverProblem Class Referenceabstract

Abstract class for solver functions. More...

#include <nonlinearSolverProblem.h>

Inheritance diagram for dftfe::nonlinearSolverProblem:
dftfe::geoOptCell dftfe::geoOptIon dftfe::nudgedElasticBandClass

Public Member Functions

 nonlinearSolverProblem ()
 Constructor.
 
virtual ~nonlinearSolverProblem ()=0
 Destructor.
 
virtual unsigned int getNumberUnknowns () const =0
 Obtain number of unknowns.
 
virtual void value (std::vector< double > &functionValue)=0
 Compute function value (aka energy).
 
virtual void gradient (std::vector< double > &gradient)=0
 Compute function gradient (aka forces).
 
virtual void precondition (std::vector< double > &s, const std::vector< double > &gradient)=0
 Apply preconditioner to function gradient.
 
virtual void update (const std::vector< double > &solution, const bool computeForces=true, const bool useSingleAtomSolutionsInitialGuess=false)=0
 Update solution.
 
virtual void solution (std::vector< double > &solution)=0
 Obtain current solution.
 
virtual std::vector< unsigned int > getUnknownCountFlag () const =0
 For each unknown indicate whether that unknown should be accumulated. This functionality is needed in the case of parallel execution when domain decomposition is employed. Unknowns residing on processor boundary should only be accumulated once when dot products of vertex fields are computed (e.g. residual).
 
virtual bool isConverged () const =0
 check for convergence.
 
virtual void save ()=0
 create checkpoint for the current state of the problem i.e problem domain and solution.
 
virtual const MPI_Comm & getMPICommunicator ()=0
 get MPI communicator.
 

Detailed Description

Abstract class for solver functions.

Author
Sambit Das

Constructor & Destructor Documentation

◆ nonlinearSolverProblem()

dftfe::nonlinearSolverProblem::nonlinearSolverProblem ( )

Constructor.

◆ ~nonlinearSolverProblem()

virtual dftfe::nonlinearSolverProblem::~nonlinearSolverProblem ( )
pure virtual

Destructor.

Member Function Documentation

◆ getMPICommunicator()

virtual const MPI_Comm & dftfe::nonlinearSolverProblem::getMPICommunicator ( )
pure virtual

get MPI communicator.

Implemented in dftfe::geoOptCell, dftfe::geoOptIon, and dftfe::nudgedElasticBandClass.

◆ getNumberUnknowns()

virtual unsigned int dftfe::nonlinearSolverProblem::getNumberUnknowns ( ) const
pure virtual

Obtain number of unknowns.

Returns
Number of unknowns.

Implemented in dftfe::geoOptCell, dftfe::geoOptIon, and dftfe::nudgedElasticBandClass.

◆ getUnknownCountFlag()

virtual std::vector< unsigned int > dftfe::nonlinearSolverProblem::getUnknownCountFlag ( ) const
pure virtual

For each unknown indicate whether that unknown should be accumulated. This functionality is needed in the case of parallel execution when domain decomposition is employed. Unknowns residing on processor boundary should only be accumulated once when dot products of vertex fields are computed (e.g. residual).

Returns
A vector of int values for each unknown. Value of 1 indicates that the unknown should be counted and 0 otherwise.

Implemented in dftfe::geoOptCell, dftfe::geoOptIon, and dftfe::nudgedElasticBandClass.

◆ gradient()

virtual void dftfe::nonlinearSolverProblem::gradient ( std::vector< double > & gradient)
pure virtual

Compute function gradient (aka forces).

Parameters
gradientSTL vector for gradient values.

Implemented in dftfe::geoOptCell, dftfe::geoOptIon, and dftfe::nudgedElasticBandClass.

◆ isConverged()

virtual bool dftfe::nonlinearSolverProblem::isConverged ( ) const
pure virtual

check for convergence.

Implemented in dftfe::geoOptCell, dftfe::geoOptIon, and dftfe::nudgedElasticBandClass.

◆ precondition()

virtual void dftfe::nonlinearSolverProblem::precondition ( std::vector< double > & s,
const std::vector< double > & gradient )
pure virtual

Apply preconditioner to function gradient.

Parameters
sSTL vector for s=-M^{-1} gradient.
gradientSTL vector for gradient values.

Implemented in dftfe::geoOptCell, dftfe::geoOptIon, and dftfe::nudgedElasticBandClass.

◆ save()

virtual void dftfe::nonlinearSolverProblem::save ( )
pure virtual

create checkpoint for the current state of the problem i.e problem domain and solution.

Implemented in dftfe::geoOptCell, dftfe::geoOptIon, and dftfe::nudgedElasticBandClass.

◆ solution()

virtual void dftfe::nonlinearSolverProblem::solution ( std::vector< double > & solution)
pure virtual

Obtain current solution.

Parameters
solutionSpace for current solution.

Implemented in dftfe::geoOptCell, dftfe::geoOptIon, and dftfe::nudgedElasticBandClass.

◆ update()

virtual void dftfe::nonlinearSolverProblem::update ( const std::vector< double > & solution,
const bool computeForces = true,
const bool useSingleAtomSolutionsInitialGuess = false )
pure virtual

Update solution.

Parameters
solutionUpdated solution.

Implemented in dftfe::geoOptCell, dftfe::geoOptIon, and dftfe::nudgedElasticBandClass.

◆ value()

virtual void dftfe::nonlinearSolverProblem::value ( std::vector< double > & functionValue)
pure virtual

Compute function value (aka energy).

Returns
Function value.

Implemented in dftfe::geoOptCell, dftfe::geoOptIon, and dftfe::nudgedElasticBandClass.


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