OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
staggeredsolver.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 - 2013 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 staggeredsolver_h
36 #define staggeredsolver_h
37 
38 #include "sparselinsystemnm.h"
39 #include "sparsenonlinsystemnm.h"
40 #include "sparsemtrx.h"
41 #include "floatarray.h"
42 #include "linesearch.h"
43 #include "nrsolver.h"
44 #include "unknownnumberingscheme.h"
45 
46 #include <set>
47 #include <vector>
48 
49 
51 
52 #define _IFT_StaggeredSolver_Name "staggeredsolver"
53 #define _IFT_StaggeredSolver_DofIdList "dofidlist"
54 #define _IFT_StaggeredSolver_DofIdListPositions "idpos"
55 
56 
57 namespace oofem {
58 class Domain;
59 class EngngModel;
60 
61 
63 {
64 protected:
65  bool prescribed;
66  int numEqs;
68 
69 public:
71 
72  IntArray dofIdArray; // should be private
73  virtual bool isDefault() const { return true; }
74  void setDofIdArray(IntArray array) { this->dofIdArray = std::move(array); }
75 
76  virtual int giveDofEquationNumber(Dof *dof) const;
77 
78  virtual int giveRequiredNumberOfDomainEquation() const { return numEqs; }
79 
80  int giveNewEquationNumber() { return ++numEqs; }
82  int giveNumEquations() { return this->numEqs; }
83  int giveNumPresEquations() { return this->numPresEqs; }
84 };
85 
90 {
91 public:
92  std :: vector< std :: unique_ptr< SparseMtrx > > stiffnessMatrixList;
93  std :: vector< FloatArray > fIntList;
94  std :: vector< FloatArray > fExtList;
95 
96  std :: vector< IntArray > locArrayList;
97  std :: vector< FloatArray > X;
98  std :: vector< FloatArray > dX;
99  std :: vector< FloatArray > ddX;
100 
101  DofGrouping(const std :: vector< CustomEquationNumbering > &numberings, Domain * m);
102  void giveTotalLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, Domain *d);
103 };
104 
109 class OOFEM_EXPORT StaggeredSolver : public NRSolver
110 {
111 private:
114  std :: vector< CustomEquationNumbering > UnknownNumberingSchemeList;
115 
116  bool checkConvergenceDofIdArray(FloatArray &RT, FloatArray &F, FloatArray &rhs, FloatArray &ddX, FloatArray &X,
117  double RRT, const FloatArray &internalForcesEBENorm, int nite, bool &errorOutOfRange, TimeStep *tStep, IntArray &dofIdArray);
118 
119 public:
121  virtual ~StaggeredSolver() {}
122 
123  // Overloaded methods:
124  virtual NM_Status solve(SparseMtrx &k, FloatArray &R, FloatArray *R0,
125  FloatArray &X, FloatArray &dX, FloatArray &F,
126  const FloatArray &internalForcesEBENorm, double &l, referenceLoadInputModeType rlm,
127  int &nite, TimeStep *);
128 
129  virtual IRResultType initializeFrom(InputRecord *ir);
130 
131  virtual const char *giveClassName() const { return "StaggeredSolver"; }
132  virtual const char *giveInputRecordName() const { return _IFT_StaggeredSolver_Name; }
133 };
134 } // end namespace oofem
135 #endif // staggeredsolver_h
std::vector< std::unique_ptr< SparseMtrx > > stiffnessMatrixList
Class and object Domain.
Definition: domain.h:115
std::vector< CustomEquationNumbering > UnknownNumberingSchemeList
Base class for all matrices stored in sparse format.
Definition: sparsemtrx.h:60
This class implements Newton-Raphson Method, derived from abstract NumericalMethod class for solving ...
Definition: nrsolver.h:95
std::vector< FloatArray > fIntList
virtual const char * giveClassName() const
virtual int giveRequiredNumberOfDomainEquation() const
Returns required number of domain equation.
unsigned long NM_Status
Mask defining NumMetod Status; which can be asked after finishing computation by Numerical Method...
Definition: nmstatus.h:44
Class implementing an array of integers.
Definition: intarray.h:61
std::vector< FloatArray > fExtList
std::vector< FloatArray > ddX
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
referenceLoadInputModeType
The following parameter allows to specify how the reference load vector is obtained from given totalL...
std::vector< FloatArray > dX
Class representing vector of real numbers.
Definition: floatarray.h:82
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
void setDofIdArray(IntArray array)
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual const char * giveInputRecordName() const
Abstract base class representing the "problem" under consideration.
Definition: engngm.h:181
the oofem namespace is to define a context or scope in which all oofem names are defined.
std::vector< FloatArray > X
Abstract class Dof represents Degree Of Freedom in finite element mesh.
Definition: dof.h:93
Support struct to handle all the split up variables used during the solving step. ...
virtual int giveDofEquationNumber(Dof *dof) const
Returns the equation number for corresponding DOF.
Class representing solution step.
Definition: timestep.h:80
virtual bool isDefault() const
Returns true, if receiver is the default engngModel equation numbering scheme; This is useful for som...
The staggered solver will perform Newton iterations on subsets of DofIDs, in a staggered manner...
#define _IFT_StaggeredSolver_Name
std::vector< IntArray > locArrayList

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:31 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011