OOFEM 3.0
Loading...
Searching...
No Matches
variablecrosssection.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
38#include "gausspoint.h"
39#include "floatarray.h"
40#include "classfactory.h"
41#include "dynamicinputrecord.h"
42#include "scalarfunction.h"
43#include "function.h"
44
45#include <string>
46#include <sstream>
47
48namespace oofem {
50
51
52void
53VariableCrossSection :: initializeFrom(InputRecord &ir)
54{
57 }
58
61 }
62
65 }
66
69 }
70
73 }
74
77 }
78
81 }
82
85 }
86
89 }
90
93 }
94
97 }
98
100
101 directorxExpr.setValue(0.0);
104 }
105
106 directoryExpr.setValue(0.0);
109 }
110
111 directorzExpr.setValue(1.0);
114 }
115
116 // will read density and other inheritted parameters as constants
117 // NOTE: do not call SimpleCrossSection here (as the parameter names are same, but different type is used here!!!!)
118 CrossSection :: initializeFrom(ir);
119
120}
121
122
143
144void
145VariableCrossSection :: giveExpression(const ScalarFunction **expr, CrossSectionProperty aProperty) const
146{
147 if ( aProperty == CS_Thickness ) {
148 * expr = & thicknessExpr;
149 } else if ( aProperty == CS_Width ) {
150 * expr = & widthExpr;
151 } else if ( aProperty == CS_Area ) {
152 * expr = & areaExpr;
153 } else if ( aProperty == CS_TorsionConstantX ) {
154 * expr = & ixExpr;
155 } else if ( aProperty == CS_InertiaMomentY ) {
156 * expr = & iyExpr;
157 } else if ( aProperty == CS_InertiaMomentZ ) {
158 * expr = & izExpr;
159 } else if ( aProperty == CS_ShearAreaY ) {
160 * expr = & shearAreayExpr;
161 } else if ( aProperty == CS_ShearAreaZ ) {
162 * expr = & shearAreazExpr;
163 } else if ( aProperty == CS_DrillingStiffness ) {
164 * expr = & drillingStiffnessExpr;
165 } else if ( aProperty == CS_RelDrillingStiffness ) {
166 * expr = & relDrillingStiffnessExpr;
167 } else if ( aProperty == CS_DrillingType ) {
168 * expr = & drillingTypeExpr;
169 } else if ( aProperty == CS_DirectorVectorX ) {
170 * expr = & directorxExpr;
171 } else if ( aProperty == CS_DirectorVectorY ) {
172 * expr = & directoryExpr;
173 } else if ( aProperty == CS_DirectorVectorZ ) {
174 * expr = & directorzExpr;
175 } else {
176 OOFEM_ERROR("%d: called with unknown ID %d", this->giveNumber(), aProperty);
177 }
178}
179
180
181
182double
183VariableCrossSection :: give(CrossSectionProperty aProperty, GaussPoint *gpx) const
184{
185 return this->give(aProperty, gpx->giveNaturalCoordinates(), gpx->giveElement(), true);
186}
187
188
189double
190VariableCrossSection :: give(CrossSectionProperty aProperty, const FloatArray &coords, Element *elem, bool local) const
191{
192 double value = 0.0;
193 const ScalarFunction *expr;
194
195 if ( propertyDictionary.includes(aProperty) ) {
196 value = propertyDictionary.at(aProperty);
197 } else {
198 this->giveExpression(& expr, aProperty);
199
200 FloatArray c;
201 if ( this->localFormulationFlag ) {
202 if ( local ) {
203 c = coords;
204 } else {
205 // convert given coords into local cs
206 if ( !elem->computeLocalCoordinates(c, coords) ) {
207 OOFEM_ERROR( "computeLocalCoordinates failed (element %d)", elem->giveNumber() );
208 }
209 }
210 } else { // global coordinates needed
211 if ( local ) {
212 // convert given coords into global cs
213 if ( !elem->computeGlobalCoordinates(c, coords) ) {
214 OOFEM_ERROR( "computeGlobalCoordinates failed (element %d)", elem->giveNumber() );
215 }
216 } else {
217 c = coords;
218 }
219 }
220 // evaluate the expression
221 value = expr->eval( { { "x", c } }, this->giveDomain() );
222 }
223
224 return value;
225}
226} // end namespace oofem
#define REGISTER_CrossSection(class)
Dictionary propertyDictionary
void setField(int item, InputFieldType id)
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Definition element.C:1225
virtual bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
Definition element.C:1240
Domain * giveDomain() const
Definition femcmpnn.h:97
int giveNumber() const
Definition femcmpnn.h:104
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
Definition gausspoint.h:138
Element * giveElement()
Returns corresponding element to receiver.
Definition gausspoint.h:187
virtual bool hasField(InputFieldType id)=0
Returns true if record contains field identified by idString keyword.
double eval(const std ::map< std ::string, FunctionArgument >valDict, Domain *d, GaussPoint *gp=NULL, double param=0.) const
int materialNumber
Material number.
double give(CrossSectionProperty a, GaussPoint *gp) const override
ScalarFunction shearAreazExpr
Expression for cross section beam shear area $A_z$.
bool localFormulationFlag
if set to true, all expressions are in element local cs, otherwise are expressed in global cs
ScalarFunction iyExpr
Expression for cross section inertia moment $I_y$.
ScalarFunction shearAreayExpr
Expression for cross section beam shear area $A_y$.
void giveExpression(const ScalarFunction **expr, CrossSectionProperty aProperty) const
ScalarFunction izExpr
Expression for cross section inertia moment $I_z$.
ScalarFunction drillingTypeExpr
Expression for type of artificially added stiffness.
ScalarFunction relDrillingStiffnessExpr
Expression for cross section relative drilling stiffness.
ScalarFunction directorzExpr
Expression for director vector component in z-axis.
ScalarFunction directorxExpr
Expression for director vector component in x-axis.
ScalarFunction directoryExpr
Expression for director vector component in y-axis.
ScalarFunction areaExpr
Expression for cross section area.
ScalarFunction widthExpr
Expression for cross section width.
ScalarFunction thicknessExpr
Expression for cross section thickness.
ScalarFunction drillingStiffnessExpr
Expression for cross section beam drilling stiffness.
ScalarFunction ixExpr
Expression for cross section torsion moment $I_x$.
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
CrossSectionProperty
List of properties possibly stored in a cross section.
@ CS_ShearAreaY
Shear area in y direction.
@ CS_DrillingType
Type of artificially added drilling stiffness for drilling DOFs.
@ CS_InertiaMomentZ
Moment of inertia around z-axis.
@ CS_DirectorVectorY
Director vector component in y-axis.
@ CS_DrillingStiffness
Penalty stiffness for drilling DOFs.
@ CS_TorsionConstantX
Saint-Venant torsional constant (J).
@ CS_RelDrillingStiffness
Relative penalty stiffness for drilling DOFs.
@ CS_DirectorVectorX
Director vector component in x-axis.
@ CS_InertiaMomentY
Moment of inertia around y-axis.
@ CS_Area
Area.
@ CS_Thickness
Thickness.
@ CS_Width
Width.
@ CS_ShearAreaZ
Shear area in z direction.
@ CS_DirectorVectorZ
Director vector component in z-axis.
#define _IFT_SimpleCrossSection_iz
Inertia moment z.
#define _IFT_SimpleCrossSection_thick
#define _IFT_SimpleCrossSection_drillType
Type of artificially added stiffnes for drilling DOFs.
#define _IFT_SimpleCrossSection_directorx
#define _IFT_SimpleCrossSection_shearareaz
Shear area z direction.
#define _IFT_SimpleCrossSection_area
#define _IFT_SimpleCrossSection_relDrillStiffness
Relative penalty term for drilling stiffness.
#define _IFT_SimpleCrossSection_width
#define _IFT_SimpleCrossSection_iy
Inertia moment y.
#define _IFT_SimpleCrossSection_directorz
#define _IFT_SimpleCrossSection_MaterialNumber
Material number for the bulk material.
#define _IFT_SimpleCrossSection_ik
Saint-Venant torsional constant.
#define _IFT_SimpleCrossSection_directory
#define _IFT_SimpleCrossSection_drillStiffness
Penalty term for drilling stiffness.
#define _IFT_SimpleCrossSection_shearareay
Shear area y direction.

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