OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
integrationrule.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 integrationrule_h
36 #define integrationrule_h
37 
38 #include "oofemcfg.h"
39 #include "materialmode.h"
40 #include "integrationdomain.h"
41 #include "contextioresulttype.h"
42 #include "contextmode.h"
43 #include "inputrecord.h"
44 
45 #include <cstdio>
46 
47 namespace oofem {
48 class TimeStep;
49 class GaussPoint;
50 class Element;
51 class DataStream;
52 
55  IRT_None = 0,
56  IRT_Gauss = 1,
58 };
59 
94 class OOFEM_EXPORT IntegrationRule
95 {
96 protected:
98  int number;
103 
105  std::vector< GaussPoint * > gaussPoints;
110  int firstLocalStrainIndx, lastLocalStrainIndx;
111 
116  bool isDynamic;
117 
118 public:
119  std::vector< GaussPoint *> :: iterator begin() { return gaussPoints.begin(); }
120  std::vector< GaussPoint *> :: iterator end() { return gaussPoints.end(); }
121 
130  IntegrationRule(int n, Element * e, int startIndx, int endIndx, bool dynamic);
136  IntegrationRule(int n, Element * e);
138  virtual ~IntegrationRule();
139 
143  int giveNumberOfIntegrationPoints() const { return (int)gaussPoints.size(); }
148  GaussPoint *getIntegrationPoint(int n);
152  GaussPoint *findIntegrationPointClosestTo(const FloatArray &lcoord);
157  int getStartIndexOfLocalStrainWhereApply() { return firstLocalStrainIndx; }
162  int getEndIndexOfLocalStrainWhereApply() { return lastLocalStrainIndx; }
170  int setUpIntegrationPoints(integrationDomain intdomain, int nPoints, MaterialMode matMode);
179  int setUpIntegrationPoints(integrationDomain intdomain, int nPointsXY, int nPointsZ, MaterialMode matMode);
188  int setUpEmbeddedIntegrationPoints(integrationDomain intdomain, int nPoints, MaterialMode matMode,
189  const std :: vector< FloatArray > &coords);
190 
195  virtual void printOutputAt(FILE *file, TimeStep *tStep);
200  void updateYourself(TimeStep *tStep);
201 
203  Element *giveElement() { return elem; }
205  int giveNumber() { return this->number; }
207  integrationDomain giveIntegrationDomain() const { return this->intdomain; }
215  virtual int getRequiredNumberOfIntegrationPoints(integrationDomain dType, int approxOrder) { return 0; }
216 
227  virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj);
238  virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj);
242  void clear();
243 
245  virtual const IntArray *giveKnotSpan() { return NULL; }
246 
247  virtual const char *giveClassName() const { return "IntegrationRule"; }
249  std :: string errorInfo(const char *func) const { return std :: string(giveClassName()) + func; }
252 
256  int SetUpPoint(MaterialMode mode);
263  virtual int SetUpPointsOnLine(int, MaterialMode mode) { return 0; }
270  virtual int SetUpPointsOnTriangle(int, MaterialMode mode) { return 0; }
277  virtual int SetUpPointsOnSquare(int, MaterialMode mode) { return 0; }
286  virtual int SetUpPointsOn3dDegShell(int nPointsXY, int nPointsZ, MaterialMode mode) { return 0; }
296  virtual int SetUpPointsOn3dDegShellLayers(int nPointsXY, int nPointsZ, MaterialMode mode, const FloatArray &layerThickness) { return 0; }
303  virtual int SetUpPointsOnCube(int, MaterialMode mode) { return 0; }
314  virtual int SetUpPointsOnCubeLayers(int nPoints1, int nPoints2, int nPointsDepth, MaterialMode mode, const FloatArray &layerThickness) { return 0; }
321  virtual int SetUpPointsOnTetrahedra(int, MaterialMode mode) { return 0; }
327  virtual int SetUpPointsOn2DEmbeddedLine(int nPoints, MaterialMode mode,
328  const FloatArray &coord0, const FloatArray &coord1) { return 0; }
329 
338  virtual int SetUpPointsOnWedge(int nPointsTri, int nPointsDepth, MaterialMode mode) { return 0; }
348  virtual int SetUpPointsOnWedgeLayers(int nPointsTri, int nPointsDepth, MaterialMode mode, const FloatArray &layerThickness) { return 0; }
349 };
350 } // end namespace oofem
351 #endif // integrationrule_h
std::string errorInfo(const char *func) const
Error printing helper.
integrationDomain
Used by integrator class to supply integration points for proper domain to be integrated (Area...
bool isDynamic
Flag indicating that rule is dynamic, ie, its gauss points (their number, coordinates, weights) can change during computation.
Element * elem
Element which integration rule is coupled to.
integrationDomain intdomain
Integration domain.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
virtual int SetUpPointsOnWedge(int nPointsTri, int nPointsDepth, MaterialMode mode)
Sets up receiver&#39;s integration points on a wedge integration domain.
int getStartIndexOfLocalStrainWhereApply()
Returns starting component index, for which receiver applies.
std::vector< GaussPoint * >::iterator begin()
int giveNumber()
Returns receiver number.
virtual int SetUpPointsOnWedgeLayers(int nPointsTri, int nPointsDepth, MaterialMode mode, const FloatArray &layerThickness)
Sets up receiver&#39;s integration points on a wedge integration domain divided into layers in the zeta-d...
virtual int SetUpPointsOnTetrahedra(int, MaterialMode mode)
Sets up receiver&#39;s integration points on tetrahedra (volume coords) integration domain.
virtual IRResultType initializeFrom(InputRecord *ir)
virtual int SetUpPointsOn3dDegShellLayers(int nPointsXY, int nPointsZ, MaterialMode mode, const FloatArray &layerThickness)
Sets up receiver&#39;s integration points on shell integration domain wih layers.
virtual int SetUpPointsOn3dDegShell(int nPointsXY, int nPointsZ, MaterialMode mode)
Sets up receiver&#39;s integration points on shell integration domain.
Element * giveElement()
Returns reference to element containing receiver.
Abstract base class for all finite elements.
Definition: element.h:145
virtual IntegrationRuleType giveIntegrationRuleType() const
std::vector< GaussPoint * >::iterator end()
virtual int SetUpPointsOnSquare(int, MaterialMode mode)
Sets up receiver&#39;s integration points on unit square integration domain.
virtual const IntArray * giveKnotSpan()
Returns receiver sub patch indices (if apply).
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
Class implementing an array of integers.
Definition: intarray.h:61
Abstract base class representing integration rule.
virtual int SetUpPointsOn2DEmbeddedLine(int nPoints, MaterialMode mode, const FloatArray &coord0, const FloatArray &coord1)
Sets up integration points on 2D embedded line inside 2D volume (the list of local coordinates should...
virtual int SetUpPointsOnCube(int, MaterialMode mode)
Sets up receiver&#39;s integration points on unit cube integration domain.
virtual int SetUpPointsOnCubeLayers(int nPoints1, int nPoints2, int nPointsDepth, MaterialMode mode, const FloatArray &layerThickness)
Sets up receiver&#39;s integration points on unit cube integration domain divided into layers in the zeta...
Class representing vector of real numbers.
Definition: floatarray.h:82
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual int getRequiredNumberOfIntegrationPoints(integrationDomain dType, int approxOrder)
Abstract service.
int giveNumberOfIntegrationPoints() const
Returns number of integration points of receiver.
virtual int SetUpPointsOnLine(int, MaterialMode mode)
Sets up receiver&#39;s integration points on unit line integration domain.
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
int getEndIndexOfLocalStrainWhereApply()
Returns last component index, for which receiver applies.
virtual int SetUpPointsOnTriangle(int, MaterialMode mode)
Sets up receiver&#39;s integration points on triangular (area coords) integration domain.
integrationDomain giveIntegrationDomain() const
Returns the domain for the receiver.
IntegrationRuleType
the oofem namespace is to define a context or scope in which all oofem names are defined.
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
std::vector< GaussPoint * > gaussPoints
Array containing integration points.
virtual const char * giveClassName() const

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