OOFEM 3.0
Loading...
Searching...
No Matches
calmls.h
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#ifndef calmls_h
36#define calmls_h
37
38#include <set>
39#include <vector>
40#include <memory>
41
42#include "sparselinsystemnm.h"
44#include "convergedreason.h"
45#include "floatarray.h"
46#include "intarray.h"
47#include "dofiditem.h"
48
50
51#define _IFT_CylindricalALM_Name "calm"
52#define _IFT_CylindricalALM_psi "psi"
53#define _IFT_CylindricalALM_maxiter "maxiter"
54#define _IFT_CylindricalALM_maxrestarts "maxrestarts"
55#define _IFT_CylindricalALM_minsteplength "minsteplength"
56#define _IFT_CylindricalALM_steplength "steplength"
57#define _IFT_CylindricalALM_initialsteplength "initialsteplength"
58#define _IFT_CylindricalALM_forcedinitialsteplength "forcedinitialsteplength"
59#define _IFT_CylindricalALM_reqiterations "reqiterations"
60#define _IFT_CylindricalALM_miniterations "miniter"
61#define _IFT_CylindricalALM_manrmsteps "manrmsteps"
62#define _IFT_CylindricalALM_hpcmode "hpcmode"
63#define _IFT_CylindricalALM_hpc "hpc"
64#define _IFT_CylindricalALM_hpcw "hpcw"
65#define _IFT_CylindricalALM_lstype "lstype"
66#define _IFT_CylindricalALM_linesearch "linesearch"
67#define _IFT_CylindricalALM_lsearchtol "lsearchtol"
68#define _IFT_CylindricalALM_lsearchamp "lsearchamp"
69#define _IFT_CylindricalALM_lsearchmaxeta "lsearchmaxeta"
70#define _IFT_CylindricalALM_nccdg "nccdg"
71#define _IFT_CylindricalALM_ccdg "ccdg"
72#define _IFT_CylindricalALM_rtolv "rtolv"
73#define _IFT_CylindricalALM_rtolf "rtolf"
74#define _IFT_CylindricalALM_rtold "rtold"
75#define _IFT_CylindricalALM_rootselectiontype "rootselectiontype"
77
78
79namespace oofem {
80class Domain;
81class EngngModel;
82class ParallelContext;
83
84#define calm_SMALL_NUM 1.e-20
85#define calm_SMALL_ERROR_NUM 1.e-6
86
147{
148protected:
155
162
163 typedef std :: set< DofIDItem > __DofIDSet;
164
165 int nsmax;
167 double Psi;
173
176
187
189 std :: unique_ptr< SparseLinearSystemNM > linSolver;
192
200 double maxEta, minEta;
201
202 // Support for evaluation of error norms for user defined dof-groups.
204 int nccdg;
206 std :: vector< __DofIDSet >ccDofGroups;
213
223
228
229public:
231 virtual ~CylindricalALM();
232
233 // Overloaded methods:
235 FloatArray &X, FloatArray &dX, FloatArray &F,
236 const FloatArray &internalForcesEBENorm, double &ReachedLambda, referenceLoadInputModeType rlm,
237 int &nite, TimeStep *) override;
238 double giveCurrentStepLength() override { return deltaL; }
239 void setStepLength(double s) override { deltaL = s; }
240 void initializeFrom(InputRecord &ir) override;
241 bool referenceLoad() const override { return true; }
242 void saveContext(DataStream &stream, ContextMode mode) override;
243 void restoreContext(DataStream &stream, ContextMode mode) override;
244 void setDomain(Domain *d) override {
245 this->domain = d;
246 if ( linSolver ) {
247 linSolver->setDomain(d);
248 }
249 }
250 void reinitialize() override {
251 calm_hpc_init = 1;
252 if ( linSolver ) {
253 linSolver->reinitialize();
254 }
255 }
256 const char *giveClassName() const override { return "CylindricalALM"; }
257 const char *giveInputRecordName() const { return _IFT_CylindricalALM_Name; }
258
259 SparseLinearSystemNM *giveLinearSolver() override;
260
261protected:
262 void convertHPCMap();
263
267 int computeDeltaLambda(double &deltaLambda, const FloatArray &dX, const FloatArray &deltaXt,
268 const FloatArray &deltaX_, const FloatArray &R, double RR, double eta,
269 double deltaL, double DeltaLambda0, int neq);
270
271 void search(int istep, FloatArray &prod, FloatArray &eta, double amp,
272 double maxeta, double mineta, int &status);
273
275 bool checkConvergence(const FloatArray &R, const FloatArray *R0, const FloatArray &F,
276 const FloatArray &X, const FloatArray &ddX,
277 double Lambda, double RR0, double RR, double drProduct,
278 const FloatArray &internalForcesEBENorm, int nite, bool &errorOutOfRange);
279
281 void do_lineSearch(FloatArray &X, const FloatArray &XInitial, const FloatArray &deltaX_, const FloatArray &deltaXt,
282 const FloatArray &dXm1, FloatArray &dX, FloatArray &ddX,
283 const FloatArray &R, const FloatArray *R0, const FloatArray &F,
284 double &DeltaLambda, double &DeltaLambdam1, double &deltaLambda,
285 double &Lambda, double &ReachedLambda, double RR, double &drProduct, TimeStep *tStep);
286};
287} // end namespace oofem
288#endif // calmls_h
#define _IFT_CylindricalALM_Name
Definition calmls.h:51
void setDomain(Domain *d) override
Definition calmls.h:244
FloatArray rtold
Relative iterative displacement change tolerance for each group.
Definition calmls.h:210
void setStepLength(double s) override
Definition calmls.h:239
int minIterations
Minimum hard number of iteration.s.
Definition calmls.h:175
FloatArray calm_HPCDmanWeightSrcArray
Input array of dofman weights (for hpcmode 2).
Definition calmls.h:186
ParallelContext * parallel_context
Parallel context for computing norms, dot products and such.
Definition calmls.h:212
std ::set< DofIDItem > __DofIDSet
Definition calmls.h:163
ConvergedReason solve(SparseMtrx &K, FloatArray &R, FloatArray *R0, FloatArray &X, FloatArray &dX, FloatArray &F, const FloatArray &internalForcesEBENorm, double &ReachedLambda, referenceLoadInputModeType rlm, int &nite, TimeStep *) override
Definition calmls.C:108
const char * giveInputRecordName() const
Definition calmls.h:257
FloatArray calm_HPCWeights
Definition calmls.h:180
double ls_tolerance
Line search tolerance.
Definition calmls.h:196
calm_NR_ModeType calm_NR_Mode
Definition calmls.h:170
CylindricalALM(Domain *d, EngngModel *m)
calm_ControlType
CALM mode type; determines the calm step length control.
Definition calmls.h:150
@ calml_hpc
Linearized ALM (only displacements), taking into account only selected dofs with given weight.
Definition calmls.h:153
@ calm_hpc_on
Full ALM with quadratic constrain, taking into account only selected dofs.
Definition calmls.h:152
@ calm_hpc_off
Full ALM with quadratic constrain and all dofs.
Definition calmls.h:151
calm_NR_ModeType calm_NR_OldMode
Definition calmls.h:170
int numberOfRequiredIterations
Definition calmls.h:169
double amplifFactor
Line search amplification factor.
Definition calmls.h:198
int calm_hpc_init
Variables for HyperPlaneControl.
Definition calmls.h:178
double giveCurrentStepLength() override
Definition calmls.h:238
int lsFlag
Line search flag.
Definition calmls.h:194
int nccdg
Number of convergence criteria dof groups.
Definition calmls.h:204
calm_NR_ModeType
Controlling mode of Newton-Raphson Method.
Definition calmls.h:157
@ calm_modifiedNRM
Keeps the old tangent.
Definition calmls.h:158
@ calm_accelNRM
Updates the tangent after a few steps.
Definition calmls.h:160
@ calm_fullNRM
Updates the tangent every iteration.
Definition calmls.h:159
IntArray calm_HPCDmanDofSrcArray
Input array containing dofmanagers and corresponding dof numbers under indirect control.
Definition calmls.h:184
calm_ControlType calm_Control
Definition calmls.h:179
void reinitialize() override
Definition calmls.h:250
LinSystSolverType solverType
linear system solver ID.
Definition calmls.h:191
std ::unique_ptr< SparseLinearSystemNM > linSolver
Linear system solver.
Definition calmls.h:189
IntArray calm_HPCIndirectDofMask
Array containing equation numbers of dofs under indirect control.
Definition calmls.h:182
FloatArray old_dX
previous increment of dX, needed by root selection type 1
Definition calmls.h:227
std ::vector< __DofIDSet > ccDofGroups
Convergence criteria dof groups.
Definition calmls.h:206
bool referenceLoad() const override
Definition calmls.h:241
double maxEta
Line search parameters (limits).
Definition calmls.h:200
const char * giveClassName() const override
Definition calmls.h:256
RootSelectionType rootselectiontype
Root selection type.
Definition calmls.h:225
FloatArray rtolf
Relative unbalanced force tolerance for each group.
Definition calmls.h:208
Domain * domain
Pointer to domain.
Definition nummet.h:84
SparseNonLinearSystemNM(Domain *d, EngngModel *m)
Constructor.
long ContextMode
Definition contextmode.h:43
#define OOFEM_EXPORT
Definition oofemcfg.h:7

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011