OOFEM 3.0
Loading...
Searching...
No Matches
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 - 2025 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 "oofemenv.h"
45#include "integrationrule.h"
47#include "element.h"
48#include "floatarray.h"
49#include "materialmode.h"
50#include <map>
51
52namespace oofem {
53class Material;
57class CrossSection;
58class IntegrationRule;
59
95{
96private:
98 int number;
104 std::unique_ptr<FloatArray> subPatchCoordinates;
106 std::unique_ptr<FloatArray> globalCoordinates;
108 double weight;
110 MaterialMode materialMode;
111
112protected:
113 // layer and fibered material support
115 std::vector< GaussPoint * > gaussPoints;
117 std::map<int, std::unique_ptr<IntegrationPointStatus>> materialStatuses;
118
119public:
129 GaussPoint(IntegrationRule *ir, int n, FloatArray iNaturalCoord, double w, MaterialMode mode);
130
131 GaussPoint(IntegrationRule *ir, int n, double w, MaterialMode mode);
132
133 ~GaussPoint();
134
136 double giveNaturalCoordinate(int i) const { return naturalCoordinates.at(i); }
140
143 {
144 if ( subPatchCoordinates ) {
145 return *subPatchCoordinates;
146 } else {
147 return naturalCoordinates;
148 }
149 }
151 {
152 if ( subPatchCoordinates ) {
154 } else {
155 subPatchCoordinates = std::make_unique<FloatArray>(c);
156 }
157 }
158
160 {
161 if ( globalCoordinates ) {
162 return *globalCoordinates;
163 } else {
164 globalCoordinates = std::make_unique<FloatArray>();
165 this->giveElement()->computeGlobalCoordinates(*globalCoordinates, naturalCoordinates);
166 return *globalCoordinates;
167 }
168 }
169
171 {
172 if ( globalCoordinates ) {
173 *globalCoordinates = iCoord;
174 } else {
175 globalCoordinates = std::make_unique<FloatArray>(iCoord);
176 }
177 }
178
180 double giveWeight() { return weight; }
181 void setWeight(double w) { weight = w; }
183 int giveNumber() { return number; }
187 Element *giveElement() { return irule->giveElement(); }
188
190 MaterialMode giveMaterialMode() { return this->materialMode; }
192 void setMaterialMode(MaterialMode newMode) { this->materialMode = newMode; }
194
196 Material *giveMaterial() { return giveElement()->giveMaterial(); }
197
199 CrossSection *giveCrossSection() { return giveElement()->giveCrossSection(); }
200
204 IntegrationPointStatus *giveMaterialStatus(IntegrationPointStatusIDType key=IPSID_Default) { return this->materialStatuses.at(key).get(); }
205 const IntegrationPointStatus *giveMaterialStatus(IntegrationPointStatusIDType key=IPSID_Default) const { return this->materialStatuses.at(key).get(); }
206 bool hasMaterialStatus(IntegrationPointStatusIDType key=IPSID_Default) const { return this->materialStatuses.find(key) != this->materialStatuses.end(); }
207
214 {
215 if ( this->materialStatuses.find(key) != this->materialStatuses.end() ) {
216 OOFEM_ERROR("status already exist");
217 }
218 this->materialStatuses[key]=std::move(ptr);
219 return this->materialStatuses[key].get();
220 }
221
226 GaussPoint *giveSlaveGaussPoint(int index);
227 std::vector< GaussPoint * > &giveSlaveGaussPoints() {return this->gaussPoints;}
228
232 bool hasSlaveGaussPoint();
236 size_t findFirstIndexOfSlaveGaussPoint(GaussPoint *gp);
242 void printOutputAt(FILE *file, TimeStep *tStep, const char* indent="");
249 void updateYourself(TimeStep *tStep);
250
252 const char *giveClassName() const { return "GaussPoint"; }
253
260 {
261 if ( this->materialStatuses.find(key) != this->materialStatuses.end() ) {
262 OOFEM_ERROR("status already exist");
263 }
264 this->materialStatuses[key]=std::unique_ptr<IntegrationPointStatus>(ptr);
265 return this->materialStatuses[key].get();
266 }
267
270};
271
273} // end namespace oofem
274#endif // gausspoint_h
double weight
Integration weight.
Definition gausspoint.h:108
const IntegrationPointStatus * giveMaterialStatus(IntegrationPointStatusIDType key=IPSID_Default) const
Definition gausspoint.h:205
IntegrationPointStatus * __setMaterialStatus(IntegrationPointStatus *ptr, IntegrationPointStatusIDType key=IPSID_Default)
Definition gausspoint.h:259
Material * giveMaterial()
Returns reference to material associated to related element of receiver.
Definition gausspoint.h:196
int giveNumber()
Returns number of receiver.
Definition gausspoint.h:183
friend class LayeredCrossSection
Definition gausspoint.h:268
double giveNaturalCoordinate(int i) const
Returns i-th natural element coordinate of receiver.
Definition gausspoint.h:136
std::vector< GaussPoint * > & giveSlaveGaussPoints()
Definition gausspoint.h:227
bool hasMaterialStatus(IntegrationPointStatusIDType key=IPSID_Default) const
Definition gausspoint.h:206
const char * giveClassName() const
Returns class name of the receiver.
Definition gausspoint.h:252
void setMaterialMode(MaterialMode newMode)
Sets material mode of receiver.
Definition gausspoint.h:192
std::vector< GaussPoint * > gaussPoints
List of slave integration points.
Definition gausspoint.h:115
GaussPoint(IntegrationRule *ir, int n, FloatArray iNaturalCoord, double w, MaterialMode mode)
Definition gausspoint.C:44
IntegrationPointStatus * setMaterialStatus(std::unique_ptr< IntegrationPointStatus > ptr, IntegrationPointStatusIDType key=IPSID_Default)
Definition gausspoint.h:213
FloatArray naturalCoordinates
Natural Element Coordinates of receiver.
Definition gausspoint.h:102
friend class FiberedCrossSection
Definition gausspoint.h:269
void setNaturalCoordinates(const FloatArray &c)
Definition gausspoint.h:139
const FloatArray & giveGlobalCoordinates()
Definition gausspoint.h:159
std::unique_ptr< FloatArray > subPatchCoordinates
Optional local sub-patch (sub-patches form element volume) coordinates of the receiver.
Definition gausspoint.h:104
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
Definition gausspoint.h:138
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition gausspoint.h:190
const FloatArray & giveSubPatchCoordinates() const
Returns local sub-patch coordinates of the receiver.
Definition gausspoint.h:142
IntegrationPointStatus * giveMaterialStatus(IntegrationPointStatusIDType key=IPSID_Default)
Definition gausspoint.h:204
IntegrationRule * giveIntegrationRule()
Returns corresponding integration rule to receiver.
Definition gausspoint.h:185
IntegrationRule * irule
Reference to parent integration rule.
Definition gausspoint.h:100
Element * giveElement()
Returns corresponding element to receiver.
Definition gausspoint.h:187
CrossSection * giveCrossSection()
Returns reference to cross section associated to related element of receiver.
Definition gausspoint.h:199
void setSubPatchCoordinates(const FloatArray &c)
Definition gausspoint.h:150
void setWeight(double w)
Definition gausspoint.h:181
double giveWeight()
Returns integration weight of receiver.
Definition gausspoint.h:180
std::map< int, std::unique_ptr< IntegrationPointStatus > > materialStatuses
Status of e.g. material in point.
Definition gausspoint.h:117
int number
Number.
Definition gausspoint.h:98
void setGlobalCoordinates(const FloatArray &iCoord)
Definition gausspoint.h:170
std::unique_ptr< FloatArray > globalCoordinates
Optional global (Cartesian) coordinates.
Definition gausspoint.h:106
MaterialMode materialMode
Material mode of receiver.
Definition gausspoint.h:110
#define OOFEM_ERROR(...)
Definition error.h:79
GaussPoint IntegrationPoint
Definition gausspoint.h:272
#define OOFEM_EXPORT
Definition oofemcfg.h:7

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011