OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
intelsurftr1.C
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 #include "../sm/Elements/Interfaces/intelsurftr1.h"
36 #include "node.h"
37 #include "crosssection.h"
38 #include "gausspoint.h"
39 #include "gaussintegrationrule.h"
40 #include "floatmatrix.h"
41 #include "floatarray.h"
42 #include "intarray.h"
43 #include "mathfem.h"
44 #include "classfactory.h"
45 
46 #ifdef __OOFEG
47  #include "oofeggraphiccontext.h"
48 
49  #include <Emarkwd3d.h>
50 #endif
51 
52 namespace oofem {
53 REGISTER_Element(IntElSurfTr1);
54 
56 
58  StructuralInterfaceElement(n, aDomain)
59 {
60  numberOfDofMans = 6;
61 }
62 
63 
64 void
66 {
67  // Returns the modified N-matrix which multiplied with u give the spatial jump.
68 
69  FloatArray N;
71 
72  answer.resize(3, 18);
73  answer.zero();
74 
75  answer.at(1, 10) = answer.at(2, 11) = answer.at(3, 12) = N.at(1);
76  answer.at(1, 1) = answer.at(2, 2) = answer.at(3, 3) = -N.at(1);
77 
78  answer.at(1, 13) = answer.at(2, 14) = answer.at(3, 15) = N.at(2);
79  answer.at(1, 4) = answer.at(2, 5) = answer.at(3, 6) = -N.at(2);
80 
81  answer.at(1, 16) = answer.at(2, 17) = answer.at(3, 18) = N.at(3);
82  answer.at(1, 7) = answer.at(2, 8) = answer.at(3, 9) = -N.at(3);
83 }
84 
85 
86 void
88 {
89  // Sets up the array of Gauss Points of the receiver.
90  if ( integrationRulesArray.size() == 0 ) {
91  integrationRulesArray.resize(1);
92  //integrationRulesArray[0] = new LobattoIntegrationRule (1,domain, 1, 2);
93  integrationRulesArray [ 0 ].reset( new GaussIntegrationRule(1, this, 1, 3) );
94  integrationRulesArray [ 0 ]->setUpIntegrationPoints(_Triangle, 4, _3dInterface);
95  }
96 }
97 
98 
99 void
101 {
102  FloatMatrix dNdxi;
104  G1.resize(3);
105  G2.resize(3);
106  G1.zero();
107  G2.zero();
108 
109  FloatArray meanNode;
110  int numNodes = this->giveNumberOfNodes();
111  for ( int i = 1; i <= dNdxi.giveNumberOfRows(); i++ ) {
112  meanNode = 0.5 * ( *this->giveNode(i)->giveCoordinates() + *this->giveNode(i + numNodes / 2)->giveCoordinates() );
113  G1 += dNdxi.at(i, 1) * meanNode;
114  G2 += dNdxi.at(i, 2) * meanNode;
115  }
116 }
117 
118 
119 double
121 {
122  FloatArray G1, G2, G3;
123  this->computeCovarBaseVectorsAt(ip, G1, G2);
124  double weight = ip->giveWeight();
125  G3.beVectorProductOf(G1, G2);
126  return 0.5 * G3.computeNorm() * weight;
127 }
128 
129 
132 {
134 }
135 
136 
137 void
139 {
140  answer = { D_u, D_v, D_w };
141 }
142 
143 #if 0
144 bool
146 {
147  FloatMatrix lcs;
148  computeTransformationMatrixAt(this->giveDefaultIntegrationRulePtr()->getIntegrationPoint(0), lcs);
149  answer.resize(18, 18);
150  for ( int i = 0; i < 6; i++ ) {
151  for ( int j = 1; j <= 3; j++ ) {
152  answer.at(i * 3 + 1, i * 3 + j) = lcs.at(3, j);
153  answer.at(i * 3 + 2, i * 3 + j) = lcs.at(1, j);
154  answer.at(i * 3 + 3, i * 3 + j) = lcs.at(2, j);
155  }
156  }
157 
158 
159  return 1;
160 }
161 #endif
162 
163 void
165 {
166  // Transformation matrix to the local coordinate system
167  FloatArray G1, G2, Normal;
168  this->computeCovarBaseVectorsAt(gp, G1, G2);
169  Normal.beVectorProductOf(G1, G2);
170  Normal.normalize();
171  answer.beLocalCoordSys(Normal);
172 }
173 
174 
175 
176 int
178 {
179  FloatArray N, meanNode;
180  this->interpolation.evalN( N, lcoords, FEIElementGeometryWrapper(this) );
181  answer.resize(3);
182  answer.zero();
183  for ( int i = 1; i <= 3; i++ ) {
184  meanNode = 0.5 * ( *this->giveNode(i)->giveCoordinates() + *this->giveNode(i + 3)->giveCoordinates() );
185  answer += N.at(i) * meanNode;
186  }
187 
188  return 1;
189 }
190 
191 
192 bool
194 {
195  OOFEM_ERROR("Not implemented");
196  return false;
197 }
198 
200 #ifdef __OOFEG
202 {
203  GraphicObj *go;
204  // if (!go) { // create new one
205  WCRec p [ 3 ]; /* triangle */
206  if ( !gc.testElementGraphicActivity(this) ) {
207  return;
208  }
209 
210  EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
211  EASValsSetColor( gc.getElementColor() );
212  EASValsSetEdgeColor( gc.getElementEdgeColor() );
213  EASValsSetEdgeFlag(true);
214  EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
215  p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);
216  p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);
217  p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveCoordinate(3);
218  p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);
219  p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);
220  p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveCoordinate(3);
221  p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);
222  p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);
223  p [ 2 ].z = ( FPNum ) this->giveNode(3)->giveCoordinate(3);
224 
225  go = CreateTriangle3D(p);
226  EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
227  EGAttachObject(go, ( EObjectP ) this);
228  EMAddGraphicsToModel(ESIModel(), go);
229 }
230 
231 
233 { }
234 
235 
237 { }
238 
239 #endif
240 } // end namespace oofem
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: intelsurftr1.C:131
int testElementGraphicActivity(Element *)
Test if particular element passed fulfills various filtering criteria for its graphics output...
virtual void evaldNdxi(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point...
Definition: fei3dtrlin.C:58
static FEI3dTrLin interpolation
Definition: intelsurftr1.h:50
void beVectorProductOf(const FloatArray &v1, const FloatArray &v2)
Computes vector product (or cross product) of vectors given as parameters, , and stores the result in...
Definition: floatarray.C:415
Class and object Domain.
Definition: domain.h:115
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
Definition: element.h:822
virtual void computeCovarBaseVectorsAt(IntegrationPoint *ip, FloatArray &G1, FloatArray &G2)
Definition: intelsurftr1.C:100
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
#define OOFEG_RAW_GEOMETRY_LAYER
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
Definition: intelsurftr1.C:201
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
virtual double giveCoordinate(int i)
Definition: node.C:82
Class implementing an array of integers.
Definition: intarray.h:61
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
Definition: intelsurftr1.C:87
virtual void computeTransformationMatrixAt(GaussPoint *gp, FloatMatrix &answer)
Definition: intelsurftr1.C:164
virtual int giveNumberOfNodes() const
Returns number of nodes of receiver.
Definition: element.h:662
virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
Definition: intelsurftr1.C:236
#define OOFEM_ERROR(...)
Definition: error.h:61
REGISTER_Element(LSpace)
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of interpolation functions (shape functions) at given point.
Definition: fei3dtrlin.C:44
#define OOFEG_RAW_GEOMETRY_WIDTH
virtual double giveWeight()
Returns integration weight of receiver.
Definition: gausspoint.h:181
virtual double computeAreaAround(IntegrationPoint *ip)
Definition: intelsurftr1.C:120
UnknownType
Type representing particular unknown (its physical meaning).
Definition: unknowntype.h:55
Wrapper around element definition to provide FEICellGeometry interface.
Definition: feinterpol.h:95
void beLocalCoordSys(const FloatArray &normal)
Makes receiver the local coordinate for the given normal.
Definition: floatmatrix.C:515
#define N(p, q)
Definition: mdm.C:367
virtual void giveDofManDofIDMask(int inode, IntArray &answer) const
Returns dofmanager dof mask for node.
Definition: intelsurftr1.C:138
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
IntElSurfTr1(int n, Domain *d)
Definition: intelsurftr1.C:57
Class representing vector of real numbers.
Definition: floatarray.h:82
virtual void drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType)
Definition: intelsurftr1.C:232
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
double computeNorm() const
Computes the norm (or length) of the vector.
Definition: floatarray.C:840
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
Class representing the general Input Record.
Definition: inputrecord.h:101
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
std::vector< std::unique_ptr< IntegrationRule > > integrationRulesArray
List of integration rules of receiver (each integration rule contains associated integration points a...
Definition: element.h:170
virtual FloatArray * giveCoordinates()
Definition: node.h:114
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
Abstract base class for all structural interface elements.
virtual bool computeGtoLRotationMatrix(FloatMatrix &answer)
Returns transformation matrix from global c.s.
Definition: element.C:1537
the oofem namespace is to define a context or scope in which all oofem names are defined.
double normalize()
Normalizes receiver.
Definition: floatarray.C:828
Node * giveNode(int i) const
Returns reference to the i-th node of element.
Definition: element.h:610
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Computes the global coordinates from given element&#39;s local coordinates.
Definition: intelsurftr1.C:177
int giveNumberOfRows() const
Returns number of rows of receiver.
Definition: floatmatrix.h:156
virtual bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
Computes the element local coordinates from given global coordinates.
Definition: intelsurftr1.C:193
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
virtual void computeNmatrixAt(GaussPoint *ip, FloatMatrix &answer)
Computes modified interpolation matrix (N) for the element which multiplied with the unknowns vector ...
Definition: intelsurftr1.C:65
int numberOfDofMans
Number of dofmanagers.
Definition: element.h:149
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Definition: gausspoint.h:138
Class representing Gaussian-quadrature integration rule.
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631

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