Modifying stiffness matrix and rhs vector to allow for fixed displacements - Code Answer Flashcards
1
Q
What does the ‘for iv = 1 : nvfix;’ loop consist of?
A
for id = 1 : ndofn;
if ifpre(iv, id) ≅ 0;
ig = (nofix (iv) - 1) * ndofn + id;
for i = 1 : ntotv;
rhsmod(i) = rhsmod(i) - presc(iv, id) * gstif(i, ig);
gstifmod(ig, i) = 0.0; gstifmod(i, ig) = 0.0;
end
gstifmod(ig, ig) = gstif(ig, ig);
end
end
2
Q
What is the for loop following the previous question?
A
for iv = 1 : nvfix; for id = 1 : ndofn; if ifpre(iv, id) ≅ 0; ig = (nofix (iv) - 1) * ndofn + id; rhsmod(ig) = presc(iv, id) * gstif(ig, ig); end end end