Skip to content

Commit d7aa2b3

Browse files
committed
cmp
1 parent 4bbe1df commit d7aa2b3

File tree

15 files changed

+73
-3829
lines changed

15 files changed

+73
-3829
lines changed

content/en/examples/Example1/Example1R.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Create a Model (with two-dimensions and 2 DOF/node)
2020
model = ops.Model(ndm=2, ndf=2)
2121

22-
# Create nodes - command: node nodeId xCrd yCrd
22+
# Create nodes
2323
model.node(1, ( 0.0, 0.0))
2424
model.node(2, (144.0, 0.0))
2525
model.node(3, (168.0, 0.0))
@@ -55,16 +55,14 @@
5555
# Start of analysis generation
5656
# ------------------------------
5757

58-
# create the constraint handler, a Plain handler is used as homo constraints
5958
model.constraints("Plain")
6059

61-
# create the solution algorithm, a Linear algorithm is created
60+
# create the solution algorithm
6261
model.algorithm("Linear")
6362

6463
# create the integration scheme, the LoadControl scheme using steps of 1.0
6564
model.integrator("LoadControl", 1.0)
6665

67-
# create the analysis object
6866
model.analysis("Static")
6967

7068

content/en/examples/Example3/archive/Example3.1.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
width = 360.0
3232
height = 144.0
3333

34-
# create nodes & add to Domain - command: node nodeId xCrd yCrd
34+
# Create nodes
3535
model.node(1, 0.0, 0.0)
3636
model.node(2, width, 0.0)
3737
model.node(3, 0.0, height)
3838
model.node(4, width, height)
3939

40-
# set the boundary conditions - command: fix nodeID uxRestrnt? uyRestrnt? rzRestrnt?
40+
# set the boundary conditions
4141
model.fix(1, 1, 1, 1)
4242
model.fix(2, 1, 1, 1)
4343

@@ -124,11 +124,6 @@
124124
# print model
125125
model.print("-JSON", "-file", "Example3.1.json")
126126

127-
# ------------------------------
128-
# End of model generation
129-
# ------------------------------
130-
131-
132127
# ------------------------------
133128
# Start of analysis generation
134129
# ------------------------------
@@ -152,13 +147,8 @@
152147
# create the integration scheme, the LoadControl scheme using steps of 0.1
153148
model.integrator("LoadControl", 0.1)
154149

155-
# create the analysis object
156150
model.analysis("Static")
157151

158-
# ------------------------------
159-
# End of analysis generation
160-
# ------------------------------
161-
162152

163153
# ------------------------------
164154
# Finally perform the analysis

content/en/examples/Example3/archive/Example3.3.py

Lines changed: 12 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,18 @@
3535
# Set a parameter for the axial load
3636
P = 180.0; # 10% of axial capacity of columns
3737

38-
# create a Linear TimeSeries (load factor varies linearly with time) - command: timeSeries Linear $tag
39-
model.timeSeries("Linear", 1)
40-
4138
# create a Plain load pattern - command: pattern Plain $tag $timeSeriesTag { $loads }
42-
model.pattern("Plain", 1, 1, "-fact", 1.0)
39+
model.pattern("Plain", 1, "Linear")
4340

4441
# create the nodal load - command: load nodeID xForce yForce zMoment
45-
model.load(3, 0.0, -P, 0.0)
46-
model.load(4, 0.0, -P, 0.0)
42+
model.load(3, (0.0, -P, 0.0), pattern=1)
43+
model.load(4, (0.0, -P, 0.0), pattern=1)
4744

48-
# ------------------------------
49-
# End of model generation
50-
# ------------------------------
5145

5246

53-
# ------------------------------
47+
#
5448
# Start of analysis generation
55-
# ------------------------------
49+
#
5650

5751
# create the system of equation
5852
model.system("BandGeneral")
@@ -73,13 +67,8 @@
7367
# create the integration scheme, the LoadControl scheme using steps of 0.1
7468
model.integrator("LoadControl", 0.1)
7569

76-
# create the analysis object
7770
model.analysis("Static")
7871

79-
# ------------------------------
80-
# End of analysis generation
81-
# ------------------------------
82-
8372

