diff --git a/.gitignore b/.gitignore index 4e56def..501cb56 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,6 @@ docs/source/examples/.ipynb_checkpoints/ *.log *.log .pdm-python +test_examples_output.log +*.log +test_examples.log diff --git a/.pdm.toml b/.pdm.toml deleted file mode 100644 index 855e3b5..0000000 --- a/.pdm.toml +++ /dev/null @@ -1,2 +0,0 @@ -[python] -path = "C:\\Users\\Jonas Lindemann\\Development\\calfem-python\\.venv\\Scripts\\python.exe" diff --git a/setup-org.py b/archive/setup-org.py similarity index 100% rename from setup-org.py rename to archive/setup-org.py diff --git a/setup-template.py b/archive/setup-template.py similarity index 100% rename from setup-template.py rename to archive/setup-template.py diff --git a/setup.py b/archive/setup.py similarity index 100% rename from setup.py rename to archive/setup.py diff --git a/example_output.py b/example_output.py index 806e064..cc6153d 100644 --- a/example_output.py +++ b/example_output.py @@ -1,107 +1,5 @@ -# -*- coding: utf-8 -*- -""" -Module containing example output for comparisons. -""" - examples = { - "exs_beam1.py": -"""+-------------+ -| a | -|-------------| -| 0.0000e+00 | -| -9.4859e-03 | -| -2.2766e-02 | -| -3.7943e-03 | -| 0.0000e+00 | -| 7.5887e-03 | -+-------------+ -+-------------+ -| r | -|-------------| -| 6.6667e+03 | -| 0.0000e+00 | -| 9.0949e-12 | -| -1.0914e-11 | -| 3.3333e+03 | -| 0.0000e+00 | -+-------------+ - -## es1 - -+-------------+------------+ -| V1 | M1 | -|-------------+------------| -| -6.6667e+03 | 9.1437e-12 | -| -6.6667e+03 | 6.6667e+03 | -| -6.6667e+03 | 1.3333e+04 | -| -6.6667e+03 | 2.0000e+04 | -+-------------+------------+ - -## ed1 - -+-------------+ -| v1 | -|-------------| -| 0.0000e+00 | -| -9.2751e-03 | -| -1.7285e-02 | -| -2.2766e-02 | -+-------------+ - -## ec1 - -+------------+ -| x1 | -|------------| -| 0.0000e+00 | -| 1.0000e+00 | -| 2.0000e+00 | -| 3.0000e+00 | -+------------+ - -## es2 - -+------------+------------+ -| V2 | M2 | -|------------+------------| -| 3.3333e+03 | 2.0000e+04 | -| 3.3333e+03 | 1.6667e+04 | -| 3.3333e+03 | 1.3333e+04 | -| 3.3333e+03 | 1.0000e+04 | -| 3.3333e+03 | 6.6667e+03 | -| 3.3333e+03 | 3.3333e+03 | -| 3.3333e+03 | 4.5719e-12 | -+------------+------------+ - -## ed2 - -+-------------+ -| v2 | -|-------------| -| -2.2766e-02 | -| -2.4769e-02 | -| -2.3609e-02 | -| -1.9920e-02 | -| -1.4334e-02 | -| -7.4833e-03 | -| 0.0000e+00 | -+-------------+ - -## ec2 - -+------------+ -| x2 | -|------------| -| 0.0000e+00 | -| 1.0000e+00 | -| 2.0000e+00 | -| 3.0000e+00 | -| 4.0000e+00 | -| 5.0000e+00 | -| 6.0000e+00 | -+------------+ -""", -"exs_bar2.py":""" + "exs_bar2.py": ''' # Analysis of a plane truss. @@ -146,149 +44,38 @@ ## Element forces r: -N1 = +N1 = [[-29844.55958549] [-29844.55958549]] -N2 = +N2 = [[57616.58031088] [57616.58031088]] -N3 = +N3 = [[37305.69948187] [37305.69948187]] sfac= 138.8489208633094 -""", -"exs_beam2.py":""" -## Displacements a: - -+-------------+ -| 0.0000e+00 | -| 0.0000e+00 | -| 0.0000e+00 | -| 2.0175e-04 | -| -5.5551e-04 | -| -9.6319e-04 | -| 3.7224e-04 | -| -4.5567e-03 | -| -3.2909e-03 | -| 3.7224e-04 | -| -1.2990e-02 | -| -4.5254e-03 | -| 0.0000e+00 | -| 0.0000e+00 | -+-------------+ - -## Reaction forces r: - -+-------------+ -| -8.0702e+04 | -| -6.6044e+03 | -| -1.4032e+03 | -| 0.0000e+00 | -| -1.4552e-11 | -| -2.2737e-12 | -| 0.0000e+00 | -| 0.0000e+00 | -| -7.2760e-12 | -| 0.0000e+00 | -| 0.0000e+00 | -| 3.8654e-11 | -| 8.0702e+04 | -| 4.6604e+04 | -+-------------+ - -## es1 = - -+------------+------------+-------------+ -| N | Q | M | -|------------+------------+-------------| -| 8.0702e+04 | 6.6044e+03 | 1.4032e+03 | -| 8.0702e+04 | 6.6044e+03 | 8.2292e+01 | -| 8.0702e+04 | 6.6044e+03 | -1.2386e+03 | -| 8.0702e+04 | 6.6044e+03 | -2.5595e+03 | -| 8.0702e+04 | 6.6044e+03 | -3.8803e+03 | -| 8.0702e+04 | 6.6044e+03 | -5.2012e+03 | -| 8.0702e+04 | 6.6044e+03 | -6.5221e+03 | -| 8.0702e+04 | 6.6044e+03 | -7.8430e+03 | -| 8.0702e+04 | 6.6044e+03 | -9.1639e+03 | -| 8.0702e+04 | 6.6044e+03 | -1.0485e+04 | -| 8.0702e+04 | 6.6044e+03 | -1.1806e+04 | -+------------+------------+-------------+ - -## es2 = - -+------------+-------------+-------------+ -| N | Q | M | -|------------+-------------+-------------| -| 6.8194e+04 | -5.9028e+03 | -1.1806e+04 | -| 6.8194e+04 | -3.9028e+03 | -1.0825e+04 | -| 6.8194e+04 | -1.9028e+03 | -1.0245e+04 | -| 6.8194e+04 | 9.7186e+01 | -1.0064e+04 | -| 6.8194e+04 | 2.0972e+03 | -1.0283e+04 | -| 6.8194e+04 | 4.0972e+03 | -1.0903e+04 | -| 6.8194e+04 | 6.0972e+03 | -1.1922e+04 | -| 6.8194e+04 | 8.0972e+03 | -1.3342e+04 | -| 6.8194e+04 | 1.0097e+04 | -1.5161e+04 | -| 6.8194e+04 | 1.2097e+04 | -1.7381e+04 | -| 6.8194e+04 | 1.4097e+04 | -2.0000e+04 | -+------------+-------------+-------------+ - -## es3 = - -+------------+-------------+-------------+ -| N | Q | M | -|------------+-------------+-------------| -| 0.0000e+00 | -2.0000e+04 | -2.0000e+04 | -| 0.0000e+00 | -1.8000e+04 | -1.6200e+04 | -| 0.0000e+00 | -1.6000e+04 | -1.2800e+04 | -| 0.0000e+00 | -1.4000e+04 | -9.8000e+03 | -| 0.0000e+00 | -1.2000e+04 | -7.2000e+03 | -| 0.0000e+00 | -1.0000e+04 | -5.0000e+03 | -| 0.0000e+00 | -8.0000e+03 | -3.2000e+03 | -| 0.0000e+00 | -6.0000e+03 | -1.8000e+03 | -| 0.0000e+00 | -4.0000e+03 | -8.0000e+02 | -| 0.0000e+00 | -2.0000e+03 | -2.0000e+02 | -| 0.0000e+00 | -4.6838e-12 | 4.8594e-11 | -+------------+-------------+-------------+ - -## es4 = - -+-------------+ -| N | -|-------------| -| -1.7688e+04 | -| -1.7688e+04 | -+-------------+ - -## es5 = - -+-------------+ -| N | -|-------------| -| -7.6244e+04 | -| -7.6244e+04 | -+-------------+ -""", -"exs_bar2_la.py":""" +''', + "exs_bar2_la.py": ''' # Analysis of a plane truss using loops ## Stiffness matrix K: -+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+ -| 3.5531e+08 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -| -9.2808e+07 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -| 0.0000e+00 | 0.0000e+00 | 3.5531e+08 | 9.2808e+07 | -9.2808e+07 | -9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -| 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | 9.2808e+07 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -| -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 7.1062e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | -| 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 4.4812e+08 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | -| -9.2808e+07 | 9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 7.1062e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | -2.6250e+08 | 0.0000e+00 | -| 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | 4.4812e+08 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | -| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 3.5531e+08 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | -| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 9.2808e+07 | 3.5531e+08 | 0.0000e+00 | -2.6250e+08 | -| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 3.5531e+08 | -9.2808e+07 | -| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | -9.2808e+07 | 3.5531e+08 | -+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+ ++-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+ +| 3.5531e+08 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| -9.2808e+07 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 3.5531e+08 | 9.2808e+07 | -9.2808e+07 | -9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | 9.2808e+07 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 7.1062e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | +| 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 4.4812e+08 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | +| -9.2808e+07 | 9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 7.1062e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | -2.6250e+08 | 0.0000e+00 | +| 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | 4.4812e+08 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 3.5531e+08 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 9.2808e+07 | 3.5531e+08 | 0.0000e+00 | -2.6250e+08 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 3.5531e+08 | -9.2808e+07 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | -9.2808e+07 | 3.5531e+08 | ++-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+ ## Displacements a: @@ -314,14 +101,14 @@ | 2.4009e+05 | | 6.1603e+05 | | 1.9293e+05 | -| 2.3283e-10 | -| -2.3283e-10 | -| 1.1642e-10 | +| 0.0000e+00 | +| -1.4552e-10 | | -1.1642e-10 | -| -2.3283e-10 | -| 3.4925e-10 | -| -2.9104e-11 | -| 4.6566e-10 | +| 5.8208e-11 | +| -1.1642e-10 | +| 2.3283e-10 | +| 2.9104e-11 | +| 2.9104e-10 | +-------------+ ## Element forces: @@ -335,8 +122,9 @@ N7 = -272838 N8 = -241321 N9 = 339534 -N10 = 371051""", -"exs_bar2_lb.py":""" +N10 = 371051 +''', + "exs_bar2_lb.py": ''' # Analysis of a plane truss using loops and extraction of element coordinates from a global coordinate matrix. @@ -381,14 +169,14 @@ | 2.4009e+05 | | 6.1603e+05 | | 1.9293e+05 | -| 2.3283e-10 | -| -2.3283e-10 | -| 1.1642e-10 | +| 0.0000e+00 | +| -1.4552e-10 | | -1.1642e-10 | -| -2.3283e-10 | -| 3.4925e-10 | -| -2.9104e-11 | -| 4.6566e-10 | +| 5.8208e-11 | +| -1.1642e-10 | +| 2.3283e-10 | +| 2.9104e-11 | +| 2.9104e-10 | +-------------+ ## Element forces: @@ -402,8 +190,105 @@ N7 = -272838 N8 = -241321 N9 = 339534 -N10 = 371051""", -"exs_beam2.py":"""+-------------+ +N10 = 371051 +''', + "exs_beam1.py": '''+-------------+ +| a | +|-------------| +| 0.0000e+00 | +| -9.4859e-03 | +| -2.2766e-02 | +| -3.7943e-03 | +| 0.0000e+00 | +| 7.5887e-03 | ++-------------+ ++-------------+ +| r | +|-------------| +| 6.6667e+03 | +| -3.6380e-12 | +| 7.2760e-12 | +| -1.0914e-11 | +| 3.3333e+03 | +| 0.0000e+00 | ++-------------+ + +## es1 + ++-------------+------------+ +| V1 | M1 | +|-------------+------------| +| -6.6667e+03 | 9.1437e-12 | +| -6.6667e+03 | 6.6667e+03 | +| -6.6667e+03 | 1.3333e+04 | +| -6.6667e+03 | 2.0000e+04 | ++-------------+------------+ + +## ed1 + ++-------------+ +| v1 | +|-------------| +| 0.0000e+00 | +| -9.2751e-03 | +| -1.7285e-02 | +| -2.2766e-02 | ++-------------+ + +## ec1 + ++------------+ +| x1 | +|------------| +| 0.0000e+00 | +| 1.0000e+00 | +| 2.0000e+00 | +| 3.0000e+00 | ++------------+ + +## es2 + ++------------+------------+ +| V2 | M2 | +|------------+------------| +| 3.3333e+03 | 2.0000e+04 | +| 3.3333e+03 | 1.6667e+04 | +| 3.3333e+03 | 1.3333e+04 | +| 3.3333e+03 | 1.0000e+04 | +| 3.3333e+03 | 6.6667e+03 | +| 3.3333e+03 | 3.3333e+03 | +| 3.3333e+03 | 4.5719e-12 | ++------------+------------+ + +## ed2 + ++-------------+ +| v2 | +|-------------| +| -2.2766e-02 | +| -2.4769e-02 | +| -2.3609e-02 | +| -1.9920e-02 | +| -1.4334e-02 | +| -7.4833e-03 | +| 6.9389e-18 | ++-------------+ + +## ec2 + ++------------+ +| x2 | +|------------| +| 0.0000e+00 | +| 1.0000e+00 | +| 2.0000e+00 | +| 3.0000e+00 | +| 4.0000e+00 | +| 5.0000e+00 | +| 6.0000e+00 | ++------------+ +''', + "exs_beam2.py": '''+-------------+ | a | |-------------| | 0.0000e+00 | @@ -427,10 +312,10 @@ | 4.4527e+02 | | 0.0000e+00 | | 0.0000e+00 | -| -3.6380e-12 | -| -2.3283e-10 | | 0.0000e+00 | -| -7.2760e-12 | +| -2.3283e-10 | +| 3.6380e-12 | +| 3.6380e-12 | | -3.9268e+03 | | 3.1259e+04 | | 0.0000e+00 | @@ -489,7 +374,7 @@ | 4.3111e-05 | 4.6722e-05 | | 2.8741e-05 | 1.7554e-05 | | 1.4370e-05 | 3.5858e-06 | -| 0.0000e+00 | 3.4694e-18 | +| 0.0000e+00 | 1.7347e-18 | +------------+------------+ ## es2 @@ -517,7 +402,7 @@ | -3.1259e+04 | -3.9268e+03 | -2.3561e+03 | | -3.1259e+04 | -3.9268e+03 | -1.5707e+03 | | -3.1259e+04 | -3.9268e+03 | -7.8535e+02 | -| -3.1259e+04 | -3.9268e+03 | 0.0000e+00 | +| -3.1259e+04 | -3.9268e+03 | 5.5511e-12 | +-------------+-------------+-------------+ ## edi2 @@ -545,7 +430,7 @@ | 4.6889e-05 | 3.0466e-03 | | 3.1259e-05 | 2.0474e-03 | | 1.5630e-05 | 1.0286e-03 | -| 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 3.4694e-18 | +------------+------------+ ## es3 @@ -604,10 +489,122 @@ | 7.5161e-03 | -3.1259e-04 | +------------+-------------+ sfac= -54.77300198398879 +54.77300198398877 sfac= -3.628630851048567e-05""", -"exs_flw_diff2.py":""" +3.628630851048567e-05 +''', + "exs_beambar2.py": ''' +## Displacements a: + ++-------------+ +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 2.0175e-04 | +| -5.5551e-04 | +| -9.6319e-04 | +| 3.7224e-04 | +| -4.5567e-03 | +| -3.2909e-03 | +| 3.7224e-04 | +| -1.2990e-02 | +| -4.5254e-03 | +| 0.0000e+00 | +| 0.0000e+00 | ++-------------+ + +## Reaction forces r: + ++-------------+ +| -8.0702e+04 | +| -6.6044e+03 | +| -1.4032e+03 | +| 0.0000e+00 | +| 1.4552e-11 | +| 5.0022e-12 | +| 0.0000e+00 | +| 0.0000e+00 | +| 2.1828e-11 | +| 0.0000e+00 | +| -2.9104e-11 | +| 3.8654e-11 | +| 8.0702e+04 | +| 4.6604e+04 | ++-------------+ + +## es1 = + ++------------+------------+-------------+ +| N | Q | M | +|------------+------------+-------------| +| 8.0702e+04 | 6.6044e+03 | 1.4032e+03 | +| 8.0702e+04 | 6.6044e+03 | 8.2292e+01 | +| 8.0702e+04 | 6.6044e+03 | -1.2386e+03 | +| 8.0702e+04 | 6.6044e+03 | -2.5595e+03 | +| 8.0702e+04 | 6.6044e+03 | -3.8803e+03 | +| 8.0702e+04 | 6.6044e+03 | -5.2012e+03 | +| 8.0702e+04 | 6.6044e+03 | -6.5221e+03 | +| 8.0702e+04 | 6.6044e+03 | -7.8430e+03 | +| 8.0702e+04 | 6.6044e+03 | -9.1639e+03 | +| 8.0702e+04 | 6.6044e+03 | -1.0485e+04 | +| 8.0702e+04 | 6.6044e+03 | -1.1806e+04 | ++------------+------------+-------------+ + +## es2 = + ++------------+-------------+-------------+ +| N | Q | M | +|------------+-------------+-------------| +| 6.8194e+04 | -5.9028e+03 | -1.1806e+04 | +| 6.8194e+04 | -3.9028e+03 | -1.0825e+04 | +| 6.8194e+04 | -1.9028e+03 | -1.0245e+04 | +| 6.8194e+04 | 9.7186e+01 | -1.0064e+04 | +| 6.8194e+04 | 2.0972e+03 | -1.0283e+04 | +| 6.8194e+04 | 4.0972e+03 | -1.0903e+04 | +| 6.8194e+04 | 6.0972e+03 | -1.1922e+04 | +| 6.8194e+04 | 8.0972e+03 | -1.3342e+04 | +| 6.8194e+04 | 1.0097e+04 | -1.5161e+04 | +| 6.8194e+04 | 1.2097e+04 | -1.7381e+04 | +| 6.8194e+04 | 1.4097e+04 | -2.0000e+04 | ++------------+-------------+-------------+ + +## es3 = + ++------------+-------------+-------------+ +| N | Q | M | +|------------+-------------+-------------| +| 2.1684e-11 | -2.0000e+04 | -2.0000e+04 | +| 2.1684e-11 | -1.8000e+04 | -1.6200e+04 | +| 2.1684e-11 | -1.6000e+04 | -1.2800e+04 | +| 2.1684e-11 | -1.4000e+04 | -9.8000e+03 | +| 2.1684e-11 | -1.2000e+04 | -7.2000e+03 | +| 2.1684e-11 | -1.0000e+04 | -5.0000e+03 | +| 2.1684e-11 | -8.0000e+03 | -3.2000e+03 | +| 2.1684e-11 | -6.0000e+03 | -1.8000e+03 | +| 2.1684e-11 | -4.0000e+03 | -8.0000e+02 | +| 2.1684e-11 | -2.0000e+03 | -2.0000e+02 | +| 2.1684e-11 | 9.3675e-12 | -7.6111e-12 | ++------------+-------------+-------------+ + +## es4 = + ++-------------+ +| N | +|-------------| +| -1.7688e+04 | +| -1.7688e+04 | ++-------------+ + +## es5 = + ++-------------+ +| N | +|-------------| +| -7.6244e+04 | +| -7.6244e+04 | ++-------------+ +''', + "exs_flw_diff2.py": ''' ## Ex +------------+------------+------------+------------+ @@ -671,8 +668,9 @@ | 1.7857e-04 | 2.5000e-04 | 5.4937e-04 | 4.3382e-04 | | 0.0000e+00 | 4.3382e-04 | 1.0000e-03 | 5.0000e-04 | | 4.3382e-04 | 5.4937e-04 | 1.0000e-03 | 1.0000e-03 | -+------------+------------+------------+------------+""", -"exs_flw_temp1.py":""" ++------------+------------+------------+------------+ +''', + "exs_flw_temp1.py": ''' ## Temperatures a: +-------------+ @@ -688,8 +686,8 @@ +-------------+ | -1.4039e+01 | -| 0.0000e+00 | -| 0.0000e+00 | +| -5.6843e-14 | +| -1.1546e-14 | | 0.0000e+00 | | 5.6843e-14 | | 4.0394e+00 | @@ -697,47 +695,18 @@ ## Element flows: -q1 = +q1 = 14.039386189223357 -q2 = +q2 = 14.039386189223451 -q3 = +q3 = 14.039386189223485 -q4 = +q4 = 4.039386189223492 -q5 = -4.03938618922342""", -"exs_spring.py":""" -## Stiffness matrix K: - -+-------------+-------------+-------------+ -| 3.0000e+03 | -3.0000e+03 | 0.0000e+00 | -| -3.0000e+03 | 7.5000e+03 | -4.5000e+03 | -| 0.0000e+00 | -4.5000e+03 | 4.5000e+03 | -+-------------+-------------+-------------+ - -## Displacements a: - -+------------+ -| 0.0000e+00 | -| 1.3333e-02 | -| 0.0000e+00 | -+------------+ - -## Reaction forces r: - -+-------------+ -| -4.0000e+01 | -| 0.0000e+00 | -| -6.0000e+01 | -+-------------+ - -## Element forces N: - -N1 = 40.0 -N2 = -20.0 -N3 = -40.0""", -"exs_flw_temp2.py":""" +q5 = +4.03938618922342 +''', + "exs_flw_temp2.py": ''' ## Stiffness matrix K: +-------------+-------------+-------------+-------------+-------------+-------------+ @@ -764,8 +733,8 @@ +-------------+ | -1.4039e+01 | -| 0.0000e+00 | -| 0.0000e+00 | +| -5.6843e-14 | +| -1.1546e-14 | | 0.0000e+00 | | 5.6843e-14 | | 4.0394e+00 | @@ -777,6 +746,37 @@ q2 = 14.039386189223451 q3 = 14.039386189223485 q4 = 4.039386189223492 -q5 = 4.03938618922342""" +q5 = 4.03938618922342 +''', + "exs_spring.py": ''' +## Stiffness matrix K: -} \ No newline at end of file ++-------------+-------------+-------------+ +| 3.0000e+03 | -3.0000e+03 | 0.0000e+00 | +| -3.0000e+03 | 7.5000e+03 | -4.5000e+03 | +| 0.0000e+00 | -4.5000e+03 | 4.5000e+03 | ++-------------+-------------+-------------+ + +## Displacements a: + ++------------+ +| 0.0000e+00 | +| 1.3333e-02 | +| 0.0000e+00 | ++------------+ + +## Reaction forces r: + ++-------------+ +| -4.0000e+01 | +| 0.0000e+00 | +| -6.0000e+01 | ++-------------+ + +## Element forces N: + +N1 = 40.0 +N2 = -20.0 +N3 = -40.0 +''', +} diff --git a/example_output_dict.py b/example_output_dict.py new file mode 100644 index 0000000..cc6153d --- /dev/null +++ b/example_output_dict.py @@ -0,0 +1,782 @@ +examples = { + "exs_bar2.py": ''' +# Analysis of a plane truss. + + +## Stiffness matrix K: + ++-------------+------------+-------------+-------------+-------------+-------------+------------+-------------+ +| 7.5000e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -7.5000e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 6.4000e+07 | -4.8000e+07 | -6.4000e+07 | 4.8000e+07 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | -4.8000e+07 | 3.6000e+07 | 4.8000e+07 | -3.6000e+07 | 0.0000e+00 | 0.0000e+00 | +| -7.5000e+07 | 0.0000e+00 | -6.4000e+07 | 4.8000e+07 | 1.3900e+08 | -4.8000e+07 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 4.8000e+07 | -3.6000e+07 | -4.8000e+07 | 8.6000e+07 | 0.0000e+00 | -5.0000e+07 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -5.0000e+07 | 0.0000e+00 | 5.0000e+07 | ++-------------+------------+-------------+-------------+-------------+-------------+------------+-------------+ + +## Displacements a: + ++-------------+ +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| -3.9793e-04 | +| -1.1523e-03 | +| 0.0000e+00 | +| 0.0000e+00 | ++-------------+ + +## Reaction forces r: + ++-------------+ +| 2.9845e+04 | +| 0.0000e+00 | +| -2.9845e+04 | +| 2.2383e+04 | +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 5.7617e+04 | ++-------------+ + +## Element forces r: + +N1 = +[[-29844.55958549] + [-29844.55958549]] +N2 = +[[57616.58031088] + [57616.58031088]] +N3 = +[[37305.69948187] + [37305.69948187]] +sfac= +138.8489208633094 +''', + "exs_bar2_la.py": ''' +# Analysis of a plane truss using loops + + +## Stiffness matrix K: + ++-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+ +| 3.5531e+08 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| -9.2808e+07 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 3.5531e+08 | 9.2808e+07 | -9.2808e+07 | -9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | 9.2808e+07 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 7.1062e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | +| 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 4.4812e+08 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | +| -9.2808e+07 | 9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 7.1062e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | -2.6250e+08 | 0.0000e+00 | +| 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | 4.4812e+08 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 3.5531e+08 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 9.2808e+07 | 3.5531e+08 | 0.0000e+00 | -2.6250e+08 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 3.5531e+08 | -9.2808e+07 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | -9.2808e+07 | 3.5531e+08 | ++-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+ + +## Displacements a: + ++-------------+ +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 2.3845e-03 | +| -4.4633e-03 | +| -1.6118e-03 | +| -4.1987e-03 | +| 3.0346e-03 | +| -1.0684e-02 | +| -1.6589e-03 | +| -1.1334e-02 | ++-------------+ + +## Reaction forces r: + ++-------------+ +| -8.6603e+05 | +| 2.4009e+05 | +| 6.1603e+05 | +| 1.9293e+05 | +| 0.0000e+00 | +| -1.4552e-10 | +| -1.1642e-10 | +| 5.8208e-11 | +| -1.1642e-10 | +| 2.3283e-10 | +| 2.9104e-11 | +| 2.9104e-10 | ++-------------+ + +## Element forces: + +N1 = 625938 +N2 = -423100 +N3 = 170640 +N4 = -12372.8 +N5 = -69447 +N6 = 170640 +N7 = -272838 +N8 = -241321 +N9 = 339534 +N10 = 371051 +''', + "exs_bar2_lb.py": ''' +# Analysis of a plane truss using loops and extraction of element coordinates from a global coordinate matrix. + + +## Stiffness matrix K: + ++-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+ +| 3.5531e+08 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| -9.2808e+07 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 3.5531e+08 | 9.2808e+07 | -9.2808e+07 | -9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | 9.2808e+07 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 7.1062e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | +| 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 4.4812e+08 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | +| -9.2808e+07 | 9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 7.1062e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | -2.6250e+08 | 0.0000e+00 | +| 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | 4.4812e+08 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 3.5531e+08 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 9.2808e+07 | 3.5531e+08 | 0.0000e+00 | -2.6250e+08 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 3.5531e+08 | -9.2808e+07 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | -9.2808e+07 | 3.5531e+08 | ++-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+ + +## Displacements a: + ++-------------+ +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 2.3845e-03 | +| -4.4633e-03 | +| -1.6118e-03 | +| -4.1987e-03 | +| 3.0346e-03 | +| -1.0684e-02 | +| -1.6589e-03 | +| -1.1334e-02 | ++-------------+ + +## Reaction forces r: + ++-------------+ +| -8.6603e+05 | +| 2.4009e+05 | +| 6.1603e+05 | +| 1.9293e+05 | +| 0.0000e+00 | +| -1.4552e-10 | +| -1.1642e-10 | +| 5.8208e-11 | +| -1.1642e-10 | +| 2.3283e-10 | +| 2.9104e-11 | +| 2.9104e-10 | ++-------------+ + +## Element forces: + +N1 = 625938 +N2 = -423100 +N3 = 170640 +N4 = -12372.8 +N5 = -69447 +N6 = 170640 +N7 = -272838 +N8 = -241321 +N9 = 339534 +N10 = 371051 +''', + "exs_beam1.py": '''+-------------+ +| a | +|-------------| +| 0.0000e+00 | +| -9.4859e-03 | +| -2.2766e-02 | +| -3.7943e-03 | +| 0.0000e+00 | +| 7.5887e-03 | ++-------------+ ++-------------+ +| r | +|-------------| +| 6.6667e+03 | +| -3.6380e-12 | +| 7.2760e-12 | +| -1.0914e-11 | +| 3.3333e+03 | +| 0.0000e+00 | ++-------------+ + +## es1 + ++-------------+------------+ +| V1 | M1 | +|-------------+------------| +| -6.6667e+03 | 9.1437e-12 | +| -6.6667e+03 | 6.6667e+03 | +| -6.6667e+03 | 1.3333e+04 | +| -6.6667e+03 | 2.0000e+04 | ++-------------+------------+ + +## ed1 + ++-------------+ +| v1 | +|-------------| +| 0.0000e+00 | +| -9.2751e-03 | +| -1.7285e-02 | +| -2.2766e-02 | ++-------------+ + +## ec1 + ++------------+ +| x1 | +|------------| +| 0.0000e+00 | +| 1.0000e+00 | +| 2.0000e+00 | +| 3.0000e+00 | ++------------+ + +## es2 + ++------------+------------+ +| V2 | M2 | +|------------+------------| +| 3.3333e+03 | 2.0000e+04 | +| 3.3333e+03 | 1.6667e+04 | +| 3.3333e+03 | 1.3333e+04 | +| 3.3333e+03 | 1.0000e+04 | +| 3.3333e+03 | 6.6667e+03 | +| 3.3333e+03 | 3.3333e+03 | +| 3.3333e+03 | 4.5719e-12 | ++------------+------------+ + +## ed2 + ++-------------+ +| v2 | +|-------------| +| -2.2766e-02 | +| -2.4769e-02 | +| -2.3609e-02 | +| -1.9920e-02 | +| -1.4334e-02 | +| -7.4833e-03 | +| 6.9389e-18 | ++-------------+ + +## ec2 + ++------------+ +| x2 | +|------------| +| 0.0000e+00 | +| 1.0000e+00 | +| 2.0000e+00 | +| 3.0000e+00 | +| 4.0000e+00 | +| 5.0000e+00 | +| 6.0000e+00 | ++------------+ +''', + "exs_beam2.py": '''+-------------+ +| a | +|-------------| +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 7.5357e-03 | +| -2.8741e-04 | +| -5.3735e-03 | +| 7.5161e-03 | +| -3.1259e-04 | +| 4.6656e-03 | +| 0.0000e+00 | +| 0.0000e+00 | +| -5.1513e-03 | ++-------------+ ++-------------+ +| r | +|-------------| +| 1.9268e+03 | +| 2.8741e+04 | +| 4.4527e+02 | +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| -2.3283e-10 | +| 3.6380e-12 | +| 3.6380e-12 | +| -3.9268e+03 | +| 3.1259e+04 | +| 0.0000e+00 | ++-------------+ + +## es1 + ++-------------+------------+------------+ +| N | Vy | Mz | +|-------------+------------+------------| +| -2.8741e+04 | 1.9268e+03 | 8.1523e+03 | +| -2.8741e+04 | 1.9268e+03 | 7.7670e+03 | +| -2.8741e+04 | 1.9268e+03 | 7.3816e+03 | +| -2.8741e+04 | 1.9268e+03 | 6.9963e+03 | +| -2.8741e+04 | 1.9268e+03 | 6.6109e+03 | +| -2.8741e+04 | 1.9268e+03 | 6.2256e+03 | +| -2.8741e+04 | 1.9268e+03 | 5.8402e+03 | +| -2.8741e+04 | 1.9268e+03 | 5.4548e+03 | +| -2.8741e+04 | 1.9268e+03 | 5.0695e+03 | +| -2.8741e+04 | 1.9268e+03 | 4.6841e+03 | +| -2.8741e+04 | 1.9268e+03 | 4.2988e+03 | +| -2.8741e+04 | 1.9268e+03 | 3.9134e+03 | +| -2.8741e+04 | 1.9268e+03 | 3.5281e+03 | +| -2.8741e+04 | 1.9268e+03 | 3.1427e+03 | +| -2.8741e+04 | 1.9268e+03 | 2.7574e+03 | +| -2.8741e+04 | 1.9268e+03 | 2.3720e+03 | +| -2.8741e+04 | 1.9268e+03 | 1.9867e+03 | +| -2.8741e+04 | 1.9268e+03 | 1.6013e+03 | +| -2.8741e+04 | 1.9268e+03 | 1.2160e+03 | +| -2.8741e+04 | 1.9268e+03 | 8.3062e+02 | +| -2.8741e+04 | 1.9268e+03 | 4.4527e+02 | ++-------------+------------+------------+ + +## edi1 + ++------------+------------+ +| u1 | v1 | +|------------+------------| +| 2.8741e-04 | 7.5357e-03 | +| 2.7304e-04 | 6.5112e-03 | +| 2.5867e-04 | 5.5837e-03 | +| 2.4430e-04 | 4.7485e-03 | +| 2.2993e-04 | 4.0008e-03 | +| 2.1556e-04 | 3.3357e-03 | +| 2.0119e-04 | 2.7484e-03 | +| 1.8682e-04 | 2.2341e-03 | +| 1.7245e-04 | 1.7880e-03 | +| 1.5807e-04 | 1.4053e-03 | +| 1.4370e-04 | 1.0811e-03 | +| 1.2933e-04 | 8.1067e-04 | +| 1.1496e-04 | 5.8915e-04 | +| 1.0059e-04 | 4.1173e-04 | +| 8.6223e-05 | 2.7359e-04 | +| 7.1852e-05 | 1.6993e-04 | +| 5.7482e-05 | 9.5907e-05 | +| 4.3111e-05 | 4.6722e-05 | +| 2.8741e-05 | 1.7554e-05 | +| 1.4370e-05 | 3.5858e-06 | +| 0.0000e+00 | 1.7347e-18 | ++------------+------------+ + +## es2 + ++-------------+-------------+-------------+ +| N | Vy | Mz | +|-------------+-------------+-------------| +| -3.1259e+04 | -3.9268e+03 | -1.5707e+04 | +| -3.1259e+04 | -3.9268e+03 | -1.4922e+04 | +| -3.1259e+04 | -3.9268e+03 | -1.4136e+04 | +| -3.1259e+04 | -3.9268e+03 | -1.3351e+04 | +| -3.1259e+04 | -3.9268e+03 | -1.2566e+04 | +| -3.1259e+04 | -3.9268e+03 | -1.1780e+04 | +| -3.1259e+04 | -3.9268e+03 | -1.0995e+04 | +| -3.1259e+04 | -3.9268e+03 | -1.0210e+04 | +| -3.1259e+04 | -3.9268e+03 | -9.4242e+03 | +| -3.1259e+04 | -3.9268e+03 | -8.6389e+03 | +| -3.1259e+04 | -3.9268e+03 | -7.8535e+03 | +| -3.1259e+04 | -3.9268e+03 | -7.0682e+03 | +| -3.1259e+04 | -3.9268e+03 | -6.2828e+03 | +| -3.1259e+04 | -3.9268e+03 | -5.4975e+03 | +| -3.1259e+04 | -3.9268e+03 | -4.7121e+03 | +| -3.1259e+04 | -3.9268e+03 | -3.9268e+03 | +| -3.1259e+04 | -3.9268e+03 | -3.1414e+03 | +| -3.1259e+04 | -3.9268e+03 | -2.3561e+03 | +| -3.1259e+04 | -3.9268e+03 | -1.5707e+03 | +| -3.1259e+04 | -3.9268e+03 | -7.8535e+02 | +| -3.1259e+04 | -3.9268e+03 | 5.5511e-12 | ++-------------+-------------+-------------+ + +## edi2 + ++------------+------------+ +| u1 | v1 | +|------------+------------| +| 3.1259e-04 | 7.5161e-03 | +| 2.9696e-04 | 8.3527e-03 | +| 2.8133e-04 | 9.0027e-03 | +| 2.6570e-04 | 9.4761e-03 | +| 2.5007e-04 | 9.7825e-03 | +| 2.3444e-04 | 9.9319e-03 | +| 2.1881e-04 | 9.9341e-03 | +| 2.0318e-04 | 9.7988e-03 | +| 1.8755e-04 | 9.5359e-03 | +| 1.7193e-04 | 9.1552e-03 | +| 1.5630e-04 | 8.6665e-03 | +| 1.4067e-04 | 8.0796e-03 | +| 1.2504e-04 | 7.4044e-03 | +| 1.0941e-04 | 6.6506e-03 | +| 9.3777e-05 | 5.8282e-03 | +| 7.8148e-05 | 4.9468e-03 | +| 6.2518e-05 | 4.0163e-03 | +| 4.6889e-05 | 3.0466e-03 | +| 3.1259e-05 | 2.0474e-03 | +| 1.5630e-05 | 1.0286e-03 | +| 0.0000e+00 | 3.4694e-18 | ++------------+------------+ + +## es3 + ++-------------+-------------+-------------+ +| N | Vy | Mz | +|-------------+-------------+-------------| +| -3.9268e+03 | -2.8741e+04 | -8.1523e+03 | +| -3.9268e+03 | -2.5741e+04 | 1.9953e+01 | +| -3.9268e+03 | -2.2741e+04 | 7.2922e+03 | +| -3.9268e+03 | -1.9741e+04 | 1.3664e+04 | +| -3.9268e+03 | -1.6741e+04 | 1.9137e+04 | +| -3.9268e+03 | -1.3741e+04 | 2.3709e+04 | +| -3.9268e+03 | -1.0741e+04 | 2.7381e+04 | +| -3.9268e+03 | -7.7409e+03 | 3.0154e+04 | +| -3.9268e+03 | -4.7409e+03 | 3.2026e+04 | +| -3.9268e+03 | -1.7409e+03 | 3.2998e+04 | +| -3.9268e+03 | 1.2591e+03 | 3.3070e+04 | +| -3.9268e+03 | 4.2591e+03 | 3.2243e+04 | +| -3.9268e+03 | 7.2591e+03 | 3.0515e+04 | +| -3.9268e+03 | 1.0259e+04 | 2.7887e+04 | +| -3.9268e+03 | 1.3259e+04 | 2.4359e+04 | +| -3.9268e+03 | 1.6259e+04 | 1.9932e+04 | +| -3.9268e+03 | 1.9259e+04 | 1.4604e+04 | +| -3.9268e+03 | 2.2259e+04 | 8.3762e+03 | +| -3.9268e+03 | 2.5259e+04 | 1.2484e+03 | +| -3.9268e+03 | 2.8259e+04 | -6.7793e+03 | +| -3.9268e+03 | 3.1259e+04 | -1.5707e+04 | ++-------------+-------------+-------------+ + +## edi3 + ++------------+-------------+ +| u1 | v1 | +|------------+-------------| +| 7.5357e-03 | -2.8741e-04 | +| 7.5347e-03 | -1.9218e-03 | +| 7.5337e-03 | -3.5566e-03 | +| 7.5328e-03 | -5.1312e-03 | +| 7.5318e-03 | -6.5927e-03 | +| 7.5308e-03 | -7.8952e-03 | +| 7.5298e-03 | -9.0009e-03 | +| 7.5288e-03 | -9.8789e-03 | +| 7.5279e-03 | -1.0506e-02 | +| 7.5269e-03 | -1.0868e-02 | +| 7.5259e-03 | -1.0954e-02 | +| 7.5249e-03 | -1.0766e-02 | +| 7.5239e-03 | -1.0310e-02 | +| 7.5229e-03 | -9.6000e-03 | +| 7.5220e-03 | -8.6584e-03 | +| 7.5210e-03 | -7.5143e-03 | +| 7.5200e-03 | -6.2048e-03 | +| 7.5190e-03 | -4.7743e-03 | +| 7.5180e-03 | -3.2745e-03 | +| 7.5171e-03 | -1.7650e-03 | +| 7.5161e-03 | -3.1259e-04 | ++------------+-------------+ +sfac= +54.77300198398877 +sfac= +3.628630851048567e-05 +''', + "exs_beambar2.py": ''' +## Displacements a: + ++-------------+ +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 2.0175e-04 | +| -5.5551e-04 | +| -9.6319e-04 | +| 3.7224e-04 | +| -4.5567e-03 | +| -3.2909e-03 | +| 3.7224e-04 | +| -1.2990e-02 | +| -4.5254e-03 | +| 0.0000e+00 | +| 0.0000e+00 | ++-------------+ + +## Reaction forces r: + ++-------------+ +| -8.0702e+04 | +| -6.6044e+03 | +| -1.4032e+03 | +| 0.0000e+00 | +| 1.4552e-11 | +| 5.0022e-12 | +| 0.0000e+00 | +| 0.0000e+00 | +| 2.1828e-11 | +| 0.0000e+00 | +| -2.9104e-11 | +| 3.8654e-11 | +| 8.0702e+04 | +| 4.6604e+04 | ++-------------+ + +## es1 = + ++------------+------------+-------------+ +| N | Q | M | +|------------+------------+-------------| +| 8.0702e+04 | 6.6044e+03 | 1.4032e+03 | +| 8.0702e+04 | 6.6044e+03 | 8.2292e+01 | +| 8.0702e+04 | 6.6044e+03 | -1.2386e+03 | +| 8.0702e+04 | 6.6044e+03 | -2.5595e+03 | +| 8.0702e+04 | 6.6044e+03 | -3.8803e+03 | +| 8.0702e+04 | 6.6044e+03 | -5.2012e+03 | +| 8.0702e+04 | 6.6044e+03 | -6.5221e+03 | +| 8.0702e+04 | 6.6044e+03 | -7.8430e+03 | +| 8.0702e+04 | 6.6044e+03 | -9.1639e+03 | +| 8.0702e+04 | 6.6044e+03 | -1.0485e+04 | +| 8.0702e+04 | 6.6044e+03 | -1.1806e+04 | ++------------+------------+-------------+ + +## es2 = + ++------------+-------------+-------------+ +| N | Q | M | +|------------+-------------+-------------| +| 6.8194e+04 | -5.9028e+03 | -1.1806e+04 | +| 6.8194e+04 | -3.9028e+03 | -1.0825e+04 | +| 6.8194e+04 | -1.9028e+03 | -1.0245e+04 | +| 6.8194e+04 | 9.7186e+01 | -1.0064e+04 | +| 6.8194e+04 | 2.0972e+03 | -1.0283e+04 | +| 6.8194e+04 | 4.0972e+03 | -1.0903e+04 | +| 6.8194e+04 | 6.0972e+03 | -1.1922e+04 | +| 6.8194e+04 | 8.0972e+03 | -1.3342e+04 | +| 6.8194e+04 | 1.0097e+04 | -1.5161e+04 | +| 6.8194e+04 | 1.2097e+04 | -1.7381e+04 | +| 6.8194e+04 | 1.4097e+04 | -2.0000e+04 | ++------------+-------------+-------------+ + +## es3 = + ++------------+-------------+-------------+ +| N | Q | M | +|------------+-------------+-------------| +| 2.1684e-11 | -2.0000e+04 | -2.0000e+04 | +| 2.1684e-11 | -1.8000e+04 | -1.6200e+04 | +| 2.1684e-11 | -1.6000e+04 | -1.2800e+04 | +| 2.1684e-11 | -1.4000e+04 | -9.8000e+03 | +| 2.1684e-11 | -1.2000e+04 | -7.2000e+03 | +| 2.1684e-11 | -1.0000e+04 | -5.0000e+03 | +| 2.1684e-11 | -8.0000e+03 | -3.2000e+03 | +| 2.1684e-11 | -6.0000e+03 | -1.8000e+03 | +| 2.1684e-11 | -4.0000e+03 | -8.0000e+02 | +| 2.1684e-11 | -2.0000e+03 | -2.0000e+02 | +| 2.1684e-11 | 9.3675e-12 | -7.6111e-12 | ++------------+-------------+-------------+ + +## es4 = + ++-------------+ +| N | +|-------------| +| -1.7688e+04 | +| -1.7688e+04 | ++-------------+ + +## es5 = + ++-------------+ +| N | +|-------------| +| -7.6244e+04 | +| -7.6244e+04 | ++-------------+ +''', + "exs_flw_diff2.py": ''' +## Ex + ++------------+------------+------------+------------+ +| x0 | x1 | x2 | x3 | +|------------+------------+------------+------------| +| 0.0000e+00 | 2.5000e-02 | 2.5000e-02 | 0.0000e+00 | +| 2.5000e-02 | 5.0000e-02 | 5.0000e-02 | 2.5000e-02 | +| 0.0000e+00 | 2.5000e-02 | 2.5000e-02 | 0.0000e+00 | +| 2.5000e-02 | 5.0000e-02 | 5.0000e-02 | 2.5000e-02 | +| 0.0000e+00 | 2.5000e-02 | 2.5000e-02 | 0.0000e+00 | +| 2.5000e-02 | 5.0000e-02 | 5.0000e-02 | 2.5000e-02 | +| 0.0000e+00 | 2.5000e-02 | 2.5000e-02 | 0.0000e+00 | +| 2.5000e-02 | 5.0000e-02 | 5.0000e-02 | 2.5000e-02 | ++------------+------------+------------+------------+ + +## Ey + ++------------+------------+------------+------------+ +| x0 | x1 | x2 | x3 | +|------------+------------+------------+------------| +| 0.0000e+00 | 0.0000e+00 | 2.5000e-02 | 2.5000e-02 | +| 0.0000e+00 | 0.0000e+00 | 2.5000e-02 | 2.5000e-02 | +| 2.5000e-02 | 2.5000e-02 | 5.0000e-02 | 5.0000e-02 | +| 2.5000e-02 | 2.5000e-02 | 5.0000e-02 | 5.0000e-02 | +| 5.0000e-02 | 5.0000e-02 | 7.5000e-02 | 7.5000e-02 | +| 5.0000e-02 | 5.0000e-02 | 7.5000e-02 | 7.5000e-02 | +| 7.5000e-02 | 7.5000e-02 | 1.0000e-01 | 1.0000e-01 | +| 7.5000e-02 | 7.5000e-02 | 1.0000e-01 | 1.0000e-01 | ++------------+------------+------------+------------+ + +## a + ++------------+ +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 6.6176e-05 | +| 9.3487e-05 | +| 0.0000e+00 | +| 1.7857e-04 | +| 2.5000e-04 | +| 0.0000e+00 | +| 4.3382e-04 | +| 5.4937e-04 | +| 5.0000e-04 | +| 1.0000e-03 | +| 1.0000e-03 | ++------------+ + +## Ed + ++------------+------------+------------+------------+ +| ed0 | ed1 | ed2 | ed3 | +|------------+------------+------------+------------| +| 0.0000e+00 | 0.0000e+00 | 6.6176e-05 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 9.3487e-05 | 6.6176e-05 | +| 0.0000e+00 | 6.6176e-05 | 1.7857e-04 | 0.0000e+00 | +| 6.6176e-05 | 9.3487e-05 | 2.5000e-04 | 1.7857e-04 | +| 0.0000e+00 | 1.7857e-04 | 4.3382e-04 | 0.0000e+00 | +| 1.7857e-04 | 2.5000e-04 | 5.4937e-04 | 4.3382e-04 | +| 0.0000e+00 | 4.3382e-04 | 1.0000e-03 | 5.0000e-04 | +| 4.3382e-04 | 5.4937e-04 | 1.0000e-03 | 1.0000e-03 | ++------------+------------+------------+------------+ +''', + "exs_flw_temp1.py": ''' +## Temperatures a: + ++-------------+ +| -1.7000e+01 | +| -1.6438e+01 | +| -1.5861e+01 | +| 1.9238e+01 | +| 1.9475e+01 | +| 2.0000e+01 | ++-------------+ + +## Reaction flows r: + ++-------------+ +| -1.4039e+01 | +| -5.6843e-14 | +| -1.1546e-14 | +| 0.0000e+00 | +| 5.6843e-14 | +| 4.0394e+00 | ++-------------+ + +## Element flows: + +q1 = +14.039386189223357 +q2 = +14.039386189223451 +q3 = +14.039386189223485 +q4 = +4.039386189223492 +q5 = +4.03938618922342 +''', + "exs_flw_temp2.py": ''' +## Stiffness matrix K: + ++-------------+-------------+-------------+-------------+-------------+-------------+ +| 2.5000e+01 | -2.5000e+01 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| -2.5000e+01 | 4.9300e+01 | -2.4300e+01 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | -2.4300e+01 | 2.4700e+01 | -4.0000e-01 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | -4.0000e-01 | 1.7400e+01 | -1.7000e+01 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -1.7000e+01 | 2.4700e+01 | -7.7000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -7.7000e+00 | 7.7000e+00 | ++-------------+-------------+-------------+-------------+-------------+-------------+ + +## Temperatures a: + ++-------------+ +| -1.7000e+01 | +| -1.6438e+01 | +| -1.5861e+01 | +| 1.9238e+01 | +| 1.9475e+01 | +| 2.0000e+01 | ++-------------+ + +## Reaction flows r: + ++-------------+ +| -1.4039e+01 | +| -5.6843e-14 | +| -1.1546e-14 | +| 0.0000e+00 | +| 5.6843e-14 | +| 4.0394e+00 | ++-------------+ + +## Element flows r: + +q1 = 14.039386189223357 +q2 = 14.039386189223451 +q3 = 14.039386189223485 +q4 = 4.039386189223492 +q5 = 4.03938618922342 +''', + "exs_spring.py": ''' +## Stiffness matrix K: + ++-------------+-------------+-------------+ +| 3.0000e+03 | -3.0000e+03 | 0.0000e+00 | +| -3.0000e+03 | 7.5000e+03 | -4.5000e+03 | +| 0.0000e+00 | -4.5000e+03 | 4.5000e+03 | ++-------------+-------------+-------------+ + +## Displacements a: + ++------------+ +| 0.0000e+00 | +| 1.3333e-02 | +| 0.0000e+00 | ++------------+ + +## Reaction forces r: + ++-------------+ +| -4.0000e+01 | +| 0.0000e+00 | +| -6.0000e+01 | ++-------------+ + +## Element forces N: + +N1 = 40.0 +N2 = -20.0 +N3 = -40.0 +''', +} diff --git a/example_output_old.py b/example_output_old.py new file mode 100644 index 0000000..806e064 --- /dev/null +++ b/example_output_old.py @@ -0,0 +1,782 @@ +# -*- coding: utf-8 -*- +""" +Module containing example output for comparisons. +""" + +examples = { + "exs_beam1.py": +"""+-------------+ +| a | +|-------------| +| 0.0000e+00 | +| -9.4859e-03 | +| -2.2766e-02 | +| -3.7943e-03 | +| 0.0000e+00 | +| 7.5887e-03 | ++-------------+ ++-------------+ +| r | +|-------------| +| 6.6667e+03 | +| 0.0000e+00 | +| 9.0949e-12 | +| -1.0914e-11 | +| 3.3333e+03 | +| 0.0000e+00 | ++-------------+ + +## es1 + ++-------------+------------+ +| V1 | M1 | +|-------------+------------| +| -6.6667e+03 | 9.1437e-12 | +| -6.6667e+03 | 6.6667e+03 | +| -6.6667e+03 | 1.3333e+04 | +| -6.6667e+03 | 2.0000e+04 | ++-------------+------------+ + +## ed1 + ++-------------+ +| v1 | +|-------------| +| 0.0000e+00 | +| -9.2751e-03 | +| -1.7285e-02 | +| -2.2766e-02 | ++-------------+ + +## ec1 + ++------------+ +| x1 | +|------------| +| 0.0000e+00 | +| 1.0000e+00 | +| 2.0000e+00 | +| 3.0000e+00 | ++------------+ + +## es2 + ++------------+------------+ +| V2 | M2 | +|------------+------------| +| 3.3333e+03 | 2.0000e+04 | +| 3.3333e+03 | 1.6667e+04 | +| 3.3333e+03 | 1.3333e+04 | +| 3.3333e+03 | 1.0000e+04 | +| 3.3333e+03 | 6.6667e+03 | +| 3.3333e+03 | 3.3333e+03 | +| 3.3333e+03 | 4.5719e-12 | ++------------+------------+ + +## ed2 + ++-------------+ +| v2 | +|-------------| +| -2.2766e-02 | +| -2.4769e-02 | +| -2.3609e-02 | +| -1.9920e-02 | +| -1.4334e-02 | +| -7.4833e-03 | +| 0.0000e+00 | ++-------------+ + +## ec2 + ++------------+ +| x2 | +|------------| +| 0.0000e+00 | +| 1.0000e+00 | +| 2.0000e+00 | +| 3.0000e+00 | +| 4.0000e+00 | +| 5.0000e+00 | +| 6.0000e+00 | ++------------+ +""", +"exs_bar2.py":""" +# Analysis of a plane truss. + + +## Stiffness matrix K: + ++-------------+------------+-------------+-------------+-------------+-------------+------------+-------------+ +| 7.5000e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -7.5000e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 6.4000e+07 | -4.8000e+07 | -6.4000e+07 | 4.8000e+07 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | -4.8000e+07 | 3.6000e+07 | 4.8000e+07 | -3.6000e+07 | 0.0000e+00 | 0.0000e+00 | +| -7.5000e+07 | 0.0000e+00 | -6.4000e+07 | 4.8000e+07 | 1.3900e+08 | -4.8000e+07 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 4.8000e+07 | -3.6000e+07 | -4.8000e+07 | 8.6000e+07 | 0.0000e+00 | -5.0000e+07 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -5.0000e+07 | 0.0000e+00 | 5.0000e+07 | ++-------------+------------+-------------+-------------+-------------+-------------+------------+-------------+ + +## Displacements a: + ++-------------+ +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| -3.9793e-04 | +| -1.1523e-03 | +| 0.0000e+00 | +| 0.0000e+00 | ++-------------+ + +## Reaction forces r: + ++-------------+ +| 2.9845e+04 | +| 0.0000e+00 | +| -2.9845e+04 | +| 2.2383e+04 | +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 5.7617e+04 | ++-------------+ + +## Element forces r: + +N1 = +[[-29844.55958549] + [-29844.55958549]] +N2 = +[[57616.58031088] + [57616.58031088]] +N3 = +[[37305.69948187] + [37305.69948187]] +sfac= +138.8489208633094 +""", +"exs_beam2.py":""" +## Displacements a: + ++-------------+ +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 2.0175e-04 | +| -5.5551e-04 | +| -9.6319e-04 | +| 3.7224e-04 | +| -4.5567e-03 | +| -3.2909e-03 | +| 3.7224e-04 | +| -1.2990e-02 | +| -4.5254e-03 | +| 0.0000e+00 | +| 0.0000e+00 | ++-------------+ + +## Reaction forces r: + ++-------------+ +| -8.0702e+04 | +| -6.6044e+03 | +| -1.4032e+03 | +| 0.0000e+00 | +| -1.4552e-11 | +| -2.2737e-12 | +| 0.0000e+00 | +| 0.0000e+00 | +| -7.2760e-12 | +| 0.0000e+00 | +| 0.0000e+00 | +| 3.8654e-11 | +| 8.0702e+04 | +| 4.6604e+04 | ++-------------+ + +## es1 = + ++------------+------------+-------------+ +| N | Q | M | +|------------+------------+-------------| +| 8.0702e+04 | 6.6044e+03 | 1.4032e+03 | +| 8.0702e+04 | 6.6044e+03 | 8.2292e+01 | +| 8.0702e+04 | 6.6044e+03 | -1.2386e+03 | +| 8.0702e+04 | 6.6044e+03 | -2.5595e+03 | +| 8.0702e+04 | 6.6044e+03 | -3.8803e+03 | +| 8.0702e+04 | 6.6044e+03 | -5.2012e+03 | +| 8.0702e+04 | 6.6044e+03 | -6.5221e+03 | +| 8.0702e+04 | 6.6044e+03 | -7.8430e+03 | +| 8.0702e+04 | 6.6044e+03 | -9.1639e+03 | +| 8.0702e+04 | 6.6044e+03 | -1.0485e+04 | +| 8.0702e+04 | 6.6044e+03 | -1.1806e+04 | ++------------+------------+-------------+ + +## es2 = + ++------------+-------------+-------------+ +| N | Q | M | +|------------+-------------+-------------| +| 6.8194e+04 | -5.9028e+03 | -1.1806e+04 | +| 6.8194e+04 | -3.9028e+03 | -1.0825e+04 | +| 6.8194e+04 | -1.9028e+03 | -1.0245e+04 | +| 6.8194e+04 | 9.7186e+01 | -1.0064e+04 | +| 6.8194e+04 | 2.0972e+03 | -1.0283e+04 | +| 6.8194e+04 | 4.0972e+03 | -1.0903e+04 | +| 6.8194e+04 | 6.0972e+03 | -1.1922e+04 | +| 6.8194e+04 | 8.0972e+03 | -1.3342e+04 | +| 6.8194e+04 | 1.0097e+04 | -1.5161e+04 | +| 6.8194e+04 | 1.2097e+04 | -1.7381e+04 | +| 6.8194e+04 | 1.4097e+04 | -2.0000e+04 | ++------------+-------------+-------------+ + +## es3 = + ++------------+-------------+-------------+ +| N | Q | M | +|------------+-------------+-------------| +| 0.0000e+00 | -2.0000e+04 | -2.0000e+04 | +| 0.0000e+00 | -1.8000e+04 | -1.6200e+04 | +| 0.0000e+00 | -1.6000e+04 | -1.2800e+04 | +| 0.0000e+00 | -1.4000e+04 | -9.8000e+03 | +| 0.0000e+00 | -1.2000e+04 | -7.2000e+03 | +| 0.0000e+00 | -1.0000e+04 | -5.0000e+03 | +| 0.0000e+00 | -8.0000e+03 | -3.2000e+03 | +| 0.0000e+00 | -6.0000e+03 | -1.8000e+03 | +| 0.0000e+00 | -4.0000e+03 | -8.0000e+02 | +| 0.0000e+00 | -2.0000e+03 | -2.0000e+02 | +| 0.0000e+00 | -4.6838e-12 | 4.8594e-11 | ++------------+-------------+-------------+ + +## es4 = + ++-------------+ +| N | +|-------------| +| -1.7688e+04 | +| -1.7688e+04 | ++-------------+ + +## es5 = + ++-------------+ +| N | +|-------------| +| -7.6244e+04 | +| -7.6244e+04 | ++-------------+ +""", +"exs_bar2_la.py":""" +# Analysis of a plane truss using loops + + +## Stiffness matrix K: + ++-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+ +| 3.5531e+08 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| -9.2808e+07 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 3.5531e+08 | 9.2808e+07 | -9.2808e+07 | -9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | 9.2808e+07 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 7.1062e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | +| 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 4.4812e+08 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | +| -9.2808e+07 | 9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 7.1062e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | -2.6250e+08 | 0.0000e+00 | +| 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | 4.4812e+08 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 3.5531e+08 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 9.2808e+07 | 3.5531e+08 | 0.0000e+00 | -2.6250e+08 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 3.5531e+08 | -9.2808e+07 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | -9.2808e+07 | 3.5531e+08 | ++-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+ + +## Displacements a: + ++-------------+ +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 2.3845e-03 | +| -4.4633e-03 | +| -1.6118e-03 | +| -4.1987e-03 | +| 3.0346e-03 | +| -1.0684e-02 | +| -1.6589e-03 | +| -1.1334e-02 | ++-------------+ + +## Reaction forces r: + ++-------------+ +| -8.6603e+05 | +| 2.4009e+05 | +| 6.1603e+05 | +| 1.9293e+05 | +| 2.3283e-10 | +| -2.3283e-10 | +| 1.1642e-10 | +| -1.1642e-10 | +| -2.3283e-10 | +| 3.4925e-10 | +| -2.9104e-11 | +| 4.6566e-10 | ++-------------+ + +## Element forces: + +N1 = 625938 +N2 = -423100 +N3 = 170640 +N4 = -12372.8 +N5 = -69447 +N6 = 170640 +N7 = -272838 +N8 = -241321 +N9 = 339534 +N10 = 371051""", +"exs_bar2_lb.py":""" +# Analysis of a plane truss using loops and extraction of element coordinates from a global coordinate matrix. + + +## Stiffness matrix K: + ++-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+ +| 3.5531e+08 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| -9.2808e+07 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 3.5531e+08 | 9.2808e+07 | -9.2808e+07 | -9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | 9.2808e+07 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 7.1062e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | +| 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 4.4812e+08 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | +| -9.2808e+07 | 9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 7.1062e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | -2.6250e+08 | 0.0000e+00 | +| 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | 4.4812e+08 | -9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 3.5531e+08 | 9.2808e+07 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | -9.2808e+07 | 9.2808e+07 | 3.5531e+08 | 0.0000e+00 | -2.6250e+08 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -9.2808e+07 | 9.2808e+07 | -2.6250e+08 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 3.5531e+08 | -9.2808e+07 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 9.2808e+07 | -9.2808e+07 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -2.6250e+08 | -9.2808e+07 | 3.5531e+08 | ++-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+ + +## Displacements a: + ++-------------+ +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 2.3845e-03 | +| -4.4633e-03 | +| -1.6118e-03 | +| -4.1987e-03 | +| 3.0346e-03 | +| -1.0684e-02 | +| -1.6589e-03 | +| -1.1334e-02 | ++-------------+ + +## Reaction forces r: + ++-------------+ +| -8.6603e+05 | +| 2.4009e+05 | +| 6.1603e+05 | +| 1.9293e+05 | +| 2.3283e-10 | +| -2.3283e-10 | +| 1.1642e-10 | +| -1.1642e-10 | +| -2.3283e-10 | +| 3.4925e-10 | +| -2.9104e-11 | +| 4.6566e-10 | ++-------------+ + +## Element forces: + +N1 = 625938 +N2 = -423100 +N3 = 170640 +N4 = -12372.8 +N5 = -69447 +N6 = 170640 +N7 = -272838 +N8 = -241321 +N9 = 339534 +N10 = 371051""", +"exs_beam2.py":"""+-------------+ +| a | +|-------------| +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 7.5357e-03 | +| -2.8741e-04 | +| -5.3735e-03 | +| 7.5161e-03 | +| -3.1259e-04 | +| 4.6656e-03 | +| 0.0000e+00 | +| 0.0000e+00 | +| -5.1513e-03 | ++-------------+ ++-------------+ +| r | +|-------------| +| 1.9268e+03 | +| 2.8741e+04 | +| 4.4527e+02 | +| 0.0000e+00 | +| 0.0000e+00 | +| -3.6380e-12 | +| -2.3283e-10 | +| 0.0000e+00 | +| -7.2760e-12 | +| -3.9268e+03 | +| 3.1259e+04 | +| 0.0000e+00 | ++-------------+ + +## es1 + ++-------------+------------+------------+ +| N | Vy | Mz | +|-------------+------------+------------| +| -2.8741e+04 | 1.9268e+03 | 8.1523e+03 | +| -2.8741e+04 | 1.9268e+03 | 7.7670e+03 | +| -2.8741e+04 | 1.9268e+03 | 7.3816e+03 | +| -2.8741e+04 | 1.9268e+03 | 6.9963e+03 | +| -2.8741e+04 | 1.9268e+03 | 6.6109e+03 | +| -2.8741e+04 | 1.9268e+03 | 6.2256e+03 | +| -2.8741e+04 | 1.9268e+03 | 5.8402e+03 | +| -2.8741e+04 | 1.9268e+03 | 5.4548e+03 | +| -2.8741e+04 | 1.9268e+03 | 5.0695e+03 | +| -2.8741e+04 | 1.9268e+03 | 4.6841e+03 | +| -2.8741e+04 | 1.9268e+03 | 4.2988e+03 | +| -2.8741e+04 | 1.9268e+03 | 3.9134e+03 | +| -2.8741e+04 | 1.9268e+03 | 3.5281e+03 | +| -2.8741e+04 | 1.9268e+03 | 3.1427e+03 | +| -2.8741e+04 | 1.9268e+03 | 2.7574e+03 | +| -2.8741e+04 | 1.9268e+03 | 2.3720e+03 | +| -2.8741e+04 | 1.9268e+03 | 1.9867e+03 | +| -2.8741e+04 | 1.9268e+03 | 1.6013e+03 | +| -2.8741e+04 | 1.9268e+03 | 1.2160e+03 | +| -2.8741e+04 | 1.9268e+03 | 8.3062e+02 | +| -2.8741e+04 | 1.9268e+03 | 4.4527e+02 | ++-------------+------------+------------+ + +## edi1 + ++------------+------------+ +| u1 | v1 | +|------------+------------| +| 2.8741e-04 | 7.5357e-03 | +| 2.7304e-04 | 6.5112e-03 | +| 2.5867e-04 | 5.5837e-03 | +| 2.4430e-04 | 4.7485e-03 | +| 2.2993e-04 | 4.0008e-03 | +| 2.1556e-04 | 3.3357e-03 | +| 2.0119e-04 | 2.7484e-03 | +| 1.8682e-04 | 2.2341e-03 | +| 1.7245e-04 | 1.7880e-03 | +| 1.5807e-04 | 1.4053e-03 | +| 1.4370e-04 | 1.0811e-03 | +| 1.2933e-04 | 8.1067e-04 | +| 1.1496e-04 | 5.8915e-04 | +| 1.0059e-04 | 4.1173e-04 | +| 8.6223e-05 | 2.7359e-04 | +| 7.1852e-05 | 1.6993e-04 | +| 5.7482e-05 | 9.5907e-05 | +| 4.3111e-05 | 4.6722e-05 | +| 2.8741e-05 | 1.7554e-05 | +| 1.4370e-05 | 3.5858e-06 | +| 0.0000e+00 | 3.4694e-18 | ++------------+------------+ + +## es2 + ++-------------+-------------+-------------+ +| N | Vy | Mz | +|-------------+-------------+-------------| +| -3.1259e+04 | -3.9268e+03 | -1.5707e+04 | +| -3.1259e+04 | -3.9268e+03 | -1.4922e+04 | +| -3.1259e+04 | -3.9268e+03 | -1.4136e+04 | +| -3.1259e+04 | -3.9268e+03 | -1.3351e+04 | +| -3.1259e+04 | -3.9268e+03 | -1.2566e+04 | +| -3.1259e+04 | -3.9268e+03 | -1.1780e+04 | +| -3.1259e+04 | -3.9268e+03 | -1.0995e+04 | +| -3.1259e+04 | -3.9268e+03 | -1.0210e+04 | +| -3.1259e+04 | -3.9268e+03 | -9.4242e+03 | +| -3.1259e+04 | -3.9268e+03 | -8.6389e+03 | +| -3.1259e+04 | -3.9268e+03 | -7.8535e+03 | +| -3.1259e+04 | -3.9268e+03 | -7.0682e+03 | +| -3.1259e+04 | -3.9268e+03 | -6.2828e+03 | +| -3.1259e+04 | -3.9268e+03 | -5.4975e+03 | +| -3.1259e+04 | -3.9268e+03 | -4.7121e+03 | +| -3.1259e+04 | -3.9268e+03 | -3.9268e+03 | +| -3.1259e+04 | -3.9268e+03 | -3.1414e+03 | +| -3.1259e+04 | -3.9268e+03 | -2.3561e+03 | +| -3.1259e+04 | -3.9268e+03 | -1.5707e+03 | +| -3.1259e+04 | -3.9268e+03 | -7.8535e+02 | +| -3.1259e+04 | -3.9268e+03 | 0.0000e+00 | ++-------------+-------------+-------------+ + +## edi2 + ++------------+------------+ +| u1 | v1 | +|------------+------------| +| 3.1259e-04 | 7.5161e-03 | +| 2.9696e-04 | 8.3527e-03 | +| 2.8133e-04 | 9.0027e-03 | +| 2.6570e-04 | 9.4761e-03 | +| 2.5007e-04 | 9.7825e-03 | +| 2.3444e-04 | 9.9319e-03 | +| 2.1881e-04 | 9.9341e-03 | +| 2.0318e-04 | 9.7988e-03 | +| 1.8755e-04 | 9.5359e-03 | +| 1.7193e-04 | 9.1552e-03 | +| 1.5630e-04 | 8.6665e-03 | +| 1.4067e-04 | 8.0796e-03 | +| 1.2504e-04 | 7.4044e-03 | +| 1.0941e-04 | 6.6506e-03 | +| 9.3777e-05 | 5.8282e-03 | +| 7.8148e-05 | 4.9468e-03 | +| 6.2518e-05 | 4.0163e-03 | +| 4.6889e-05 | 3.0466e-03 | +| 3.1259e-05 | 2.0474e-03 | +| 1.5630e-05 | 1.0286e-03 | +| 0.0000e+00 | 0.0000e+00 | ++------------+------------+ + +## es3 + ++-------------+-------------+-------------+ +| N | Vy | Mz | +|-------------+-------------+-------------| +| -3.9268e+03 | -2.8741e+04 | -8.1523e+03 | +| -3.9268e+03 | -2.5741e+04 | 1.9953e+01 | +| -3.9268e+03 | -2.2741e+04 | 7.2922e+03 | +| -3.9268e+03 | -1.9741e+04 | 1.3664e+04 | +| -3.9268e+03 | -1.6741e+04 | 1.9137e+04 | +| -3.9268e+03 | -1.3741e+04 | 2.3709e+04 | +| -3.9268e+03 | -1.0741e+04 | 2.7381e+04 | +| -3.9268e+03 | -7.7409e+03 | 3.0154e+04 | +| -3.9268e+03 | -4.7409e+03 | 3.2026e+04 | +| -3.9268e+03 | -1.7409e+03 | 3.2998e+04 | +| -3.9268e+03 | 1.2591e+03 | 3.3070e+04 | +| -3.9268e+03 | 4.2591e+03 | 3.2243e+04 | +| -3.9268e+03 | 7.2591e+03 | 3.0515e+04 | +| -3.9268e+03 | 1.0259e+04 | 2.7887e+04 | +| -3.9268e+03 | 1.3259e+04 | 2.4359e+04 | +| -3.9268e+03 | 1.6259e+04 | 1.9932e+04 | +| -3.9268e+03 | 1.9259e+04 | 1.4604e+04 | +| -3.9268e+03 | 2.2259e+04 | 8.3762e+03 | +| -3.9268e+03 | 2.5259e+04 | 1.2484e+03 | +| -3.9268e+03 | 2.8259e+04 | -6.7793e+03 | +| -3.9268e+03 | 3.1259e+04 | -1.5707e+04 | ++-------------+-------------+-------------+ + +## edi3 + ++------------+-------------+ +| u1 | v1 | +|------------+-------------| +| 7.5357e-03 | -2.8741e-04 | +| 7.5347e-03 | -1.9218e-03 | +| 7.5337e-03 | -3.5566e-03 | +| 7.5328e-03 | -5.1312e-03 | +| 7.5318e-03 | -6.5927e-03 | +| 7.5308e-03 | -7.8952e-03 | +| 7.5298e-03 | -9.0009e-03 | +| 7.5288e-03 | -9.8789e-03 | +| 7.5279e-03 | -1.0506e-02 | +| 7.5269e-03 | -1.0868e-02 | +| 7.5259e-03 | -1.0954e-02 | +| 7.5249e-03 | -1.0766e-02 | +| 7.5239e-03 | -1.0310e-02 | +| 7.5229e-03 | -9.6000e-03 | +| 7.5220e-03 | -8.6584e-03 | +| 7.5210e-03 | -7.5143e-03 | +| 7.5200e-03 | -6.2048e-03 | +| 7.5190e-03 | -4.7743e-03 | +| 7.5180e-03 | -3.2745e-03 | +| 7.5171e-03 | -1.7650e-03 | +| 7.5161e-03 | -3.1259e-04 | ++------------+-------------+ +sfac= +54.77300198398879 +sfac= +3.628630851048567e-05""", +"exs_flw_diff2.py":""" +## Ex + ++------------+------------+------------+------------+ +| x0 | x1 | x2 | x3 | +|------------+------------+------------+------------| +| 0.0000e+00 | 2.5000e-02 | 2.5000e-02 | 0.0000e+00 | +| 2.5000e-02 | 5.0000e-02 | 5.0000e-02 | 2.5000e-02 | +| 0.0000e+00 | 2.5000e-02 | 2.5000e-02 | 0.0000e+00 | +| 2.5000e-02 | 5.0000e-02 | 5.0000e-02 | 2.5000e-02 | +| 0.0000e+00 | 2.5000e-02 | 2.5000e-02 | 0.0000e+00 | +| 2.5000e-02 | 5.0000e-02 | 5.0000e-02 | 2.5000e-02 | +| 0.0000e+00 | 2.5000e-02 | 2.5000e-02 | 0.0000e+00 | +| 2.5000e-02 | 5.0000e-02 | 5.0000e-02 | 2.5000e-02 | ++------------+------------+------------+------------+ + +## Ey + ++------------+------------+------------+------------+ +| x0 | x1 | x2 | x3 | +|------------+------------+------------+------------| +| 0.0000e+00 | 0.0000e+00 | 2.5000e-02 | 2.5000e-02 | +| 0.0000e+00 | 0.0000e+00 | 2.5000e-02 | 2.5000e-02 | +| 2.5000e-02 | 2.5000e-02 | 5.0000e-02 | 5.0000e-02 | +| 2.5000e-02 | 2.5000e-02 | 5.0000e-02 | 5.0000e-02 | +| 5.0000e-02 | 5.0000e-02 | 7.5000e-02 | 7.5000e-02 | +| 5.0000e-02 | 5.0000e-02 | 7.5000e-02 | 7.5000e-02 | +| 7.5000e-02 | 7.5000e-02 | 1.0000e-01 | 1.0000e-01 | +| 7.5000e-02 | 7.5000e-02 | 1.0000e-01 | 1.0000e-01 | ++------------+------------+------------+------------+ + +## a + ++------------+ +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 6.6176e-05 | +| 9.3487e-05 | +| 0.0000e+00 | +| 1.7857e-04 | +| 2.5000e-04 | +| 0.0000e+00 | +| 4.3382e-04 | +| 5.4937e-04 | +| 5.0000e-04 | +| 1.0000e-03 | +| 1.0000e-03 | ++------------+ + +## Ed + ++------------+------------+------------+------------+ +| ed0 | ed1 | ed2 | ed3 | +|------------+------------+------------+------------| +| 0.0000e+00 | 0.0000e+00 | 6.6176e-05 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 9.3487e-05 | 6.6176e-05 | +| 0.0000e+00 | 6.6176e-05 | 1.7857e-04 | 0.0000e+00 | +| 6.6176e-05 | 9.3487e-05 | 2.5000e-04 | 1.7857e-04 | +| 0.0000e+00 | 1.7857e-04 | 4.3382e-04 | 0.0000e+00 | +| 1.7857e-04 | 2.5000e-04 | 5.4937e-04 | 4.3382e-04 | +| 0.0000e+00 | 4.3382e-04 | 1.0000e-03 | 5.0000e-04 | +| 4.3382e-04 | 5.4937e-04 | 1.0000e-03 | 1.0000e-03 | ++------------+------------+------------+------------+""", +"exs_flw_temp1.py":""" +## Temperatures a: + ++-------------+ +| -1.7000e+01 | +| -1.6438e+01 | +| -1.5861e+01 | +| 1.9238e+01 | +| 1.9475e+01 | +| 2.0000e+01 | ++-------------+ + +## Reaction flows r: + ++-------------+ +| -1.4039e+01 | +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 5.6843e-14 | +| 4.0394e+00 | ++-------------+ + +## Element flows: + +q1 = +14.039386189223357 +q2 = +14.039386189223451 +q3 = +14.039386189223485 +q4 = +4.039386189223492 +q5 = +4.03938618922342""", +"exs_spring.py":""" +## Stiffness matrix K: + ++-------------+-------------+-------------+ +| 3.0000e+03 | -3.0000e+03 | 0.0000e+00 | +| -3.0000e+03 | 7.5000e+03 | -4.5000e+03 | +| 0.0000e+00 | -4.5000e+03 | 4.5000e+03 | ++-------------+-------------+-------------+ + +## Displacements a: + ++------------+ +| 0.0000e+00 | +| 1.3333e-02 | +| 0.0000e+00 | ++------------+ + +## Reaction forces r: + ++-------------+ +| -4.0000e+01 | +| 0.0000e+00 | +| -6.0000e+01 | ++-------------+ + +## Element forces N: + +N1 = 40.0 +N2 = -20.0 +N3 = -40.0""", +"exs_flw_temp2.py":""" +## Stiffness matrix K: + ++-------------+-------------+-------------+-------------+-------------+-------------+ +| 2.5000e+01 | -2.5000e+01 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| -2.5000e+01 | 4.9300e+01 | -2.4300e+01 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | -2.4300e+01 | 2.4700e+01 | -4.0000e-01 | 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | -4.0000e-01 | 1.7400e+01 | -1.7000e+01 | 0.0000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -1.7000e+01 | 2.4700e+01 | -7.7000e+00 | +| 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | -7.7000e+00 | 7.7000e+00 | ++-------------+-------------+-------------+-------------+-------------+-------------+ + +## Temperatures a: + ++-------------+ +| -1.7000e+01 | +| -1.6438e+01 | +| -1.5861e+01 | +| 1.9238e+01 | +| 1.9475e+01 | +| 2.0000e+01 | ++-------------+ + +## Reaction flows r: + ++-------------+ +| -1.4039e+01 | +| 0.0000e+00 | +| 0.0000e+00 | +| 0.0000e+00 | +| 5.6843e-14 | +| 4.0394e+00 | ++-------------+ + +## Element flows r: + +q1 = 14.039386189223357 +q2 = 14.039386189223451 +q3 = 14.039386189223485 +q4 = 4.039386189223492 +q5 = 4.03938618922342""" + +} \ No newline at end of file diff --git a/examples/exs_flw_temp2.py b/examples/exs_flw_temp2.py index 05caa70..fcafa9a 100644 --- a/examples/exs_flw_temp2.py +++ b/examples/exs_flw_temp2.py @@ -29,8 +29,8 @@ # ----- Stiffness matrix K and load vector f --------------------- -K = np.mat(np.zeros((6, 6))) -f = np.mat(np.zeros((6, 1))) +K = np.matrix(np.zeros((6, 6))) +f = np.matrix(np.zeros((6, 1))) f[3] = 10.0 # ----- Element properties --------------------------------------- diff --git a/gen_output_dict.py b/gen_output_dict.py new file mode 100644 index 0000000..ecd60e4 --- /dev/null +++ b/gen_output_dict.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +""" +This script generates a dictionary of example outputs. +""" + +import os, sys +from pprint import pprint + +def gen_output_examples(): + + examples_dir = "examples" + + examples = [ + "exs_bar2.py", + "exs_bar2_la.py", + "exs_bar2_lb.py", + "exs_beam1.py", + "exs_beam2.py", + "exs_beambar2.py", + "exs_flw_diff2.py", + "exs_flw_temp1.py", + "exs_flw_temp2.py", + "exs_spring.py" + ] + + # Set environment variable to avoid blocking of plots + + os.environ["CFV_NO_BLOCK"] = "YES" + + # Assume 0 return codes + + return_codes = 0 + + for example in examples: + print(f"Running: {example}", end="") + + echo_string = f"echo ## EXAMPLE: {example} " + os.system(echo_string + "-"*(40-len(example)) + + " >> run_examples.log 2>&1") + + example_path = os.path.join(examples_dir, example) + python_executable = sys.executable + + return_code = os.system( + f'"{python_executable}" {example_path} >> run_examples.log 2>&1') + + if return_code == 0: + print(" --- PASSED!") + else: + print(" --- FAILED!") + + return_codes += return_code + + assert return_codes == 0 + + example_dict = {} + + with open("run_examples.log", "r") as f: + lines = f.readlines() + + current_example = "" + + for line in lines: + if "## EXAMPLE:" in line: + current_example = line.split()[2].strip() + example_dict[current_example] = "" + elif current_example!="": + example_dict[current_example] = example_dict[current_example] + line + + if os.path.exists("example_output.py"): + os.rename("example_output.py", "example_output.py.bak") + + with open("example_output.py", "w") as f: + f.write("examples = {\n") + for example, output in example_dict.items(): + f.write(f" \"{example}\": '''{output}''',\n") + f.write("}\n") + + +if __name__ == "__main__": + gen_output_examples() \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d34d2d1..0e1b9f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "calfem-python" -version = "3.6.9" +version = "3.6.10" description = "CALFEM for Python" authors = [ {name = "Jonas Lindemann", email = "jonas.lindemann@lunarc.lu.se"}, diff --git a/src/calfem/core.py b/src/calfem/core.py index fc157ae..fb1fa80 100644 --- a/src/calfem/core.py +++ b/src/calfem/core.py @@ -3270,18 +3270,18 @@ def flw2i4e(ex, ey, ep, D, eq=None): if ir == 1: g1 = 0.0 w1 = 2.0 - gp = np.mat([g1, g1]) - w = np.mat([w1, w1]) + gp = np.matrix([g1, g1]) + w = np.matrix([w1, w1]) elif ir == 2: g1 = 0.577350269189626 w1 = 1 - gp = np.mat([ + gp = np.matrix([ [-g1, -g1], [g1, -g1], [-g1, g1], [g1, g1] ]) - w = np.mat([ + w = np.matrix([ [w1, w1], [w1, w1], [w1, w1], @@ -3292,7 +3292,7 @@ def flw2i4e(ex, ey, ep, D, eq=None): g2 = 0. w1 = 0.555555555555555 w2 = 0.888888888888888 - gp = np.mat([ + gp = np.matrix([ [-g1, -g1], [-g2, -g1], [g1, -g1], @@ -3303,7 +3303,7 @@ def flw2i4e(ex, ey, ep, D, eq=None): [g2, g1], [g1, g1] ]) - w = np.mat([ + w = np.matrix([ [w1, w1], [w2, w1], [w1, w1], @@ -3327,7 +3327,7 @@ def flw2i4e(ex, ey, ep, D, eq=None): N = np.append(N, np.multiply((1+xsi), (1+eta))/4., axis=1) N = np.append(N, np.multiply((1-xsi), (1+eta))/4., axis=1) - dNr = np.mat(np.zeros((r2, 4))) + dNr = np.matrix(np.zeros((r2, 4))) dNr[0:r2:2, 0] = -(1-eta)/4. dNr[0:r2:2, 1] = (1-eta)/4. dNr[0:r2:2, 2] = (1+eta)/4. @@ -3337,9 +3337,9 @@ def flw2i4e(ex, ey, ep, D, eq=None): dNr[1:r2+1:2, 2] = (1+xsi)/4. dNr[1:r2+1:2, 3] = (1-xsi)/4. - Ke1 = np.mat(np.zeros((4, 4))) - fe1 = np.mat(np.zeros((4, 1))) - JT = dNr*np.mat([ex, ey]).T + Ke1 = np.matrix(np.zeros((4, 4))) + fe1 = np.matrix(np.zeros((4, 1))) + JT = dNr*np.matrix([ex, ey]).T for i in range(ngp): indx = np.array([2*(i+1)-1, 2*(i+1)]) @@ -3393,18 +3393,18 @@ def flw2i4s(ex, ey, ep, D, ed): if ir == 1: g1 = 0.0 w1 = 2.0 - gp = np.mat([g1, g1]) - w = np.mat([w1, w1]) + gp = np.matrix([g1, g1]) + w = np.matrix([w1, w1]) elif ir == 2: g1 = 0.577350269189626 w1 = 1 - gp = np.mat([ + gp = np.matrix([ [-g1, -g1], [g1, -g1], [-g1, g1], [g1, g1] ]) - w = np.mat([ + w = np.matrix([ [w1, w1], [w1, w1], [w1, w1], @@ -3415,7 +3415,7 @@ def flw2i4s(ex, ey, ep, D, ed): g2 = 0. w1 = 0.555555555555555 w2 = 0.888888888888888 - gp = np.mat([ + gp = np.matrix([ [-g1, -g1], [-g2, -g1], [g1, -g1], @@ -3426,7 +3426,7 @@ def flw2i4s(ex, ey, ep, D, ed): [g2, g1], [g1, g1] ]) - w = np.mat([ + w = np.matrix([ [w1, w1], [w2, w1], [w1, w1], @@ -3450,7 +3450,7 @@ def flw2i4s(ex, ey, ep, D, ed): N = np.append(N, np.multiply((1+xsi), (1+eta))/4., axis=1) N = np.append(N, np.multiply((1-xsi), (1+eta))/4., axis=1) - dNr = np.mat(np.zeros((r2, 4))) + dNr = np.matrix(np.zeros((r2, 4))) dNr[0:r2:2, 0] = -(1-eta)/4. dNr[0:r2:2, 1] = (1-eta)/4. dNr[0:r2:2, 2] = (1+eta)/4. @@ -3460,15 +3460,15 @@ def flw2i4s(ex, ey, ep, D, ed): dNr[1:r2+1:2, 2] = (1+xsi)/4. dNr[1:r2+1:2, 3] = (1-xsi)/4. - eci = N*np.mat([ex, ey]).T + eci = N*np.matrix([ex, ey]).T if ed.ndim == 1: ed = np.array([ed]) red, ced = np.shape(ed) - JT = dNr*np.mat([ex, ey]).T + JT = dNr*np.matrix([ex, ey]).T - es = np.mat(np.zeros((ngp*red, 2))) - et = np.mat(np.zeros((ngp*red, 2))) + es = np.matrix(np.zeros((ngp*red, 2))) + et = np.matrix(np.zeros((ngp*red, 2))) for i in range(ngp): indx = np.array([2*(i+1)-1, 2*(i+1)]) detJ = np.linalg.det(JT[indx-1, :]) @@ -3519,18 +3519,18 @@ def flw2i8e(ex, ey, ep, D, eq=None): if ir == 1: g1 = 0.0 w1 = 2.0 - gp = np.mat([g1, g1]) - w = np.mat([w1, w1]) + gp = np.matrix([g1, g1]) + w = np.matrix([w1, w1]) elif ir == 2: g1 = 0.577350269189626 w1 = 1 - gp = np.mat([ + gp = np.matrix([ [-g1, -g1], [g1, -g1], [-g1, g1], [g1, g1] ]) - w = np.mat([ + w = np.matrix([ [w1, w1], [w1, w1], [w1, w1], @@ -3541,7 +3541,7 @@ def flw2i8e(ex, ey, ep, D, eq=None): g2 = 0. w1 = 0.555555555555555 w2 = 0.888888888888888 - gp = np.mat([ + gp = np.matrix([ [-g1, -g1], [-g2, -g1], [g1, -g1], @@ -3552,7 +3552,7 @@ def flw2i8e(ex, ey, ep, D, eq=None): [g2, g1], [g1, g1] ]) - w = np.mat([ + w = np.matrix([ [w1, w1], [w2, w1], [w1, w1], @@ -3587,7 +3587,7 @@ def flw2i8e(ex, ey, ep, D, eq=None): N = np.append(N, np.multiply( (1-xsi), (1-np.multiply(eta, eta)))/2., axis=1) - dNr = np.mat(np.zeros((r2, 8))) + dNr = np.matrix(np.zeros((r2, 8))) dNr[0:r2:2, 0] = -(-np.multiply((1-eta), (1+xsi+eta)) + np.multiply((1-xsi), (1-eta)))/4. dNr[0:r2:2, 1] = -(np.multiply((1-eta), (1-xsi+eta)) - @@ -3613,9 +3613,9 @@ def flw2i8e(ex, ey, ep, D, eq=None): dNr[1:r2+1:2, 6] = (1-np.multiply(xsi, xsi))/2. dNr[1:r2+1:2, 7] = -np.multiply(eta, (1-xsi)) - Ke1 = np.mat(np.zeros((8, 8))) - fe1 = np.mat(np.zeros((8, 1))) - JT = dNr*np.mat([ex, ey]).T + Ke1 = np.matrix(np.zeros((8, 8))) + fe1 = np.matrix(np.zeros((8, 1))) + JT = dNr*np.matrix([ex, ey]).T for i in range(ngp): indx = np.array([2*(i+1)-1, 2*(i+1)]) @@ -3669,18 +3669,18 @@ def flw2i8s(ex, ey, ep, D, ed): if ir == 1: g1 = 0.0 w1 = 2.0 - gp = np.mat([g1, g1]) - w = np.mat([w1, w1]) + gp = np.matrix([g1, g1]) + w = np.matrix([w1, w1]) elif ir == 2: g1 = 0.577350269189626 w1 = 1 - gp = np.mat([ + gp = np.matrix([ [-g1, -g1], [g1, -g1], [-g1, g1], [g1, g1] ]) - w = np.mat([ + w = np.matrix([ [w1, w1], [w1, w1], [w1, w1], @@ -3691,7 +3691,7 @@ def flw2i8s(ex, ey, ep, D, ed): g2 = 0. w1 = 0.555555555555555 w2 = 0.888888888888888 - gp = np.mat([ + gp = np.matrix([ [-g1, -g1], [-g2, -g1], [g1, -g1], @@ -3702,7 +3702,7 @@ def flw2i8s(ex, ey, ep, D, ed): [g2, g1], [g1, g1] ]) - w = np.mat([ + w = np.matrix([ [w1, w1], [w2, w1], [w1, w1], @@ -3737,7 +3737,7 @@ def flw2i8s(ex, ey, ep, D, ed): N = np.append(N, np.multiply( (1-xsi), (1-np.multiply(eta, eta)))/2., axis=1) - dNr = np.mat(np.zeros((r2, 8))) + dNr = np.matrix(np.zeros((r2, 8))) dNr[0:r2:2, 0] = -(-np.multiply((1-eta), (1+xsi+eta)) + np.multiply((1-xsi), (1-eta)))/4. dNr[0:r2:2, 1] = -(np.multiply((1-eta), (1-xsi+eta)) - @@ -3763,14 +3763,14 @@ def flw2i8s(ex, ey, ep, D, ed): dNr[1:r2+1:2, 6] = (1-np.multiply(xsi, xsi))/2. dNr[1:r2+1:2, 7] = -np.multiply(eta, (1-xsi)) - eci = N*np.mat([ex, ey]).T + eci = N*np.matrix([ex, ey]).T if ed.ndim == 1: ed = np.array([ed]) red, ced = np.shape(ed) - JT = dNr*np.mat([ex, ey]).T + JT = dNr*np.matrix([ex, ey]).T - es = np.mat(np.zeros((ngp*red, 2))) - et = np.mat(np.zeros((ngp*red, 2))) + es = np.matrix(np.zeros((ngp*red, 2))) + et = np.matrix(np.zeros((ngp*red, 2))) for i in range(ngp): indx = np.array([2*(i+1)-1, 2*(i+1)]) @@ -3823,7 +3823,7 @@ def flw3i8e(ex, ey, ez, ep, D, eq=None): if ir == 2: g1 = 0.577350269189626 w1 = 1 - gp = np.mat([ + gp = np.matrix([ [-1, -1, -1], [1, -1, -1], [1, 1, -1], @@ -3833,37 +3833,37 @@ def flw3i8e(ex, ey, ez, ep, D, eq=None): [1, 1, 1], [-1, 1, 1] ])*g1 - w = np.mat(np.ones((8, 3)))*w1 + w = np.matrix(np.ones((8, 3)))*w1 elif ir == 3: g1 = 0.774596669241483 g2 = 0. w1 = 0.555555555555555 w2 = 0.888888888888888 - gp = np.mat(np.zeros((27, 3))) - w = np.mat(np.zeros((27, 3))) + gp = np.matrix(np.zeros((27, 3))) + w = np.matrix(np.zeros((27, 3))) I1 = np.array([-1, 0, 1, -1, 0, 1, -1, 0, 1]) I2 = np.array([0, -1, 0, 0, 1, 0, 0, 1, 0]) - gp[:, 0] = np.mat([I1, I1, I1]).reshape(27, 1)*g1 - gp[:, 0] = np.mat([I2, I2, I2]).reshape(27, 1)*g2+gp[:, 0] + gp[:, 0] = np.matrix([I1, I1, I1]).reshape(27, 1)*g1 + gp[:, 0] = np.matrix([I2, I2, I2]).reshape(27, 1)*g2+gp[:, 0] I1 = abs(I1) I2 = abs(I2) - w[:, 0] = np.mat([I1, I1, I1]).reshape(27, 1)*w1 - w[:, 0] = np.mat([I2, I2, I2]).reshape(27, 1)*w2+w[:, 0] + w[:, 0] = np.matrix([I1, I1, I1]).reshape(27, 1)*w1 + w[:, 0] = np.matrix([I2, I2, I2]).reshape(27, 1)*w2+w[:, 0] I1 = np.array([-1, -1, -1, 0, 0, 0, 1, 1, 1]) I2 = np.array([0, 0, 0, 1, 1, 1, 0, 0, 0]) - gp[:, 1] = np.mat([I1, I1, I1]).reshape(27, 1)*g1 - gp[:, 1] = np.mat([I2, I2, I2]).reshape(27, 1)*g2+gp[:, 1] + gp[:, 1] = np.matrix([I1, I1, I1]).reshape(27, 1)*g1 + gp[:, 1] = np.matrix([I2, I2, I2]).reshape(27, 1)*g2+gp[:, 1] I1 = abs(I1) I2 = abs(I2) - w[:, 1] = np.mat([I1, I1, I1]).reshape(27, 1)*w1 - w[:, 1] = np.mat([I2, I2, I2]).reshape(27, 1)*w2+w[:, 1] + w[:, 1] = np.matrix([I1, I1, I1]).reshape(27, 1)*w1 + w[:, 1] = np.matrix([I2, I2, I2]).reshape(27, 1)*w2+w[:, 1] I1 = np.array([-1, -1, -1, -1, -1, -1, -1, -1, -1]) I2 = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0]) I3 = abs(I1) - gp[:, 2] = np.mat([I1, I2, I3]).reshape(27, 1)*g1 - gp[:, 2] = np.mat([I2, I3, I2]).reshape(27, 1)*g2+gp[:, 2] - w[:, 2] = np.mat([I3, I2, I3]).reshape(27, 1)*w1 - w[:, 2] = np.mat([I2, I3, I2]).reshape(27, 1)*w2+w[:, 2] + gp[:, 2] = np.matrix([I1, I2, I3]).reshape(27, 1)*g1 + gp[:, 2] = np.matrix([I2, I3, I2]).reshape(27, 1)*g2+gp[:, 2] + w[:, 2] = np.matrix([I3, I2, I3]).reshape(27, 1)*w1 + w[:, 2] = np.matrix([I2, I3, I2]).reshape(27, 1)*w2+w[:, 2] else: info("Used number of integration points not implemented") return @@ -3891,7 +3891,7 @@ def flw3i8e(ex, ey, ez, ep, D, eq=None): N = np.append(N, np.multiply(np.multiply( (1-xsi), (1+eta)), (1+zet))/8., axis=1) - dNr = np.mat(np.zeros((r2, 8))) + dNr = np.matrix(np.zeros((r2, 8))) dNr[0:r2:3, 0] = np.multiply(-(1-eta), (1-zet)) dNr[0:r2:3, 1] = np.multiply((1-eta), (1-zet)) dNr[0:r2:3, 2] = np.multiply((1+eta), (1-zet)) @@ -3918,9 +3918,9 @@ def flw3i8e(ex, ey, ez, ep, D, eq=None): dNr[2:r2+2:3, 7] = np.multiply((1-xsi), (1+eta)) dNr = dNr/8. - Ke1 = np.mat(np.zeros((8, 8))) - fe1 = np.mat(np.zeros((8, 1))) - JT = dNr*np.mat([ex, ey, ez]).T + Ke1 = np.matrix(np.zeros((8, 8))) + fe1 = np.matrix(np.zeros((8, 1))) + JT = dNr*np.matrix([ex, ey, ez]).T for i in range(ngp): indx = np.array([3*(i+1)-2, 3*(i+1)-1, 3*(i+1)]) @@ -3977,7 +3977,7 @@ def flw3i8s(ex, ey, ez, ep, D, ed): if ir == 2: g1 = 0.577350269189626 w1 = 1 - gp = np.mat([ + gp = np.matrix([ [-1, -1, -1], [1, -1, -1], [1, 1, -1], @@ -3987,37 +3987,37 @@ def flw3i8s(ex, ey, ez, ep, D, ed): [1, 1, 1], [-1, 1, 1] ])*g1 - w = np.mat(np.ones((8, 3)))*w1 + w = np.matrix(np.ones((8, 3)))*w1 elif ir == 3: g1 = 0.774596669241483 g2 = 0. w1 = 0.555555555555555 w2 = 0.888888888888888 - gp = np.mat(np.zeros((27, 3))) - w = np.mat(np.zeros((27, 3))) + gp = np.matrix(np.zeros((27, 3))) + w = np.matrix(np.zeros((27, 3))) I1 = np.array([-1, 0, 1, -1, 0, 1, -1, 0, 1]) I2 = np.array([0, -1, 0, 0, 1, 0, 0, 1, 0]) - gp[:, 0] = np.mat([I1, I1, I1]).reshape(27, 1)*g1 - gp[:, 0] = np.mat([I2, I2, I2]).reshape(27, 1)*g2+gp[:, 0] + gp[:, 0] = np.matrix([I1, I1, I1]).reshape(27, 1)*g1 + gp[:, 0] = np.matrix([I2, I2, I2]).reshape(27, 1)*g2+gp[:, 0] I1 = abs(I1) I2 = abs(I2) - w[:, 0] = np.mat([I1, I1, I1]).reshape(27, 1)*w1 - w[:, 0] = np.mat([I2, I2, I2]).reshape(27, 1)*w2+w[:, 0] + w[:, 0] = np.matrix([I1, I1, I1]).reshape(27, 1)*w1 + w[:, 0] = np.matrix([I2, I2, I2]).reshape(27, 1)*w2+w[:, 0] I1 = np.array([-1, -1, -1, 0, 0, 0, 1, 1, 1]) I2 = np.array([0, 0, 0, 1, 1, 1, 0, 0, 0]) - gp[:, 1] = np.mat([I1, I1, I1]).reshape(27, 1)*g1 - gp[:, 1] = np.mat([I2, I2, I2]).reshape(27, 1)*g2+gp[:, 1] + gp[:, 1] = np.matrix([I1, I1, I1]).reshape(27, 1)*g1 + gp[:, 1] = np.matrix([I2, I2, I2]).reshape(27, 1)*g2+gp[:, 1] I1 = abs(I1) I2 = abs(I2) - w[:, 1] = np.mat([I1, I1, I1]).reshape(27, 1)*w1 - w[:, 1] = np.mat([I2, I2, I2]).reshape(27, 1)*w2+w[:, 1] + w[:, 1] = np.matrix([I1, I1, I1]).reshape(27, 1)*w1 + w[:, 1] = np.matrix([I2, I2, I2]).reshape(27, 1)*w2+w[:, 1] I1 = np.array([-1, -1, -1, -1, -1, -1, -1, -1, -1]) I2 = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0]) I3 = abs(I1) - gp[:, 2] = np.mat([I1, I2, I3]).reshape(27, 1)*g1 - gp[:, 2] = np.mat([I2, I3, I2]).reshape(27, 1)*g2+gp[:, 2] - w[:, 2] = np.mat([I3, I2, I3]).reshape(27, 1)*w1 - w[:, 2] = np.mat([I2, I3, I2]).reshape(27, 1)*w2+w[:, 2] + gp[:, 2] = np.matrix([I1, I2, I3]).reshape(27, 1)*g1 + gp[:, 2] = np.matrix([I2, I3, I2]).reshape(27, 1)*g2+gp[:, 2] + w[:, 2] = np.matrix([I3, I2, I3]).reshape(27, 1)*w1 + w[:, 2] = np.matrix([I2, I3, I2]).reshape(27, 1)*w2+w[:, 2] else: info("Used number of integration points not implemented") return @@ -4045,7 +4045,7 @@ def flw3i8s(ex, ey, ez, ep, D, ed): N = np.append(N, np.multiply(np.multiply( (1-xsi), (1+eta)), (1+zet))/8., axis=1) - dNr = np.mat(np.zeros((r2, 8))) + dNr = np.matrix(np.zeros((r2, 8))) dNr[0:r2:3, 0] = np.multiply(-(1-eta), (1-zet)) dNr[0:r2:3, 1] = np.multiply((1-eta), (1-zet)) dNr[0:r2:3, 2] = np.multiply((1+eta), (1-zet)) @@ -4072,14 +4072,14 @@ def flw3i8s(ex, ey, ez, ep, D, ed): dNr[2:r2+2:3, 7] = np.multiply((1-xsi), (1+eta)) dNr = dNr/8. - eci = N*np.mat([ex, ey, ez]).T + eci = N*np.matrix([ex, ey, ez]).T if ed.ndim == 1: ed = np.array([ed]) red, ced = np.shape(ed) - JT = dNr*np.mat([ex, ey, ez]).T + JT = dNr*np.matrix([ex, ey, ez]).T - es = np.mat(np.zeros((ngp*red, 3))) - et = np.mat(np.zeros((ngp*red, 3))) + es = np.matrix(np.zeros((ngp*red, 3))) + et = np.matrix(np.zeros((ngp*red, 3))) for i in range(ngp): indx = np.array([3*(i+1)-2, 3*(i+1)-1, 3*(i+1)]) detJ = np.linalg.det(JT[indx-1, :]) @@ -4128,7 +4128,7 @@ def plante(ex, ey, ep, D, eq=None): bx = eq[0] by = eq[1] - C = np.mat([ + C = np.matrix([ [1, ex[0], ey[0], 0, 0, 0], [0, 0, 0, 1, ex[0], ey[0]], [1, ex[1], ey[1], 0, 0, 0], @@ -4137,7 +4137,7 @@ def plante(ex, ey, ep, D, eq=None): [0, 0, 0, 1, ex[2], ey[2]] ]) - A = 0.5*np.linalg.det(np.mat([ + A = 0.5*np.linalg.det(np.matrix([ [1, ex[0], ey[0]], [1, ex[1], ey[1]], [1, ex[2], ey[2]] @@ -4146,7 +4146,7 @@ def plante(ex, ey, ep, D, eq=None): # --------- plane stress -------------------------------------- if ptype == 1: - B = np.mat([ + B = np.matrix([ [0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0] @@ -4161,7 +4161,7 @@ def plante(ex, ey, ep, D, eq=None): Dm = D Ke = B.T*Dm*B*A*t - fe = A/3*np.mat([bx, by, bx, by, bx, by]).T*t + fe = A/3*np.matrix([bx, by, bx, by, bx, by]).T*t if eq is None: return Ke @@ -4171,7 +4171,7 @@ def plante(ex, ey, ep, D, eq=None): #--------- plane strain -------------------------------------- elif ptype == 2: - B = np.mat([ + B = np.matrix([ [0, 1, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, 1, ], [0, 0, 1, 0, 1, 0, ] @@ -4185,7 +4185,7 @@ def plante(ex, ey, ep, D, eq=None): Dm = D Ke = B.T*Dm*B*A*t - fe = A/3*np.mat([bx, by, bx, by, bx, by]).T*t + fe = A/3*np.matrix([bx, by, bx, by, bx, by]).T*t if eq is None: return Ke @@ -4371,7 +4371,7 @@ def plantf(ex, ey, ep, es): if ptype == 1: - C = np.mat([ + C = np.matrix([ [1, ex[0], ey[0], 0, 0, 0], [0, 0, 0, 1, ex[0], ey[0]], [1, ex[1], ey[1], 0, 0, 0], @@ -4380,13 +4380,13 @@ def plantf(ex, ey, ep, es): [0, 0, 0, 1, ex[2], ey[2]] ]) - A = 0.5*np.linalg.det(np.mat([ + A = 0.5*np.linalg.det(np.matrix([ [1, ex[0], ey[0]], [1, ex[1], ey[1]], [1, ex[2], ey[2]] ])) - B = np.mat([ + B = np.matrix([ [0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0] @@ -4405,7 +4405,7 @@ def plantf(ex, ey, ep, es): elif ptype == 2: - C = np.mat([ + C = np.matrix([ [1, ex[0], ey[0], 0, 0, 0], [0, 0, 0, 1, ex[0], ey[0]], [1, ex[1], ey[1], 0, 0, 0], @@ -4414,13 +4414,13 @@ def plantf(ex, ey, ep, es): [0, 0, 0, 1, ex[2], ey[2]] ]) - A = 0.5*np.linalg.det(np.mat([ + A = 0.5*np.linalg.det(np.matrix([ [1, ex[0], ey[0]], [1, ex[1], ey[1]], [1, ex[2], ey[2]] ])) - B = np.mat([ + B = np.matrix([ [0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0] @@ -4502,7 +4502,7 @@ def platre(ex, ey, ep, D, eq=None): C20 = 1/3.*A8*D[0, 0]+2/15.*A9*D[2, 2] C21 = D[0, 1] - Keq = np.mat(np.zeros((12, 12))) + Keq = np.matrix(np.zeros((12, 12))) Keq[0, 0:13] = C1, C5, -C6, C2, C9, -C8, C4, C11, -C12, C3, C7, -C10 Keq[1, 1:13] = C13, -C21, C9, C15, 0, -C11, C19, 0, -C7, C17, 0 Keq[2, 2:13] = C14, C8, 0, C18, C12, 0, C20, -C10, 0, C16 @@ -4523,7 +4523,7 @@ def platre(ex, ey, ep, D, eq=None): R2 = q*Lx*Ly**2/24 R3 = q*Ly*Lx**2/24 - feq = np.mat([R1, R2, -R3, R1, R2, R3, R1, -R2, R3, R1, -R2, -R3]) + feq = np.matrix([R1, R2, -R3, R1, R2, R3, R1, -R2, R3, R1, -R2, -R3]) if eq != None: return Keq, feq @@ -4634,22 +4634,22 @@ def planqs(ex, ey, ep, D, ed, eq=None): A1 = 0.5 * \ np.linalg.det( - np.hstack([np.ones((3, 1)), np.mat(ex1).T, np.mat(ey1).T])) + np.hstack([np.ones((3, 1)), np.matrix(ex1).T, np.matrix(ey1).T])) A2 = 0.5 * \ np.linalg.det( - np.hstack([np.ones((3, 1)), np.mat(ex2).T, np.mat(ey2).T])) + np.hstack([np.ones((3, 1)), np.matrix(ex2).T, np.matrix(ey2).T])) A3 = 0.5 * \ np.linalg.det( - np.hstack([np.ones((3, 1)), np.mat(ex3).T, np.mat(ey3).T])) + np.hstack([np.ones((3, 1)), np.matrix(ex3).T, np.matrix(ey3).T])) A4 = 0.5 * \ np.linalg.det( - np.hstack([np.ones((3, 1)), np.mat(ex4).T, np.mat(ey4).T])) + np.hstack([np.ones((3, 1)), np.matrix(ex4).T, np.matrix(ey4).T])) Atot = A1+A2+A3+A4 a, _ = solveq(K, f, np.array(range(1, 9)), ed) # ni = ed.shape[0] -# a = np.mat(empty((10,ni))) +# a = np.matrix(empty((10,ni))) # for i in range(ni): # a[:,i] = solveq(K, f, np.array(range(1,9)), ed[i,:])[0] # #a = np.hstack([a, solveq(K, f, np.hstack([matrix(range(1,9)).T, ed[i,:].T]) ) ]) @@ -4701,17 +4701,17 @@ def plani4e(ex, ey, ep, D, eq=None): if ir == 1: g1 = 0.0 w1 = 2.0 - gp = np.mat([g1, g1]) - w = np.mat([w1, w1]) + gp = np.matrix([g1, g1]) + w = np.matrix([w1, w1]) elif ir == 2: g1 = 0.577350269189626 w1 = 1 - gp = np.mat([ + gp = np.matrix([ [-g1, -g1], [g1, -g1], [-g1, g1], [g1, g1]]) - w = np.mat([ + w = np.matrix([ [w1, w1], [w1, w1], [w1, w1], @@ -4721,7 +4721,7 @@ def plani4e(ex, ey, ep, D, eq=None): g2 = 0. w1 = 0.555555555555555 w2 = 0.888888888888888 - gp = np.mat([ + gp = np.matrix([ [-g1, -g1], [-g2, -g1], [g1, -g1], @@ -4731,7 +4731,7 @@ def plani4e(ex, ey, ep, D, eq=None): [-g1, g1], [g2, g1], [g1, g1]]) - w = np.mat([ + w = np.matrix([ [w1, w1], [w2, w1], [w1, w1], @@ -4753,7 +4753,7 @@ def plani4e(ex, ey, ep, D, eq=None): N = np.append(N, np.multiply((1+xsi), (1+eta))/4., axis=1) N = np.append(N, np.multiply((1-xsi), (1+eta))/4., axis=1) - dNr = np.mat(np.zeros((r2, 4))) + dNr = np.matrix(np.zeros((r2, 4))) dNr[0:r2:2, 0] = -(1-eta)/4. dNr[0:r2:2, 1] = (1-eta)/4. dNr[0:r2:2, 2] = (1+eta)/4. @@ -4764,9 +4764,9 @@ def plani4e(ex, ey, ep, D, eq=None): dNr[1:r2+1:2, 3] = (1-xsi)/4. # - Ke1 = np.mat(np.zeros((8, 8))) - fe1 = np.mat(np.zeros((8, 1))) - JT = dNr*np.mat([ex, ey]).T + Ke1 = np.matrix(np.zeros((8, 8))) + fe1 = np.matrix(np.zeros((8, 1))) + JT = dNr*np.matrix([ex, ey]).T # --------- plane stress -------------------------------------- if ptype == 1: colD = np.shape(D)[0] @@ -5913,12 +5913,12 @@ def statcon(K, f, cd): aindx = np.delete(aindx, cd, 0) bindx = cd - Kaa = np.mat(K[np.ix_(aindx, aindx)]) - Kab = np.mat(K[np.ix_(aindx, bindx)]) - Kbb = np.mat(K[np.ix_(bindx, bindx)]) + Kaa = np.matrix(K[np.ix_(aindx, aindx)]) + Kab = np.matrix(K[np.ix_(aindx, bindx)]) + Kbb = np.matrix(K[np.ix_(bindx, bindx)]) - fa = np.mat(f[aindx]) - fb = np.mat(f[bindx]) + fa = np.matrix(f[aindx]) + fb = np.matrix(f[bindx]) K1 = Kaa-Kab*Kbb.I*Kab.T f1 = fa-Kab*Kbb.I*fb diff --git a/src/calfem/vis_mpl.py b/src/calfem/vis_mpl.py index 5df7e70..5f85ccc 100644 --- a/src/calfem/vis_mpl.py +++ b/src/calfem/vis_mpl.py @@ -17,12 +17,6 @@ import matplotlib as mpl import matplotlib.tri as tri -try: - from numpy.lib.function_base import place -except: - print("from numpy.lib.function_base import place - Not available") - pass - from calfem.core import beam2crd import calfem.core as cfc @@ -39,6 +33,12 @@ import logging as cflog +try: + from numpy.lib.function_base import place +except: + pass + + g_figures = [] diff --git a/test_examples.log b/test_examples.log index f8561e0..af23e8a 100644 --- a/test_examples.log +++ b/test_examples.log @@ -101,14 +101,14 @@ sfac= | 2.4009e+05 | | 6.1603e+05 | | 1.9293e+05 | -| 2.3283e-10 | -| -2.3283e-10 | -| 1.1642e-10 | +| 0.0000e+00 | +| -1.4552e-10 | | -1.1642e-10 | -| -2.3283e-10 | -| 3.4925e-10 | -| -2.9104e-11 | -| 4.6566e-10 | +| 5.8208e-11 | +| -1.1642e-10 | +| 2.3283e-10 | +| 2.9104e-11 | +| 2.9104e-10 | +-------------+ ## Element forces: @@ -169,14 +169,14 @@ N10 = 371051 | 2.4009e+05 | | 6.1603e+05 | | 1.9293e+05 | -| 2.3283e-10 | -| -2.3283e-10 | -| 1.1642e-10 | +| 0.0000e+00 | +| -1.4552e-10 | | -1.1642e-10 | -| -2.3283e-10 | -| 3.4925e-10 | -| -2.9104e-11 | -| 4.6566e-10 | +| 5.8208e-11 | +| -1.1642e-10 | +| 2.3283e-10 | +| 2.9104e-11 | +| 2.9104e-10 | +-------------+ ## Element forces: @@ -206,8 +206,8 @@ N10 = 371051 | r | |-------------| | 6.6667e+03 | -| 0.0000e+00 | -| 9.0949e-12 | +| -3.6380e-12 | +| 7.2760e-12 | | -1.0914e-11 | | 3.3333e+03 | | 0.0000e+00 | @@ -271,7 +271,7 @@ N10 = 371051 | -1.9920e-02 | | -1.4334e-02 | | -7.4833e-03 | -| 0.0000e+00 | +| 6.9389e-18 | +-------------+ ## ec2 @@ -312,10 +312,10 @@ N10 = 371051 | 4.4527e+02 | | 0.0000e+00 | | 0.0000e+00 | -| -3.6380e-12 | -| -2.3283e-10 | | 0.0000e+00 | -| -7.2760e-12 | +| -2.3283e-10 | +| 3.6380e-12 | +| 3.6380e-12 | | -3.9268e+03 | | 3.1259e+04 | | 0.0000e+00 | @@ -374,7 +374,7 @@ N10 = 371051 | 4.3111e-05 | 4.6722e-05 | | 2.8741e-05 | 1.7554e-05 | | 1.4370e-05 | 3.5858e-06 | -| 0.0000e+00 | 3.4694e-18 | +| 0.0000e+00 | 1.7347e-18 | +------------+------------+ ## es2 @@ -402,7 +402,7 @@ N10 = 371051 | -3.1259e+04 | -3.9268e+03 | -2.3561e+03 | | -3.1259e+04 | -3.9268e+03 | -1.5707e+03 | | -3.1259e+04 | -3.9268e+03 | -7.8535e+02 | -| -3.1259e+04 | -3.9268e+03 | 0.0000e+00 | +| -3.1259e+04 | -3.9268e+03 | 5.5511e-12 | +-------------+-------------+-------------+ ## edi2 @@ -430,7 +430,7 @@ N10 = 371051 | 4.6889e-05 | 3.0466e-03 | | 3.1259e-05 | 2.0474e-03 | | 1.5630e-05 | 1.0286e-03 | -| 0.0000e+00 | 0.0000e+00 | +| 0.0000e+00 | 3.4694e-18 | +------------+------------+ ## es3 @@ -489,7 +489,7 @@ N10 = 371051 | 7.5161e-03 | -3.1259e-04 | +------------+-------------+ sfac= -54.77300198398879 +54.77300198398877 sfac= 3.628630851048567e-05 ## EXAMPLE: exs_beambar2.py ------------------------- @@ -520,14 +520,14 @@ sfac= | -6.6044e+03 | | -1.4032e+03 | | 0.0000e+00 | +| 1.4552e-11 | +| 5.0022e-12 | | 0.0000e+00 | -| -2.2737e-12 | -| -5.8208e-11 | | 0.0000e+00 | -| 2.9104e-11 | +| 2.1828e-11 | | 0.0000e+00 | | -2.9104e-11 | -| 9.5497e-12 | +| 3.8654e-11 | | 8.0702e+04 | | 4.6604e+04 | +-------------+ @@ -573,17 +573,17 @@ sfac= +------------+-------------+-------------+ | N | Q | M | |------------+-------------+-------------| -| 0.0000e+00 | -2.0000e+04 | -2.0000e+04 | -| 0.0000e+00 | -1.8000e+04 | -1.6200e+04 | -| 0.0000e+00 | -1.6000e+04 | -1.2800e+04 | -| 0.0000e+00 | -1.4000e+04 | -9.8000e+03 | -| 0.0000e+00 | -1.2000e+04 | -7.2000e+03 | -| 0.0000e+00 | -1.0000e+04 | -5.0000e+03 | -| 0.0000e+00 | -8.0000e+03 | -3.2000e+03 | -| 0.0000e+00 | -6.0000e+03 | -1.8000e+03 | -| 0.0000e+00 | -4.0000e+03 | -8.0000e+02 | -| 0.0000e+00 | -2.0000e+03 | -2.0000e+02 | -| 0.0000e+00 | -3.2786e-11 | 2.9859e-11 | +| 2.1684e-11 | -2.0000e+04 | -2.0000e+04 | +| 2.1684e-11 | -1.8000e+04 | -1.6200e+04 | +| 2.1684e-11 | -1.6000e+04 | -1.2800e+04 | +| 2.1684e-11 | -1.4000e+04 | -9.8000e+03 | +| 2.1684e-11 | -1.2000e+04 | -7.2000e+03 | +| 2.1684e-11 | -1.0000e+04 | -5.0000e+03 | +| 2.1684e-11 | -8.0000e+03 | -3.2000e+03 | +| 2.1684e-11 | -6.0000e+03 | -1.8000e+03 | +| 2.1684e-11 | -4.0000e+03 | -8.0000e+02 | +| 2.1684e-11 | -2.0000e+03 | -2.0000e+02 | +| 2.1684e-11 | 9.3675e-12 | -7.6111e-12 | +------------+-------------+-------------+ ## es4 = @@ -686,8 +686,8 @@ sfac= +-------------+ | -1.4039e+01 | -| 0.0000e+00 | -| 0.0000e+00 | +| -5.6843e-14 | +| -1.1546e-14 | | 0.0000e+00 | | 5.6843e-14 | | 4.0394e+00 | @@ -733,8 +733,8 @@ q5 = +-------------+ | -1.4039e+01 | -| 0.0000e+00 | -| 0.0000e+00 | +| -5.6843e-14 | +| -1.1546e-14 | | 0.0000e+00 | | 5.6843e-14 | | 4.0394e+00 | diff --git a/test_examples_output.log b/test_examples_output.log index a6cf4a7..26647ac 100644 --- a/test_examples_output.log +++ b/test_examples_output.log @@ -3,6 +3,7 @@ Comparing output of exs_bar2_la.py --- PASSED! Comparing output of exs_bar2_lb.py --- PASSED! Comparing output of exs_beam1.py --- PASSED! Comparing output of exs_beam2.py --- PASSED! +Comparing output of exs_beambar2.py --- PASSED! Comparing output of exs_flw_diff2.py --- PASSED! Comparing output of exs_flw_temp1.py --- PASSED! Comparing output of exs_flw_temp2.py --- PASSED!