OOFEM 3.0
Loading...
Searching...
No Matches
gausspoint.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 - 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#include "gausspoint.h"
36#include "matstatus.h"
37#include "material.h"
38
39#include <memory>
40#include <algorithm>
41
42namespace oofem {
43//GaussPoint :: GaussPoint(IntegrationRule *ir, int n, FloatArray *a, double w, MaterialMode mode) : statusDict()
44GaussPoint :: GaussPoint(IntegrationRule *ir, int n, FloatArray iNaturalCoord, double w, MaterialMode mode) :
45 number(n),
46 irule(ir),
47 naturalCoordinates(std :: move(iNaturalCoord)),
48 weight(w),
49 materialMode(mode)
50{
51}
52
53GaussPoint :: GaussPoint(IntegrationRule * ir, int n, double w, MaterialMode mode) :
54 number(n),
55 irule(ir),
56 weight(w),
57 materialMode(mode)
58{
59}
60
62{
63 for ( GaussPoint *gp: gaussPoints ) {
64 delete gp;
65 }
66}
67
68
69 void GaussPoint :: printOutputAt(FILE *file, TimeStep *tStep, const char* indent)
70{
71 int iruleNumber = irule ? irule->giveNumber() : 0;
72
73 fprintf(file, "%s GP %2d.%-2d :", indent, iruleNumber, number);
74
75 for (auto const& [key, val] : materialStatuses)
76 {
77 val->printOutputAt(file, tStep);
78 }
79
80 if ( gaussPoints.size() != 0 ) { // layered material
81 fprintf(file, "\tLayers report {\n");
82 for ( auto &gp: gaussPoints ) {
83 gp->printOutputAt(file, tStep, "\t\t");
84 }
85
86 fprintf(file, "\t} end layers report\n");
87 }
88}
89
90
91GaussPoint *GaussPoint :: giveSlaveGaussPoint(int index)
92// returns receivers slave gauss point
93// 'slaves' are introduced in order to support various type
94// of cross sections models (for example layered material, where
95// each separate layer has its own slave gp.)
96//
97{
98 if ( gaussPoints.size() == 0 ) {
99 return nullptr;
100 }
101
102 if ( ( index < 0 ) || ( index >= (int)gaussPoints.size() ) ) {
103 OOFEM_ERROR("index out of range");
104 }
105
106 return gaussPoints [ index ];
107}
108
109bool GaussPoint :: hasSlaveGaussPoint()
110{
111 if ( this->gaussPoints.size() != 0 ) {// layered material
112 return true;
113 }
114 return false;
115}
116
117size_t GaussPoint :: findFirstIndexOfSlaveGaussPoint(GaussPoint *gp)
118{
119 auto it = std::find( gaussPoints.begin(), gaussPoints.end(), gp );
120 if ( it != gaussPoints.end() ) {
121 return it - gaussPoints.begin();
122 } else {
123 OOFEM_ERROR("Slave Gauss point not found.");
124 }
125}
126
127void GaussPoint :: updateYourself(TimeStep *tStep)
128{
129
130 for (auto const& [key, val] : materialStatuses)
131 {
132 val->updateYourself(tStep);
133 }
134
135 for ( auto &gp: gaussPoints ) {
136 gp->updateYourself(tStep);
137 }
138}
139
140} // end namespace oofem
double weight
Integration weight.
Definition gausspoint.h:108
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
FloatArray naturalCoordinates
Natural Element Coordinates of receiver.
Definition gausspoint.h:102
IntegrationRule * irule
Reference to parent integration rule.
Definition gausspoint.h:100
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
MaterialMode materialMode
Material mode of receiver.
Definition gausspoint.h:110
#define OOFEM_ERROR(...)
Definition error.h:79

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