8473
# ------------------------------
8574
# Finally perform the analysis
@@ -91,11 +80,7 @@
9180
print("Gravity load analysis completed\n")
9281

9382
# Set the gravity loads to be constant & reset the time in the domain
94-
model.loadConst("-time", 0.0)
95-
96-
# ----------------------------------------------------
97-
# End of Model Generation & Initial Gravity Analysis
98-
# ----------------------------------------------------
83+
model.loadConst(time=0.0)
9984

10085

10186
# ----------------------------------------------------
@@ -105,9 +90,9 @@
10590
# Define nodal mass in terms of axial load on columns
10691
m = P/g
10792

108-
# tag MX MY RZ
109-
model.mass(3, m, m, 0.0)
110-
model.mass(4, m, m, 0.0)
93+
# tag MX MY RZ
94+
model.mass(3, (m, m, 0.0))
95+
model.mass(4, (m, m, 0.0))
11196

11297
# Define dynamic loads
11398
# --------------------
@@ -125,10 +110,6 @@
125110
# Set the rayleigh damping factors for nodes & elements
126111
model.rayleigh(0.0, 0.0, 0.0, 0.000625)
127112

128-
# ----------------------------------------------------
129-
# End of additional modeling for dynamic loads
130-
# ----------------------------------------------------
131-
132113

133114
# ---------------------------------------------------------
134115
# Start of modifications to analysis for transient analysis
@@ -137,17 +118,9 @@
137118
# delete the old analysis and all its component objects
138119
model.wipeAnalysis()
139120

140-
# create the system of equation, a banded general storage scheme
141121
model.system("BandGeneral")
142-
143-
# create the DOF numberer, the reverse Cuthill-McKee algorithm
144122
model.numberer("RCM")
145-
146-
# create the constraint handler, a plain handler as homogeneous boundary
147123
model.constraints("Plain")
148-
149-
# create the convergence test, the norm of the residual with a tolerance of
150-
# 1e-12 and a max number of iterations of 10
151124
model.test("NormDispIncr", 1.0e-12, 10)
152125

153126
# create the solution algorithm, a Newton-Raphson algorithm
@@ -156,32 +129,24 @@
156129
# create the integration scheme, the Newmark with gamma=0.5 and beta=0.25
157130
model.integrator("Newmark", 0.5, 0.25)
158131

159-
# create the analysis object
160132
model.analysis("Transient")
161133

162-
# ---------------------------------------------------------
163-
# End of modifications to analysis for transient analysis
164-
# ---------------------------------------------------------
165134

166135

167136
# ------------------------------
168137
# Start of recorder generation
169138
# ------------------------------
170139

171140
# Create a recorder to monitor nodal displacements
172-
model.recorder("Node", "-time", "-file", "disp.out", "-node", 3, 4, "-dof", 1, 2, 3, "disp")
173-
model.recorder("Node", "-time", "-file", "accel.out", "-node", 3, 4, "-dof", 1, 2, 3, "accel")
174-
model.recorder("Node", "-time", "-file", "totAccel.out", "-timeSeries", 2, 0, 0, "-node", 3, 4, "-dof", 1, 2, 3, "accel")
141+
model.recorder("Node", "disp", "-time", "-file", "disp.out", "-node", 3, 4, "-dof", 1, 2, 3)
142+
model.recorder("Node", "accel", "-time", "-file", "accel.out", "-node", 3, 4, "-dof", 1, 2, 3)
143+
model.recorder("Node", "accel", "-time", "-file", "totAccel.out", "-timeSeries", 2, 0, 0, "-node", 3, 4, "-dof", 1, 2, 3)
175144

176145
# Create recorders to monitor section forces and deformations
177146
# at the base of the left column
178147
model.recorder("Element", "-time", "-file", "ele1secForce.out", "-ele", 1, "section", 1, "force")
179148
model.recorder("Element", "-time", "-file", "ele1secDef.out", "-ele", 1, "section", 1, "deformation")
180149

181-
# --------------------------------
182-
# End of recorder generation
183-
# ---------------------------------
184-
185150

186151
# ------------------------------
187152
# Finally perform the analysis

content/en/examples/Example8/out/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)