OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
intelline2.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/intelline2.h"
36 #include "../sm/CrossSections/structuralinterfacecrosssection.h"
37 #include "gausspoint.h"
38 #include "gaussintegrationrule.h"
39 #include "floatmatrix.h"
40 #include "floatarray.h"
41 #include "intarray.h"
42 #include "fei2dlinequad.h"
43 #include "fei2dlinelin.h"
44 #include "classfactory.h"
45 
46 #ifdef __OOFEG
47  #include "oofeggraphiccontext.h"
48  #include <Emarkwd3d.h>
49 #endif
50 
51 namespace oofem {
52 REGISTER_Element(IntElLine2);
53 
54 FEI2dLineQuad IntElLine2 :: interp(2, 2);
55 FEI2dLineLin IntElLine2 :: interpLin(1, 1);
56 
57 
58 IntElLine2 :: IntElLine2(int n, Domain *aDomain) : IntElLine1(n, aDomain)
59 {
60  numberOfDofMans = 6;
61 
63  linear = false;
64 }
65 
66 
67 void
69 {
70 
71  // Returns the modified N-matrix which multiplied with u give the spatial jump.
72  FloatArray N;
73  answer.resize(2, 12);
74  answer.zero();
75 
76  if(linear) {
78 
79  answer.at(1, 1) = answer.at(2, 2) = -N.at(1);
80  answer.at(1, 3) = answer.at(2, 4) = -N.at(2);
81 // answer.at(1, 5) = answer.at(2, 6) = -N.at(3);
82 
83  answer.at(1, 7) = answer.at(2, 8) = N.at(1);
84  answer.at(1, 9) = answer.at(2, 10) = N.at(2);
85 // answer.at(1, 11) = answer.at(2, 12) = N.at(3);
86  }
87  else {
89 
90  answer.at(1, 1) = answer.at(2, 2) = -N.at(1);
91  answer.at(1, 3) = answer.at(2, 4) = -N.at(2);
92  answer.at(1, 5) = answer.at(2, 6) = -N.at(3);
93 
94  answer.at(1, 7) = answer.at(2, 8) = N.at(1);
95  answer.at(1, 9) = answer.at(2, 10) = N.at(2);
96  answer.at(1, 11) = answer.at(2, 12) = N.at(3);
97  }
98 }
99 
100 
101 void
103 // Sets up the array of Gauss Points of the receiver.
104 {
105  if ( integrationRulesArray.size() == 0 ) {
106  integrationRulesArray.resize( 1 );
107  //integrationRulesArray[ 0 ].reset( new LobattoIntegrationRule (1,domain, 1, 2) ); ///@todo - should be able to decide
108  integrationRulesArray [ 0 ].reset( new GaussIntegrationRule(1, this, 1, 2) );
109  integrationRulesArray [ 0 ]->SetUpPointsOnLine(numberOfGaussPoints, _2dInterface);
110  }
111 }
112 
115 {
116  return & interp;
117 }
118 
119 
122 {
124  return IntElLine1 :: initializeFrom(ir);
125 }
126 
127 
128 
129 #ifdef __OOFEG
131 {
132  GraphicObj *go;
133  // if (!go) { // create new one
134  WCRec p [ 2 ]; /* poin */
135  if ( !gc.testElementGraphicActivity(this) ) {
136  return;
137  }
138 
139  EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
140  EASValsSetColor( gc.getElementColor() );
141  EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
142  p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);
143  p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);
144  p [ 0 ].z = 0.0;
145  p [ 1 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);
146  p [ 1 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);
147  p [ 1 ].z = 0.0;
148  go = CreateLine3D(p);
149  EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
150  EGAttachObject(go, ( EObjectP ) this);
151  EMAddGraphicsToModel(ESIModel(), go);
152  p [ 0 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);
153  p [ 0 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);
154  p [ 0 ].z = 0.0;
155  p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);
156  p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);
157  p [ 1 ].z = 0.0;
158  go = CreateLine3D(p);
159  EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
160  EGAttachObject(go, ( EObjectP ) this);
161  EMAddGraphicsToModel(ESIModel(), go);
162 }
163 
164 
166 {
167  GraphicObj *go;
168  // if (!go) { // create new one
169  WCRec p [ 2 ]; /* poin */
170  if ( !gc.testElementGraphicActivity(this) ) {
171  return;
172  }
173 
174  double defScale = gc.getDefScale();
175 
176  EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
177  EASValsSetColor( gc.getDeformedElementColor() );
178  EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER + 1);
179  p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);
180  p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);
181  p [ 0 ].z = 0.0;
182  p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);
183  p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);
184  p [ 1 ].z = 0.0;
185  go = CreateLine3D(p);
186  EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
187  EMAddGraphicsToModel(ESIModel(), go);
188 
189  p [ 0 ].x = ( FPNum ) this->giveNode(4)->giveUpdatedCoordinate(1, tStep, defScale);
190  p [ 0 ].y = ( FPNum ) this->giveNode(4)->giveUpdatedCoordinate(2, tStep, defScale);
191  p [ 0 ].z = 0.0;
192  p [ 1 ].x = ( FPNum ) this->giveNode(5)->giveUpdatedCoordinate(1, tStep, defScale);
193  p [ 1 ].y = ( FPNum ) this->giveNode(5)->giveUpdatedCoordinate(2, tStep, defScale);
194  p [ 1 ].z = 0.0;
195  go = CreateLine3D(p);
196  EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
197  EMAddGraphicsToModel(ESIModel(), go);
198 }
199 
200 
202 {
203  int indx, result = 0;
205  FloatArray gcoord(3), v1;
206  WCRec p [ 1 ];
207  GraphicObj *go;
208  double val [ 1 ];
209 
210  if ( !gc.testElementGraphicActivity(this) ) {
211  return;
212  }
213 
214  if ( gc.giveIntVarMode() == ISM_recovered ) {
215  return;
216  }
217 
218  for ( GaussPoint *gp: *iRule ) {
219  result = 0;
220  result += giveIPValue(v1, gp, gc.giveIntVarType(), tStep);
221  if ( result != 1 ) {
222  continue;
223  }
224 
225  indx = gc.giveIntVarIndx();
226 
227  result += this->computeGlobalCoordinates( gcoord, gp->giveNaturalCoordinates() );
228 
229  p [ 0 ].x = ( FPNum ) gcoord.at(1);
230  p [ 0 ].y = ( FPNum ) gcoord.at(2);
231  p [ 0 ].z = 0.;
232 
233  val [ 0 ] = v1.at(indx);
234  gc.updateFringeTableMinMax(val, 1);
235  //if (val[0] > 0.) {
236 
237  EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
238  EASValsSetMType(FILLED_CIRCLE_MARKER);
239  go = CreateMarkerWD3D(p, val [ 0 ]);
240  EGWithMaskChangeAttributes(LAYER_MASK | FILL_MASK | MTYPE_MASK, go);
241  EMAddGraphicsToModel(ESIModel(), go);
242  //}
243  }
244 }
245 
246 #endif
247 
248 
249 } // end namespace oofem
int testElementGraphicActivity(Element *)
Test if particular element passed fulfills various filtering criteria for its graphics output...
#define _IFT_IntElLine2_LinearTraction
Definition: intelline2.h:41
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
Definition: intelline2.C:102
Class and object Domain.
Definition: domain.h:115
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
Definition: element.h:822
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
#define OOFEG_RAW_GEOMETRY_LAYER
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of interpolation functions (shape functions) at given point.
Definition: fei2dlinelin.C:42
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
virtual bool hasField(InputFieldType id)=0
Returns true if record contains field identified by idString keyword.
virtual double giveCoordinate(int i)
Definition: node.C:82
#define OOFEG_DEFORMED_GEOMETRY_LAYER
virtual void drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType)
Definition: intelline2.C:165
Abstract base class representing integration rule.
static FEI2dLineLin interpLin
Definition: intelline2.h:56
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Computes the global coordinates from given element&#39;s local coordinates.
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
IntElLine2(int n, Domain *d)
Definition: intelline2.C:58
InternalStateType giveIntVarType()
REGISTER_Element(LSpace)
#define OOFEG_RAW_GEOMETRY_WIDTH
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of interpolation functions (shape functions) at given point.
Definition: fei2dlinequad.C:42
UnknownType
Type representing particular unknown (its physical meaning).
Definition: unknowntype.h:55
Wrapper around element definition to provide FEICellGeometry interface.
Definition: feinterpol.h:95
virtual double giveUpdatedCoordinate(int ic, TimeStep *tStep, double scale=1.)
Returns updated ic-th coordinate of receiver.
Definition: node.C:245
#define N(p, q)
Definition: mdm.C:367
virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
Definition: intelline2.C:201
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
int numberOfGaussPoints
Number of integration points as specified by nip.
Definition: element.h:188
InternalStateMode giveIntVarMode()
Class representing vector of real numbers.
Definition: floatarray.h:82
virtual FEInterpolation * giveInterpolation() const
Definition: intelline2.C:114
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
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
bool linear
If linear interpolation should be used.
Definition: intelline2.h:82
#define OOFEG_DEFORMED_GEOMETRY_WIDTH
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
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
This class implements a two dimensional interface element.
Definition: intelline1.h:55
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
Definition: intelline2.C:130
void updateFringeTableMinMax(double *s, int size)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: intelline1.C:148
static FEI2dLineQuad interp
Definition: intelline2.h:55
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: intelline2.C:121
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
Node * giveNode(int i) const
Returns reference to the i-th node of element.
Definition: element.h:610
#define OOFEG_VARPLOT_PATTERN_LAYER
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
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.
virtual void computeNmatrixAt(GaussPoint *gp, FloatMatrix &answer)
Computes modified interpolation matrix (N) for the element which multiplied with the unknowns vector ...
Definition: intelline2.C:68

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