OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
brick1_ht.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 "brick1_ht.h"
36 #include "fei3dhexalin.h"
37 #include "node.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 "load.h"
45 #include "crosssection.h"
46 #include "classfactory.h"
47 
48 #ifdef __OOFEG
49  #include "oofeggraphiccontext.h"
50  #include "oofegutils.h"
51  #include "connectivitytable.h"
52 #endif
53 
54 namespace oofem {
55 REGISTER_Element(Brick1_ht);
56 REGISTER_Element(Brick1_hmt);
57 REGISTER_Element(Brick1_mt);
58 
59 FEI3dHexaLin Brick1_ht :: interpolation;
60 
62 {
63  numberOfDofMans = 8;
65 }
66 
67 Brick1_hmt :: Brick1_hmt(int n, Domain *aDomain) : Brick1_ht(n, aDomain)
68 {
70 }
71 
72 Brick1_mt :: Brick1_mt(int n, Domain *aDomain) : Brick1_ht(n, aDomain)
73 {
75 }
76 
78 { }
79 
82 
83 void
85 {
86  if ( integrationRulesArray.size() == 0 ) {
87  integrationRulesArray.resize( 1 );
88  integrationRulesArray [ 0 ].reset( new GaussIntegrationRule(1, this, 1, 2) );
90  }
91 }
92 
93 
96 {
99 }
100 
101 
102 double
104 // Returns the portion of the receiver which is attached to gp.
105 {
106  double determinant, weight, volume;
107  determinant = fabs( this->interpolation.giveTransformationJacobian( gp->giveNaturalCoordinates(),
108  FEIElementGeometryWrapper(this) ) );
109 
110  weight = gp->giveWeight();
111  volume = determinant * weight;
112  return volume;
113 }
114 
115 
116 double
118 {
119  double result = this->interpolation.edgeGiveTransformationJacobian( iEdge, gp->giveNaturalCoordinates(),
121  return result *gp->giveWeight();
122 }
123 
124 
127 {
128  IntegrationRule *iRule = new GaussIntegrationRule(1, this, 1, 1);
129  int npoints = iRule->getRequiredNumberOfIntegrationPoints(_Square, approxOrder);
130  iRule->SetUpPointsOnSquare(npoints, _Unknown);
131  return iRule;
132 }
133 
134 
135 double
137 {
138  double determinant, weight, volume;
140  weight = gp->giveWeight();
141  volume = determinant * weight;
142  return volume;
143 }
144 
145 
146 Interface *
148 {
149  if ( interface == SpatialLocalizerInterfaceType ) {
150  return static_cast< SpatialLocalizerInterface * >(this);
151  } else if ( interface == EIPrimaryFieldInterfaceType ) {
152  return static_cast< EIPrimaryFieldInterface * >(this);
153  } else if ( interface == ZZNodalRecoveryModelInterfaceType ) {
154  return static_cast< ZZNodalRecoveryModelInterface * >(this);
155  } else if ( interface == SPRNodalRecoveryModelInterfaceType ) {
156  return static_cast< SPRNodalRecoveryModelInterface * >(this);
157  }
158 
159  return NULL;
160 }
161 
162 void
164 {
165  pap.resize(numberOfDofMans);
166  for ( int i = 1; i <= numberOfDofMans; i++ ) {
167  pap.at(i) = this->giveNode(i)->giveNumber();
168  }
169 }
170 
171 void
173 {
174  int found = 0;
175  answer.resize(1);
176 
177  for ( int i = 1; i <= numberOfDofMans; i++ ) {
178  if ( this->giveNode(i)->giveNumber() == pap ) {
179  found = 1;
180  }
181  }
182 
183  if ( found ) {
184  answer.at(1) = pap;
185  } else {
186  OOFEM_ERROR("unknown node number %d", pap);
187  }
188 }
189 
190 int
192 {
193  return numberOfGaussPoints;
194 }
195 
196 
199 {
200  return SPRPatchType_3dBiLin;
201 }
202 
203 
204 #ifdef __OOFEG
206 {
207  WCRec p [ 8 ];
208  GraphicObj *go;
209 
210  if ( !gc.testElementGraphicActivity(this) ) {
211  return;
212  }
213 
214  EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
215  EASValsSetColor( gc.getElementColor() );
216  EASValsSetEdgeColor( gc.getElementEdgeColor() );
217  EASValsSetEdgeFlag(true);
218  EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
219  EASValsSetFillStyle(FILL_SOLID);
220  for ( int i = 0; i < 8; i++ ) {
221  p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
222  p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
223  p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(3);
224  }
225 
226  go = CreateHexahedron(p);
227  EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
228  EGAttachObject(go, ( EObjectP ) this);
229  EMAddGraphicsToModel(ESIModel(), go);
230 }
231 
232 
234 {
235  int indx, result = 0;
236  WCRec p [ 8 ];
237  GraphicObj *tr;
238  FloatArray v [ 8 ];
239  double s [ 8 ];
240 
241  if ( !gc.testElementGraphicActivity(this) ) {
242  return;
243  }
244 
245  if ( gc.giveIntVarMode() == ISM_recovered ) {
246  for ( int i = 1; i <= 8; i++ ) {
247  result += this->giveInternalStateAtNode(v [ i - 1 ], gc.giveIntVarType(), gc.giveIntVarMode(), i, tStep);
248  }
249 
250  if ( result != 8 ) {
251  return;
252  }
253  } else if ( gc.giveIntVarMode() == ISM_local ) {
254  return;
255  }
256 
257  indx = gc.giveIntVarIndx();
258 
259  for ( int i = 1; i <= 8; i++ ) {
260  s [ i - 1 ] = v [ i - 1 ].at(indx);
261  }
262 
263  EASValsSetEdgeColor( gc.getElementEdgeColor() );
264  EASValsSetEdgeFlag(true);
265  EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
266  if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
267  for ( int i = 0; i < 8; i++ ) {
268  p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
269  p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
270  p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(3);
271  }
272 
273  gc.updateFringeTableMinMax(s, 8);
274  tr = CreateHexahedronWD(p, s);
275  EGWithMaskChangeAttributes(LAYER_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK, tr);
276  EMAddGraphicsToModel(ESIModel(), tr);
277  }
278 }
279 
280 #endif
281 } // end namespace oofem
CrossSection * giveCrossSection()
Definition: element.C:495
int testElementGraphicActivity(Element *)
Test if particular element passed fulfills various filtering criteria for its graphics output...
The element interface required by ZZNodalRecoveryModel.
virtual Interface * giveInterface(InterfaceType t)
Interface requesting service.
Definition: brick1_ht.C:147
int giveInternalStateAtNode(FloatArray &answer, InternalStateType type, InternalStateMode mode, int node, TimeStep *tStep)
Returns internal state variable (like stress,strain) at node of element in Reduced form...
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: brick1_ht.C:95
Class and object Domain.
Definition: domain.h:115
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
Definition: brick1_ht.C:84
ScalarAlgorithmType getScalarAlgo()
virtual double computeEdgeVolumeAround(GaussPoint *gp, int iEdge)
Computes the length around a integration point on a edge.
Definition: brick1_ht.C:117
virtual FEInterpolation * giveInterpolation() const
Definition: brick1_ht.C:81
virtual double giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation.
Definition: feinterpol.C:43
The element interface required by ZZNodalRecoveryModel.
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
virtual SPRPatchType SPRNodalRecoveryMI_givePatchType()
Definition: brick1_ht.C:198
#define OOFEG_RAW_GEOMETRY_LAYER
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
Brick (3d) elements with linear approximation for heat and mass transfer.
Definition: brick1_ht.h:54
virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
Definition: brick1_ht.C:233
virtual int SetUpPointsOnSquare(int, MaterialMode mode)
Sets up receiver&#39;s integration points on unit square integration domain.
virtual double giveCoordinate(int i)
Definition: node.C:82
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
Abstract base class representing integration rule.
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
Definition: brick1_ht.C:103
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
Element interface class.
Definition: primaryfield.h:58
InternalStateType giveIntVarType()
Brick1_mt(int n, Domain *d)
Definition: brick1_ht.C:72
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: element.C:638
#define OOFEM_ERROR(...)
Definition: error.h:61
REGISTER_Element(LSpace)
#define OOFEG_RAW_GEOMETRY_WIDTH
virtual double giveWeight()
Returns integration weight of receiver.
Definition: gausspoint.h:181
This abstract class represent a general base element class for transport problems.
virtual ~Brick1_ht()
Definition: brick1_ht.C:77
Wrapper around element definition to provide FEICellGeometry interface.
Definition: feinterpol.h:95
void resize(int n)
Checks size of receiver towards requested bounds.
Definition: intarray.C:124
virtual IntegrationRule * GetSurfaceIntegrationRule(int approxOrder)
Definition: brick1_ht.C:126
virtual int setupIntegrationPoints(IntegrationRule &irule, int npoints, Element *element)
Sets up integration rule for the given element.
Definition: crosssection.C:54
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
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual double edgeGiveTransformationJacobian(int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the edge jacobian of transformation between local and global coordinates.
Definition: fei3dhexalin.C:275
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual int getRequiredNumberOfIntegrationPoints(integrationDomain dType, int approxOrder)
Abstract service.
Class Interface.
Definition: interface.h:82
virtual double computeSurfaceVolumeAround(GaussPoint *gp, int iEdge)
Definition: brick1_ht.C:136
The spatial localizer element interface associated to spatial localizer.
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
Brick1_hmt(int n, Domain *d)
Definition: brick1_ht.C:67
InterfaceType
Enumerative type, used to identify interface type.
Definition: interfacetype.h:43
virtual void SPRNodalRecoveryMI_giveDofMansDeterminedByPatch(IntArray &answer, int pap)
Definition: brick1_ht.C:172
void updateFringeTableMinMax(double *s, int size)
virtual void SPRNodalRecoveryMI_giveSPRAssemblyPoints(IntArray &pap)
Definition: brick1_ht.C:163
static FEI3dHexaLin interpolation
Definition: brick1_ht.h:57
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
Definition: brick1_ht.C:205
virtual int SPRNodalRecoveryMI_giveNumberOfIP()
Definition: brick1_ht.C:191
int giveNumber() const
Definition: femcmpnn.h:107
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
virtual double surfaceGiveTransformationJacobian(int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the edge jacobian of transformation between local and global coordinates.
Definition: fei3dhexalin.C:459
int numberOfDofMans
Number of dofmanagers.
Definition: element.h:149
Brick1_ht(int n, Domain *d)
Definition: brick1_ht.C:61
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Definition: gausspoint.h:138
Class representing Gaussian-quadrature integration rule.

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