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

problem class for cell stress relaxation solver. More...

#include <geoOptCell.h>

Inheritance diagram for dftfe::geoOptCell:
dftfe::nonlinearSolverProblem

Public Member Functions

 geoOptCell (dftBase *dftPtr, const MPI_Comm &mpi_comm_parent, const bool restart=false)
 Constructor.
 
void init (const std::string &restartPath)
 initializes the data member d_relaxationFlags.
 
int run ()
 calls the cell stress relaxation solver.
 
void writeMesh (std::string meshFileName)
 writes the current fem mesh.
 
unsigned int getNumberUnknowns () const
 Obtain number of unknowns (depends on the stress relaxation constraint type).
 
void gradient (std::vector< double > &gradient)
 Compute function gradient (stress).
 
void update (const std::vector< double > &solution, const bool computeStress=true, const bool useSingleAtomSolutionsInitialGuess=false)
 Update the strain tensor epsilon.
 
void save ()
 create checkpoint file for current domain bounding vectors and atomic coordinates.
 
bool isConverged () const
 check for convergence.
 
const MPI_Comm & getMPICommunicator ()
 get MPI communicator.
 
void value (std::vector< double > &functionValue)
 Not implemented.
 
void precondition (std::vector< double > &s, const std::vector< double > &gradient)
 Not implemented.
 
void solution (std::vector< double > &solution)
 Not implemented.
 
std::vector< unsigned int > getUnknownCountFlag () const
 Not implemented.
 
- Public Member Functions inherited from dftfe::nonlinearSolverProblem
 nonlinearSolverProblem ()
 Constructor.
 
virtual ~nonlinearSolverProblem ()=0
 Destructor.
 

Private Attributes

std::vector< unsigned int > d_relaxationFlags
 
std::string d_restartPath
 
std::string d_solverRestartPath
 
bool d_isRestart
 
bool d_solverRestart
 
bool d_isScfRestart
 
int d_solver
 
int d_totalUpdateCalls
 total number of calls to update()
 
double d_domainVolumeInitial
 
dealii::Tensor< 2, 3, double > d_strainEpsilon
 current strain tensor applied on the domain
 
dftBased_dftPtr
 pointer to dft class
 
std::unique_ptr< nonLinearSolverd_nonLinearSolverPtr
 
const MPI_Comm mpi_communicator
 parallel communication objects
 
const unsigned int n_mpi_processes
 
const unsigned int this_mpi_process
 
dealii::ConditionalOStream pcout
 conditional stream object
 

Detailed Description

problem class for cell stress relaxation solver.

Author
Sambit Das

Constructor & Destructor Documentation

◆ geoOptCell()

dftfe::geoOptCell::geoOptCell ( dftBase * dftPtr,
const MPI_Comm & mpi_comm_parent,
const bool restart = false )

Constructor.

Parameters
_dftPtrpointer to dftClass
mpi_comm_parentparent mpi_communicator

Member Function Documentation

◆ getMPICommunicator()

const MPI_Comm & dftfe::geoOptCell::getMPICommunicator ( )
virtual

get MPI communicator.

Implements dftfe::nonlinearSolverProblem.

◆ getNumberUnknowns()

unsigned int dftfe::geoOptCell::getNumberUnknowns ( ) const
virtual

Obtain number of unknowns (depends on the stress relaxation constraint type).

Returns
int Number of unknowns.

Implements dftfe::nonlinearSolverProblem.

◆ getUnknownCountFlag()

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

Not implemented.

Implements dftfe::nonlinearSolverProblem.

◆ gradient()

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

Compute function gradient (stress).

Parameters
gradientSTL vector for gradient values.

Implements dftfe::nonlinearSolverProblem.

◆ init()

void dftfe::geoOptCell::init ( const std::string & restartPath)

initializes the data member d_relaxationFlags.

◆ isConverged()

bool dftfe::geoOptCell::isConverged ( ) const
virtual

check for convergence.

Implements dftfe::nonlinearSolverProblem.

◆ precondition()

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

Not implemented.

Implements dftfe::nonlinearSolverProblem.

◆ run()

int dftfe::geoOptCell::run ( )

calls the cell stress relaxation solver.

The Polak–Ribière nonlinear CG solver with secant based line search is used for the stress relaxation.

Returns
int total geometry update calls

◆ save()

void dftfe::geoOptCell::save ( )
virtual

create checkpoint file for current domain bounding vectors and atomic coordinates.

Implements dftfe::nonlinearSolverProblem.

◆ solution()

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

Not implemented.

Implements dftfe::nonlinearSolverProblem.

◆ update()

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

Update the strain tensor epsilon.

The new strain tensor is epsilonNew= epsilon+ delta(epsilon). Since epsilon strain is already applied to the domain. The new strain to be applied to the domain is epsilonNew*inv(epsilon)

Parameters
solutiondelta(epsilon).

Implements dftfe::nonlinearSolverProblem.

◆ value()

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

Not implemented.

Implements dftfe::nonlinearSolverProblem.

◆ writeMesh()

void dftfe::geoOptCell::writeMesh ( std::string meshFileName)

writes the current fem mesh.

Member Data Documentation

◆ d_dftPtr

dftBase* dftfe::geoOptCell::d_dftPtr
private

pointer to dft class

◆ d_domainVolumeInitial

double dftfe::geoOptCell::d_domainVolumeInitial
private

◆ d_isRestart

bool dftfe::geoOptCell::d_isRestart
private

◆ d_isScfRestart

bool dftfe::geoOptCell::d_isScfRestart
private

◆ d_nonLinearSolverPtr

std::unique_ptr<nonLinearSolver> dftfe::geoOptCell::d_nonLinearSolverPtr
private

◆ d_relaxationFlags

std::vector<unsigned int> dftfe::geoOptCell::d_relaxationFlags
private

Relaxation flags which determine whether a particular stress component is to be relaxed or not.

◆ d_restartPath

std::string dftfe::geoOptCell::d_restartPath
private

◆ d_solver

int dftfe::geoOptCell::d_solver
private

◆ d_solverRestart

bool dftfe::geoOptCell::d_solverRestart
private

◆ d_solverRestartPath

std::string dftfe::geoOptCell::d_solverRestartPath
private

◆ d_strainEpsilon

dealii::Tensor<2, 3, double> dftfe::geoOptCell::d_strainEpsilon
private

current strain tensor applied on the domain

◆ d_totalUpdateCalls

int dftfe::geoOptCell::d_totalUpdateCalls
private

total number of calls to update()

◆ mpi_communicator

const MPI_Comm dftfe::geoOptCell::mpi_communicator
private

parallel communication objects

◆ n_mpi_processes

const unsigned int dftfe::geoOptCell::n_mpi_processes
private

◆ pcout

dealii::ConditionalOStream dftfe::geoOptCell::pcout
private

conditional stream object

◆ this_mpi_process

const unsigned int dftfe::geoOptCell::this_mpi_process
private

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