MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
linesearch.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/linesearch.h,v 1.11 2017/01/12 14:46:09 masarati Exp $ */
2 /*
3  * MBDyn (C) is a multibody analysis code.
4  * http://www.mbdyn.org
5  *
6  * Copyright (C) 1996-2017
7  *
8  * Pierangelo Masarati <masarati@aero.polimi.it>
9  * Paolo Mantegazza <mantegazza@aero.polimi.it>
10  *
11  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
12  * via La Masa, 34 - 20156 Milano, Italy
13  * http://www.aero.polimi.it
14  *
15  * Changing this copyright notice is forbidden.
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation (version 2 of the License).
20  *
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */
31 
32  /*
33  * Portions Copyright (C) 2003-2017
34  * Giuseppe Quaranta <quaranta@aero.polimi.it>
35  *
36  * classi che implementano la risoluzione del sistema nonlineare
37  */
38 
39  /*
40  AUTHOR: Reinhard Resch <r.resch@secop.com>
41  Copyright (C) 2011(-2017) all rights reserved.
42 
43  The copyright of this code is transferred
44  to Pierangelo Masarati and Paolo Mantegazza
45  for use in the software MBDyn as described
46  in the GNU Public License version 2.1
47  */
48 
49 #ifndef LINE_SEARCH_H
50 #define LINE_SEARCH_H
51 
52 #include "nonlin.h"
53 #include "vh.h"
54 
56 {
66  enum { ZERO_GRADIENT_CONTINUE = 0x001,
68  ALGORITHM_CUBIC = 0x004,
74  VERBOSE_MODE = 0x100,
77  unsigned uFlags;
79 };
80 
82 {
90  const DataManager* const pDM;
91 
92 public:
94  {
95  public:
98  {
99 
100  }
101  };
102 
104  {
105  public:
108  {
109 
110  }
111  };
112 
114  {
115  public:
118  {
119 
120  }
121  };
122 
124  {
125  public:
128  {
129 
130  }
131  };
132 
135  const struct LineSearchParameters& param);
136  ~LineSearchSolver(void);
137 
138  void Solve(const NonlinearProblem *pNLP,
139  Solver *pS,
140  const integer iMaxIter,
141  const doublereal& Tol,
142  integer& iIterCnt,
143  doublereal& dErr,
144  const doublereal& SolTol,
145  doublereal& dSolErr);
146 
147 private:
148  void LineSearch(doublereal stpmax, doublereal fold, doublereal& f, bool& check, const integer& iIterCnt);
149  void Residual(doublereal& f, integer iIterCnt);
150  void Jacobian();
151 };
152 
153 #endif /* LINE_SEARCH_H */
154 
void Solve(const NonlinearProblem *pNLP, Solver *pS, const integer iMaxIter, const doublereal &Tol, integer &iIterCnt, doublereal &dErr, const doublereal &SolTol, doublereal &dSolErr)
Definition: linesearch.cc:400
MyVectorHandler p
Definition: linesearch.h:85
VectorHandler * pRes
Definition: linesearch.h:83
#define MBDYN_EXCEPT_ARGS_PASSTHRU
Definition: except.h:55
doublereal dMaxStep
Definition: linesearch.h:60
MyVectorHandler g
Definition: linesearch.h:86
#define MBDYN_EXCEPT_ARGS_DECL
Definition: except.h:43
doublereal dTolMin
Definition: linesearch.h:58
~LineSearchSolver(void)
Definition: linesearch.cc:134
void LineSearch(doublereal stpmax, doublereal fold, doublereal &f, bool &check, const integer &iIterCnt)
Definition: linesearch.cc:210
VectorHandler * pSol
Definition: linesearch.h:84
const NonlinearProblem * pNLP
Definition: linesearch.h:88
const DataManager *const pDM
Definition: linesearch.h:90
doublereal dLambdaMin
Definition: linesearch.h:62
doublereal dTolX
Definition: linesearch.h:57
doublereal dDivergenceCheck
Definition: linesearch.h:64
void Residual(doublereal &f, integer iIterCnt)
Definition: linesearch.cc:140
MaxIterations(MBDYN_EXCEPT_ARGS_DECL)
Definition: linesearch.h:116
MyVectorHandler dXneg
Definition: linesearch.h:87
ZeroGradient(MBDYN_EXCEPT_ARGS_DECL)
Definition: linesearch.h:106
doublereal dMinStepScale
Definition: linesearch.h:65
doublereal dAlpha
Definition: linesearch.h:61
struct option options[]
Definition: ann_in.c:46
Definition: solver.h:78
LineSearchSolver(DataManager *pDM, const NonlinearSolverOptions &options, const struct LineSearchParameters &param)
Definition: linesearch.cc:102
integer iMaxIterations
Definition: linesearch.h:59
SlopeNotNegative(MBDYN_EXCEPT_ARGS_DECL)
Definition: linesearch.h:96
doublereal dLambdaFactMin
Definition: linesearch.h:63
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
ResidualNotDecreased(MBDYN_EXCEPT_ARGS_DECL)
Definition: linesearch.h:126