OOFEM 3.0
Loading...
Searching...
No Matches
beambaseelement.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 "intarray.h"
41#include "floatarray.h"
42#include "engngm.h"
43#include "boundaryload.h"
44#include "mathfem.h"
45#include "bctracker.h"
46
47#include "bodyload.h"
48#include "boundaryload.h"
49
50namespace oofem {
51
52
53BeamBaseElement :: BeamBaseElement (int n, Domain *aDomain) : StructuralElement(n, aDomain)
54{}
55
56BeamBaseElement :: ~BeamBaseElement()
57{}
58
59void
60BeamBaseElement :: computeLocalForceLoadVector(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
61// computes the part of load vector, which is imposed by force loads acting
62// on element volume (surface).
63// Why is this function taken separately ?
64// When reactions forces are computed, they are computed from element::GiveRealStressVector
65// in this vector a real forces are stored (temperature part is subtracted).
66// so we need further subtract part corresponding to non-nodal loading.
67{
68 FloatArray helpLoadVector(1);
69 answer.clear();
70
71 // loop over body load array first
72 int nBodyLoads = this->giveBodyLoadArray()->giveSize();
73 for ( int i = 1; i <= nBodyLoads; i++ ) {
74 int id = bodyLoadArray.at(i);
75 Load *load = domain->giveLoad(id);
76 bcGeomType ltype = load->giveBCGeoType();
77 if ( ( ltype == BodyLoadBGT ) && ( load->giveBCValType() == ForceLoadBVT ) ) {
78 this->computeBodyLoadVectorAt(helpLoadVector, load, tStep, mode);
79 if ( helpLoadVector.giveSize() ) {
80 answer.add(helpLoadVector);
81 }
82 } else {
83 if ( load->giveBCValType() != TemperatureBVT && load->giveBCValType() != EigenstrainBVT ) {
84 // temperature and eigenstrain is handled separately at computeLoadVectorAt subroutine
85 OOFEM_ERROR("body load %d is of unsupported type (%d)", id, ltype);
86 }
87 }
88 }
89
90 // loop over boundary load array
91 int nBoundaryLoads = this->giveBoundaryLoadArray()->giveSize() / 2;
92 for ( int i = 1; i <= nBoundaryLoads; i++ ) {
93 int n = boundaryLoadArray.at(1 + ( i - 1 ) * 2);
94 int id = boundaryLoadArray.at(i * 2);
95 Load *load = domain->giveLoad(n);
96 BoundaryLoad* bLoad;
97 if ((bLoad = dynamic_cast<BoundaryLoad*> (load))) {
98 bcGeomType ltype = load->giveBCGeoType();
99 if ( ltype == EdgeLoadBGT ) {
100 this->computeBoundaryEdgeLoadVector(helpLoadVector, bLoad, id, ExternalForcesVector, mode, tStep, false);
101 if ( helpLoadVector.giveSize() ) {
102 answer.add(helpLoadVector);
103 }
104 } else if ( ltype == SurfaceLoadBGT ) {
105 this->computeBoundarySurfaceLoadVector(helpLoadVector, bLoad, id, ExternalForcesVector, mode, tStep, false);
106 if ( helpLoadVector.giveSize() ) {
107 answer.add(helpLoadVector);
108 }
109 } else if ( ltype == PointLoadBGT ) {
110 // id not used
111 this->computePointLoadVectorAt(helpLoadVector, load, tStep, mode, false);
112 if ( helpLoadVector.giveSize() ) {
113 answer.add(helpLoadVector);
114 }
115 } else {
116 OOFEM_ERROR("boundary load %d is of unsupported type (%d)", id, ltype);
117 }
118 }
119 }
120
121
122 // add exact end forces due to nonnodal loading applied indirectly (via sets)
123 BCTracker *bct = this->domain->giveBCTracker();
125 FloatArray help;
126
127 for (BCTracker::entryListType::iterator it = bcList.begin(); it != bcList.end(); ++it) {
128 GeneralBoundaryCondition *bc = this->domain->giveBc((*it).bcNumber);
129 BodyLoad *bodyLoad;
130 BoundaryLoad *boundaryLoad;
131 if (bc->isImposed(tStep)) {
132 if ((bodyLoad = dynamic_cast<BodyLoad*>(bc))) { // body load
133 this->computeBodyLoadVectorAt(help,bodyLoad, tStep, VM_Total); // this one is local
134 answer.add(help);
135 } else if ((boundaryLoad = dynamic_cast<BoundaryLoad*>(bc))) {
136 // compute Boundary Edge load vector in GLOBAL CS !!!!!!!
137 this->computeBoundaryEdgeLoadVector(help, boundaryLoad, (*it).boundaryId,
138 ExternalForcesVector, VM_Total, tStep, false);
139 // get it transformed back to local c.s.
140 // this->computeGtoLRotationMatrix(t);
141 // help.rotatedWith(t, 'n');
142 answer.add(help);
143 }
144 }
145 }
146}
147
148} // end namespace oofem
const entryListType & getElementRecords(int elem)
Definition bctracker.C:133
std::list< Entry > entryListType
Definition bctracker.h:67
IntArray boundaryLoadArray
Definition element.h:147
IntArray * giveBodyLoadArray()
Returns array containing load numbers of loads acting on element.
Definition element.C:411
IntArray * giveBoundaryLoadArray()
Returns array containing load numbers of boundary loads acting on element.
Definition element.C:420
IntArray bodyLoadArray
Definition element.h:147
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition femcmpnn.h:79
int number
Component number.
Definition femcmpnn.h:77
Index giveSize() const
Returns the size of receiver.
Definition floatarray.h:261
void add(const FloatArray &src)
Definition floatarray.C:218
virtual bcGeomType giveBCGeoType() const
virtual bool isImposed(TimeStep *tStep)
virtual void computePointLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode, bool global=true)
StructuralElement(int n, Domain *d)
virtual void computeBodyLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode)
void computeBoundaryEdgeLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true) override
void computeBoundarySurfaceLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true) override
#define OOFEM_ERROR(...)
Definition error.h:79
bcGeomType
Type representing the geometric character of loading.
Definition bcgeomtype.h:40
@ SurfaceLoadBGT
Distributed surface load.
Definition bcgeomtype.h:45
@ PointLoadBGT
Concentrated point load (placed anywhere).
Definition bcgeomtype.h:46
@ BodyLoadBGT
Distributed body load.
Definition bcgeomtype.h:43
@ EdgeLoadBGT
Distributed edge load.
Definition bcgeomtype.h:44
@ ForceLoadBVT
Definition bcvaltype.h:43
@ EigenstrainBVT
Definition bcvaltype.h:48
@ TemperatureBVT
Definition bcvaltype.h:42

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