OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
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 - 2013 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 #include "../sm/Elements/Beams/beambaseelement.h"
36 #include "node.h"
37 #include "gausspoint.h"
38 #include "gaussintegrationrule.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 
50 namespace oofem {
51 
52 
54 {}
55 
57 {}
58 
59 void
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
virtual bool isImposed(TimeStep *tStep)
Returns nonzero if receiver representing BC is imposed at given time, otherwise returns zero...
int number
Component number.
Definition: femcmpnn.h:80
This class keeps track of applied boundary conditions on individual entities.
Definition: bctracker.h:53
IntArray * giveBoundaryLoadArray()
Returns array containing load numbers of boundary loads acting on element.
Definition: element.C:381
Class and object Domain.
Definition: domain.h:115
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition: femcmpnn.h:82
bcGeomType
Type representing the geometric character of loading.
Definition: bcgeomtype.h:40
BeamBaseElement(int n, Domain *d)
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
Class implementing element body load, acting over whole element volume (e.g., the dead weight)...
Definition: bodyload.h:49
void clear()
Clears receiver (zero size).
Definition: floatarray.h:206
BCTracker * giveBCTracker()
Definition: domain.C:427
Concentrated point load (placed anywhere).
Definition: bcgeomtype.h:46
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
virtual void computeLocalForceLoadVector(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
Computes element end force vector from applied loading in local coordinate system.
Distributed body load.
Definition: bcgeomtype.h:43
const entryListType & getElementRecords(int elem)
Definition: bctracker.C:100
GeneralBoundaryCondition * giveBc(int n)
Service for accessing particular domain bc.
Definition: domain.C:243
Abstract base class for all "structural" finite elements.
virtual void computeBodyLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode)
Computes the load vector due to body load acting on receiver, at given time step. ...
Distributed edge load.
Definition: bcgeomtype.h:44
Abstract base class representing a boundary load (force, momentum, ...) that acts directly on a bound...
Definition: boundaryload.h:110
virtual void computeBoundarySurfaceLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true)
Computes the contribution of the given load at the given boundary surface in global coordinate system...
#define OOFEM_ERROR(...)
Definition: error.h:61
IntArray * giveBodyLoadArray()
Returns array containing load numbers of loads acting on element.
Definition: element.C:372
IntArray bodyLoadArray
Array containing indexes of loads (body loads and boundary loads are kept separately), that apply on receiver.
Definition: element.h:160
Abstract base class for all boundary conditions of problem.
Distributed surface load.
Definition: bcgeomtype.h:45
Class representing vector of real numbers.
Definition: floatarray.h:82
std::list< Entry > entryListType
Definition: bctracker.h:64
virtual void computeBoundaryEdgeLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true)
Computes the contribution of the given load at the given boundary edge.
virtual bcGeomType giveBCGeoType() const
Returns geometry character of boundary condition.
Load is base abstract class for all loads.
Definition: load.h:61
int giveSize() const
Definition: intarray.h:203
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual void computePointLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode, bool global=true)
Computes point load vector contribution of receiver for given load (should has BoundaryLoad Base)...
virtual bcValType giveBCValType() const
Returns receiver load type.
Load * giveLoad(int n)
Service for accessing particular domain load.
Definition: domain.C:222
IntArray boundaryLoadArray
Definition: element.h:160
Class representing solution step.
Definition: timestep.h:80
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:27 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011