1 /* ---------------------------------------------------------------------- 2 This is the 3 4 ██╗ ██╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗████████╗███████╗ 5 ██║ ██║██╔════╝ ██╔════╝ ██╔════╝ ██║ ██║╚══██╔══╝██╔════╝ 6 ██║ ██║██║ ███╗██║ ███╗██║ ███╗███████║ ██║ ███████╗ 7 ██║ ██║██║ ██║██║ ██║██║ ██║██╔══██║ ██║ ╚════██║ 8 ███████╗██║╚██████╔╝╚██████╔╝╚██████╔╝██║ ██║ ██║ ███████║ 9 ╚══════╝╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝® 10 11 DEM simulation engine, released by 12 DCS Computing Gmbh, Linz, Austria 13 http://www.dcs-computing.com, office@dcs-computing.com 14 15 LIGGGHTS® is part of CFDEM®project: 16 http://www.liggghts.com | http://www.cfdem.com 17 18 Core developer and main author: 19 Christoph Kloss, christoph.kloss@dcs-computing.com 20 21 LIGGGHTS® is open-source, distributed under the terms of the GNU Public 22 License, version 2 or later. It is distributed in the hope that it will 23 be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 24 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have 25 received a copy of the GNU General Public License along with LIGGGHTS®. 26 If not, see http://www.gnu.org/licenses . See also top-level README 27 and LICENSE files. 28 29 LIGGGHTS® and CFDEM® are registered trade marks of DCS Computing GmbH, 30 the producer of the LIGGGHTS® software and the CFDEM®coupling software 31 See http://www.cfdem.com/terms-trademark-policy for details. 32 33 ------------------------------------------------------------------------- 34 Contributing author and copyright for this file: 35 This file is from LAMMPS 36 LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 37 http://lammps.sandia.gov, Sandia National Laboratories 38 Steve Plimpton, sjplimp@sandia.gov 39 40 Copyright (2003) Sandia Corporation. Under the terms of Contract 41 DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains 42 certain rights in this software. This software is distributed under 43 the GNU General Public License. 44 ------------------------------------------------------------------------- */ 45 46 #ifndef LMP_MIN_LSRCH_H 47 #define LMP_MIN_LSRCH_H 48 49 #include "min.h" 50 51 namespace LAMMPS_NS { 52 53 class MinLineSearch : public Min { 54 public: 55 MinLineSearch(class LAMMPS *); 56 ~MinLineSearch(); 57 void init(); 58 void setup_style(); 59 void reset_vectors(); 60 61 protected: 62 // vectors needed by linesearch minimizers 63 // allocated and stored by fix_minimize 64 // x,f are stored by parent or Atom class or Pair class 65 66 double *x0; // coords at start of linesearch 67 double *g; // old gradient vector 68 double *h; // search direction vector 69 70 double *gextra; // g,h for extra global dof, x0 is stored by fix 71 double *hextra; 72 73 double **x0extra_atom; // x0,g,h for extra per-atom dof 74 double **gextra_atom; 75 double **hextra_atom; 76 77 typedef int (MinLineSearch::*FnPtr)(double, double &); 78 FnPtr linemin; 79 int linemin_backtrack(double, double &); 80 int linemin_quadratic(double, double &); 81 int linemin_forcezero(double, double &); 82 83 double alpha_step(double, int); 84 double compute_dir_deriv(double &); 85 }; 86 87 } 88 89 #endif 90