20 #ifndef JDFTX_ELECTRONIC_LATTICEMINIMIZER_H 21 #define JDFTX_ELECTRONIC_LATTICEMINIMIZER_H 23 #include <electronic/common.h> 25 #include <core/matrix3.h> 44 double sync(
double x)
const;
63 double centralDifference(
matrix3<> direction);
67 static void updateLatticeDependent(
Everything& e,
bool ignoreElectronic=
false);
72 #endif // JDFTX_ELECTRONIC_LATTICEMINIMIZER_H Definition: IonDynamics.h:30
void randomize(TptrCollection &x)
Initialize to normal random numbers:
Definition: ScalarFieldArray.h:154
std::vector< matrix3<> > strainBasis
Definition: LatticeMinimizer.h:51
complex dot(const Tptr &X, const Tptr &Y)
Definition: Operators.h:196
double safeStepSize(const matrix3<> &dir) const
Override to return maximum safe step size along a given direction. Steps can be arbitrarily large by ...
Definition: LatticeMinimizer.h:33
void step(const matrix3<> &dir, double alpha)
Move the state in parameter space along direction dir with scale alpha.
Tptr clone(const Tptr &X)
Clone (NOTE: operator= is by reference for the ScalarField classes)
Definition: Operators.h:111
void restore()
Restores the lattice to the original state (i.e. strain=0)
void constrain(matrix3<> &)
Constrain search directions to the space of free directions for minimize.
Definition: Everything.h:41
Nonlinear minimization templates.
double compute(matrix3<> *grad, matrix3<> *Kgrad)
Returns the objective function at the current state and store the gradient in grad and preconditioned...
Definition: Minimize.h:46
void axpy(double alpha, const Tptr &X, Tptr &Y)
Generic axpy for complex data types (Note: null pointers are treated as zero)
Definition: Operators.h:158
std::vector< double > calculateStress()
Calculates the stresses along the strain directions.
double sync(double x) const
All processes minimize together; make sure scalars are in sync to round-off error.