OOFEM 3.0
Loading...
Searching...
No Matches
q27space.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
36#include "node.h"
37#include "gausspoint.h"
39#include "floatmatrix.h"
40#include "floatarray.h"
41#include "intarray.h"
42#include "domain.h"
43#include "mathfem.h"
44#include "crosssection.h"
45#include "classfactory.h"
46#include "fei3dhexatriquad.h"
47
48namespace oofem {
50
51FEI3dHexaTriQuad Q27Space :: interpolation;
52
53FEInterpolation *Q27Space :: giveInterpolation() const
54{
55 return & interpolation;
56}
57
58Q27Space :: Q27Space(int n, Domain *aDomain) : Structural3DElement(n, aDomain), ZZNodalRecoveryModelInterface(this)
59{
60 numberOfDofMans = 27;
62}
63
64
65void
66Q27Space :: initializeFrom(InputRecord &ir, int priority)
67{
68 Structural3DElement :: initializeFrom(ir, priority);
69}
70
71
72// ******************************
73// *** Surface load support ***
74// ******************************
75
76int
77Q27Space :: computeLoadLSToLRotationMatrix(FloatMatrix &answer, int iSurf, GaussPoint *gp)
78{
79 // returns transformation matrix from
80 // surface local coordinate system
81 // to element local c.s
82 // (same as global c.s in this case)
83 //
84 // i.e. f(element local) = T * f(edge local)
85
86 // definition of local c.s on surface:
87 // local z axis - perpendicular to surface, pointing outwards from element
88 // local x axis - is in global xy plane (perpendicular to global z axis)
89 // local y axis - completes the righ hand side cs.
90
91 /*
92 * OOFEM_ERROR("surface local coordinate system not supported");
93 * return 1;
94 */
95 FloatArray gc(3);
96 FloatArray h1(3), h2(3), nn(3), n(3);
97
98 answer.resize(3, 3);
99 answer.zero();
100
101 const auto &snodes = this->interpolation.computeSurfaceMapping(dofManArray, iSurf);
102 for ( int i = 1; i <= 4; i++ ) {
103 gc.add( domain->giveNode( snodes.at(i) )->giveCoordinates() );
104 }
105
106 gc.times(1. / 4.);
107 // determine "average normal"
108 for ( int i = 1; i <= 4; i++ ) {
109 int j = ( i ) % 4 + 1;
110 h1.beDifferenceOf(domain->giveNode( snodes.at(i) )->giveCoordinates(), gc);
111 h2.beDifferenceOf(domain->giveNode( snodes.at(j) )->giveCoordinates(), gc);
112 n.beVectorProductOf(h1, h2);
113 if ( n.computeSquaredNorm() > 1.e-6 ) {
114 n.normalize();
115 }
116
117 nn.add(n);
118 }
119
120 nn.times(1. / 4.);
121 if ( nn.computeSquaredNorm() < 1.e-6 ) {
122 answer.zero();
123 }
124
125 nn.normalize();
126 for ( int i = 1; i <= 3; i++ ) {
127 answer.at(i, 3) = nn.at(i);
128 }
129
130 // determine lcs of surface
131 // local x axis in xy plane
132 double test = fabs(fabs( nn.at(3) ) - 1.0);
133 if ( test < 1.e-5 ) {
134 h1.at(1) = answer.at(1, 1) = 1.0;
135 h1.at(2) = answer.at(2, 1) = 0.0;
136 } else {
137 h1.at(1) = answer.at(1, 1) = answer.at(2, 3);
138 h1.at(2) = answer.at(2, 1) = -answer.at(1, 3);
139 }
140
141 h1.at(3) = answer.at(3, 1) = 0.0;
142 // local y axis perpendicular to local x,z axes
143 h2.beVectorProductOf(nn, h1);
144 for ( int i = 1; i <= 3; i++ ) {
145 answer.at(i, 2) = h2.at(i);
146 }
147
148 return 1;
149}
150
151Interface *
152Q27Space :: giveInterface(InterfaceType interface)
153{
154 if ( interface == ZZNodalRecoveryModelInterfaceType ) {
155 return static_cast< ZZNodalRecoveryModelInterface * >(this);
156 } else if ( interface == SPRNodalRecoveryModelInterfaceType ) {
157 return static_cast< SPRNodalRecoveryModelInterface * >(this);
158 } else if ( interface == NodalAveragingRecoveryModelInterfaceType ) {
159 return static_cast< NodalAveragingRecoveryModelInterface * >(this);
160 }
161
162 OOFEM_LOG_INFO("Interface on Qspace element not supported");
163 return NULL;
164}
165
166void
167Q27Space :: SPRNodalRecoveryMI_giveSPRAssemblyPoints(IntArray &pap)
168{
169 pap.resize(27);
170 for ( int i = 1; i <= 27; i++ ) {
171 pap.at(i) = this->giveNode(i)->giveNumber();
172 }
173}
174
175void
176Q27Space :: SPRNodalRecoveryMI_giveDofMansDeterminedByPatch(IntArray &answer, int pap)
177{
178 int found = 0;
179 answer.resize(1);
180
181 for ( int i = 1; i <= 27; i++ ) {
182 if ( this->giveNode(i)->giveNumber() == pap ) {
183 found = 1;
184 }
185 }
186
187 if ( found ) {
188 answer.at(1) = pap;
189 } else {
190 OOFEM_ERROR("unknown node number %d", pap);
191 }
192}
193
194int
195Q27Space :: SPRNodalRecoveryMI_giveNumberOfIP()
196{
197 return numberOfGaussPoints;
198}
199
200
202Q27Space :: SPRNodalRecoveryMI_givePatchType()
203{
205}
206
207
208void
209Q27Space :: NodalAveragingRecoveryMI_computeNodalValue(FloatArray &answer, int node, InternalStateType type, TimeStep *tStep)
210{
211 answer.clear();
212 OOFEM_WARNING("IP values will not be transferred to nodes. Use ZZNodalRecovery instead (parameter stype 1)");
213}
214
215} // end namespace oofem
#define REGISTER_Element(class)
Node * giveNode(int i) const
Definition element.h:629
IntArray dofManArray
Array containing dofmanager numbers.
Definition element.h:138
int numberOfDofMans
Number of dofmanagers.
Definition element.h:136
int numberOfGaussPoints
Definition element.h:175
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition femcmpnn.h:79
int giveNumber() const
Definition femcmpnn.h:104
double computeSquaredNorm() const
Definition floatarray.C:867
void beVectorProductOf(const FloatArray &v1, const FloatArray &v2)
Definition floatarray.C:476
void resize(Index rows, Index cols)
Definition floatmatrix.C:79
void zero()
Zeroes all coefficient of receiver.
double at(std::size_t i, std::size_t j) const
void resize(int n)
Definition intarray.C:73
int & at(std::size_t i)
Definition intarray.h:104
static FEI3dHexaTriQuad interpolation
Definition q27space.h:56
Structural3DElement(int n, Domain *d)
ZZNodalRecoveryModelInterface(Element *element)
Constructor.
#define OOFEM_WARNING(...)
Definition error.h:80
#define OOFEM_ERROR(...)
Definition error.h:79
#define OOFEM_LOG_INFO(...)
Definition logger.h:143
@ SPRNodalRecoveryModelInterfaceType
@ ZZNodalRecoveryModelInterfaceType
@ NodalAveragingRecoveryModelInterfaceType
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]

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