OOFEM 3.0
Loading...
Searching...
No Matches
beam2d.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#ifndef beam2d_h
36#define beam2d_h
37
40#include "dofmanager.h"
41
43
44#define _IFT_Beam2d_Name "beam2d"
45#define _IFT_Beam2d_dofstocondense "dofstocondense"
47
48namespace oofem {
49class FEI2dLineLin;
50class FEI2dLineHermite;
51class ParamKey;
63{
64protected:
65 double kappa, pitch, length;
75
78
80
81public:
82 Beam2d(int n, Domain *aDomain);
83 virtual ~Beam2d();
84
85 void computeConsistentMassMatrix(FloatMatrix &answer, TimeStep *tStep, double &mass, const double *ipDensity = NULL) override;
86 void computeInitialStressMatrix(FloatMatrix &answer, TimeStep *tStep) override;
87 void computeLumpedInitialStressMatrix(FloatMatrix &answer, TimeStep *tStep) override;
88
89 void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep) override;
90 int giveLocalCoordinateSystem(FloatMatrix &answer) override;
91 void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord = 0) override;
92 void giveEndForcesVector(FloatArray &answer, TimeStep *tStep);
93
94 int testElementExtension(ElementExtension ext) override { return ( ext == Element_EdgeLoadSupport ); }
95
97
98 FEInterpolation *giveInterpolation() const override;
99 FEInterpolation *giveInterpolation(DofIDItem id) const override { return nullptr; }
100
101 int computeNumberOfDofs() override { return 6; }
102 int computeNumberOfGlobalDofs() override { return 6 + this->numberOfCondensedDofs; }
103 void giveDofManDofIDMask(int inode, IntArray &) const override;
104 int giveNumberOfInternalDofManagers() const override { return ( ghostNodes [ 0 ] != nullptr ) + ( ghostNodes [ 1 ] != nullptr ); }
105 DofManager *giveInternalDofManager(int i) const override {
106 if ( i == 1 ) {
107 if ( ghostNodes [ 0 ] ) { return ghostNodes [ 0 ]; } else { return ghostNodes [ 1 ]; }
108 } else if ( i == 2 ) { // i==2
109 return ghostNodes [ 1 ];
110 } else {
111 OOFEM_ERROR("No such DOF available on Element %d", number);
112 }
113 }
114 void giveInternalDofManDofIDMask(int i, IntArray &answer) const override {
115 if ( i == 1 ) {
116 if ( ghostNodes [ 0 ] ) {
117 ghostNodes [ 0 ]->giveCompleteMasterDofIDArray(answer);
118 } else {
119 ghostNodes [ 1 ]->giveCompleteMasterDofIDArray(answer);
120 }
121 } else if ( i == 2 ) { // i==2
122 ghostNodes [ 1 ]->giveCompleteMasterDofIDArray(answer);
123 } else {
124 OOFEM_ERROR("No such DOF available on Element %d", number);
125 }
126 }
127
128 void giveBoundaryLocationArray(IntArray &locationArray, const IntArray &bNodes, const UnknownNumberingScheme &s, IntArray *dofIds = NULL) override {
129 giveLocationArray (locationArray, s, dofIds);
130 }
131
132 void giveBoundaryLocationArray(IntArray &locationArray, const IntArray &bNodes, const IntArray &dofIDMask, const UnknownNumberingScheme &s, IntArray *dofIds = NULL) override {
133 giveLocationArray (locationArray, dofIDMask, s, dofIds);
134 }
135
136 double computeVolumeAround(GaussPoint *gp) override;
137 void printOutputAt(FILE *file, TimeStep *tStep) override;
138
139 Element_Geometry_Type giveGeometryType() const override {return EGT_line_1;}
140
141 const char *giveClassName() const override { return "Beam2d"; }
142 const char *giveInputRecordName() const override { return _IFT_Beam2d_Name; }
143 void initializeFrom(InputRecord &ir, int priority) override;
144 void postInitialize() override;
145
146#ifdef __OOFEG
147 void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep) override;
149#endif
150
151 void computeStrainVectorInLayer(FloatArray &answer, const FloatArray &masterGpStrain,
152 GaussPoint *masterGp, GaussPoint *slaveGp, TimeStep *tStep) override;
153
154 int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep) override;
155
156protected:
157 void computeBoundaryEdgeLoadVector(FloatArray &answer, BoundaryLoad *load, int edge, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true) override;
158 void computeBmatrixAt(GaussPoint *, FloatMatrix &, int = 1, int = ALL_STRAINS) override;
159 void computeNmatrixAt(const FloatArray &iLocCoord, FloatMatrix &) override;
160 bool computeGtoLRotationMatrix(FloatMatrix &answer) override;
161
162 void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) override;
163 void computeStressVector(FloatArray &answer, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep) override;
164
165 void computeBodyLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode) override;
166
167 double giveKappaCoeff(TimeStep *tStep);
168 double computeLength() override;
169 double givePitch();
170 void computeGaussPoints() override;
171 MaterialMode giveMaterialMode() override { return _2dBeam; }
172 int giveNumberOfIPForMassMtrxIntegration() override { return 4; }
173
174 bool hasDofs2Condense() { return ( ghostNodes [ 0 ] || ghostNodes [ 1 ] ); }
175};
176} // end namespace oofem
177#endif // beam2d_h
#define _IFT_Beam2d_Name
Definition beam2d.h:44
double giveKappaCoeff(TimeStep *tStep)
Definition beam2d.C:342
void postInitialize() override
Performs post initialization steps. Called after all components are created and initialized.
Definition beam2d.C:393
void computeLumpedInitialStressMatrix(FloatMatrix &answer, TimeStep *tStep) override
Definition beam2d.C:669
Interface * giveInterface(InterfaceType) override
Definition beam2d.C:94
void printOutputAt(FILE *file, TimeStep *tStep) override
Definition beam2d.C:546
const char * giveInputRecordName() const override
Definition beam2d.h:142
int giveNumberOfInternalDofManagers() const override
Definition beam2d.h:104
Beam2d(int n, Domain *aDomain)
Definition beam2d.C:69
int computeNumberOfGlobalDofs() override
Definition beam2d.h:102
void giveDofManDofIDMask(int inode, IntArray &) const override
Definition beam2d.C:295
void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep) override
Definition beam2d.C:696
void initializeFrom(InputRecord &ir, int priority) override
Definition beam2d.C:384
DofManager * giveInternalDofManager(int i) const override
Definition beam2d.h:105
double computeVolumeAround(GaussPoint *gp) override
Definition beam2d.C:267
virtual ~Beam2d()
Definition beam2d.C:83
void giveBoundaryLocationArray(IntArray &locationArray, const IntArray &bNodes, const IntArray &dofIDMask, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) override
Definition beam2d.h:132
DofManager * ghostNodes[2]
Definition beam2d.h:72
int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep) override
Definition beam2d.C:504
double computeLength() override
Definition beam2d.C:304
double length
Definition beam2d.h:65
void giveEndForcesVector(FloatArray &answer, TimeStep *tStep)
Definition beam2d.C:433
bool computeGtoLRotationMatrix(FloatMatrix &answer) override
Definition beam2d.C:210
int computeNumberOfDofs() override
Definition beam2d.h:101
int giveLocalCoordinateSystem(FloatMatrix &answer) override
Definition beam2d.C:359
void computeBodyLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode) override
Definition beam2d.C:495
void giveBoundaryLocationArray(IntArray &locationArray, const IntArray &bNodes, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) override
Definition beam2d.h:128
double givePitch()
Definition beam2d.C:322
void giveInternalDofManDofIDMask(int i, IntArray &answer) const override
Definition beam2d.h:114
int giveNumberOfIPForMassMtrxIntegration() override
Definition beam2d.h:172
void computeBoundaryEdgeLoadVector(FloatArray &answer, BoundaryLoad *load, int edge, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true) override
Definition beam2d.C:449
void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord=0) override
Definition beam2d.C:426
void computeNmatrixAt(const FloatArray &iLocCoord, FloatMatrix &) override
Definition beam2d.C:145
MaterialMode giveMaterialMode() override
Definition beam2d.h:171
static FEI2dLineLin interp_geom
Definition beam2d.h:76
double kappa
Definition beam2d.h:65
static ParamKey IPK_Beam2d_dofsToCondense
[optional] DOFs to condense
Definition beam2d.h:79
Element_Geometry_Type giveGeometryType() const override
Definition beam2d.h:139
FEInterpolation * giveInterpolation(DofIDItem id) const override
Definition beam2d.h:99
double pitch
Definition beam2d.h:65
const char * giveClassName() const override
Definition beam2d.h:141
int numberOfCondensedDofs
number of condensed DOFs
Definition beam2d.h:74
int testElementExtension(ElementExtension ext) override
Definition beam2d.h:94
static FEI2dLineHermite interp_beam
Definition beam2d.h:77
void computeStressVector(FloatArray &answer, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep) override
Definition beam2d.C:203
void computeConsistentMassMatrix(FloatMatrix &answer, TimeStep *tStep, double &mass, const double *ipDensity=NULL) override
Definition beam2d.C:577
void computeStrainVectorInLayer(FloatArray &answer, const FloatArray &masterGpStrain, GaussPoint *masterGp, GaussPoint *slaveGp, TimeStep *tStep) override
Definition beam2d.C:274
void drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType) override
Definition beam2d.C:722
void computeInitialStressMatrix(FloatMatrix &answer, TimeStep *tStep) override
Definition beam2d.C:627
void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) override
Definition beam2d.C:196
void computeBmatrixAt(GaussPoint *, FloatMatrix &, int=1, int=ALL_STRAINS) override
Definition beam2d.C:105
FEInterpolation * giveInterpolation() const override
Definition beam2d.C:90
bool hasDofs2Condense()
Definition beam2d.h:174
void computeGaussPoints() override
Definition beam2d.C:132
void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep) override
Definition beam2d.C:179
BeamBaseElement(int n, Domain *d)
void giveLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) const
Definition element.C:429
int number
Component number.
Definition femcmpnn.h:77
#define OOFEM_ERROR(...)
Definition error.h:79
@ Element_EdgeLoadSupport
Element extension for edge loads.
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define ALL_STRAINS

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