18#ifndef LBFGSNonLinearSolver_h
19#define LBFGSNonLinearSolver_h
48 const bool usePreconditioner,
49 const double maxUpdate,
50 const unsigned int maxNumberIterations,
51 const int maxNumPastSteps,
52 const unsigned int debugLevel,
53 const MPI_Comm & mpi_comm_parent,
54 const bool isCurvatureOnlyLineSearchStoppingCondition =
false);
75 const std::string checkpointFileName =
"",
76 const bool restart =
false);
85 save(
const std::string &checkpointFileName);
155 load(
const std::string &checkpointFileName);
void computeStepScale(nonlinearSolverProblem &problem)
Compute scaling factor for the step.
bool d_wolfeSufficientDec
Definition LBFGSNonLinearSolver.h:200
std::vector< double > d_preconditioner
storage for the preconditioner.
Definition LBFGSNonLinearSolver.h:171
void updateHistory()
Update the stored history, damped LBFGS.
void save(const std::string &checkpointFileName)
Create checkpoint file for current state of the LBFGS solver.
void initializePreconditioner(nonlinearSolverProblem &problem)
Initialize preconditioner.
void load(const std::string &checkpointFileName)
Load LBFGS solver state from checkpoint file.
dealii::ConditionalOStream pcout
Definition LBFGSNonLinearSolver.h:215
void computeUpdateStep()
Compute Update Vector.
std::vector< double > d_gradientNew
Definition LBFGSNonLinearSolver.h:163
bool d_useSingleAtomSolutionsInitialGuess
Definition LBFGSNonLinearSolver.h:206
void computeStep()
Compute LBFGS step.
std::vector< double > d_updateVector
Definition LBFGSNonLinearSolver.h:168
double d_normDeltaXnew
storage for inf norm of the update step.
Definition LBFGSNonLinearSolver.h:191
std::vector< double > d_value
Definition LBFGSNonLinearSolver.h:159
double d_alpha
storage for backtracking line search parameter.
Definition LBFGSNonLinearSolver.h:197
std::vector< double > d_gradient
Definition LBFGSNonLinearSolver.h:159
bool d_wolfeSatisfied
Definition LBFGSNonLinearSolver.h:201
LBFGSNonLinearSolver(const bool usePreconditioner, const double maxUpdate, const unsigned int maxNumberIterations, const int maxNumPastSteps, const unsigned int debugLevel, const MPI_Comm &mpi_comm_parent, const bool isCurvatureOnlyLineSearchStoppingCondition=false)
Constructor.
const bool d_usePreconditioner
flag for using the preconditioner
Definition LBFGSNonLinearSolver.h:204
int d_numPastSteps
storage for the number of past steps currently stored.
Definition LBFGSNonLinearSolver.h:188
void scalePreconditioner(nonlinearSolverProblem &problem)
Scale preconditioner.
unsigned int d_numberUnknowns
Definition LBFGSNonLinearSolver.h:175
const int d_maxNumPastSteps
storage for the maximum number of past steps to be stored.
Definition LBFGSNonLinearSolver.h:185
std::deque< std::vector< double > > d_deltaGq
storage for history.
Definition LBFGSNonLinearSolver.h:181
unsigned int d_iter
storage for current bfgs iteration count.
Definition LBFGSNonLinearSolver.h:178
std::vector< double > d_deltaX
Definition LBFGSNonLinearSolver.h:168
void computeHx(std::vector< double > &Hx)
Compute Hessian inverse times vector.
std::vector< double > d_deltaXNew
Definition LBFGSNonLinearSolver.h:168
bool d_stepAccepted
boolean parameter for step accepteance and Wolfe conditions.
Definition LBFGSNonLinearSolver.h:200
bool d_isCurvatureOnlyLineSearchStoppingCondition
Definition LBFGSNonLinearSolver.h:209
~LBFGSNonLinearSolver()
Destructor.
bool updateSolution(const std::vector< double > &step, nonlinearSolverProblem &problem)
Update solution x -> x + step.
std::vector< double > d_valueNew
Definition LBFGSNonLinearSolver.h:163
void checkWolfe()
Test if the step satisfies strong Wolfe conditions.
bool d_noHistory
Definition LBFGSNonLinearSolver.h:206
std::deque< std::vector< double > > d_deltaXq
Definition LBFGSNonLinearSolver.h:181
bool d_wolfeCurvature
Definition LBFGSNonLinearSolver.h:200
std::deque< double > d_rhoq
Definition LBFGSNonLinearSolver.h:182
nonLinearSolver::ReturnValueType solve(nonlinearSolverProblem &problem, const std::string checkpointFileName="", const bool restart=false)
Solve non-linear problem using LBFGS method.
double d_maxStepLength
storage for the maximum allowed step length.
Definition LBFGSNonLinearSolver.h:194
MPI_Comm mpi_communicator
Definition LBFGSNonLinearSolver.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