OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
weakperiodicbc.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 WEAKPERIODICBC_H_
36 #define WEAKPERIODICBC_H_
37 
38 #include <vector>
39 #include <iostream>
40 #include <memory>
41 
42 #include "activebc.h"
43 #include "inputrecord.h"
44 #include "floatmatrix.h"
45 #include "floatarray.h"
46 #include "intarray.h"
47 #include "gausspoint.h"
48 
50 
51 #define _IFT_WeakPeriodicBoundaryCondition_Name "weakperiodicbc"
52 #define _IFT_WeakPeriodicBoundaryCondition_order "order"
53 #define _IFT_WeakPeriodicBoundaryCondition_descritizationType "descritizationtype"
54 #define _IFT_WeakPeriodicBoundaryCondition_dofids "dofids"
55 #define _IFT_WeakPeriodicBoundaryCondition_ngp "ngp"
56 #define _IFT_WeakPeriodicBoundaryCondition_gradient "gradient"
57 #define _IFT_WeakPeriodicBoundaryCondition_nlgeo "nlgeo"
58 #define _IFT_WeakPeriodicBoundaryCondition_elementSidesPositive "elementsidespositive"
59 #define _IFT_WeakPeriodicBoundaryCondition_elementSidesNegative "elementsidesnegative"
60 #define _IFT_WeakPeriodicBoundaryCondition_elementSidesPositiveSet "elementsidespositiveset"
61 #define _IFT_WeakPeriodicBoundaryCondition_elementSidesNegativeSet "elementsidesnegativeset"
62 
63 
64 namespace oofem {
65 
66 class Node;
67 class Element;
68 
76 {
77 private:
78 
80  int bcID;
82 
85 
87  int direction;
88 
91 
94 
96  int ngp;
97 
99  int ndof;
100 
102  int posSet;
103 
105  int negSet;
106 
109 
111  signed int sideSign [ 2 ];
112 
114  std :: vector< int >side [ 2 ], element [ 2 ];
115 
117  std :: vector< double >directions;
118 
119  void giveEdgeNormal(FloatArray &answer, int element, int side);
120 
121  void updateSminmax();
122 
123  void updateDirection();
124 
125  double computeBaseFunctionValue(int baseID, FloatArray coordinate);
126 
127  double computeBaseFunctionValue1D(int baseID, double coordinate);
128 
129  double computeBaseFunctionValue2D(int baseID, FloatArray coordinate);
130 
131  std :: unique_ptr< Node > gammaDman;
133 
134  double factorial(int n);
135 
136  double binomial(double n, int k);
137 
139  void getExponents(int n, int &i, int &j);
140 
142  void computeOrthogonalBasis();
143 
144  double computeProjectionCoefficient(int vIndex, int uIndex);
145 
148 
149  void computeDeformationGradient(FloatMatrix &answer, Element *e, FloatArray *lcoord, TimeStep *tStep);
150 
152  int tcount;
153 
155  int ndofids;
156 
158  bool nlgeo;
159 
160 public:
163 
164  virtual IRResultType initializeFrom(InputRecord *ir);
165 
166  basisType giveBasisType() { return useBasisType; }
167 
168  virtual void assemble(SparseMtrx &answer, TimeStep *tStep, CharType type,
169  const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s, double scale = 1.0);
170 
171  virtual void assembleVector(FloatArray &answer, TimeStep *tStep,
172  CharType type, ValueModeType mode,
173  const UnknownNumberingScheme &s, FloatArray *eNorm = NULL);
174 
175  void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep,
176  CharType type, ValueModeType mode,
177  const UnknownNumberingScheme &s, FloatArray *eNorm = NULL);
178 
179  void giveExternalForcesVector(FloatArray &answer, TimeStep *tStep,
180  CharType type, ValueModeType mode,
181  const UnknownNumberingScheme &s);
182 
183  virtual int giveNumberOfInternalDofManagers();
184 
185  virtual DofManager *giveInternalDofManager(int i);
186 
187  virtual void addElementSide(int elem, int side);
188 
189  virtual const char *giveClassName() const { return "WeakPeriodicBoundaryCondition"; }
190  virtual const char *giveInputRecordName() const { return _IFT_WeakPeriodicBoundaryCondition_Name; }
191 
192 protected:
193  void computeElementTangent(FloatMatrix &answer, Element *e, int boundary, TimeStep *tStep);
194 };
195 }
196 #endif /* WEAKPERIODICBC_H_ */
Class and object Domain.
Definition: domain.h:115
std::vector< double > directions
Keeps track of which coordinate(s) are changing on the surface/edge.
Base class for all matrices stored in sparse format.
Definition: sparsemtrx.h:60
virtual const char * giveInputRecordName() const
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
int tcount
Number of terms in polynomial.
Abstract base class for all finite elements.
Definition: element.h:145
Base class for dof managers.
Definition: dofmanager.h:113
std::unique_ptr< Node > gammaDman
int posSet
Set containing positive side.
Class implementing an array of integers.
Definition: intarray.h:61
IntArray dofids
ID of dofs on which weak periodicity is imposed.
int ndof
Number of degrees of freedom (number of terms)
int direction
Direction of normal.
FloatMatrix gsMatrix
gsMatrix contains coefficients for the Gram-Schmidt polynomials
IntArray surfaceIndexes
Keeps info on which coordinates varies over the surface.
#define _IFT_WeakPeriodicBoundaryCondition_Name
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
Abstract base class for all active boundary conditions.
Definition: activebc.h:63
bool nlgeo
Use finite strains?
int ngp
Number of Gausspoints used when integrating along the element edges.
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
CharType
Definition: chartype.h:87
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual const char * giveClassName() const
FloatArray g
Contains prescribed gradient.
int negSet
Set containing negative side.
the oofem namespace is to define a context or scope in which all oofem names are defined.
Imposes weak periodicity on the doftype of choice.
Class representing solution step.
Definition: timestep.h:80

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:32 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011