OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
gausspoint.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 /*
36  * The original idea for this class comes from
37  * Dubois-Pelerin, Y.: "Object-Oriented Finite Elements: Programming concepts and Implementation",
38  * PhD Thesis, EPFL, Lausanne, 1992.
39  */
40 
41 #ifndef gausspoint_h
42 #define gausspoint_h
43 
44 #include "oofemcfg.h"
45 #include "integrationrule.h"
46 #include "integrationpointstatus.h"
47 #include "element.h"
48 #include "floatarray.h"
49 #include "materialmode.h"
50 
51 namespace oofem {
52 class Material;
53 class LayeredCrossSection;
54 class MicroplaneMaterial;
55 class FiberedCrossSection;
56 class CrossSection;
57 class IntegrationRule;
58 
93 class OOFEM_EXPORT GaussPoint
94 {
95 private:
97  int number;
107  double weight;
110 
111 protected:
112  // layer and fibered material support
114  std::vector< GaussPoint * >gaussPoints;
117 
118 public:
128  GaussPoint(IntegrationRule * ir, int n, FloatArray iNaturalCoord, double w, MaterialMode mode);
129 
130  GaussPoint(IntegrationRule * ir, int n, double w, MaterialMode mode);
131 
133  virtual ~GaussPoint();
134 
136  double giveNaturalCoordinate(int i) const { return naturalCoordinates.at(i); }
138  const FloatArray &giveNaturalCoordinates() { return naturalCoordinates; }
140  naturalCoordinates = c;
141  }
142 
145  if ( subPatchCoordinates ) {
146  return *subPatchCoordinates;
147  } else {
148  return naturalCoordinates;
149  }
150  }
152  {
153  if ( subPatchCoordinates ) {
154  * subPatchCoordinates = c;
155  } else {
156  subPatchCoordinates = new FloatArray(c);
157  }
158  }
159 
161  if( globalCoordinates ) {
162  return *globalCoordinates;
163  }
164  else {
165  globalCoordinates = new FloatArray();
166  this->giveElement()->computeGlobalCoordinates(*globalCoordinates, naturalCoordinates);
167  return *globalCoordinates;
168  }
169  }
170 
171  void setGlobalCoordinates(const FloatArray &iCoord) {
172  if( globalCoordinates ) {
173  *globalCoordinates = iCoord;
174  }
175  else {
176  globalCoordinates = new FloatArray(iCoord);
177  }
178  }
179 
181  virtual double giveWeight() { return weight; }
182  void setWeight(double w) { weight = w; }
184  int giveNumber() { return number; }
188  Element *giveElement() { return irule->giveElement(); }
189 
191  MaterialMode giveMaterialMode() { return this->materialMode; }
193  void setMaterialMode(MaterialMode newMode) { this->materialMode = newMode; }
195 
197  Material *giveMaterial() { return giveElement()->giveMaterial(); }
198 
200  CrossSection *giveCrossSection() { return giveElement()->giveCrossSection(); }
201 
205  IntegrationPointStatus *giveMaterialStatus() { return this->materialStatus; }
206 
214  {
215  return this->setMaterialStatus(ptr);
216  }
217 
224  {
225  if ( this->materialStatus != NULL ) {
226  OOFEM_ERROR("status already exist");
227  }
228  this->materialStatus = ptr;
229  return ptr;
230  }
236  GaussPoint *giveSlaveGaussPoint(int index);
237 
241  bool hasSlaveGaussPoint();
245  size_t findFirstIndexOfSlaveGaussPoint(GaussPoint *gp);
251  virtual void printOutputAt(FILE *file, TimeStep *tStep);
258  virtual void updateYourself(TimeStep *tStep);
259 
260  // store & restore context functions
261  /*
262  * Stores receiver state to output stream, including associated material status.
263  * Warning: Slaves are not saved, they must be saved by corresponding
264  * cross section or material model, which creates these slaves.
265  * This is because they may have special weights and coordinates,
266  * and these are not saved into context file, because they remain the same
267  * during whole solution (only variables which vary are stored into context).
268  * Note: does not invoke FEMComponents saveContext, since this writes only
269  * class id header, but typically due to large number of IPs,
270  * this is avoided.
271  * @exception throws an ContextIOERR exception if error encountered.
272  */
273  //contextIOResultType saveContext (FILE* stream, void *obj = NULL);
274  /*
275  * Restores receiver state to output stream, including associated material status.
276  * Warning: Slaves are not restored, they must be restored by corresponding
277  * cross section or material model, which creates these slaves.
278  * This is because they may have special weights and coordinates,
279  * and these are not saved into context file, because they remain the same
280  * during whole solution (only variables which vary are stored into context).
281  * Note: does not invoke FEMComponents restoreContext, since this writes only
282  * class id header, but typically due to large number of IPs,
283  * this is avoided.
284  * @exception throws an ContextIOERR exception if error encountered.
285  */
286  //contextIOResultType restoreContext(FILE* stream, void *obj = NULL);
287 
289  virtual const char *giveClassName() const { return "GaussPoint"; }
292 
293  friend class LayeredCrossSection;
294  friend class MicroplaneMaterial;
295  friend class FiberedCrossSection;
296  //friend class Material;
297  //friend class LayeredMaterial;
298 };
299 
301 } // end namespace oofem
302 #endif // gausspoint_h
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
FloatArray * globalCoordinates
Optional global (Cartesian) coordinates.
Definition: gausspoint.h:105
IntegrationPointStatus * setMaterialStatus(IntegrationPointStatus *ptr, int n)
Sets Material status managed by receiver.
Definition: gausspoint.h:213
const FloatArray & giveSubPatchCoordinates()
Returns local sub-patch coordinates of the receiver.
Definition: gausspoint.h:144
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
void setGlobalCoordinates(const FloatArray &iCoord)
Definition: gausspoint.h:171
Element * giveElement()
Returns reference to element containing receiver.
Abstract base class for all finite elements.
Definition: element.h:145
Element * giveElement()
Returns corresponding element to receiver.
Definition: gausspoint.h:188
void setWeight(double w)
Definition: gausspoint.h:182
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
double weight
Integration weight.
Definition: gausspoint.h:107
void setSubPatchCoordinates(const FloatArray &c)
Definition: gausspoint.h:151
Abstract base class representing integration rule.
This class implements a layered cross section in a finite element problem.
GaussPoint IntegrationPoint
Definition: gausspoint.h:300
Base abstract class representing cross section in finite element mesh.
Definition: crosssection.h:107
Abstract base class for all microplane models.
double giveNaturalCoordinate(int i) const
Returns i-th natural element coordinate of receiver.
Definition: gausspoint.h:136
#define OOFEM_ERROR(...)
Definition: error.h:61
int giveNumber()
Returns number of receiver.
Definition: gausspoint.h:184
virtual double giveWeight()
Returns integration weight of receiver.
Definition: gausspoint.h:181
int number
Number.
Definition: gausspoint.h:97
CrossSection * giveCrossSection()
Returns reference to cross section associated to related element of receiver.
Definition: gausspoint.h:200
Material * giveMaterial()
Returns reference to material associated to related element of receiver.
Definition: gausspoint.h:197
This class implements a fibered cross section in a finite element problem.
Definition: fiberedcs.h:89
IntegrationPointStatus * setMaterialStatus(IntegrationPointStatus *ptr)
Sets Material status managed by receiver.
Definition: gausspoint.h:223
Abstract base class for all material models.
Definition: material.h:95
FloatArray naturalCoordinates
Natural Element Coordinates of receiver.
Definition: gausspoint.h:101
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: gausspoint.h:291
IntegrationRule * giveIntegrationRule()
Returns corresponding integration rule to receiver.
Definition: gausspoint.h:186
const FloatArray & giveGlobalCoordinates()
Definition: gausspoint.h:160
void setMaterialMode(MaterialMode newMode)
Sets material mode of receiver.
Definition: gausspoint.h:193
IntegrationRule * irule
Reference to parent integration rule.
Definition: gausspoint.h:99
Class representing vector of real numbers.
Definition: floatarray.h:82
virtual const char * giveClassName() const
Returns class name of the receiver.
Definition: gausspoint.h:289
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
MaterialMode materialMode
Material mode of receiver.
Definition: gausspoint.h:109
IntegrationPointStatus * giveMaterialStatus()
Returns reference to associated material status (NULL if not defined).
Definition: gausspoint.h:205
void setNaturalCoordinates(const FloatArray &c)
Definition: gausspoint.h:139
std::vector< GaussPoint * > gaussPoints
List of slave integration points.
Definition: gausspoint.h:114
Class representing the general Input Record.
Definition: inputrecord.h:101
FloatArray * subPatchCoordinates
Optional local sub-patch (sub-patches form element volume) coordinates of the receiver.
Definition: gausspoint.h:103
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
Abstract base class representing a integration status.
IntegrationPointStatus * materialStatus
Status of e.g. material in point.
Definition: gausspoint.h:116
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Definition: gausspoint.h:138

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