CivilFEM Python Manual
CivilFEM Python Manual
Table of Contents
Python Manual ........................................................................................................................... 1
Table of Contents ....................................................................................................................... 2
Chapter 1 .................................................................................................................................... 5
1.1.
1.2.
1.1.2.
1.1.3.
1.2.2.
1.2.3.
1.2.4.
1.2.5.
1.2.6.
1.2.7.
1.2.8.
Parameters .......................................................................................... 13
1.2.9.
Containers ........................................................................................... 13
Chapter 2 .................................................................................................................................. 15
2.1.
Files ....................................................................................................................... 16
2.2.
2.3.
2.3.2.
2.3.3.
2.4.
Materials............................................................................................................... 20
2.5.
2.6.
2.7.
2.8.
2.9.
2.10.
2.5.1.
2.5.2.
Mesh ...................................................................................................................... 25
2.6.1.
2.6.2.
2.6.3.
Loading ................................................................................................................. 28
2.7.1.
Loads .................................................................................................. 28
2.7.2.
Solve ...................................................................................................................... 30
2.8.1.
2.8.2.
Solve ................................................................................................... 30
CivilFEM results.................................................................................................. 31
2.9.1.
2.9.2.
Envelope ............................................................................................. 32
2.9.3.
2.9.4.
Grid ..................................................................................................... 34
2.10.2.
Camera ................................................................................................ 34
3
Chapter 3 .................................................................................................................................. 36
3.1.
3.1.1.
Chapter 1
General Aspect
float
A floating point number similar to double data type in C and the real*8 data type
in FORTRAN.
integer
An integer or fixed point number similar to the long int data type in C and the
integer*8 data type in FORTRAN.
A Python list is essentially a linked list that can be accessed like an array using
the square bracket operators [ ]. The list can be composed of strings, floats, or
integers to name a few.
Coordinates of the points are written in brackets and vectors in square brackets.
To create loops using for, if, while, lines of Python code that define the function
must be indented at least one space. To end the function definition, the code is
unindented.
Python have some reserved words: and, assert, break, class, continue,
def,
del,
elif,
else,
except,
exec,
finally,
for,
from,
global, if, import, in, is, lambda, not, or, pass, print,
raise, return, try, while, yield.
To avoid escape characters, such as /n that means newline o /s which means space, is
necessary to type "r" or R before the path, as follows:
execfile(r"C:\CivilFEM\Paths\new_example.py")
*
*
*
*
*
0
1
2
3
4
=
=
=
=
=
0
1
4
9
16
Is able to run scripts already created with the command execfile, only by giving the
path of the file:
execfile(r"C:\CivilFem\script\example.py")
Vector
Double
Point(0,5,2,"m")
Vector(1,0,0)
Is a larger float type that holds both bigger and more precise numbers. Are
used to changed units.
For example:
Formula
Double(15,"mm")
WARNING! These basic types are considered reserved words, by using is made a redefine and
causes errors.
Image 1: location of the activation tabs of Command Line and Script Editor
The Script Editor has its own menu, where the script can be saved; an existing script can be
opened, or the script can be run and stop.
In addition to these shortcuts, the Script Editor also has autocomplete function. This is enabled by
pressing ctr+space when you start writing in the script editor.
As a complement to autocompletion of the script editor, there is .help function, with which the
output attributes of each class are shown. For example, to show boundary conditions attributes,
execute BCGroupsContainer.Find("BC").BCs[0].help() in the script editor o in the
command line. In the Output window will be printed the attributes like this:
Image 3: BC attributes
The most characteristic feature in the command line is capability of executing only selected lines
of scripts. With the command run you can execute certain lines of code, only is need to type
run and the number of the lines in quotes. Something important to keep in mind is that you
should always write the starting line and the end one, so if for example, you want to run only line
5 would be type as follows:
> run "5" "5"
10
Keep in mind that the macro recording is performed in the document units and configuration.
11
All available Python libraries and its uses can be found at the following link. In addition CivilFEM
has the Numpy and MatPlotLib libraries already installed and ready to use.
All code is executed in CivilFEM under the "cf" module. This should be taken into account when
using user-defined functions. For example:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig = plt.figure()
ax = fig.add_subplot(111)
x = np.arange(0,2 * np.pi,0.01)
line1, = ax.plot(x,np.sin(x),'o')
def animate(i):
import cf
import numpy as np
cf.line1.set_ydata(np.sin(cf.x+i/10.0))
return cf.line1,
def init():
import cf
import numpy as np
cf.line1.set_ydata(np.ma.array(cf.x, mask=True))
return cf.line1,
ani =
animation.FuncAnimation(fig,animate,np.arange(1,200),init_func=init,inter
val=25,blit=True)
plt.show()
The variables fig, ax, x, line1 and ani, as well as imports, are defined in the "cf" module.
To use these global variables inside a function definition you must include what you need to use.
12
Default folder:
C:\Program Files\CivilFEM\2014 Beta Revision 1\manual\CivilFEM Script Manual.html
It should also be in mind that each command has the same model restrictions as the interface
model, being unable, for example, to execute 2-dimensions commands in three-dimensional
models, or transient commands in harmonic models.
1.2.8. Parameters
CivilFEM has its own parameters, which are also available through Python code. To create, modify
and delete a parameter, proceed as follows:
createParam("Param","VECTOR2D","Global Cartesian","[9, 0]","m")
modifyParam("Param", "Global Cartesian","[5, 1]", "mm")
deleteParam("P")
1.2.9. Containers
All entities properties are accessible through their containers. In CivilFEM there are the following
containers:
CoordSystemsContainer
GeometryContainer
MaterialsContainer
SectionsContainer
StructualElementsContainer
13
ModelUtilsContainer
ContactsContainer
LoadGroupsContainer
BCGroupsContainer
LoadCasesContainer
To change a property of a specified entity you have to use the"Find" method and then access that
property. For example to change the mesh size of a structural element, it would be done as
follows:
#.Find("Name of the Structural Element")
s = StructuralElementsContainer.Find("Structural element")
s.MeshTool2D.ParameterMesh.SizeEdges = Double(0.12)
If you want to change one or more properties of multiple entities at the same time, you can
iterate the container. For example, if we have created several points and lines, and we want to
change the name of the points without changing lines, the code would be as follows:
i = 0
for geom in GeometryContainer:
if geom.GeomType == "VertexByCoord":
geom.GeomName="RenamePoint" + str(i+1)
i = i + 1
Pay special attention to the possibility of creating an infinite loop, do not use copy commands in
the iterator. If you have in the iterator a CivilFEM command, you can stop the execution with the
stop running script bottom.
Comparisons in the containers can be made by ==. To change the name of several point with x
coordinate 2, proceed as follows:
i = 0
for g in GeometryContainer:
if (g.GeomType == "VertexByCoord") and (geom.Pnt.x() == 2):
g.GeomName="renamePoint" + str(i+1)
i = i+1
Chapter 2
Basic Concepts
15
2.1.
Files
Python code in CivilFEM allows running several commands that affect documents, these are:
newDocument: create a new document from Dimension, Time and Discipline. For example to
create a 2D, Static, Structural model:
newDocument("Dim2D","Static","Structural")
If you already have an existing file named this way in the same directory, CivilFEM by default will
ask if you want to overwrite the file. If you want to overwrite it and avoid the stop of script
running, proceed as follows:
saveDocumentAs(".\new example.cf", True)
16
2.2.
Environment Commands
As already mentioned in section 1.2.1., CivilFEM has default properties, some of them in the
Environment of the model. These can be modified through both, the interface and the Python code.
Below you can see some examples of the changes therein:
Units System: CivilFEM has de International System ("IS") as default and it can be changed to
Imperial Units ("BFeet" or "BInch"), or a User ("User") one.
ConfigUnits.System = "BInch"
The User System allows modify one by one the different units listed through enumerates placed
in the Script Manual.
Coordinate System: in this case, the default coordinate system is Global Cartesian and changes
are linked to the dimensions of the model, i.e., 2D or 3D. You can also create several coordinate
systems and activate just the one you need in the moment you need it. For example here is the
code to create a Cartesian 3D coordinate system, and how to set it as active:
#Name,Origin,XVector,ZVector,Active
createCartesianCoordSys("C",(0,0,0),[1,0,0],[0,0,1],True)
If you have several coordinate systems create, you can activate it giving the name of the system
as follows:
activeCoordSystem("NameCoordSys")
Codes & Standards: CivilFEM has a catalogue of Codes & Standards for Reinforced Concrete and
Structural Steel. The default code in Reinforced Concrete is Eurocode 2 (EN 1992-1-1:2004/AC:
2008) and in Structural Steel is Eurocode 3 (EN 1993-1-1:2005). Each code has its own command,
to change it, set the command (changeConcreteCode, changeSteelCode) and the code
enumerate as argument (place in the Script Manual).
For example to change the Structural Steel code to the British Standard 8110:
changeSteelCode("BS8110")
17
You can also create groups of points or lines in a few lines of code using loops. This example
shows how to create 50 points and 49 lines in reference to these points:
Dim = 50
Point = []
Line = []
for i in range(Dim):
Point.append("Point" + str(i+1))
createPoint(Point[i],[i+10,0,i+15])
for j in range(Dim-1):
Line.append("Line" + str(j+1))
createLine(Line[j],Point[j],Point[j+1])
18
To create a quadrilateral surface, is needed 4 points, giving its coordinates or reference points
already created ("P1","P2","P3","P4"):
createQuad("Quad",(0,0,0),(1,0,0),(1,1,0),(0,1,0))
createQuad("Quad","P1","P2","P3","P4")
CivilFEM has certain primitive volumes, such as cones, spheres and boxes. For example the cone
needs a central point of the cone base, axis, radius of the lower base, upper radius, height and
angle to truncate, shown as follows:
createCone("Cone",(0,0,0),[0,0,1],1,0,1,360)
You can also change arguments units on code with the basic type Double:
createCone("Cone",(0,0,0),[0,0,1],Double(1,"m"),0,Double(1,"m"),Double(360,"Deg"))
Export selected: Exports the selected geometry to an external file in igs, iges, stp, step, x_t or
dxf extensions, giving the entities and the path.
exportSelect([geom1,geom2,geom3],".\geometry.igs")
Export all: Exports all geometry to an external file in igs, iges, stp, step, x_t or dxf extensions,
giving the path.
exportAll(".\export_geometry.igs")
19
2.4. Materials
CivilFEM has a materials library, which can be selected through the material. Materials properties
(listed in the Script Manual) can also be changed; these are organized through containers.
To change structural steel properties, for example, name, Poisson ratio or thicknesses
proceed as follows:
MaterialsContainer.Find("Fe360").Name = "SteelMat"
MaterialsContainer.Find("SteelMat").Poisson = 0.5
MaterialsContainer.Find("SteelMat").Thicknesses[1] = Double(0.15,"m")
Concrete: this material is divided in three different ways: concrete, reinforcement steel and
prestressing steel. To create a concrete material is necessary de code and the name.
createConcreteMat("Eurocode 2","C12/15")
createReinfMat("Eurocode 2","S400")
createPrestMat("Eurocode EN 10138","Y1570C")
20
To change concrete properties, for example, Poisson ratio, cracking or damping coefficients
proceed as follows:
m = MaterialsContainer.Find("C12/15")
m.Poisson = 0.3
m.CrackingProperties.CrackingYN = True
m.DampingProperties.AutocalculateRayleigh = False
m.DampingProperties.AlphaRayleigh = Double(1,"Sec_Inv")
Rock: to create rock material is needed to set Rock Type, Rock Subtype, Rock Class and
Name, all possible arguments are listed in Script Manual.
createRockMat("Sedimentary","Siliceous","Aggregated","Flint")
To change rock properties, for example, Poisson ratio, cracking or damping coefficients
proceed as follows:
m = MaterialsContainer.Find("Flint")
m.ElastMod = Double(25000,"Pa")
m.Poisson = 0.2
Soil: CivilFEM provides a list of possible soil materials, all included in the Script Manual.
createSoilMat("Peat low plasticity")
To change soil properties, for example, Poisson ratio, cracking or damping coefficients
proceed as follows:
m = MaterialsContainer.Find("Peat low plasticity")
m.ElastMod = Double(200000,"Pa")
m.Poisson = 0.35
21
Generic: if you prefer to create an own material, use the generic material, in this command is
needed the Elastic modulus, Poisson ratio, Density and the linear thermal expansion
coefficient.
# Name,ElastMod,Poisson,Density,ThExpans
createGenericMat("GenMat", 2500, 0.3, 1200, 0)
To change generic material properties, for example, Shear modulus or damping, proceed as
follows:
m = MaterialsContainer.Find("GenMat")
m.ShearModulus = Double(52000,"Pa")
m.DampingProperties.AutocalculateRayleigh = False
m.DampingProperties.AlphaRayleigh = Double(5,"Sec_Inv")
22
Cable Sections: for cable sections the arguments are name, material and outer diameter.
createCableSection("Cable", "Structural steel", Double(1,"m"))
Generic Sections: Besides the default sections CivilFEM has generic sections, whose
arguments are name, material, area, inertia about element Y axis, inertia about element Z
axis and torsion constant.
createGenericSection("Generic", "GenericMat", 2, 1300, 1300,4)
Steel from library: CivilFEM has an own library sections for steel; all items are included in
Script Manual. The arguments for this command are: material, shape, code or standard and
name.
createSteelLibrarySection("Steel","Channel","Europn UAP","UAP 80")
Steel by plates: this section is defined by adding plates, giving thickness and one point (X,Z).
For the first plate, two points are given in Python.
createSteelByPlatesSection("Steel generic", "structural steel")
sec = SectionsContainer.Find("Steel generic")
addPlate([sec],Double(0.5,"m"), (0,1),(0,5))
addPlate([sec],Double(0.5,"m"), (5,10))
23
Steel by dimensions: There are some default sections for steel similar to concrete sections;
I, L, T, Channel, Pipe and Box, each one has an own command and different arguments. For
example, in I section the arguments are: Name, Material, Height, Width, Web thickness,
Flage thickness and Weld throat.
createSteelDimISection("Steel I","Steel",1, 1.5, 1, 0.5, 1)
If a snapshot is already created with the same name, the program will ask you if you want to
overwrite the file, to avoid the pop-up is as easy as put a third boolean argument, if you want to
overwrite set True, and set False if you want to save the file with another name.
sectionSnapshot([section], r"section_Snapshot.bmp",True)
24
2.6. Mesh
2.6.1. Structural Elements
In order to create structural elements required for the creation of some previous items; geometry
and section are required, for which previously is necessary to create a material. For example to
create a Beam the arguments needed are, Name of the Structural Element, Cross Section I, Cross
Section J and the Geometry:
createSEBeam("BEAM","IPE 80","IPE 80","Curve")
You can also modify the properties of the Structural Element once created, such as mesh
parameters.
s = StructuralElementsContainer.Find("BEAM")
s.MeshTool1D.OptionMeshType = "MaxLength"
st.MeshTool1D.ParameterMesh.Length = Double(0.5,"m")
To create a Shell the arguments needed are: Name of the Structural Element, Material, Thickness
and Geometry:
createSEShell("SHELL","C30/37",Double(0.05,"m"),"Surface")
Structural Elements can be meshed one by one with the contextual command:
meshSESelected([SE1,SE2,])
25
Contacts only need a name and the contacted and contacting Structural Element to be defined:
#Name, Contacted, Contacting
createContact("Contact pair","Beam SE","ShellSE")
26
CivilFEM also has commands to obtain information of the mesh once is done. These are:
getSEElements("SE")
getElementNodes(10)
getNodeCoords(10)
27
2.7. Loading
2.7.1. Loads
Python code in CivilFEM allows creating load groups and boundary conditions, as well as spectral
analysis and acceleration loads.
Load Groups: the first step is to create a Load Group, then you can add point loads, point
moments, linear loads, surface loads or temperature. For example to create a point load and
a point moment, proceed as follows:
LG = createLoadGroup("Load Group")
# Entity, Name, Structural element, Point, Direction, Load
addPointLoad([LG],"Punct","SE",(0,0,0),[1,0,0],Double(50,"Newton"))
# Entity, Name, Structural element, Point, Direction, Load
addPointMoment([LG],"Moment","SE",(0,0,0),[1,0,0],Double(50,"NxM"))
Harmonic loads can be also created with the same command, only by writing one more
argument:
createLoadGroup("loads","HarmonicLoads")
createLoadGroup("loads","PrestressingLoads")
Spectral Analysis: spectral analysis can be created by two standards, Eurocode 8 EN 19981:2004 and the NCSE 2002. Having each one its own command and arguments:
createSpectrumEC8("Name","Design2","A", 10, 1, 1, 0.2)
createSpectrumNCSE02("Name","Normal","Elastic", 10, 1, 1)
28
Boundary Conditions Group: the first step is creating a Boundary Conditions Group, then you
can add point, linear, surface or displacement boundary conditions. For example to create a
linear boundary condition, proceed as follows:
BC = createBCGroup("Boundary conditions group")
#Entity, Name, Structural Element, Constrain X,Y,Z movement,
Constrain X,Y,Z Rotation
addCurveBC([BC],"BC Curve","SE",True,True,False,False,False,True)
29
2.8. Solve
2.8.1. Solver Configuration & Solver Output
Python code allowed changing the solver configuration by ConfigSolver command as shown
below:
ConfigSolver.LargeDeflections = True
ConfigSolver.ConvergenceDisp = True
ConfigSolver.FrictionForceTolerance = Double(0.02,"Newton")
2.8.2. Solve
As seen in mesh commands Python code can execute de solver and stop it:
solve()
stopSolve()
30
Once the results want to be shown are set, you can list and plot them as follows:
listResults()
plotResults()
You can also get specific data from a node or a particular element, stored in memory for a later
export or to be displayed in the Output Window by the Python command "print".
First get the data from the results file:
res = getResults("ExampleResults.rcf")
31
Element Results: Get the X component of stress in the element 1, extreme 1 and first integer
point.
iElement = Double(0.0)
res.getElementResult(iElement, "Sx", 1, 1, 1)
print(str(iElement.getValue()))
End Results: Get the direct membrane force per width unit in local X-direction in the element
1 and extreme 1
iEnd = Double(0.0)
res.getEndResult(iEnd, "SF1", 1, 1)
print(str(iEnd.getValue()))
Checking results are given by end results, so if you want to get them only is needed to use
checking enumerate results in end results commands.
2.9.2. Envelope
To create an envelope of CivilFEM results it is not necessary to open a results file, it must be set
only if the expected results are maximum or minimum, the name of the envelope and its file path
and the results file paths as follows:
envelope("Max","Max","Max","Max","Max","Max","Max","Max","Envelope","enve
lope.rcf",["Load case.rcf","Load case2.rcf","Load case3.rcf"])
To design in axial bending a concrete beam, open results file and proceed as follows:
32
#SHELLS
#Element, End, concrete stress, steel stress, dirkey
shellInteractionDiagram(1,1,Double(0),Double(0),"X")
interactionDiagramSnapshot(r".\DiagramShell.bmp")
33
2.10.2. Camera
With the camera is possible to make zoom, select different ways of viewing the model and even
to take a snapshot of the model using the following commands:
makeZoom: This command allow change zoom and fit the model to the view window by
using different arguments:
makeZoom("ZoomIn")
makeZoom("ZoomOut")
makeZoom("Fit")
changeView: This command makes possible to change the view of the model according to
34
snapShot: Capture a snapshot of the graphical view and store it in a file giving the path
rotateCamera: With this command you can rotate your model in X, Y or Z direction in an
angle, only by giving the three coordinates. You can also set the unit type of the angles
("Deg" or "Rad") if you want, by default takes document units.
rotateCamera(Vector(0,3.1415,0,"Rad"))
rotateCamera((0,180,0))
35
Chapter 3
Examples
36
3.1.
Example 1: Warehouse
3.1.1.
Problem description
Perform a linear static analysis to obtain the results that self-weight and snow load cause on the
warehouse below.
The structure is composed of different profiles (which are described later) for
columns, belts, diagonals and beams. Plates will be modelled with shells.
Apply a wind load (global +X) to columns (1000 lbf/in) and snow load over steel
plates (0.1 psi).
Define two load cases to analyze the structure due to effect of gravity, snow load and
wind load according to following combinations:
1.20 x Self Weight + 1.20 x Snow Load
1.35 x Self Weight + 0.55 x Wind Load
37
Note that a new coordinate system CS1 is created. Coordinates of points P01 to P22 are oriented
according to global Cartesian System. Coordinates of points P23 to P27 are oriented according to
CS1.
38
Suggested Steps:
1. Create a new model.
2. Set units.
3. Create the geometry points.
4. Create the geometry lines.
5. Create the geometry surfaces.
6. Create the material.
7. Cross sections
8. Create the structural elements.
9. Create the mesh.
10. Apply loads.
11. Create the boundary conditions.
12. Create all load cases.
13. Analyze the model.
14. Post process results
39
3.1.1.
Python Code
# Save model
saveDocumentAs(r"C:\CivilFEM\EM_EX06.cf")
# Def. Columns
COL = []
for i in range(9):
COL.append("COLUMN" + str(i+1))
line(COL[0],"P1","P22")
40
line(COL[1],"P4","P16")
line(COL[2],"P12","P17")
line(COL[3],"P7","P18")
line(COL[4],"P24","P26")
line(COL[5],"P23","P25")
line(COL[6],"P19","P9")
line(COL[7],"P10","P20")
line(COL[8],"P15","P21")
# Def. Beams
BM = []
for i in range(14):
BM.append("BEAM" + str(i+1))
b1 = line(BM[0],"P1","P4")
b2 = line(BM[1],"P4","P12")
b11 = line(BM[2],"P2","P3")
b12 = line(BM[3],"P3","P11")
b21 = line(BM[4],"P5","P6")
b22 = line(BM[5],"P6","P13")
b31 = line(BM[6],"P7","P8")
b32 = line(BM[7],"P8","P14")
b41 = line(BM[8],"P9","P10")
b42 = line(BM[9],"P10","P15")
b51 = line(BM[10],"P7","P24")
b52 = line(BM[11],"P24","P23")
b53 = line(BM[12],"P23","P9")
b54 = line(BM[13],"P9","P7")
# Def. Belts
BT = []
for i in range(11):
BT.append("BELT" + str(i+1))
bt1 = line(BT[0],"P1","P2")
bt2 = line(BT[1],"P2","P5")
bt3 = line(BT[2],"P5","P7")
bt11 = line(BT[3],"P4","P3")
bt12 = line(BT[4],"P3","P6")
bt13 = line(BT[5],"P6","P8")
bt14 = line(BT[6],"P8","P10")
bt21 = line(BT[7],"P12","P11")
bt22 = line(BT[8],"P11","P13")
bt23 = line(BT[9],"P13","P14")
bt24 = line(BT[10],"P14","P15")
# Def. Diag.
DIAG = []
for i in range(4):
DIAG.append("DIAG" + str(i+1))
d1 = line(DIAG[0],"P7","P27")
41
d2 = line(DIAG[1],"P24","P27")
d3 = line(DIAG[2],"P23","P27")
d4 = line(DIAG[3],"P9","P27")
# Def. Polyline surface
PT = []
for i in range(12):
PT.append("PLATE" + str(i+1))
fillFace(PT[0],[bt1,b1,bt11,b11])
fillFace(PT[1],[bt2,b21,bt12,b11])
fillFace(PT[2],[bt3,b21,bt13,b31])
fillFace(PT[3],[b54,b41,bt14,b31])
fillFace(PT[4],[bt21,b2,bt11,b12])
fillFace(PT[5],[bt22,b22,bt12,b12])
fillFace(PT[6],[bt23,b22,bt13,b32])
fillFace(PT[7],[bt24,b42,bt14,b32])
fillFace(PT[8],[d1,b54,d4])
fillFace(PT[9],[d3,b53,d4])
fillFace(PT[10],[d3,b52,d2])
fillFace(PT[11],[d1,b51,d2])
# Def. Structure
createSteelMat("ASTM","A529 grade 42")
Ht1=12.12
Wth1=12.0
WT1=0.39
FT1=0.605
WdT1=1e-05
createSteelDimISection("Steel I COL","A529 grade 42",Ht1,Wth1,WT1,FT1,WdT1)
Ht2=16.97
Wth2=10.425
WT2=0.585
FT2=0.985
WdT2=1e-05
createSteelDimISection("Steel I BELT","A529 grade 42",Ht2,Wth2,WT2,FT2,WdT2)
Ht3=8.06
Wth3=6.535
WT3=0.285
FT3=0.465
WdT3=1e-05
createSteelDimISection("Steel I BEAM","A529 grade 42",Ht3,Wth3,WT3,FT3,WdT3)
HtB=6.0
WthB=6.0
WTB=0.25
FTB=0.25
WdTB=0.25
createSteelDimBoxSection("Steel Box Diagonal","A529 grade 42",HtB,
WthB,WTB,FTB,WdTB)
42
#Structural Elements
for i in range(12):
createSEShell(PT[i],"A529 grade 42",Double(0.5, "Inch"),PT[i])
SE1 = StructuralElementsContainer.Find(PT[i]).MeshTool2D.ParameterMesh
SE1.EType = "QUAD"
SE1.SizeEdges = Double(35,"Inch")
SE1.Tol = Double(0.01,"Inch")
for i in range(9):
createSEBeam(COL[i],"Steel I COL","Steel I COL",COL[i])
StructuralElementsContainer.Find(COL[i]).MeshTool1D.ParameterMesh.NumberOfSegments= 3
for i in range(14):
createSEBeam(BM[i],"Steel I BEAM","Steel I BEAM",BM[i])
SE3 = StructuralElementsContainer.Find(BM[i]).MeshTool1D
SE3.OptionMeshType = "MaxLength"
SE3.ParameterMesh.Length = Double(35, "Inch")
for i in range(11):
createSEBeam(BT[i],"Steel I BELT","Steel I BELT",BT[i])
SE4 = StructuralElementsContainer.Find(BT[i]).MeshTool1D
SE4.OptionMeshType = "MaxLength"
SE4.ParameterMesh.Length = Double(35, "Inch")
for i in range(4):
createSEBeam(DIAG[i],"Steel Box Diagonal","Steel Box Diagonal",DIAG[i])
SE5 = StructuralElementsContainer.Find(DIAG[i]).MeshTool1D
SE5.OptionMeshType = "MaxLength"
SE5.ParameterMesh.Length = Double(35, "Inch")
# Mesh
mesh()
# Load Groups
lg1 = createLoadGroup("Snow Load")
Load_on = []
for i in range(12):
Load_on.append("Load_on" + str(i+1))
for i in range(12):
addSurfaceLoad([lg1],Load_on[i],PT[i],[0,0,-1],Double(0.1, "Psi"))
lg2 = createLoadGroup("Wind load+X")
addCurveLoad([lg2],"Load 1","COLUMN1",[1,0,0],Double(1000, "Pli"))
addCurveLoad([lg2],"Load 2","COLUMN2",[1,0,0],Double(1000, "Pli"))
addCurveLoad([lg2],"Load 3","COLUMN3",[1,0,0],Double(1000, "Pli"))
43
# Boundary Conditions
bc = createBCGroup("Fixed")
BC = ["BC 1","BC 2","BC 3","BC 4","BC 5","BC 6","BC 7","BC 8","BC 9"]
for i in range(9):
addPointBC([bc],BC[i],COL[i],[0,0,0],True,True,True,True,True,True)
# Load Cases
lc1 = createLoadCase("Comb1")
addLoadGroupToLoadCase([lc1],lg1,1.2)
addLoadGroupToLoadCase([lc1],"Gravity",1.2)
addBCGroupToLoadCase([lc1],bc)
lc2 = createLoadCase("Comb2")
addLoadGroupToLoadCase([lc2],lg2,0.55)
addLoadGroupToLoadCase([lc2],"Gravity",1.35)
addBCGroupToLoadCase([lc2],bc)
# Solve
solve()
openResultsFile("Comb1.rcf")
makeZoom("Fit")
# x-component of stress
setResult("ElementResults","Sx")
setResultsViewStyle("Deformed")
plotResults()
44
# Z-component of displacement
setResult("NodeResults","UTz")
plotResults()
45
46
#Axial Force
setResult("EndResults","SF1","Beam","Kip")
plotResults()
47