MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / apply_load_pattern

Function apply_load_pattern

EXAMPLES/SolverBenchmark/benchmark_python_sparse.py:136–149  ·  view source on GitHub ↗

Apply a vertical load to all nodes on the free face.

(total_load: float)

Source from the content-addressed store, hash-verified

134
135
136def apply_load_pattern(total_load: float) -> None:
137 """Apply a vertical load to all nodes on the free face."""
138 tStart, tEnd, period = 0.0, 6.0, 4.0
139 ops.timeSeries('Trig', 1, tStart, tEnd, period, '-factor', 1.0)
140 ops.pattern("Plain", 1, 1)
141 far_x_nodes = [
142 node for node in ops.getNodeTags()
143 if math.isclose(ops.nodeCoord(node, 1), BAR_LENGTH, abs_tol=1e-9)
144 ]
145 if not far_x_nodes:
146 raise ValueError("No nodes found on the far face (x = BAR_LENGTH)")
147 load_per_node = total_load / len(far_x_nodes)
148 for node in far_x_nodes:
149 ops.load(node, 0.0, 0.0, -load_per_node)
150
151
152# -----------------------------------------------------------------------------

Callers 1

run_benchmarkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected