OOFEM 3.0
Loading...
Searching...
No Matches
brick1_ht.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 "fei3dhexalin.h"
37#include "node.h"
38#include "gausspoint.h"
40#include "floatmatrix.h"
41#include "floatarray.h"
42#include "intarray.h"
43#include "mathfem.h"
44#include "load.h"
45#include "crosssection.h"
46#include "classfactory.h"
47
48#ifdef __OOFEG
49 #include "oofeggraphiccontext.h"
50 #include "oofegutils.h"
51 #include "connectivitytable.h"
52#endif
53
54namespace oofem {
58
59FEI3dHexaLin Brick1_ht :: interpolation;
60
66
67Brick1_hmt :: Brick1_hmt(int n, Domain *aDomain) : Brick1_ht(n, aDomain)
68{
70}
71
72Brick1_mt :: Brick1_mt(int n, Domain *aDomain) : Brick1_ht(n, aDomain)
73{
75}
76
78Brick1_ht :: giveInterpolation() const { return & interpolation; }
79
80void
81Brick1_ht :: computeGaussPoints()
82{
83 if ( integrationRulesArray.size() == 0 ) {
84 integrationRulesArray.resize( 1 );
85 integrationRulesArray [ 0 ] = std::make_unique<GaussIntegrationRule>(1, this, 1, 2);
86 this->giveCrossSection()->setupIntegrationPoints(* integrationRulesArray [ 0 ], numberOfGaussPoints, this);
87 }
88}
89
90
91void
92Brick1_ht :: initializeFrom(InputRecord &ir, int priority)
93{
94 TransportElement :: initializeFrom(ir, priority);
95}
96
97
98double
99Brick1_ht :: computeVolumeAround(GaussPoint *gp)
100{
101 double determinant = fabs( this->interpolation.giveTransformationJacobian( gp->giveNaturalCoordinates(),
103
104 return determinant * gp->giveWeight();
105}
106
107
108double
109Brick1_ht :: computeEdgeVolumeAround(GaussPoint *gp, int iEdge)
110{
111 double result = this->interpolation.edgeGiveTransformationJacobian( iEdge, gp->giveNaturalCoordinates(),
113 return result *gp->giveWeight();
114}
115
116
117double
118Brick1_ht :: computeSurfaceVolumeAround(GaussPoint *gp, int iSurf)
119{
120 double determinant = fabs( interpolation.surfaceGiveTransformationJacobian( iSurf, gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) ) );
121 return determinant * gp->giveWeight();
122}
123
124
125Interface *
126Brick1_ht :: giveInterface(InterfaceType interface)
127{
128 if ( interface == SpatialLocalizerInterfaceType ) {
129 return static_cast< SpatialLocalizerInterface * >(this);
130 } else if ( interface == EIPrimaryFieldInterfaceType ) {
131 return static_cast< EIPrimaryFieldInterface * >(this);
132 } else if ( interface == ZZNodalRecoveryModelInterfaceType ) {
133 return static_cast< ZZNodalRecoveryModelInterface * >(this);
134 } else if ( interface == SPRNodalRecoveryModelInterfaceType ) {
135 return static_cast< SPRNodalRecoveryModelInterface * >(this);
136 }
137
138 return nullptr;
139}
140
141void
142Brick1_ht :: SPRNodalRecoveryMI_giveSPRAssemblyPoints(IntArray &pap)
143{
145 for ( int i = 1; i <= numberOfDofMans; i++ ) {
146 pap.at(i) = this->giveNode(i)->giveNumber();
147 }
148}
149
150void
151Brick1_ht :: SPRNodalRecoveryMI_giveDofMansDeterminedByPatch(IntArray &answer, int pap)
152{
153 int found = 0;
154 answer.resize(1);
155
156 for ( int i = 1; i <= numberOfDofMans; i++ ) {
157 if ( this->giveNode(i)->giveNumber() == pap ) {
158 found = 1;
159 }
160 }
161
162 if ( found ) {
163 answer.at(1) = pap;
164 } else {
165 OOFEM_ERROR("unknown node number %d", pap);
166 }
167}
168
169int
170Brick1_ht :: SPRNodalRecoveryMI_giveNumberOfIP()
171{
172 return numberOfGaussPoints;
173}
174
175
177Brick1_ht :: SPRNodalRecoveryMI_givePatchType()
178{
180}
181
182
183#ifdef __OOFEG
184void Brick1_ht :: drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
185{
186 WCRec p [ 8 ];
187 GraphicObj *go;
188
189 if ( !gc.testElementGraphicActivity(this) ) {
190 return;
191 }
192
193 EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
194 EASValsSetColor( gc.getElementColor() );
195 EASValsSetEdgeColor( gc.getElementEdgeColor() );
196 EASValsSetEdgeFlag(true);
197 EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
198 EASValsSetFillStyle(FILL_SOLID);
199 for ( int i = 0; i < 8; i++ ) {
200 p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
201 p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
202 p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(3);
203 }
204
205 go = CreateHexahedron(p);
206 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
207 EGAttachObject(go, ( EObjectP ) this);
208 EMAddGraphicsToModel(ESIModel(), go);
209}
210
211
212void Brick1_ht :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
213{
214 int indx, result = 0;
215 WCRec p [ 8 ];
216 GraphicObj *tr;
217 FloatArray v [ 8 ];
218 double s [ 8 ];
219
220 if ( !gc.testElementGraphicActivity(this) ) {
221 return;
222 }
223
224 if ( gc.giveIntVarMode() == ISM_recovered ) {
225 for ( int i = 1; i <= 8; i++ ) {
226 result += this->giveInternalStateAtNode(v [ i - 1 ], gc.giveIntVarType(), gc.giveIntVarMode(), i, tStep);
227 }
228
229 if ( result != 8 ) {
230 return;
231 }
232 } else if ( gc.giveIntVarMode() == ISM_local ) {
233 return;
234 }
235
236 indx = gc.giveIntVarIndx();
237
238 for ( int i = 1; i <= 8; i++ ) {
239 s [ i - 1 ] = v [ i - 1 ].at(indx);
240 }
241
242 EASValsSetEdgeColor( gc.getElementEdgeColor() );
243 EASValsSetEdgeFlag(true);
244 EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
245 if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
246 for ( int i = 0; i < 8; i++ ) {
247 p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
248 p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
249 p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(3);
250 }
251
252 gc.updateFringeTableMinMax(s, 8);
253 tr = CreateHexahedronWD(p, s);
254 EGWithMaskChangeAttributes(LAYER_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK, tr);
255 EMAddGraphicsToModel(ESIModel(), tr);
256 }
257}
258
259#endif
260} // end namespace oofem
#define REGISTER_Element(class)
static FEI3dHexaLin interpolation
Definition brick1_ht.h:57
Brick1_ht(int n, Domain *d)
Definition brick1_ht.C:61
Node * giveNode(int i) const
Definition element.h:629
int numberOfDofMans
Number of dofmanagers.
Definition element.h:136
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
Definition element.h:157
int numberOfGaussPoints
Definition element.h:175
CrossSection * giveCrossSection()
Definition element.C:534
int giveNumber() const
Definition femcmpnn.h:104
double & at(Index i)
Definition floatarray.h:202
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
Definition gausspoint.h:138
double giveWeight()
Returns integration weight of receiver.
Definition gausspoint.h:180
void resize(int n)
Definition intarray.C:73
int & at(std::size_t i)
Definition intarray.h:104
SpatialLocalizerInterface(Element *element)
TransportElement(int n, Domain *d, ElementMode em=HeatTransferEM)
int giveInternalStateAtNode(FloatArray &answer, InternalStateType type, InternalStateMode mode, int node, TimeStep *tStep) override
ZZNodalRecoveryModelInterface(Element *element)
Constructor.
#define OOFEM_ERROR(...)
Definition error.h:79
@ SPRNodalRecoveryModelInterfaceType
@ ZZNodalRecoveryModelInterfaceType
@ EIPrimaryFieldInterfaceType
@ SpatialLocalizerInterfaceType
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define OOFEG_VARPLOT_PATTERN_LAYER
#define OOFEG_RAW_GEOMETRY_WIDTH
#define OOFEG_RAW_GEOMETRY_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