Solver
Creates an instance of a Solver
method |
input |
returns |
description |
---|---|---|---|
__init__(…) |
constructor. |
||
addNode(newNode) |
Node(…) object |
add one Node() object to your list of elements (the model) |
|
addElement(newElem) |
Element(…) object |
add one Element() object to your list of elements (the model) |
|
solve() |
assemble \([K_t]\) and \(\{P\}\), solve for \(\{u\} = [K_t]^{-1}\{P\}\), loop through nodes and update nodal displacement, compute unbalanced force \(\{R\} = \{P\} - \{F\}\) |
||
plot(factor=1.0) |
collect node info and send it to the plotter. Request the plot. |
||
report() |
print a summary report: list of nodal position, load, displacement, unbalanced force. |
name |
type |
description |
---|---|---|
nodes |
List of Node() objects |
holds all the nodes in the model |
elements |
List of Element() objects |
holds all the elements in the model |
disp |
np.array([…]) |
system sized displacement vector |
loads |
np.array([…]) |
system sized load vector |
Equations
each element has node0 = elem.nodes[0] and node1 = elem.nodes[1]
node indices i = node0.index and j = node1.index
a local d.o.f. \(u\to k=0\) or \(v\to k=1\) of node \(i\) belongs at global index \(K = 4*i + k\)
a local d.o.f. \(u\to m=0\) or \(v\to m=1\) of node \(j\) belongs at global index \(M = 4*j + m\)
Assembly:
\({\bf F}\): element force from elem.getForce()
\({\bf K_t}\): element stiffness from elem.getStiffness()
\({\bf R}_{sys}\): system force
\({\bf K_t}_{sys}\): system stiffness
Loop over nodes: \({\bf R}_{sys}[K] = nodes[i].getLoad()[k]\) (this should return 0 if no load at this node and d.o.f.)
Loop over elements: \({\bf R}_{sys}[K] = {\bf R}_{sys}[K] - {\bf F}[i][k]\)
Loop over elements: \({\bf K_t}_{sys}[K,M] = {\bf K_t}_{sys}[K,M] + {\bf K_t}[i,j][k,m]\)
Loop over nodes: if a d.o.f. at K is fixed, set \({\bf R}_{sys}[K] = 0\) and \({\bf K_t}_{sys}[K,K] = 1.0e20\).
Solve system of equations: \({\bf U} = {\bf K_t}_{sys}^{-1}\,{\bf R}_{sys}\)
Loop over nodes: \(nodes[i].setDisp(u,v)\) using \(u = {\bf U}[2*i]\) and \(v = {\bf U}[2*i+1]\)
Recompute: \({\bf R}_{sys}\) as in steps 5 and 6 (do not repeat steps 7-11). If everything was done correctly, fixed d.o.f.s will contain the support reactions and free d.o.f.s should hold numeric zeros.