OOFEM  2.4 OOFEM.org - Object Oriented Finite Element Solver
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
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
36 #include "floatmatrix.h"
37 #include "floatarray.h"
38 #include "gaussintegrationrule.h"
39
40 namespace oofem {
41 void
43 {
44  double u, v;
45
46  u = lcoords.at(1);
47  v = lcoords.at(2);
48
49  double a[] = {
50  0.5 * ( u - 1.0 ) * u, 1.0 - u * u, 0.5 * ( u + 1.0 ) * u
51  };
52  double b[] = {
53  0.5 * ( v - 1.0 ) * v, 1.0 - v * v, 0.5 * ( v + 1.0 ) * v
54  };
55
57  answer.at(1) = a [ 0 ] * b [ 0 ];
58  answer.at(5) = a [ 1 ] * b [ 0 ];
59  answer.at(2) = a [ 2 ] * b [ 0 ];
60
61  answer.at(8) = a [ 0 ] * b [ 1 ];
62  answer.at(9) = a [ 1 ] * b [ 1 ];
63  answer.at(6) = a [ 2 ] * b [ 1 ];
64
65  answer.at(4) = a [ 0 ] * b [ 2 ];
66  answer.at(7) = a [ 1 ] * b [ 2 ];
67  answer.at(3) = a [ 2 ] * b [ 2 ];
68 }
69
70
71 void
73 {
74  double u = lc.at(1);
75  double v = lc.at(2);
76
77  double a[] = {
78  0.5 * ( u - 1.0 ) * u, 1.0 - u * u, 0.5 * ( u + 1.0 ) * u
79  };
80  double b[] = {
81  0.5 * ( v - 1.0 ) * v, 1.0 - v * v, 0.5 * ( v + 1.0 ) * v
82  };
83
84  double da[] = {
85  u - 0.5, -2.0 * u, u + 0.5
86  };
87  double db[] = {
88  v - 0.5, -2.0 * v, v + 0.5
89  };
90
91  dN.resize(9, 2);
92
93  dN.at(1, 1) = da [ 0 ] * b [ 0 ];
94  dN.at(5, 1) = da [ 1 ] * b [ 0 ];
95  dN.at(2, 1) = da [ 2 ] * b [ 0 ];
96  dN.at(8, 1) = da [ 0 ] * b [ 1 ];
97  dN.at(9, 1) = da [ 1 ] * b [ 1 ];
98  dN.at(6, 1) = da [ 2 ] * b [ 1 ];
99  dN.at(4, 1) = da [ 0 ] * b [ 2 ];
100  dN.at(7, 1) = da [ 1 ] * b [ 2 ];
101  dN.at(3, 1) = da [ 2 ] * b [ 2 ];
102
103  dN.at(1, 2) = a [ 0 ] * db [ 0 ];
104  dN.at(5, 2) = a [ 1 ] * db [ 0 ];
105  dN.at(2, 2) = a [ 2 ] * db [ 0 ];
106  dN.at(8, 2) = a [ 0 ] * db [ 1 ];
107  dN.at(9, 2) = a [ 1 ] * db [ 1 ];
108  dN.at(6, 2) = a [ 2 ] * db [ 1 ];
109  dN.at(4, 2) = a [ 0 ] * db [ 2 ];
110  dN.at(7, 2) = a [ 1 ] * db [ 2 ];
111  dN.at(3, 2) = a [ 2 ] * db [ 2 ];
112 }
113
114
116 {
117  IntegrationRule *iRule = new GaussIntegrationRule(1, NULL);
118  int points = iRule->getRequiredNumberOfIntegrationPoints(_Square, order + 6);
119  iRule->SetUpPointsOnSquare(points, _Unknown);
120  return iRule;
121 }
122 } // end namespace oofem
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
Class representing a general abstraction for cell geometry.
Definition: feinterpol.h:62
virtual int SetUpPointsOnSquare(int, MaterialMode mode)
Sets up receiver&#39;s integration points on unit square integration domain.
Abstract base class representing integration rule.
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of interpolation functions (shape functions) at given point.
virtual IntegrationRule * giveIntegrationRule(int order)
Sets up a suitable integration rule for numerical integrating over volume.
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
virtual int getRequiredNumberOfIntegrationPoints(integrationDomain dType, int approxOrder)
Abstract service.
virtual void giveDerivatives(FloatMatrix &answer, const FloatArray &lcoords)
the oofem namespace is to define a context or scope in which all oofem names are defined.