Skip to content
Snippets Groups Projects
Commit 596e4f40 authored by Porrmann, Maik's avatar Porrmann, Maik
Browse files

working implementation of directional argyris

parent 99fc0cc1
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@ def writeBCRS(mat, path="argyrisTransformationMethods.txt"):
f.write("mat_.addindex("+str(row)+","+str(element[1])+");\n")
f.write("mat_.endindices();\n\n")
replacementDict = {"theta": (3, 3), "jacobian": (2, 2), "b_1": (
replacementDict = {"theta_0": (3, 3), "theta_1": (3, 3), "theta_2": (3, 3), "J_0": (2, 2),"J_1": (2, 2), "J_2": (2, 2),"thetaDir_0": (3, 3), "thetaDir_1": (3, 3), "thetaDir_2": (3, 3), "dir_0": (2, 2),"dir_1": (2, 2), "dir_2": (2, 2), "b_1": (
2, 2), "b_2": (2, 2), "b_0": (2, 2), 't': (3, 2), 'tau': (3, 3)}
for element in mat.RL:
code = ccode(element[2], "mat_["+str(element[0]) +
......@@ -34,13 +34,30 @@ def writeBCRS(mat, path="argyrisTransformationMethods.txt"):
E = SparseMatrix(21, 24, {(0, 0): eye(19), (19, 20): 1, (20, 22): 1})
pprint(E)
JInv = Matrix(MatrixSymbol('jacobian', 2, 2))
Theta = Matrix(MatrixSymbol('theta', 3, 3))
J_0 = Matrix(MatrixSymbol('J_0', 2, 2))
J_1 = Matrix(MatrixSymbol('J_1', 2, 2))
J_2 = Matrix(MatrixSymbol('J_2', 2, 2))
Dir_0 = Matrix(MatrixSymbol('dir_0',2,2))
Dir_1 = Matrix(MatrixSymbol('dir_1',2,2))
Dir_2 = Matrix(MatrixSymbol('dir_2',2,2))
ThetaDir_0 = Matrix(MatrixSymbol('thetaDir_0',3,3))
ThetaDir_1 = Matrix(MatrixSymbol('thetaDir_1',3,3))
ThetaDir_2 = Matrix(MatrixSymbol('thetaDir_2',3,3))
Theta_0 = Matrix(MatrixSymbol('theta_0', 3, 3))
Theta_1 = Matrix(MatrixSymbol('theta_1', 3, 3))
Theta_2 = Matrix(MatrixSymbol('theta_2', 3, 3))
B1 = Matrix(MatrixSymbol('b_0', 2, 2))
B2 = Matrix(MatrixSymbol('b_1', 2, 2))
B3 = Matrix(MatrixSymbol('b_2', 2, 2))
VC = SparseMatrix(24, 24, {(0, 0): 1, (1, 1): JInv, (3, 3): Theta, (6, 6): 1, (7, 7): JInv, (
9, 9): Theta, (12, 12): 1, (13, 13): JInv, (15, 15): Theta, (18, 18): B1, (20, 20): B2, (22, 22): B3})
Dir = SparseMatrix(21, 21, {(0, 0): 1, (1, 1): Dir_0.T, (3, 3): ThetaDir_0, (6, 6): 1, (7, 7): Dir_1.T, (
9, 9): ThetaDir_1, (12, 12): 1, (13, 13): Dir_2.T, (15, 15): ThetaDir_2, (18, 18): eye(3)})
VC = SparseMatrix(24, 24, {(0, 0): 1, (1, 1): J_0.T, (3, 3): Theta_0, (6, 6): 1, (7, 7): J_1.T, (
9, 9): Theta_1, (12, 12): 1, (13, 13): J_2.T, (15, 15): Theta_2, (18, 18): B1, (20, 20): B2, (22, 22): B3})
pprint(VC)
l = Matrix(MatrixSymbol('l', 3, 1))
......@@ -59,10 +76,11 @@ for i in range(3):
D[19+2*i, shift[i][1]+1] = -7/16 * t[i, :]
D[19+2*i, shift[i][1]+3] = l[i]/32 * tau[i, :]
pprint(D)
pprint(Dir)
# V = E*VC*D
OrientationMatrix = SparseMatrix(21,21,{(0,0):eye(18),(18,18):orientation[0],(19,19):orientation[1],(20,20):orientation[2]})
pprint(OrientationMatrix)
V = OrientationMatrix*D.T*VC*E.T
V = OrientationMatrix*Dir*D.T*VC*E.T
pprint(V)
print(V.nnz())
# pprint(V.RL)
......@@ -71,5 +89,5 @@ print(V.nnz())
print("==============================================================")
print("start writing file")
writeBCRS(V)
with open("argyrisMatrix.tex", 'w') as f:
f.write(latex(V))
#with open("argyrisMatrix.tex", 'w') as f:
#f.write(latex(V))
This diff is collapsed.
......@@ -34,8 +34,8 @@ int main(int argc, char *argv[])
auto gridFactory = GridFactory<Grid>();
gridFactory.insertVertex({0., 0.});
gridFactory.insertVertex({1., 0.});
gridFactory.insertVertex({1., 1.});
gridFactory.insertVertex({0., 1.});
gridFactory.insertVertex({1.2, 1.});
gridFactory.insertVertex({0.2, 1.});
gridFactory.insertElement(GeometryTypes::simplex(2), {0, 1, 2});
gridFactory.insertElement(GeometryTypes::simplex(2), {0, 2, 3});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment