OOFEM 3.0
Loading...
Searching...
No Matches
tetrah1_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 "gausspoint.h"
38#include "floatmatrix.h"
39#include "floatarray.h"
40#include "intarray.h"
41#include "mathfem.h"
42#include "crosssection.h"
43#include "fei3dtetlin.h"
44#include "classfactory.h"
45
46#ifdef __OOFEG
47 #include "oofeggraphiccontext.h"
48 #include "oofegutils.h"
49#endif
50
51namespace oofem {
54
55FEI3dTetLin Tetrah1_ht :: interpolation;
56
57Tetrah1_ht :: Tetrah1_ht(int n, Domain *aDomain) : TransportElement(n, aDomain, HeatTransferEM), SpatialLocalizerInterface(this), ZZNodalRecoveryModelInterface(this)
58{
61}
62
63Tetrah1_hmt :: Tetrah1_hmt(int n, Domain *aDomain) : Tetrah1_ht(n, aDomain)
64{
65 this->emode = HeatMass1TransferEM; // This could be done in a better way.
66}
67
68
70Tetrah1_ht :: giveInterpolation() const
71{
72 return & interpolation;
73}
74
75
76void
77Tetrah1_ht :: computeGaussPoints()
78{
79 if ( integrationRulesArray.size() == 0 ) {
80 integrationRulesArray.resize( 1 );
81 integrationRulesArray [ 0 ] = std::make_unique<GaussIntegrationRule>(1, this, 1, 2);
82 this->giveCrossSection()->setupIntegrationPoints(* integrationRulesArray [ 0 ], numberOfGaussPoints, this);
83 }
84}
85
86
87void
88Tetrah1_ht :: initializeFrom(InputRecord &ir, int priority)
89{
90 TransportElement :: initializeFrom(ir, priority);
91}
92
93
94double
95Tetrah1_ht :: computeVolumeAround(GaussPoint *gp)
96{
97 double determinant = fabs( this->interpolation.giveTransformationJacobian( gp->giveNaturalCoordinates(),
99
100 double weight = gp->giveWeight();
101 return determinant * weight;
102}
103
104
105double
106Tetrah1_ht :: computeEdgeVolumeAround(GaussPoint *gp, int iEdge)
107{
108 double result = this->interpolation.edgeGiveTransformationJacobian( iEdge, gp->giveNaturalCoordinates(),
110 return result * gp->giveWeight();
111}
112
113
114double
115Tetrah1_ht :: computeSurfaceVolumeAround(GaussPoint *gp, int iSurf)
116{
117 double detJ = fabs( interpolation.surfaceGiveTransformationJacobian( iSurf, gp->giveNaturalCoordinates(),
119 return detJ * gp->giveWeight();
120}
121
122
123Interface *
124Tetrah1_ht :: giveInterface(InterfaceType interface)
125{
126 if ( interface == SpatialLocalizerInterfaceType ) {
127 return static_cast< SpatialLocalizerInterface * >(this);
128 } else if ( interface == EIPrimaryFieldInterfaceType ) {
129 return static_cast< EIPrimaryFieldInterface * >(this);
130 } else if ( interface == ZZNodalRecoveryModelInterfaceType ) {
131 return static_cast< ZZNodalRecoveryModelInterface * >(this);
132 }
133
134 return nullptr;
135}
136
137
138#ifdef __OOFEG
139 #define TR_LENGHT_REDUCT 0.3333
140
141void
142Tetrah1_ht :: drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
143{
144 WCRec p [ 4 ];
145 GraphicObj *go;
146
147 if ( !gc.testElementGraphicActivity(this) ) {
148 return;
149 }
150
151 EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
152 EASValsSetColor( gc.getElementColor() );
153 EASValsSetEdgeColor( gc.getElementEdgeColor() );
154 EASValsSetEdgeFlag(true);
155 EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
156 EASValsSetFillStyle(FILL_SOLID);
157 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);
158 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);
159 p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveCoordinate(3);
160 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);
161 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);
162 p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveCoordinate(3);
163 p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);
164 p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);
165 p [ 2 ].z = ( FPNum ) this->giveNode(3)->giveCoordinate(3);
166 p [ 3 ].x = ( FPNum ) this->giveNode(4)->giveCoordinate(1);
167 p [ 3 ].y = ( FPNum ) this->giveNode(4)->giveCoordinate(2);
168 p [ 3 ].z = ( FPNum ) this->giveNode(4)->giveCoordinate(3);
169
170 go = CreateTetra(p);
171 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
172 EGAttachObject(go, ( EObjectP ) this);
173 EMAddGraphicsToModel(ESIModel(), go);
174}
175
176
177void
178Tetrah1_ht :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
179{
180 int i, indx, result = 0;
181 WCRec p [ 4 ];
182 GraphicObj *tr;
183 FloatArray v [ 4 ];
184 double s [ 4 ];
185
186 if ( !gc.testElementGraphicActivity(this) ) {
187 return;
188 }
189
190 if ( gc.giveIntVarMode() == ISM_recovered ) {
191 for ( i = 1; i <= 4; i++ ) {
192 result += this->giveInternalStateAtNode(v [ i - 1 ], gc.giveIntVarType(), gc.giveIntVarMode(), i, tStep);
193 }
194
195 if ( result != 4 ) {
196 return;
197 }
198 } else if ( gc.giveIntVarMode() == ISM_local ) {
199 return;
200 }
201
202 indx = gc.giveIntVarIndx();
203
204 for ( i = 1; i <= 4; i++ ) {
205 s [ i - 1 ] = v [ i - 1 ].at(indx);
206 }
207
208 EASValsSetEdgeColor( gc.getElementEdgeColor() );
209 EASValsSetEdgeFlag(true);
210 EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
211 if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
212 for ( i = 0; i < 4; i++ ) {
213 p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
214 p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
215 p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(3);
216 }
217
218 gc.updateFringeTableMinMax(s, 4);
219 tr = CreateTetraWD(p, s);
220 EGWithMaskChangeAttributes(LAYER_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK, tr);
221 EMAddGraphicsToModel(ESIModel(), tr);
222 }
223}
224
225#endif
226} // end namespace oofem
#define REGISTER_Element(class)
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
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
SpatialLocalizerInterface(Element *element)
Tetrah1_ht(int n, Domain *d)
Definition tetrah1_ht.C:57
static FEI3dTetLin interpolation
Definition tetrah1_ht.h:54
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.
@ 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