18#ifndef CGPRPNonLinearSolver_h
19#define CGPRPNonLinearSolver_h
50 const unsigned int maxNumberIterations,
51 const unsigned int debugLevel,
52 const MPI_Comm & mpi_comm_parent,
53 const double lineSearchTolerance = 1.0e-6,
54 const unsigned int lineSearchMaxIterations = 10,
55 const double lineSeachDampingParameter = 1.0,
56 const double maxIncrementSolLinf = 1
e+6,
57 const bool isCurvatureOnlyLineSearchStoppingCondition =
false);
78 const std::string checkpointFileName =
"",
79 const bool restart =
false);
87 save(
const std::string &checkpointFileName);
113 const double tolerance,
114 const unsigned int maxNumberIterations,
115 const unsigned int debugLevel,
116 const std::string checkpointFileName =
"",
117 const int startingIter = -1,
118 const bool isCheckpointRestart =
false);
125 std::pair<double, double>
177 const std::vector<double> &direction,
185 load(
const std::string &checkpointFileName);
double computeResidualL2Norm() const
Compute residual L2-norm.
void save(const std::string &checkpointFileName)
Create checkpoint file for current state of the cg solver.
double d_etaAlphaZeroChk
line search data
Definition cgPRPNonLinearSolver.h:259
double d_gradMax
Definition cgPRPNonLinearSolver.h:211
std::vector< double > d_conjugateDirection
storage for conjugate direction
Definition cgPRPNonLinearSolver.h:188
double d_functionValueChk
line search data
Definition cgPRPNonLinearSolver.h:262
nonLinearSolver::ReturnValueType lineSearch(nonlinearSolverProblem &problem, const double tolerance, const unsigned int maxNumberIterations, const unsigned int debugLevel, const std::string checkpointFileName="", const int startingIter=-1, const bool isCheckpointRestart=false)
Perform line search.
void computeDeltas()
Compute delta new and delta mid.
double d_beta
Definition cgPRPNonLinearSolver.h:208
~cgPRPNonLinearSolver()
Destructor.
double d_deltaOld
intermediate variable for beta computation
Definition cgPRPNonLinearSolver.h:204
double d_etaChk
line search data
Definition cgPRPNonLinearSolver.h:253
double d_maxSolutionIncrementLinf
Definition cgPRPNonLinearSolver.h:244
const double d_lineSearchTolerance
line search stopping tolerance
Definition cgPRPNonLinearSolver.h:228
double d_functionalValueAfterAlphUpdateChk
line search data
Definition cgPRPNonLinearSolver.h:265
std::vector< double > d_steepestDirectionOld
Definition cgPRPNonLinearSolver.h:195
double d_alphaChk
line search data
Definition cgPRPNonLinearSolver.h:247
const unsigned int this_mpi_process
Definition cgPRPNonLinearSolver.h:279
unsigned int d_iter
storage for current nonlinear cg iteration count
Definition cgPRPNonLinearSolver.h:217
const unsigned int n_mpi_processes
Definition cgPRPNonLinearSolver.h:278
double d_eta
line search data
Definition cgPRPNonLinearSolver.h:256
bool d_useSingleAtomSolutionsInitialGuess
Definition cgPRPNonLinearSolver.h:271
unsigned int computeTotalNumberUnknowns() const
Compute the total number of unknowns in all processors.
std::pair< double, double > computeDeltaD()
Compute delta_d and eta_p.
const unsigned int d_lineSearchMaxIterations
maximum number of line search iterations
Definition cgPRPNonLinearSolver.h:231
double d_deltaNew
intermediate variable for beta computation
Definition cgPRPNonLinearSolver.h:198
int d_lineSearchRestartIterChk
line search iter
Definition cgPRPNonLinearSolver.h:268
bool d_isCurvatureOnlyLineSearchStoppingCondition
Definition cgPRPNonLinearSolver.h:274
MPI_Comm mpi_communicator
Definition cgPRPNonLinearSolver.h:277
nonLinearSolver::ReturnValueType solve(nonlinearSolverProblem &problem, const std::string checkpointFileName="", const bool restart=false)
Solve non-linear problem using Polak-Ribiere-Polyak nonlinar conjugate gradient method.
void initializeDirection()
Initialize direction.
dealii::ConditionalOStream pcout
Definition cgPRPNonLinearSolver.h:280
double d_deltaMid
intermediate variable for beta computation
Definition cgPRPNonLinearSolver.h:201
double d_lineSearchDampingParameter
Definition cgPRPNonLinearSolver.h:236
cgPRPNonLinearSolver(const unsigned int maxNumberIterations, const unsigned int debugLevel, const MPI_Comm &mpi_comm_parent, const double lineSearchTolerance=1.0e-6, const unsigned int lineSearchMaxIterations=10, const double lineSeachDampingParameter=1.0, const double maxIncrementSolLinf=1e+6, const bool isCurvatureOnlyLineSearchStoppingCondition=false)
Constructor.
void updateDirection()
Update direction.
bool d_isCGRestartDueToLargeIncrement
Definition cgPRPNonLinearSolver.h:240
bool updateSolution(const double alpha, const std::vector< double > &direction, nonlinearSolverProblem &problem)
Update solution x -> x + \alpha direction.
std::vector< unsigned int > d_unknownCountFlag
Definition cgPRPNonLinearSolver.h:225
std::vector< double > d_gradient
storage for the gradient of the nonlinear problem in the current cg step
Definition cgPRPNonLinearSolver.h:191
void load(const std::string &checkpointFileName)
Load cg solver state from checkpoint file.
double d_etaPChk
line search data
Definition cgPRPNonLinearSolver.h:250
double computeEta()
Compute eta.
unsigned int d_numberUnknowns
storage for number of unknowns to be solved for in the nonlinear problem
Definition cgPRPNonLinearSolver.h:214
nonLinearSolver(const unsigned int debugLevel, const unsigned int maxNumberIterations, const double tolerance=0)
Constructor.
ReturnValueType
Definition nonLinearSolver.h:45
Abstract class for solver functions.
Definition nonlinearSolverProblem.h:30
Definition pseudoPotentialToDftfeConverter.cc:34
@ e
Definition ExcSSDFunctionalBaseClass.h:52