Civil Engineering Reference
In-Depth Information
commented “pcg equation solution” carries out the vector operations described in equa-
tions (3.22) within the iterative loop labelled
pcg
. The matrix-vector multiply needed
in the first of (3.22) is done using (3.23). The node number vector
num
“gathers” the
appropriate components of
p
, to be multiplied by the element conductivity matrix
kc
retrieved from
storkc
. Similarly, the vector
num
“scatters” the result of the matrix-
vector multiply to appropriate locations in
u
. A tolerance
cg tol
enables the iterations to
be stopped when successive solutions are “close enough”, but since
pcg
is a loop which
might carry on “forever”, an iteration ceiling,
cg limit
, is specified also. The nodal net
flow rates are accumulated from element-by-element matrix-vector products in the loop
called
elements 3
.
The problem given in Figure 7.20 is solved once more using Program 7.5 with the
data given in Figure 7.22. The only additional data are
cg tol
and
cg limit
,the
pcg convergence tolerance, and iteration ceiling respectively. The output in Figure 7.23 is
essentially identical to that obtained previously using an assembly strategy in Figure 7.21,
apart from the additional comment indicating that the pcg algorithm took 18 iterations to
converge.
element nod nels nn nip ndim cg_tol cg_limit np_types
'hexahedron' 8 64 125 8 3 1.0e-7 200 2
prop(kx,ky,kz)
2.0 2.0 2.0
1.0 1.0 5.0
etype
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
g_coord
0.0 0.0 0.0 1.0 0.0 0.0 2.0 0.0 0.0 3.0 0.0 0.0
.
g_coord data for nodes 5-120 omitted here
.
0.0 4.0 -4.0 1.0 4.0 -4.0 2.0 4.0 -4.0 3.0 4.0 -4.0
4.0 4.0 -4.0
g_num
6 1 2 7 31 26 27 32 7 2 3 8 32 27 28 33
.
g_num data for elements 3-62 omitted here
.
98 93 94 99 123 118 119 124 99 94 95 100 124 119 120 125
loaded_nodes,(k,loads(k),i=1,loaded_nodes)
1
21 100.0
fixed_freedoms,(node(i),value(i),i=1,fixed_freedoms)
61
1 0.0 2 0.0 3 0.0 4 0.0 5 0.0 10 0.0 15 0.0 20 0.0
.
fixed freedom data for 48 nodes omitted here
.
121 0.0 122 0.0 123 0.0 124 0.0 125 0.0
Figure 7.22 Data for Program 7.5 example