ROL
|
#include <example_01.hpp>
Public Member Functions | |
Objective_GrossPitaevskii (const Real &g, const Vector< Real > &V) | |
Real | value (const Vector< Real > &psi, Real &tol) |
Evaluate \(J[\psi]\). More... | |
void | gradient (Vector< Real > &g, const Vector< Real > &psi, Real &tol) |
Evaluate \(\nabla J[\psi]\). More... | |
void | hessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &psi, Real &tol) |
Evaluate \(\nabla^2 J[\psi] v\). More... | |
Objective_GrossPitaevskii (const Real &g, const Vector< Real > &V, ROL::Ptr< FiniteDifference< Real > > fd) | |
Real | value (const Vector< Real > &psi, Real &tol) |
Evaluate \(J[\psi]\). More... | |
void | gradient (Vector< Real > &g, const Vector< Real > &psi, Real &tol) |
Evaluate \(\nabla J[\psi]\). More... | |
void | hessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &psi, Real &tol) |
Evaluate \(\nabla^2 J[\psi] v\). More... | |
Public Member Functions inherited from ROL::Objective< Real > | |
virtual | ~Objective () |
Objective () | |
virtual void | update (const Vector< Real > &x, UpdateType type, int iter=-1) |
Update objective function. More... | |
virtual void | update (const Vector< Real > &x, bool flag=true, int iter=-1) |
Update objective function. More... | |
virtual Real | dirDeriv (const Vector< Real > &x, const Vector< Real > &d, Real &tol) |
Compute directional derivative. More... | |
virtual void | invHessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) |
Apply inverse Hessian approximation to vector. More... | |
virtual void | precond (Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) |
Apply preconditioner to vector. More... | |
virtual void | prox (Vector< Real > &Pv, const Vector< Real > &v, Real t, Real &tol) |
virtual std::vector < std::vector< Real > > | checkGradient (const Vector< Real > &x, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1) |
Finite-difference gradient check. More... | |
virtual std::vector < std::vector< Real > > | checkGradient (const Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1) |
Finite-difference gradient check. More... | |
virtual std::vector < std::vector< Real > > | checkGradient (const Vector< Real > &x, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1) |
Finite-difference gradient check with specified step sizes. More... | |
virtual std::vector < std::vector< Real > > | checkGradient (const Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1) |
Finite-difference gradient check with specified step sizes. More... | |
virtual std::vector < std::vector< Real > > | checkHessVec (const Vector< Real > &x, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1) |
Finite-difference Hessian-applied-to-vector check. More... | |
virtual std::vector < std::vector< Real > > | checkHessVec (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1) |
Finite-difference Hessian-applied-to-vector check. More... | |
virtual std::vector < std::vector< Real > > | checkHessVec (const Vector< Real > &x, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1) |
Finite-difference Hessian-applied-to-vector check with specified step sizes. More... | |
virtual std::vector < std::vector< Real > > | checkHessVec (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1) |
Finite-difference Hessian-applied-to-vector check with specified step sizes. More... | |
virtual std::vector< Real > | checkHessSym (const Vector< Real > &x, const Vector< Real > &v, const Vector< Real > &w, const bool printToStream=true, std::ostream &outStream=std::cout) |
Hessian symmetry check. More... | |
virtual std::vector< Real > | checkHessSym (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &w, const bool printToStream=true, std::ostream &outStream=std::cout) |
Hessian symmetry check. More... | |
virtual void | setParameter (const std::vector< Real > ¶m) |
Private Types | |
typedef std::vector< Real > | vector |
typedef Vector< Real > | V |
typedef StdVector< Real > | SV |
typedef vector::size_type | uint |
typedef std::vector< Real > | vector |
typedef vector::size_type | uint |
Private Member Functions | |
ROL::Ptr< const vector > | getVector (const V &x) |
ROL::Ptr< vector > | getVector (V &x) |
void | applyK (const Vector< Real > &v, Vector< Real > &kv) |
Apply finite difference operator. More... | |
void | applyK (const Vector< Real > &v, Vector< Real > &kv) |
Apply finite difference operator. More... | |
Private Attributes | |
Real | g_ |
uint | nx_ |
Real | dx_ |
ROL::Ptr< const vector > | Vp_ |
ROL::Ptr< const std::vector < Real > > | Vp_ |
ROL::Ptr< FiniteDifference < Real > > | fd_ |
Additional Inherited Members | |
Protected Member Functions inherited from ROL::Objective< Real > | |
const std::vector< Real > | getParameter (void) const |
Objective Function Class
Definition at line 53 of file gross-pitaevskii/example_01.hpp.
|
private |
Definition at line 55 of file gross-pitaevskii/example_01.hpp.
|
private |
Definition at line 56 of file gross-pitaevskii/example_01.hpp.
|
private |
Definition at line 57 of file gross-pitaevskii/example_01.hpp.
|
private |
Definition at line 59 of file gross-pitaevskii/example_01.hpp.
|
private |
Definition at line 423 of file gross-pitaevskii/example_02.hpp.
|
private |
Definition at line 424 of file gross-pitaevskii/example_02.hpp.
|
inline |
Definition at line 114 of file gross-pitaevskii/example_01.hpp.
|
inline |
Definition at line 469 of file gross-pitaevskii/example_02.hpp.
|
inlineprivate |
Definition at line 76 of file gross-pitaevskii/example_01.hpp.
|
inlineprivate |
Definition at line 81 of file gross-pitaevskii/example_01.hpp.
|
inlineprivate |
Apply finite difference operator.
Compute \(K\psi\), where \(K\) is the finite difference approximation of \(-D_x^2\)
Definition at line 91 of file gross-pitaevskii/example_01.hpp.
|
inlinevirtual |
Evaluate \(J[\psi]\).
\[ J[\psi]=\frac{1}{2} \int\limits_0^1 |\psi'|^2 + V(x)|\psi|^2+g|\psi|^4\,\mathrm{d}x \]
where the integral is approximated with the trapezoidal rule and the derivative is approximated using finite differences
Implements ROL::Objective< Real >.
Definition at line 125 of file gross-pitaevskii/example_01.hpp.
References ROL::Vector< Real >::clone().
|
inlinevirtual |
Evaluate \(\nabla J[\psi]\).
\[ \nabla J[\psi] = -\psi'' + V(x)\psi+2g|\psi|^3 \]
Reimplemented from ROL::Objective< Real >.
Definition at line 152 of file gross-pitaevskii/example_01.hpp.
References ROL::Vector< Real >::clone().
|
inlinevirtual |
Evaluate \(\nabla^2 J[\psi] v\).
\[ \nabla^2 J[\psi]v = -v'' + V(x)v+6g|\psi|^2 v \]
Reimplemented from ROL::Objective< Real >.
Definition at line 178 of file gross-pitaevskii/example_01.hpp.
|
inlineprivate |
Apply finite difference operator.
Compute \(K\psi\), where \(K\) is the finite difference approximation of \(-D_x^2\)
Definition at line 445 of file gross-pitaevskii/example_02.hpp.
|
inlinevirtual |
Evaluate \(J[\psi]\).
\[ J[\psi]=\frac{1}{2} \int\limits_0^1 |\psi'|^2 + V(x)|\psi|^2+g|\psi|^4\,\mathrm{d}x \]
where the integral is approximated with the trapezoidal rule and the derivative is approximated using finite differences
Implements ROL::Objective< Real >.
Definition at line 481 of file gross-pitaevskii/example_02.hpp.
|
inlinevirtual |
Evaluate \(\nabla J[\psi]\).
\[ \nabla J[\psi] = -\psi'' + V(x)\psi+2g|\psi|^3 \]
Reimplemented from ROL::Objective< Real >.
Definition at line 508 of file gross-pitaevskii/example_02.hpp.
|
inlinevirtual |
Evaluate \(\nabla^2 J[\psi] v\).
\[ \nabla^2 J[\psi]v = -v'' + V(x)v+6g|\psi|^2 v \]
Reimplemented from ROL::Objective< Real >.
Definition at line 534 of file gross-pitaevskii/example_02.hpp.
|
private |
Definition at line 65 of file gross-pitaevskii/example_01.hpp.
|
private |
Definition at line 68 of file gross-pitaevskii/example_01.hpp.
|
private |
Definition at line 71 of file gross-pitaevskii/example_01.hpp.
|
private |
Definition at line 74 of file gross-pitaevskii/example_01.hpp.
|
private |
Definition at line 438 of file gross-pitaevskii/example_02.hpp.
|
private |
Definition at line 440 of file gross-pitaevskii/example_02.hpp.