diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle deleted file mode 100644 index c1c44160..00000000 Binary files a/docs/build/doctrees/environment.pickle and /dev/null differ diff --git a/docs/build/doctrees/index.doctree b/docs/build/doctrees/index.doctree deleted file mode 100644 index cb688648..00000000 Binary files a/docs/build/doctrees/index.doctree and /dev/null differ diff --git a/docs/build/doctrees/rst/analysis.doctree b/docs/build/doctrees/rst/analysis.doctree deleted file mode 100644 index 6e7519b1..00000000 Binary files a/docs/build/doctrees/rst/analysis.doctree and /dev/null differ diff --git a/docs/build/doctrees/rst/api.doctree b/docs/build/doctrees/rst/api.doctree deleted file mode 100644 index 46f5fcc9..00000000 Binary files a/docs/build/doctrees/rst/api.doctree and /dev/null differ diff --git a/docs/build/doctrees/rst/examples.doctree b/docs/build/doctrees/rst/examples.doctree deleted file mode 100644 index c2e16c96..00000000 Binary files a/docs/build/doctrees/rst/examples.doctree and /dev/null differ diff --git a/docs/build/doctrees/rst/geom_mesh.doctree b/docs/build/doctrees/rst/geom_mesh.doctree deleted file mode 100644 index e81dd08b..00000000 Binary files a/docs/build/doctrees/rst/geom_mesh.doctree and /dev/null differ diff --git a/docs/build/doctrees/rst/installation.doctree b/docs/build/doctrees/rst/installation.doctree deleted file mode 100644 index 929fbad7..00000000 Binary files a/docs/build/doctrees/rst/installation.doctree and /dev/null differ diff --git a/docs/build/doctrees/rst/post.doctree b/docs/build/doctrees/rst/post.doctree deleted file mode 100644 index 3e97b54f..00000000 Binary files a/docs/build/doctrees/rst/post.doctree and /dev/null differ diff --git a/docs/build/doctrees/rst/structure.doctree b/docs/build/doctrees/rst/structure.doctree deleted file mode 100644 index 73473850..00000000 Binary files a/docs/build/doctrees/rst/structure.doctree and /dev/null differ diff --git a/docs/build/doctrees/rst/theory.doctree b/docs/build/doctrees/rst/theory.doctree deleted file mode 100644 index 096fdc6a..00000000 Binary files a/docs/build/doctrees/rst/theory.doctree and /dev/null differ diff --git a/docs/build/html/.buildinfo b/docs/build/html/.buildinfo deleted file mode 100644 index acd7e905..00000000 --- a/docs/build/html/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 8b636fd0f90ce03ce85756794396e940 -tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/build/html/_images/advanced.png b/docs/build/html/_images/advanced.png deleted file mode 100644 index ac3b56ac..00000000 Binary files a/docs/build/html/_images/advanced.png and /dev/null differ diff --git a/docs/build/html/_images/advanced1.png b/docs/build/html/_images/advanced1.png deleted file mode 100644 index ac3b56ac..00000000 Binary files a/docs/build/html/_images/advanced1.png and /dev/null differ diff --git a/docs/build/html/_images/advanced2.png b/docs/build/html/_images/advanced2.png deleted file mode 100644 index f4898986..00000000 Binary files a/docs/build/html/_images/advanced2.png and /dev/null differ diff --git a/docs/build/html/_images/angle_centroids.png b/docs/build/html/_images/angle_centroids.png deleted file mode 100644 index 74020f0e..00000000 Binary files a/docs/build/html/_images/angle_centroids.png and /dev/null differ diff --git a/docs/build/html/_images/angle_geometry.png b/docs/build/html/_images/angle_geometry.png deleted file mode 100644 index 50db319d..00000000 Binary files a/docs/build/html/_images/angle_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/angle_mesh.png b/docs/build/html/_images/angle_mesh.png deleted file mode 100644 index e85564a0..00000000 Binary files a/docs/build/html/_images/angle_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/bar_geometry.png b/docs/build/html/_images/bar_geometry.png deleted file mode 100644 index 5e637ab8..00000000 Binary files a/docs/build/html/_images/bar_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/bar_mesh.png b/docs/build/html/_images/bar_mesh.png deleted file mode 100644 index ba94fc66..00000000 Binary files a/docs/build/html/_images/bar_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/box1_geometry.png b/docs/build/html/_images/box1_geometry.png deleted file mode 100644 index a1077cef..00000000 Binary files a/docs/build/html/_images/box1_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/box1_mesh.png b/docs/build/html/_images/box1_mesh.png deleted file mode 100644 index c72540a3..00000000 Binary files a/docs/build/html/_images/box1_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/box_geometry.png b/docs/build/html/_images/box_geometry.png deleted file mode 100644 index db0b6c39..00000000 Binary files a/docs/build/html/_images/box_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/box_girder_geometry.png b/docs/build/html/_images/box_girder_geometry.png deleted file mode 100644 index c335f3a7..00000000 Binary files a/docs/build/html/_images/box_girder_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/box_girder_mesh.png b/docs/build/html/_images/box_girder_mesh.png deleted file mode 100644 index 752f996f..00000000 Binary files a/docs/build/html/_images/box_girder_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/box_mesh.png b/docs/build/html/_images/box_mesh.png deleted file mode 100644 index 1c8fa6ba..00000000 Binary files a/docs/build/html/_images/box_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/cee_geometry.png b/docs/build/html/_images/cee_geometry.png deleted file mode 100644 index 24446c63..00000000 Binary files a/docs/build/html/_images/cee_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/cee_mesh.png b/docs/build/html/_images/cee_mesh.png deleted file mode 100644 index 0c282b61..00000000 Binary files a/docs/build/html/_images/cee_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/chan1_geometry.png b/docs/build/html/_images/chan1_geometry.png deleted file mode 100644 index b64ffba2..00000000 Binary files a/docs/build/html/_images/chan1_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/chan1_mesh.png b/docs/build/html/_images/chan1_mesh.png deleted file mode 100644 index 9e3fe295..00000000 Binary files a/docs/build/html/_images/chan1_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/chan2_geometry.png b/docs/build/html/_images/chan2_geometry.png deleted file mode 100644 index 376502c5..00000000 Binary files a/docs/build/html/_images/chan2_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/chan2_mesh.png b/docs/build/html/_images/chan2_mesh.png deleted file mode 100644 index a4db62c5..00000000 Binary files a/docs/build/html/_images/chan2_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/chan_geometry.png b/docs/build/html/_images/chan_geometry.png deleted file mode 100644 index 66ec5855..00000000 Binary files a/docs/build/html/_images/chan_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/chan_mesh.png b/docs/build/html/_images/chan_mesh.png deleted file mode 100644 index b7dc9720..00000000 Binary files a/docs/build/html/_images/chan_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/chs_geometry.png b/docs/build/html/_images/chs_geometry.png deleted file mode 100644 index 8450f0c2..00000000 Binary files a/docs/build/html/_images/chs_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/chs_mesh.png b/docs/build/html/_images/chs_mesh.png deleted file mode 100644 index fe9e1656..00000000 Binary files a/docs/build/html/_images/chs_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/circle_geometry.png b/docs/build/html/_images/circle_geometry.png deleted file mode 100644 index 42f16a04..00000000 Binary files a/docs/build/html/_images/circle_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/circle_mesh.png b/docs/build/html/_images/circle_mesh.png deleted file mode 100644 index bd63c629..00000000 Binary files a/docs/build/html/_images/circle_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/composite_centroids.png b/docs/build/html/_images/composite_centroids.png deleted file mode 100644 index a0920722..00000000 Binary files a/docs/build/html/_images/composite_centroids.png and /dev/null differ diff --git a/docs/build/html/_images/composite_geometry.png b/docs/build/html/_images/composite_geometry.png deleted file mode 100644 index d31d2c8b..00000000 Binary files a/docs/build/html/_images/composite_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/composite_mesh.png b/docs/build/html/_images/composite_mesh.png deleted file mode 100644 index 3e88b17d..00000000 Binary files a/docs/build/html/_images/composite_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/composite_mesh1.png b/docs/build/html/_images/composite_mesh1.png deleted file mode 100644 index 69921a87..00000000 Binary files a/docs/build/html/_images/composite_mesh1.png and /dev/null differ diff --git a/docs/build/html/_images/composite_stress_m.png b/docs/build/html/_images/composite_stress_m.png deleted file mode 100644 index 424fbc99..00000000 Binary files a/docs/build/html/_images/composite_stress_m.png and /dev/null differ diff --git a/docs/build/html/_images/composite_stress_n.png b/docs/build/html/_images/composite_stress_n.png deleted file mode 100644 index 07dba7cb..00000000 Binary files a/docs/build/html/_images/composite_stress_n.png and /dev/null differ diff --git a/docs/build/html/_images/composite_stress_v.png b/docs/build/html/_images/composite_stress_v.png deleted file mode 100644 index 1950fd46..00000000 Binary files a/docs/build/html/_images/composite_stress_v.png and /dev/null differ diff --git a/docs/build/html/_images/cross_geometry.png b/docs/build/html/_images/cross_geometry.png deleted file mode 100644 index 6d54a8ee..00000000 Binary files a/docs/build/html/_images/cross_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/cross_mesh.png b/docs/build/html/_images/cross_mesh.png deleted file mode 100644 index b0648aa4..00000000 Binary files a/docs/build/html/_images/cross_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/cruciform_geometry.png b/docs/build/html/_images/cruciform_geometry.png deleted file mode 100644 index fe31dfae..00000000 Binary files a/docs/build/html/_images/cruciform_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/cruciform_mesh.png b/docs/build/html/_images/cruciform_mesh.png deleted file mode 100644 index edfaea86..00000000 Binary files a/docs/build/html/_images/cruciform_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/custom_centroids.png b/docs/build/html/_images/custom_centroids.png deleted file mode 100644 index 0cfa1a4f..00000000 Binary files a/docs/build/html/_images/custom_centroids.png and /dev/null differ diff --git a/docs/build/html/_images/custom_geometry.png b/docs/build/html/_images/custom_geometry.png deleted file mode 100644 index f2b1d71c..00000000 Binary files a/docs/build/html/_images/custom_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/custom_geometry1.png b/docs/build/html/_images/custom_geometry1.png deleted file mode 100644 index 4a3fd3be..00000000 Binary files a/docs/build/html/_images/custom_geometry1.png and /dev/null differ diff --git a/docs/build/html/_images/custom_mesh.png b/docs/build/html/_images/custom_mesh.png deleted file mode 100644 index b3f1b1f0..00000000 Binary files a/docs/build/html/_images/custom_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/custom_mesh1.png b/docs/build/html/_images/custom_mesh1.png deleted file mode 100644 index f9f92afe..00000000 Binary files a/docs/build/html/_images/custom_mesh1.png and /dev/null differ diff --git a/docs/build/html/_images/dbox_geometry.png b/docs/build/html/_images/dbox_geometry.png deleted file mode 100644 index 261ee19f..00000000 Binary files a/docs/build/html/_images/dbox_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/dbox_mesh.png b/docs/build/html/_images/dbox_mesh.png deleted file mode 100644 index 29e81bad..00000000 Binary files a/docs/build/html/_images/dbox_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/ehs_geometry.png b/docs/build/html/_images/ehs_geometry.png deleted file mode 100644 index 7d1bb131..00000000 Binary files a/docs/build/html/_images/ehs_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/ehs_mesh.png b/docs/build/html/_images/ehs_mesh.png deleted file mode 100644 index ffdcc918..00000000 Binary files a/docs/build/html/_images/ehs_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/ellipse_geometry.png b/docs/build/html/_images/ellipse_geometry.png deleted file mode 100644 index 864dc1f3..00000000 Binary files a/docs/build/html/_images/ellipse_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/ellipse_mesh.png b/docs/build/html/_images/ellipse_mesh.png deleted file mode 100644 index 127b11a7..00000000 Binary files a/docs/build/html/_images/ellipse_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/fcross_geometry.png b/docs/build/html/_images/fcross_geometry.png deleted file mode 100644 index 97be58cf..00000000 Binary files a/docs/build/html/_images/fcross_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/fcross_mesh.png b/docs/build/html/_images/fcross_mesh.png deleted file mode 100644 index 82dcd2df..00000000 Binary files a/docs/build/html/_images/fcross_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/frame_graph.png b/docs/build/html/_images/frame_graph.png deleted file mode 100644 index 3148ce3f..00000000 Binary files a/docs/build/html/_images/frame_graph.png and /dev/null differ diff --git a/docs/build/html/_images/gbox_geometry.png b/docs/build/html/_images/gbox_geometry.png deleted file mode 100644 index 4be70fb0..00000000 Binary files a/docs/build/html/_images/gbox_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/gbox_mesh.png b/docs/build/html/_images/gbox_mesh.png deleted file mode 100644 index f094e6d2..00000000 Binary files a/docs/build/html/_images/gbox_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/h_geometry.png b/docs/build/html/_images/h_geometry.png deleted file mode 100644 index 03ebe60f..00000000 Binary files a/docs/build/html/_images/h_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/h_mesh.png b/docs/build/html/_images/h_mesh.png deleted file mode 100644 index 385fcb8c..00000000 Binary files a/docs/build/html/_images/h_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/hat1_geometry.png b/docs/build/html/_images/hat1_geometry.png deleted file mode 100644 index 491e99b9..00000000 Binary files a/docs/build/html/_images/hat1_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/hat1_mesh.png b/docs/build/html/_images/hat1_mesh.png deleted file mode 100644 index 3284f20d..00000000 Binary files a/docs/build/html/_images/hat1_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/hat_geometry.png b/docs/build/html/_images/hat_geometry.png deleted file mode 100644 index ab0676d8..00000000 Binary files a/docs/build/html/_images/hat_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/hat_mesh.png b/docs/build/html/_images/hat_mesh.png deleted file mode 100644 index f52c5b3e..00000000 Binary files a/docs/build/html/_images/hat_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/hexa_geometry.png b/docs/build/html/_images/hexa_geometry.png deleted file mode 100644 index 62815175..00000000 Binary files a/docs/build/html/_images/hexa_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/hexa_mesh.png b/docs/build/html/_images/hexa_mesh.png deleted file mode 100644 index 93bc995e..00000000 Binary files a/docs/build/html/_images/hexa_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/i1_geometry.png b/docs/build/html/_images/i1_geometry.png deleted file mode 100644 index 376a9644..00000000 Binary files a/docs/build/html/_images/i1_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/i1_mesh.png b/docs/build/html/_images/i1_mesh.png deleted file mode 100644 index 8ae714d5..00000000 Binary files a/docs/build/html/_images/i1_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/isection_geometry.png b/docs/build/html/_images/isection_geometry.png deleted file mode 100644 index 62908350..00000000 Binary files a/docs/build/html/_images/isection_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/isection_mesh.png b/docs/build/html/_images/isection_mesh.png deleted file mode 100644 index f19ce63b..00000000 Binary files a/docs/build/html/_images/isection_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/l_geometry.png b/docs/build/html/_images/l_geometry.png deleted file mode 100644 index b146c5b8..00000000 Binary files a/docs/build/html/_images/l_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/l_mesh.png b/docs/build/html/_images/l_mesh.png deleted file mode 100644 index 651eda8d..00000000 Binary files a/docs/build/html/_images/l_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/logo.png b/docs/build/html/_images/logo.png deleted file mode 100644 index a2ffa652..00000000 Binary files a/docs/build/html/_images/logo.png and /dev/null differ diff --git a/docs/build/html/_images/merged_centroids.png b/docs/build/html/_images/merged_centroids.png deleted file mode 100644 index 97e2d3c6..00000000 Binary files a/docs/build/html/_images/merged_centroids.png and /dev/null differ diff --git a/docs/build/html/_images/merged_geometry.png b/docs/build/html/_images/merged_geometry.png deleted file mode 100644 index 363e056d..00000000 Binary files a/docs/build/html/_images/merged_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/merged_geometry1.png b/docs/build/html/_images/merged_geometry1.png deleted file mode 100644 index 5bac6209..00000000 Binary files a/docs/build/html/_images/merged_geometry1.png and /dev/null differ diff --git a/docs/build/html/_images/merged_mesh.png b/docs/build/html/_images/merged_mesh.png deleted file mode 100644 index 8c02bcbf..00000000 Binary files a/docs/build/html/_images/merged_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/merged_mesh1.png b/docs/build/html/_images/merged_mesh1.png deleted file mode 100644 index 807903b4..00000000 Binary files a/docs/build/html/_images/merged_mesh1.png and /dev/null differ diff --git a/docs/build/html/_images/mirr_rot_centroids.png b/docs/build/html/_images/mirr_rot_centroids.png deleted file mode 100644 index d09ab6b6..00000000 Binary files a/docs/build/html/_images/mirr_rot_centroids.png and /dev/null differ diff --git a/docs/build/html/_images/mirr_rot_geometry.png b/docs/build/html/_images/mirr_rot_geometry.png deleted file mode 100644 index eedcb9c4..00000000 Binary files a/docs/build/html/_images/mirr_rot_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/mirr_rot_mesh.png b/docs/build/html/_images/mirr_rot_mesh.png deleted file mode 100644 index 4e9e1511..00000000 Binary files a/docs/build/html/_images/mirr_rot_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/monoisection_geometry.png b/docs/build/html/_images/monoisection_geometry.png deleted file mode 100644 index 24a62efe..00000000 Binary files a/docs/build/html/_images/monoisection_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/monoisection_mesh.png b/docs/build/html/_images/monoisection_mesh.png deleted file mode 100644 index c79c9f01..00000000 Binary files a/docs/build/html/_images/monoisection_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/ni_geometry.png b/docs/build/html/_images/ni_geometry.png deleted file mode 100644 index e4457713..00000000 Binary files a/docs/build/html/_images/ni_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/ni_mesh.png b/docs/build/html/_images/ni_mesh.png deleted file mode 100644 index a5e2bc88..00000000 Binary files a/docs/build/html/_images/ni_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/pfc_centroids.png b/docs/build/html/_images/pfc_centroids.png deleted file mode 100644 index aa2bfb22..00000000 Binary files a/docs/build/html/_images/pfc_centroids.png and /dev/null differ diff --git a/docs/build/html/_images/pfc_geometry.png b/docs/build/html/_images/pfc_geometry.png deleted file mode 100644 index ae14cc48..00000000 Binary files a/docs/build/html/_images/pfc_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/pfc_mesh.png b/docs/build/html/_images/pfc_mesh.png deleted file mode 100644 index 8d205e51..00000000 Binary files a/docs/build/html/_images/pfc_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/polygon_geometry.png b/docs/build/html/_images/polygon_geometry.png deleted file mode 100644 index 159975f2..00000000 Binary files a/docs/build/html/_images/polygon_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/polygon_mesh.png b/docs/build/html/_images/polygon_mesh.png deleted file mode 100644 index 792175b9..00000000 Binary files a/docs/build/html/_images/polygon_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/rectangle_geometry.png b/docs/build/html/_images/rectangle_geometry.png deleted file mode 100644 index 21badcb1..00000000 Binary files a/docs/build/html/_images/rectangle_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/rectangle_mesh.png b/docs/build/html/_images/rectangle_mesh.png deleted file mode 100644 index ea25e792..00000000 Binary files a/docs/build/html/_images/rectangle_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/rhs_geometry.png b/docs/build/html/_images/rhs_geometry.png deleted file mode 100644 index 29316153..00000000 Binary files a/docs/build/html/_images/rhs_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/rhs_mesh.png b/docs/build/html/_images/rhs_mesh.png deleted file mode 100644 index f2bfbcb0..00000000 Binary files a/docs/build/html/_images/rhs_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/rod_geometry.png b/docs/build/html/_images/rod_geometry.png deleted file mode 100644 index 40ae598d..00000000 Binary files a/docs/build/html/_images/rod_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/rod_mesh.png b/docs/build/html/_images/rod_mesh.png deleted file mode 100644 index 0a174c6d..00000000 Binary files a/docs/build/html/_images/rod_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/stress_m.png b/docs/build/html/_images/stress_m.png deleted file mode 100644 index 688bc6df..00000000 Binary files a/docs/build/html/_images/stress_m.png and /dev/null differ diff --git a/docs/build/html/_images/stress_m11_zz.png b/docs/build/html/_images/stress_m11_zz.png deleted file mode 100644 index 53585b79..00000000 Binary files a/docs/build/html/_images/stress_m11_zz.png and /dev/null differ diff --git a/docs/build/html/_images/stress_m22_zz.png b/docs/build/html/_images/stress_m22_zz.png deleted file mode 100644 index 3f30108d..00000000 Binary files a/docs/build/html/_images/stress_m22_zz.png and /dev/null differ diff --git a/docs/build/html/_images/stress_m_zz.png b/docs/build/html/_images/stress_m_zz.png deleted file mode 100644 index 82dc986b..00000000 Binary files a/docs/build/html/_images/stress_m_zz.png and /dev/null differ diff --git a/docs/build/html/_images/stress_mxx_zz.png b/docs/build/html/_images/stress_mxx_zz.png deleted file mode 100644 index 41f65389..00000000 Binary files a/docs/build/html/_images/stress_mxx_zz.png and /dev/null differ diff --git a/docs/build/html/_images/stress_myy_zz.png b/docs/build/html/_images/stress_myy_zz.png deleted file mode 100644 index 3528b3ce..00000000 Binary files a/docs/build/html/_images/stress_myy_zz.png and /dev/null differ diff --git a/docs/build/html/_images/stress_mzz.png b/docs/build/html/_images/stress_mzz.png deleted file mode 100644 index fa41d860..00000000 Binary files a/docs/build/html/_images/stress_mzz.png and /dev/null differ diff --git a/docs/build/html/_images/stress_mzz_zx.png b/docs/build/html/_images/stress_mzz_zx.png deleted file mode 100644 index 9c220114..00000000 Binary files a/docs/build/html/_images/stress_mzz_zx.png and /dev/null differ diff --git a/docs/build/html/_images/stress_mzz_zxy.png b/docs/build/html/_images/stress_mzz_zxy.png deleted file mode 100644 index 8923ceb8..00000000 Binary files a/docs/build/html/_images/stress_mzz_zxy.png and /dev/null differ diff --git a/docs/build/html/_images/stress_mzz_zy.png b/docs/build/html/_images/stress_mzz_zy.png deleted file mode 100644 index 1d4b2bb0..00000000 Binary files a/docs/build/html/_images/stress_mzz_zy.png and /dev/null differ diff --git a/docs/build/html/_images/stress_n_zz.png b/docs/build/html/_images/stress_n_zz.png deleted file mode 100644 index 5e83c128..00000000 Binary files a/docs/build/html/_images/stress_n_zz.png and /dev/null differ diff --git a/docs/build/html/_images/stress_v.png b/docs/build/html/_images/stress_v.png deleted file mode 100644 index add1ffc0..00000000 Binary files a/docs/build/html/_images/stress_v.png and /dev/null differ diff --git a/docs/build/html/_images/stress_v_zx.png b/docs/build/html/_images/stress_v_zx.png deleted file mode 100644 index d4325a5b..00000000 Binary files a/docs/build/html/_images/stress_v_zx.png and /dev/null differ diff --git a/docs/build/html/_images/stress_v_zxy.png b/docs/build/html/_images/stress_v_zxy.png deleted file mode 100644 index d1cf32c5..00000000 Binary files a/docs/build/html/_images/stress_v_zxy.png and /dev/null differ diff --git a/docs/build/html/_images/stress_v_zy.png b/docs/build/html/_images/stress_v_zy.png deleted file mode 100644 index fdd62413..00000000 Binary files a/docs/build/html/_images/stress_v_zy.png and /dev/null differ diff --git a/docs/build/html/_images/stress_vm.png b/docs/build/html/_images/stress_vm.png deleted file mode 100644 index 668334ad..00000000 Binary files a/docs/build/html/_images/stress_vm.png and /dev/null differ diff --git a/docs/build/html/_images/stress_vm1.png b/docs/build/html/_images/stress_vm1.png deleted file mode 100644 index 0bc637f6..00000000 Binary files a/docs/build/html/_images/stress_vm1.png and /dev/null differ diff --git a/docs/build/html/_images/stress_vm2.png b/docs/build/html/_images/stress_vm2.png deleted file mode 100644 index a10c0d91..00000000 Binary files a/docs/build/html/_images/stress_vm2.png and /dev/null differ diff --git a/docs/build/html/_images/stress_vx_zx.png b/docs/build/html/_images/stress_vx_zx.png deleted file mode 100644 index dd392f93..00000000 Binary files a/docs/build/html/_images/stress_vx_zx.png and /dev/null differ diff --git a/docs/build/html/_images/stress_vx_zxy.png b/docs/build/html/_images/stress_vx_zxy.png deleted file mode 100644 index f53db2a2..00000000 Binary files a/docs/build/html/_images/stress_vx_zxy.png and /dev/null differ diff --git a/docs/build/html/_images/stress_vx_zy.png b/docs/build/html/_images/stress_vx_zy.png deleted file mode 100644 index 3b89f0b3..00000000 Binary files a/docs/build/html/_images/stress_vx_zy.png and /dev/null differ diff --git a/docs/build/html/_images/stress_vy_zx.png b/docs/build/html/_images/stress_vy_zx.png deleted file mode 100644 index c13569c1..00000000 Binary files a/docs/build/html/_images/stress_vy_zx.png and /dev/null differ diff --git a/docs/build/html/_images/stress_vy_zxy.png b/docs/build/html/_images/stress_vy_zxy.png deleted file mode 100644 index ef8a4aab..00000000 Binary files a/docs/build/html/_images/stress_vy_zxy.png and /dev/null differ diff --git a/docs/build/html/_images/stress_vy_zy.png b/docs/build/html/_images/stress_vy_zy.png deleted file mode 100644 index 9943dc52..00000000 Binary files a/docs/build/html/_images/stress_vy_zy.png and /dev/null differ diff --git a/docs/build/html/_images/stress_zx.png b/docs/build/html/_images/stress_zx.png deleted file mode 100644 index d57b5487..00000000 Binary files a/docs/build/html/_images/stress_zx.png and /dev/null differ diff --git a/docs/build/html/_images/stress_zxy.png b/docs/build/html/_images/stress_zxy.png deleted file mode 100644 index 9122f310..00000000 Binary files a/docs/build/html/_images/stress_zxy.png and /dev/null differ diff --git a/docs/build/html/_images/stress_zy.png b/docs/build/html/_images/stress_zy.png deleted file mode 100644 index c9232692..00000000 Binary files a/docs/build/html/_images/stress_zy.png and /dev/null differ diff --git a/docs/build/html/_images/stress_zz.png b/docs/build/html/_images/stress_zz.png deleted file mode 100644 index a5f86a23..00000000 Binary files a/docs/build/html/_images/stress_zz.png and /dev/null differ diff --git a/docs/build/html/_images/t1_geometry.png b/docs/build/html/_images/t1_geometry.png deleted file mode 100644 index 83578fa0..00000000 Binary files a/docs/build/html/_images/t1_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/t1_mesh.png b/docs/build/html/_images/t1_mesh.png deleted file mode 100644 index 2aaa6b71..00000000 Binary files a/docs/build/html/_images/t1_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/t2_geometry.png b/docs/build/html/_images/t2_geometry.png deleted file mode 100644 index e8ef838d..00000000 Binary files a/docs/build/html/_images/t2_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/t2_mesh.png b/docs/build/html/_images/t2_mesh.png deleted file mode 100644 index 38ecebb7..00000000 Binary files a/docs/build/html/_images/t2_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/t_geometry.png b/docs/build/html/_images/t_geometry.png deleted file mode 100644 index 3d389791..00000000 Binary files a/docs/build/html/_images/t_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/t_mesh.png b/docs/build/html/_images/t_mesh.png deleted file mode 100644 index c5ff8ced..00000000 Binary files a/docs/build/html/_images/t_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/taperedchannel_geometry.png b/docs/build/html/_images/taperedchannel_geometry.png deleted file mode 100644 index 5065cea9..00000000 Binary files a/docs/build/html/_images/taperedchannel_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/taperedchannel_mesh.png b/docs/build/html/_images/taperedchannel_mesh.png deleted file mode 100644 index 5cde9f53..00000000 Binary files a/docs/build/html/_images/taperedchannel_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/taperedisection_geometry.png b/docs/build/html/_images/taperedisection_geometry.png deleted file mode 100644 index 40c699c8..00000000 Binary files a/docs/build/html/_images/taperedisection_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/taperedisection_mesh.png b/docs/build/html/_images/taperedisection_mesh.png deleted file mode 100644 index 73c7b9fd..00000000 Binary files a/docs/build/html/_images/taperedisection_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/tee_geometry.png b/docs/build/html/_images/tee_geometry.png deleted file mode 100644 index 89306a91..00000000 Binary files a/docs/build/html/_images/tee_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/tee_mesh.png b/docs/build/html/_images/tee_mesh.png deleted file mode 100644 index b8971196..00000000 Binary files a/docs/build/html/_images/tee_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/tube2_geometry.png b/docs/build/html/_images/tube2_geometry.png deleted file mode 100644 index b1681947..00000000 Binary files a/docs/build/html/_images/tube2_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/tube2_mesh.png b/docs/build/html/_images/tube2_mesh.png deleted file mode 100644 index 96ecc929..00000000 Binary files a/docs/build/html/_images/tube2_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/tube_geometry.png b/docs/build/html/_images/tube_geometry.png deleted file mode 100644 index b1681947..00000000 Binary files a/docs/build/html/_images/tube_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/tube_mesh.png b/docs/build/html/_images/tube_mesh.png deleted file mode 100644 index 96ecc929..00000000 Binary files a/docs/build/html/_images/tube_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/vector_mzz_zxy.png b/docs/build/html/_images/vector_mzz_zxy.png deleted file mode 100644 index 18af895e..00000000 Binary files a/docs/build/html/_images/vector_mzz_zxy.png and /dev/null differ diff --git a/docs/build/html/_images/vector_v_zxy.png b/docs/build/html/_images/vector_v_zxy.png deleted file mode 100644 index 2eea1ddb..00000000 Binary files a/docs/build/html/_images/vector_v_zxy.png and /dev/null differ diff --git a/docs/build/html/_images/vector_vx_zxy.png b/docs/build/html/_images/vector_vx_zxy.png deleted file mode 100644 index 2aa04011..00000000 Binary files a/docs/build/html/_images/vector_vx_zxy.png and /dev/null differ diff --git a/docs/build/html/_images/vector_vy_zxy.png b/docs/build/html/_images/vector_vy_zxy.png deleted file mode 100644 index 0bfa8ee1..00000000 Binary files a/docs/build/html/_images/vector_vy_zxy.png and /dev/null differ diff --git a/docs/build/html/_images/vector_zxy.png b/docs/build/html/_images/vector_zxy.png deleted file mode 100644 index 08fe12a0..00000000 Binary files a/docs/build/html/_images/vector_zxy.png and /dev/null differ diff --git a/docs/build/html/_images/z_geometry.png b/docs/build/html/_images/z_geometry.png deleted file mode 100644 index 727aa11f..00000000 Binary files a/docs/build/html/_images/z_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/z_mesh.png b/docs/build/html/_images/z_mesh.png deleted file mode 100644 index ad568037..00000000 Binary files a/docs/build/html/_images/z_mesh.png and /dev/null differ diff --git a/docs/build/html/_images/zed_geometry.png b/docs/build/html/_images/zed_geometry.png deleted file mode 100644 index 3a73817a..00000000 Binary files a/docs/build/html/_images/zed_geometry.png and /dev/null differ diff --git a/docs/build/html/_images/zed_mesh.png b/docs/build/html/_images/zed_mesh.png deleted file mode 100644 index 65205548..00000000 Binary files a/docs/build/html/_images/zed_mesh.png and /dev/null differ diff --git a/docs/build/html/_modules/index.html b/docs/build/html/_modules/index.html deleted file mode 100644 index b30b670f..00000000 --- a/docs/build/html/_modules/index.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - - - - - Overview: module code — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- -
    - -
  • Docs »
  • - -
  • Overview: module code
  • - - -
  • - -
  • - -
- - -
-
- - - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/_modules/sectionproperties/analysis/cross_section.html b/docs/build/html/_modules/sectionproperties/analysis/cross_section.html deleted file mode 100644 index 1fa80e07..00000000 --- a/docs/build/html/_modules/sectionproperties/analysis/cross_section.html +++ /dev/null @@ -1,4351 +0,0 @@ - - - - - - - - - - - sectionproperties.analysis.cross_section — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- -
    - -
  • Docs »
  • - -
  • Module code »
  • - -
  • sectionproperties.analysis.cross_section
  • - - -
  • - -
  • - -
- - -
-
-
-
- -

Source code for sectionproperties.analysis.cross_section

-import copy
-import numpy as np
-from scipy.sparse import csc_matrix, coo_matrix, linalg
-from scipy.optimize import brentq
-import matplotlib.pyplot as plt
-import matplotlib.tri as tri
-import matplotlib.cm as cm
-import matplotlib.patches as mpatches
-from matplotlib.colors import ListedColormap
-import meshpy.triangle as triangle
-import sectionproperties.pre.pre as pre
-import sectionproperties.analysis.fea as fea
-import sectionproperties.analysis.solver as solver
-import sectionproperties.post.post as post
-
-
-
[docs]class CrossSection: - """Class for structural cross-sections. - - Stores the finite element geometry, mesh and material information and provides methods to - compute the cross-section properties. The element type used in this program is the six-noded - quadratic triangular element. - - The constructor extracts information from the provided mesh object and creates and stores the - corresponding Tri6 finite element objects. - - :param geometry: Cross-section geometry object used to generate the mesh - :type geometry: :class:`~sectionproperties.pre.sections.Geometry` - :param mesh: Mesh object returned by meshpy - :type mesh: :class:`meshpy.triangle.MeshInfo` - :param materials: A list of material properties corresponding to various regions in the - geometry and mesh. Note that if materials are specified, the number of material objects - ust equal the number of regions in the geometry. If no materials are specified, only a - purely geometric analysis can take place, and all regions will be assigned a default - material with an elastic modulus and yield strength equal to 1, and a Poisson's ratio - equal to 0. - :type materials: list[:class:`~sectionproperties.pre.pre.Material`] - :param bool time_info: If set to True, a detailed description of the computation and the time - cost is printed to the terminal. - - The following example creates a :class:`~sectionproperties.analysis.cross_section.CrossSection` - object of a 100D x 50W rectangle using a mesh size of 5:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.RectangularSection(d=100, b=50) - mesh = geometry.create_mesh(mesh_sizes=[5]) - section = CrossSection(geometry, mesh) - - The following example creates a 100D x 50W rectangle, with the top half of the section - comprised of timber and the bottom half steel. The timber section is meshed with a maximum area - of 10 and the steel section mesh with a maximum area of 5:: - - import sectionproperties.pre.sections as sections - from sectionproperties.pre.pre import Material - from sectionproperties.analysis.cross_section import CrossSection - - geom_steel = sections.RectangularSection(d=50, b=50) - geom_timber = sections.RectangularSection(d=50, b=50, shift=[0, 50]) - geometry = sections.MergedSection([geom_steel, geom_timber]) - geometry.clean_geometry() - - mesh = geometry.create_mesh(mesh_sizes=[5, 10]) - - steel = Material(name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, - yield_strength=250, color='grey' - ) - timber = Material(name='Timber', elastic_modulus=8e3, poissons_ratio=0.35, - yield_strength=20, color='burlywood' - ) - - section = CrossSection(geometry, mesh, [steel, timber]) - section.plot_mesh(materials=True, alpha=0.5) - - :cvar elements: List of finite element objects describing the cross-section mesh - :vartype elements: list[:class:`~sectionproperties.analysis.fea.Tri6`] - :cvar int num_nodes: Number of nodes in the finite element mesh - :cvar geometry: Cross-section geometry object used to generate the mesh - :vartype geometry: :class:`~sectionproperties.pre.sections.Geometry` - :cvar mesh: Mesh object returned by meshpy - :vartype mesh: :class:`meshpy.triangle.MeshInfo` - :cvar mesh_nodes: Array of node coordinates from the mesh - :vartype mesh_nodes: :class:`numpy.ndarray` - :cvar mesh_elements: Array of connectivities from the mesh - :vartype mesh_elements: :class:`numpy.ndarray` - :cvar mesh_attributes: Array of attributes from the mesh - :vartype mesh_attributes: :class:`numpy.ndarray` - :cvar materials: List of materials - :type materials: list[:class:`~sectionproperties.pre.pre.Material`] - :cvar material_groups: List of objects containing the elements in each defined material - :type materials_groups: list[:class:`~sectionproperties.pre.pre.MaterialGroup`] - :cvar section_props: Class to store calculated section properties - :vartype section_props: :class:`~sectionproperties.analysis.cross_section.SectionProperties` - - :raises AssertionError: If the number of materials does not equal the number of regions - """ - - def __init__(self, geometry, mesh, materials=None, time_info=False): - """Inits the CrossSection class.""" - - def init(): - self.geometry = geometry # save geometry data - - # extract mesh data - nodes = np.array(mesh.points, dtype=np.dtype(float)) - elements = np.array(mesh.elements, dtype=np.dtype(int)) - attributes = np.array(mesh.element_attributes, dtype=np.dtype(int)) - - # swap mid-node order to retain node ordering consistency - elements[:, [3, 4, 5]] = elements[:, [5, 3, 4]] - - # save total number of nodes in mesh - self.num_nodes = len(nodes) - - # initialise material_sections variable - self.material_groups = [] - - # if materials are specified, check that the right number of material properties are - # specified and then populate material_groups list - if materials is not None: - str = "Number of materials ({0}), ".format(len(materials)) - str += "should match the number of regions ({0}).".format( - max(attributes) + 1) - assert(len(materials) == max(attributes) + 1), str - - # add a MaterialGroup object to the material_groups list for each uniquely - # encountered material - for (i, material) in enumerate(materials): - # add the first material to the list - if i == 0: - self.material_groups.append(MaterialGroup(material, self.num_nodes)) - else: - # if the material hasn't been encountered - if material not in materials[:i]: - self.material_groups.append(MaterialGroup(material, self.num_nodes)) - # if there are no materials defined, add only the default material - else: - default_material = pre.Material('default', 1, 0, 1) - self.material_groups.append(MaterialGroup(default_material, self.num_nodes)) - - self.materials = materials # save the input materials list - - self.elements = [] # initialise list holding all element objects - - # build the mesh one element at a time - for (i, node_ids) in enumerate(elements): - x1 = nodes[node_ids[0]][0] - y1 = nodes[node_ids[0]][1] - x2 = nodes[node_ids[1]][0] - y2 = nodes[node_ids[1]][1] - x3 = nodes[node_ids[2]][0] - y3 = nodes[node_ids[2]][1] - x4 = nodes[node_ids[3]][0] - y4 = nodes[node_ids[3]][1] - x5 = nodes[node_ids[4]][0] - y5 = nodes[node_ids[4]][1] - x6 = nodes[node_ids[5]][0] - y6 = nodes[node_ids[5]][1] - - # create a list containing the vertex and mid-node coordinates - coords = np.array([[x1, x2, x3, x4, x5, x6], [y1, y2, y3, y4, y5, y6]]) - - # if materials are specified, get the material - if materials is not None: - # get attribute index of current element - att_el = attributes[i] - - # fetch the material - material = materials[att_el] - # if there are no materials specified, use a default material - else: - material = default_material - - # add tri6 elements to the mesh - new_element = fea.Tri6(i, coords, node_ids, material) - self.elements.append(new_element) - - # add element to relevant MaterialGroup - for group in self.material_groups: - if material is group.material: - group.add_element(new_element) - break - - # save mesh input - self.mesh = mesh - self.mesh_nodes = nodes - self.mesh_elements = elements - self.mesh_attributes = attributes - - # initialise class storing section properties - self.section_props = SectionProperties() - - if time_info: - text = "--Initialising the CrossSection class..." - solver.function_timer(text, init) - print("") - else: - init() - -
[docs] def calculate_geometric_properties(self, time_info=False): - """Calculates the geometric properties of the cross-section and stores them in the - :class:`~sectionproperties.analysis.cross_section.SectionProperties` object contained in - the ``section_props`` class variable. - - :param bool time_info: If set to True, a detailed description of the computation and the - time cost is printed to the terminal. - - The following geometric section properties are calculated: - - * Cross-sectional area - * Cross-sectional perimeter - * Modulus weighted area (axial rigidity) - * First moments of area - * Second moments of area about the global axis - * Second moments of area about the centroidal axis - * Elastic centroid - * Centroidal section moduli - * Radii of gyration - * Principal axis properties - - If materials are specified for the cross-section, the moments of area and section moduli - are elastic modulus weighted. - - The following example demonstrates the use of this method:: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - """ - - def calculate_geom(): - # initialise properties - self.section_props.area = 0 - self.section_props.perimeter = 0 - self.section_props.ea = 0 - self.section_props.ga = 0 - self.section_props.qx = 0 - self.section_props.qy = 0 - self.section_props.ixx_g = 0 - self.section_props.iyy_g = 0 - self.section_props.ixy_g = 0 - - # caclulate perimeter - self.section_props.perimeter = self.geometry.calculate_perimeter() - - # calculate global geometric properties - for el in self.elements: - (area, qx, qy, ixx_g, iyy_g, ixy_g, e, g) = el.geometric_properties() - - self.section_props.area += area - self.section_props.ea += area * e - self.section_props.ga += area * g - self.section_props.qx += qx * e - self.section_props.qy += qy * e - self.section_props.ixx_g += ixx_g * e - self.section_props.iyy_g += iyy_g * e - self.section_props.ixy_g += ixy_g * e - - self.section_props.nu_eff = self.section_props.ea / (2 * self.section_props.ga) - 1 - self.section_props.calculate_elastic_centroid() - self.section_props.calculate_centroidal_properties(self.mesh) - - if time_info: - text = "--Calculating geometric section properties..." - solver.function_timer(text, calculate_geom) - print("") - else: - calculate_geom()
- -
[docs] def calculate_warping_properties(self, time_info=False, solver_type='direct'): - """Calculates all the warping properties of the cross-section and stores them in the - :class:`~sectionproperties.analysis.cross_section.SectionProperties` object contained in - the ``section_props`` class variable. - - :param bool time_info: If set to True, a detailed description of the computation and the - time cost is printed to the terminal. - :param string solver_type: Solver used for solving systems of linear equations, either - using the *'direct'* method or *'cgs'* iterative method - - The following warping section properties are calculated: - - * Torsion constant - * Shear centre - * Shear area - * Warping constant - * Monosymmetry constant - - If materials are specified, the values calculated for the torsion constant, warping - constant and shear area are elastic modulus weighted. - - Note that the geometric properties must be calculated first for the calculation of the - warping properties to be correct:: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_warping_properties() - - :raises RuntimeError: If the geometric properties have not been - calculated prior to calling this method - """ - - # check that a geometric analysis has been performed - if None in [self.section_props.area, self.section_props.ixx_c, self.section_props.cx]: - err = "Cacluate geometric properties before performing a warping analysis." - raise RuntimeError(err) - - # create a new CrossSection with the origin shifted to the centroid for calculation of the - # warping properties such that the Lagrangian multiplier approach can be utilised - warping_section = CrossSection(self.geometry, self.mesh, self.materials) - - # shift the coordinates of each element N.B. the mesh class attribute remains unshifted! - for el in warping_section.elements: - el.coords[0, :] -= self.section_props.cx - el.coords[1, :] -= self.section_props.cy - - # assemble stiffness matrix and load vector for warping function - if time_info: - text = "--Assembing {0}x{0} stiffness matrix and load vector...".format(self.num_nodes) - (k, k_lg, f_torsion) = solver.function_timer(text, warping_section.assemble_torsion) - else: - (k, k_lg, f_torsion) = warping_section.assemble_torsion() - - # ILU decomposition of stiffness matrices - def ilu_decomp(): - # ILU decomposition on regular stiffness matrix - k_precond = linalg.LinearOperator( - (self.num_nodes, self.num_nodes), linalg.spilu(k).solve - ) - - # ILU decomposition on Lagrangian stiffness matrix - k_lg_precond = linalg.LinearOperator( - (self.num_nodes + 1, self.num_nodes + 1), linalg.spilu(k_lg).solve - ) - - return (k_precond, k_lg_precond) - - # if the cgs method is used, perform ILU decomposition - if solver_type == 'cgs': - if time_info: - text = "--Performing ILU decomposition on the stiffness matrices..." - (k_precond, k_lg_precond) = solver.function_timer(text, ilu_decomp) - else: - (k_precond, k_lg_precond) = ilu_decomp() - - # solve for warping function - def solve_warping(): - if solver_type == 'cgs': - omega = solver.solve_cgs(k, f_torsion, k_precond) - elif solver_type == 'direct': - omega = solver.solve_direct(k, f_torsion) - - return omega - - if time_info: - text = "--Solving for the warping function using the {0} solver...".format(solver_type) - omega = solver.function_timer(text, solve_warping) - else: - omega = solve_warping() - - # save the warping function - self.section_props.omega = omega - - # determine the torsion constant - def j_func(): - return ( - self.section_props.ixx_c + self.section_props.iyy_c - - omega.dot(k.dot(np.transpose(omega))) - ) - - if time_info: - text = "--Computing the torsion constant..." - self.section_props.j = solver.function_timer(text, j_func) - else: - self.section_props.j = j_func() - - # assemble shear function load vectors - def assemble_shear_load(): - f_psi = np.zeros(self.num_nodes) - f_phi = np.zeros(self.num_nodes) - - for el in warping_section.elements: - (f_psi_el, f_phi_el) = el.shear_load_vectors( - self.section_props.ixx_c, self.section_props.iyy_c, - self.section_props.ixy_c, self.section_props.nu_eff) - f_psi[el.node_ids] += f_psi_el - f_phi[el.node_ids] += f_phi_el - - return (f_psi, f_phi) - - if time_info: - text = "--Assembling shear function load vectors..." - (f_psi, f_phi) = solver.function_timer(text, assemble_shear_load) - else: - (f_psi, f_phi) = assemble_shear_load() - - # solve for shear functions psi and phi - def solve_shear_functions(): - if solver_type == 'cgs': - psi_shear = solver.solve_cgs_lagrange(k_lg, f_psi, m=k_lg_precond) - phi_shear = solver.solve_cgs_lagrange(k_lg, f_phi, m=k_lg_precond) - elif solver_type == 'direct': - psi_shear = solver.solve_direct_lagrange(k_lg, f_psi) - phi_shear = solver.solve_direct_lagrange(k_lg, f_phi) - - return (psi_shear, phi_shear) - - if time_info: - text = "--Solving for the shear functions using the {0} solver...".format(solver_type) - (psi_shear, phi_shear) = solver.function_timer(text, solve_shear_functions) - else: - (psi_shear, phi_shear) = solve_shear_functions() - - # save the shear functions - self.section_props.psi_shear = psi_shear - self.section_props.phi_shear = phi_shear - - # assemble shear centre and warping moment integrals - def assemle_sc_warping_integrals(): - sc_xint = 0 - sc_yint = 0 - q_omega = 0 - i_omega = 0 - i_xomega = 0 - i_yomega = 0 - - for el in warping_section.elements: - (sc_xint_el, sc_yint_el, q_omega_el, i_omega_el, i_xomega_el, - i_yomega_el) = el.shear_warping_integrals( - self.section_props.ixx_c, self.section_props.iyy_c, - self.section_props.ixy_c, omega[el.node_ids] - ) - - sc_xint += sc_xint_el - sc_yint += sc_yint_el - q_omega += q_omega_el - i_omega += i_omega_el - i_xomega += i_xomega_el - i_yomega += i_yomega_el - - return (sc_xint, sc_yint, q_omega, i_omega, i_xomega, i_yomega) - - if time_info: - text = "--Assembling shear centre and warping moment integrals..." - (sc_xint, sc_yint, q_omega, i_omega, i_xomega, i_yomega) = ( - solver.function_timer(text, assemle_sc_warping_integrals)) - else: - (sc_xint, sc_yint, q_omega, i_omega, i_xomega, i_yomega) = ( - assemle_sc_warping_integrals()) - - # calculate shear centres - def shear_centres(): - # calculate shear centres (elasticity approach) - Delta_s = ( - 2 * (1 + self.section_props.nu_eff) * ( - self.section_props.ixx_c * self.section_props.iyy_c - - self.section_props.ixy_c ** 2) - ) - x_se = ( - (1 / Delta_s) * ((self.section_props.nu_eff / 2 * - sc_xint) - f_torsion.dot(phi_shear)) - ) - y_se = ( - (1 / Delta_s) * ((self.section_props.nu_eff / 2 * - sc_yint) + f_torsion.dot(psi_shear)) - ) - (x11_se, y22_se) = fea.principal_coordinate(self.section_props.phi, x_se, y_se) - - # calculate shear centres (Trefftz's approach) - x_st = ( - (self.section_props.ixy_c * i_xomega - self.section_props.iyy_c * i_yomega) / ( - self.section_props.ixx_c * self.section_props.iyy_c - - self.section_props.ixy_c ** 2) - ) - y_st = ( - (self.section_props.ixx_c * i_xomega - self.section_props.ixy_c * i_yomega) / ( - self.section_props.ixx_c * self.section_props.iyy_c - - self.section_props.ixy_c ** 2) - ) - - return (Delta_s, x_se, y_se, x11_se, y22_se, x_st, y_st) - - if time_info: - text = "--Calculating shear centres..." - (Delta_s, x_se, y_se, x11_se, y22_se, x_st, y_st) = solver.function_timer( - text, shear_centres) - else: - (Delta_s, x_se, y_se, x11_se, y22_se, x_st, y_st) = shear_centres() - - # save shear centres - self.section_props.Delta_s = Delta_s - self.section_props.x_se = x_se - self.section_props.y_se = y_se - self.section_props.x11_se = x11_se - self.section_props.y22_se = y22_se - self.section_props.x_st = x_st - self.section_props.y_st = y_st - - # calculate warping constant - self.section_props.gamma = ( - i_omega - q_omega ** 2 / self.section_props.ea - y_se * i_xomega + x_se * i_yomega - ) - - def assemble_shear_deformation(): - # assemble shear deformation coefficients - kappa_x = 0 - kappa_y = 0 - kappa_xy = 0 - - for el in warping_section.elements: - (kappa_x_el, kappa_y_el, kappa_xy_el) = el.shear_coefficients( - self.section_props.ixx_c, self.section_props.iyy_c, - self.section_props.ixy_c, psi_shear[el.node_ids], phi_shear[el.node_ids], - self.section_props.nu_eff - ) - - kappa_x += kappa_x_el - kappa_y += kappa_y_el - kappa_xy += kappa_xy_el - - return (kappa_x, kappa_y, kappa_xy) - - if time_info: - text = "--Assembling shear deformation coefficients..." - (kappa_x, kappa_y, kappa_xy) = solver.function_timer(text, assemble_shear_deformation) - else: - (kappa_x, kappa_y, kappa_xy) = assemble_shear_deformation() - - # calculate shear areas wrt global axis - self.section_props.A_sx = Delta_s ** 2 / kappa_x - self.section_props.A_sy = Delta_s ** 2 / kappa_y - self.section_props.A_sxy = Delta_s ** 2 / kappa_xy - - # calculate shear areas wrt principal bending axis: - alpha_xx = kappa_x * self.section_props.area / Delta_s ** 2 - alpha_yy = kappa_y * self.section_props.area / Delta_s ** 2 - alpha_xy = kappa_xy * self.section_props.area / Delta_s ** 2 - - # rotate the tensor by the principal axis angle - phi_rad = self.section_props.phi * np.pi / 180 - R = np.array([ - [np.cos(phi_rad), np.sin(phi_rad)], - [-np.sin(phi_rad), np.cos(phi_rad)] - ]) - - rotatedAlpha = R.dot(np.array([ - [alpha_xx, alpha_xy], - [alpha_xy, alpha_yy] - ])).dot(np.transpose(R)) - - # recalculate the shear area based on the rotated alpha value - self.section_props.A_s11 = self.section_props.area / rotatedAlpha[0, 0] - self.section_props.A_s22 = self.section_props.area / rotatedAlpha[1, 1] - - # calculate the monosymmetry consants - def calculate_monosymmetry_integrals(): - int_x = 0 - int_y = 0 - int_11 = 0 - int_22 = 0 - - for el in warping_section.elements: - (int_x_el, int_y_el, int_11_el, int_22_el) = el.monosymmetry_integrals( - self.section_props.phi - ) - - int_x += int_x_el - int_y += int_y_el - int_11 += int_11_el - int_22 += int_22_el - - return (int_x, int_y, int_11, int_22) - - if time_info: - text = "--Assembling monosymmetry integrals..." - (int_x, int_y, int_11, int_22) = solver.function_timer( - text, calculate_monosymmetry_integrals - ) - print("") - else: - (int_x, int_y, int_11, int_22) = calculate_monosymmetry_integrals() - - # calculate the monosymmetry constants - self.section_props.beta_x_plus = ( - -int_x / self.section_props.ixx_c + 2 * self.section_props.y_se - ) - self.section_props.beta_x_minus = ( - int_x / self.section_props.ixx_c - 2 * self.section_props.y_se - ) - self.section_props.beta_y_plus = ( - -int_y / self.section_props.iyy_c + 2 * self.section_props.x_se - ) - self.section_props.beta_y_minus = ( - int_y / self.section_props.iyy_c - 2 * self.section_props.x_se - ) - self.section_props.beta_11_plus = ( - -int_11 / self.section_props.i11_c + 2 * self.section_props.y22_se - ) - self.section_props.beta_11_minus = ( - int_11 / self.section_props.i11_c - 2 * self.section_props.y22_se - ) - self.section_props.beta_22_plus = ( - -int_22 / self.section_props.i22_c + 2 * self.section_props.x11_se - ) - self.section_props.beta_22_minus = ( - int_22 / self.section_props.i22_c - 2 * self.section_props.x11_se - )
- -
[docs] def calculate_frame_properties(self, time_info=False, solver_type='direct'): - """Calculates and returns the properties required for a frame analysis. The properties are - also stored in the :class:`~sectionproperties.analysis.cross_section.SectionProperties` - object contained in the ``section_props`` class variable. - - :param bool time_info: If set to True, a detailed description of the computation and the - time cost is printed to the terminal. - :param string solver_type: Solver used for solving systems of linear equations, either - using the *'direct'* method or *'cgs'* iterative method - - :return: Cross-section properties to be used for a frame analysis *(area, ixx, iyy, ixy, j, - phi)* - :rtype: tuple(float, float, float, float, float, float) - - The following section properties are calculated: - - * Cross-sectional area *(area)* - * Second moments of area about the centroidal axis *(ixx, iyy, ixy)* - * Torsion constant *(j)* - * Principal axis angle *(phi)* - - If materials are specified for the cross-section, the area, second moments of area and - torsion constant are elastic moulus weighted. - - The following example demonstrates the use of this method:: - - section = CrossSection(geometry, mesh) - (area, ixx, iyy, ixy, j, phi) = section.calculate_frame_properties() - """ - - def calculate_frame(): - # initialise geometric properties - self.section_props.area = 0 - self.section_props.ea = 0 - self.section_props.qx = 0 - self.section_props.qy = 0 - self.section_props.ixx_g = 0 - self.section_props.iyy_g = 0 - self.section_props.ixy_g = 0 - self.section_props.ixx_c = 0 - self.section_props.iyy_c = 0 - self.section_props.ixy_c = 0 - self.section_props.j = 0 - self.section_props.phi = 0 - - # calculate global geometric properties - for el in self.elements: - (area, qx, qy, ixx_g, - iyy_g, ixy_g, e, _) = el.geometric_properties() - - self.section_props.area += area - self.section_props.ea += area * e - self.section_props.qx += qx * e - self.section_props.qy += qy * e - self.section_props.ixx_g += ixx_g * e - self.section_props.iyy_g += iyy_g * e - self.section_props.ixy_g += ixy_g * e - - # calculate elastic centroid location - self.section_props.calculate_elastic_centroid() - - # calculate second moments of area about the centroidal xy axis - self.section_props.ixx_c = ( - self.section_props.ixx_g - self.section_props.qx ** 2 / self.section_props.ea - ) - self.section_props.iyy_c = ( - self.section_props.iyy_g - self.section_props.qy ** 2 / self.section_props.ea - ) - self.section_props.ixy_c = ( - self.section_props.ixy_g - self.section_props.qx * self.section_props.qy / - self.section_props.ea - ) - - # calculate the principal axis angle - Delta = ( - ((self.section_props.ixx_c - self.section_props.iyy_c) / 2) ** 2 + - self.section_props.ixy_c ** 2 - ) ** 0.5 - - i11_c = ( - (self.section_props.ixx_c + self.section_props.iyy_c) / 2 + Delta - ) - - # calculate initial principal axis angle - if abs(self.section_props.ixx_c - i11_c) < 1e-12 * i11_c: - self.section_props.phi = 0 - else: - self.section_props.phi = np.arctan2( - self.section_props.ixx_c - self.section_props.i11_c, - self.section_props.ixy_c - ) * 180 / np.pi - - # create a new CrossSection with the origin shifted to the centroid for calculation of - # the warping properties - warping_section = CrossSection(self.geometry, self.mesh, self.materials) - - # shift the coordinates of each element N.B. the mesh class attribute remains unshifted - for el in warping_section.elements: - el.coords[0, :] -= self.section_props.cx - el.coords[1, :] -= self.section_props.cy - - (k, _, f) = warping_section.assemble_torsion(lg=False) - - # if the cgs method is used, perform ILU decomposition - if solver_type == 'cgs': - k_precond = linalg.LinearOperator( - (self.num_nodes, self.num_nodes), linalg.spilu(k).solve - ) - - # solve for warping function - if solver_type == 'cgs': - omega = solver.solve_cgs(k, f, k_precond) - elif solver_type == 'direct': - omega = solver.solve_direct(k, f) - - # calculate the torsion constant - self.section_props.j = ( - self.section_props.ixx_c + self.section_props.iyy_c - omega.dot(k.dot( - np.transpose(omega))) - ) - - if time_info: - text = "--Calculating frame section properties..." - solver.function_timer(text, calculate_frame) - print("") - else: - calculate_frame() - - return ( - self.section_props.ea, self.section_props.ixx_c, - self.section_props.iyy_c, self.section_props.ixy_c, - self.section_props.j, self.section_props.phi)
- -
[docs] def calculate_plastic_properties(self, time_info=False, verbose=False, debug=False): - """Calculates the plastic properties of the cross-section and stores the, in the - :class:`~sectionproperties.analysis.cross_section.SectionProperties` object contained in - the ``section_props`` class variable. - - :param bool time_info: If set to True, a detailed description of the computation and the - time cost is printed to the terminal. - :param bool verbose: If set to True, the number of iterations required for each plastic - axis is printed to the terminal. - :param bool debug: If set to True, the geometry is plotted each time a new mesh is - generated by the plastic centroid algorithm. - - The following warping section properties are calculated: - - * Plastic centroid for bending about the centroidal and principal axes - * Plastic section moduli for bending about the centroidal and principal axes - * Shape factors for bending about the centroidal and principal axes - - If materials are specified for the cross-section, the plastic section moduli are displayed - as plastic moments (i.e :math:`M_p = f_y S`) and the shape factors are not calculated. - - Note that the geometric properties must be calculated before the plastic properties are - calculated:: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_plastic_properties() - - :raises RuntimeError: If the geometric properties have not been calculated prior to calling - this method - """ - - # check that a geometric analysis has been performed - if self.section_props.cx is None: - err = "Cacluate geometric properties before performing a plastic analysis." - raise RuntimeError(err) - - def calc_plastic(): - plastic_section = PlasticSection(self.geometry, self.materials, debug) - - # calculate plastic properties - try: - plastic_section.calculate_plastic_properties(self, verbose) - except ValueError: - str = "Plastic section properties calculation failed. Contact " - str += "robbie.vanleeuwen@gmail.com with your analysis parameters." - raise RuntimeError(str) - - if time_info: - text = "--Calculating plastic properties..." - solver.function_timer(text, calc_plastic) - print("") - else: - calc_plastic()
- -
[docs] def calculate_stress(self, N=0, Vx=0, Vy=0, Mxx=0, Myy=0, M11=0, M22=0, - Mzz=0, time_info=False): - """Calculates the cross-section stress resulting from design actions and returns a - :class:`~sectionproperties.analysis.cross_section.StressPost` object allowing - post-processing of the stress results. - - :param float N: Axial force - :param float Vx: Shear force acting in the x-direction - :param float Vy: Shear force acting in the y-direction - :param float Mxx: Bending moment about the centroidal xx-axis - :param float Myy: Bending moment about the centroidal yy-axis - :param float M11: Bending moment about the centroidal 11-axis - :param float M22: Bending moment about the centroidal 22-axis - :param float Mzz: Torsion moment about the centroidal zz-axis - :param bool time_info: If set to True, a detailed description of the computation and the - time cost is printed to the terminal. - :return: Object for post-processing cross-section stresses - :rtype: :class:`~sectionproperties.analysis.cross_section.StressPost` - - Note that a geometric and warping analysis must be performed before a stress analysis is - carried out:: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(N=1e3, Vy=3e3, Mxx=1e6) - - :raises RuntimeError: If a geometric and warping analysis have not been performed prior to - calling this method - """ - - # check that a geometric and warping analysis has been performed - if None in [ - self.section_props.area, self.section_props.ixx_c, self.section_props.cx, - self.section_props.j - ]: - err = "Perform a geometric and warping analysis before carrying out a stress analysis." - raise RuntimeError(err) - - def calc_stress(): - # create stress post object - stress_post = StressPost(self) - - # get relevant section properties - ea = self.section_props.ea - cx = self.section_props.cx - cy = self.section_props.cy - ixx = self.section_props.ixx_c - iyy = self.section_props.iyy_c - ixy = self.section_props.ixy_c - i11 = self.section_props.i11_c - i22 = self.section_props.i22_c - phi = self.section_props.phi - j = self.section_props.j - Delta_s = self.section_props.Delta_s - nu = self.section_props.nu_eff - - # loop through all material groups - for group in stress_post.material_groups: - # allocate nodal weights vector for nodal averaging - nodal_weights = np.zeros(self.num_nodes) - - # loop through all elements in the material group - for el in group.elements: - ( - sig_zz_n_el, sig_zz_mxx_el, sig_zz_myy_el, sig_zz_m11_el, sig_zz_m22_el, - sig_zx_mzz_el, sig_zy_mzz_el, sig_zx_vx_el, sig_zy_vx_el, sig_zx_vy_el, - sig_zy_vy_el, weights - ) = el.element_stress( - N, Mxx, Myy, M11, M22, Mzz, Vx, Vy, ea, cx, cy, ixx, iyy, ixy, i11, i22, - phi, j, nu, self.section_props.omega[el.node_ids], - self.section_props.psi_shear[el.node_ids], - self.section_props.phi_shear[el.node_ids], Delta_s - ) - - # add stresses to global vectors - group.stress_result.sig_zz_n[el.node_ids] += sig_zz_n_el * weights - group.stress_result.sig_zz_mxx[el.node_ids] += sig_zz_mxx_el * weights - group.stress_result.sig_zz_myy[el.node_ids] += sig_zz_myy_el * weights - group.stress_result.sig_zz_m11[el.node_ids] += sig_zz_m11_el * weights - group.stress_result.sig_zz_m22[el.node_ids] += sig_zz_m22_el * weights - group.stress_result.sig_zx_mzz[el.node_ids] += sig_zx_mzz_el * weights - group.stress_result.sig_zy_mzz[el.node_ids] += sig_zy_mzz_el * weights - group.stress_result.sig_zx_vx[el.node_ids] += sig_zx_vx_el * weights - group.stress_result.sig_zy_vx[el.node_ids] += sig_zy_vx_el * weights - group.stress_result.sig_zx_vy[el.node_ids] += sig_zx_vy_el * weights - group.stress_result.sig_zy_vy[el.node_ids] += sig_zy_vy_el * weights - - # add nodal weights - nodal_weights[el.node_ids] += weights - - # nodal averaging - for (i, weight) in enumerate(nodal_weights): - if weight != 0: - group.stress_result.sig_zz_n[i] *= 1 / weight - group.stress_result.sig_zz_mxx[i] *= 1 / weight - group.stress_result.sig_zz_myy[i] *= 1 / weight - group.stress_result.sig_zz_m11[i] *= 1 / weight - group.stress_result.sig_zz_m22[i] *= 1 / weight - group.stress_result.sig_zx_mzz[i] *= 1 / weight - group.stress_result.sig_zy_mzz[i] *= 1 / weight - group.stress_result.sig_zx_vx[i] *= 1 / weight - group.stress_result.sig_zy_vx[i] *= 1 / weight - group.stress_result.sig_zx_vy[i] *= 1 / weight - group.stress_result.sig_zy_vy[i] *= 1 / weight - - # calculate combined stresses - group.stress_result.calculate_combined_stresses() - - return stress_post - - if time_info: - text = "--Calculating cross-section stresses..." - stress_post = solver.function_timer(text, calc_stress) - print("") - else: - stress_post = calc_stress() - - # return the stress_post object - return stress_post
- -
[docs] def assemble_torsion(self, lg=True): - """Assembles stiffness matrices to be used for the computation of warping properties and - the torsion load vector (f_torsion). Both a regular (k) and Lagrangian multiplier (k_lg) - stiffness matrix are returned. The stiffness matrices are assembled using the sparse COO - format and returned in the sparse CSC format. - - :param bool lg: Whether or not to calculate the Lagrangian multiplier stiffness matrix - - :return: Regular stiffness matrix, Lagrangian multiplier stiffness matrix and torsion load - vector *(k, k_lg, f_torsion)* - :rtype: tuple(:class:`scipy.sparse.csc_matrix`, :class:`scipy.sparse.csc_matrix`, - :class:`numpy.ndarray`) - """ - - # initialise variables - N = self.num_nodes # size of matrix - row = [] # list holding row indices - col = [] # list holding column indices - data = [] # list holding stiffness matrix entries - f_torsion = np.zeros(N) # force vector array - - # loop through all elements in the mesh - for el in self.elements: - # determine number of nodes in the current element - n = len(el.node_ids) - - # calculate the element stiffness matrix and torsion load vector - (k_el, f_el) = el.torsion_properties() - - # assemble the torsion load vector - f_torsion[el.node_ids] += f_el - - # create row index vector - r = np.repeat(el.node_ids, n) - - # create column index vector - c = np.tile(el.node_ids, n) - - # flatten element stiffness matrix - k = k_el.flatten() - - # add to global arrays - row = np.hstack((row, r)) - col = np.hstack((col, c)) - data = np.hstack((data, k)) - - k = coo_matrix((data, (row, col)), shape=(N, N)) - - if not lg: - return (csc_matrix(k), None, f_torsion) - - # construct Lagrangian multiplier matrix: - # column vector of ones - row = np.hstack((row, range(N))) - col = np.hstack((col, np.repeat(N, N))) - data = np.hstack((data, np.repeat(1, N))) - - # row vector of ones - row = np.hstack((row, np.repeat(N, N))) - col = np.hstack((col, range(N))) - data = np.hstack((data, np.repeat(1, N))) - - # zero in bottom right corner - row = np.hstack((row, N)) - col = np.hstack((col, N)) - data = np.hstack((data, 0)) - - k_lg = coo_matrix((data, (row, col)), shape=(N+1, N+1)) - - return (csc_matrix(k), csc_matrix(k_lg), f_torsion)
- -
[docs] def plot_mesh(self, ax=None, pause=True, alpha=1, materials=False, mask=None): - """Plots the finite element mesh. If no axes object is supplied a new figure and axis is - created. - - :param ax: Axes object on which the mesh is plotted - :type ax: :class:`matplotlib.axes.Axes` - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - :param float alpha: Transparency of the mesh outlines: :math:`0 \leq \\alpha \leq 1` - :param bool materials: If set to true and material properties have been provided to the - :class:`~sectionproperties.analysis.cross_section.CrossSection` object, shades the - elements with the specified material colours - :param mask: Mask array, of length ``num_nodes``, to mask out triangles - :type mask: list[bool] - - The following example plots the mesh generated for the second example - listed under the :class:`~sectionproperties.analysis.cross_section.CrossSection` object - definition:: - - import sectionproperties.pre.sections as sections - from sectionproperties.pre.pre import Material - from sectionproperties.analysis.cross_section import CrossSection - - geom_steel = sections.RectangularSection(d=50, b=50) - geom_timber = sections.RectangularSection(d=50, b=50, shift=[50, 0]) - geometry = sections.MergedSection([geom_steel, geom_timber]) - geometry.clean_geometry() - - mesh = geometry.create_mesh(mesh_sizes=[5, 10]) - - steel = Material( - name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=250, - color='grey' - ) - timber = Material( - name='Timber', elastic_modulus=8e3, poissons_ratio=0.35, yield_strength=20, - color='burlywood' - ) - - section = CrossSection(geometry, mesh, [steel, timber]) - section.plot_mesh(materials=True, alpha=0.5) - - .. figure:: ../images/composite_mesh.png - :align: center - :scale: 75 % - - Finite element mesh generated by the above example. - """ - - # if no axes object is supplied, create and setup the plot - if ax is None: - ax_supplied = False - (fig, ax) = plt.subplots() - post.setup_plot(ax, pause) - else: - ax_supplied = True - - # plot the mesh - ax.triplot( - self.mesh_nodes[:, 0], self.mesh_nodes[:, 1], self.mesh_elements[:, 0:3], lw=0.5, - color='black', alpha=alpha, mask=mask - ) - - # if the material colours are to be displayed - if materials and self.materials is not None: - color_array = [] - legend_list = [] - - # create an array of finite element colours - for element in self.elements: - color_array.append(element.material.color) - - # create a list of unique material legend entries - for (i, material) in enumerate(self.materials): - # if the material has not be entered yet - if i == 0 or material not in self.materials[0:i]: - # add the material colour and name to the legend list - legend_list.append(mpatches.Patch(color=material.color, label=material.name)) - - cmap = ListedColormap(color_array) # custom colormap - c = np.arange(len(color_array)) # indicies of elements - - # plot the mesh colours - ax.tripcolor( - self.mesh_nodes[:, 0], self.mesh_nodes[:, 1], self.mesh_elements[:, 0:3], c, - cmap=cmap - ) - - # display the legend - ax.legend(loc='center left', bbox_to_anchor=(1, 0.5), handles=legend_list) - - # if no axes object is supplied, finish the plot - if not ax_supplied: - post.finish_plot(ax, pause, title='Finite Element Mesh')
- -
[docs] def plot_centroids(self, pause=True): - """Plots the elastic centroid, the shear centre, the plastic centroids and the principal - axis, if they have been calculated, on top of the finite element mesh. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example analyses a 200 PFC section and displays a plot of - the centroids:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.PfcSection(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_warping_properties() - section.calculate_plastic_properties() - - section.plot_centroids() - - .. figure:: ../images/pfc_centroids.png - :align: center - :scale: 75 % - - Plot of the centroids generated by the above example. - - The following example analyses a 150x90x12 UA section and displays a plot of the - centroids:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_warping_properties() - section.calculate_plastic_properties() - - section.plot_centroids() - - .. figure:: ../images/angle_centroids.png - :align: center - :scale: 75 % - - Plot of the centroids generated by the above example. - """ - - # create plot and setup the plot - (fig, ax) = plt.subplots() - post.setup_plot(ax, pause) - - # plot the finite element mesh - self.plot_mesh(ax, pause, alpha=0.5) - - # if the elastic centroid has been calculated - if self.section_props.cx is not None: - ax.scatter( - self.section_props.cx, self.section_props.cy, edgecolors='r', facecolors='none', - marker='o', s=100, label='Elastic centroid' - ) - - # if the shear centre has been calculated - if self.section_props.x_se is not None: - (x_s, y_s) = self.get_sc() - ax.scatter(x_s, y_s, c='r', marker='+', s=100, label='Shear centre') - - # if the global plastic centroid has been calculated - if self.section_props.x_pc is not None: - (x_pc, y_pc) = self.get_pc() - ax.scatter(x_pc, y_pc, c='r', marker='x', s=100, label='Global plastic centroid') - - # if the principal plastic centroid has been calculated - if self.section_props.x11_pc is not None: - (x11_pc, y22_pc) = self.get_pc_p() - ax.scatter( - x11_pc, y22_pc, edgecolors='r', facecolors='none', marker='s', s=100, - label='Principal plastic centroid' - ) - - # if the principal axis has been calculated - if self.section_props.phi is not None: - post.draw_principal_axis( - ax, self.section_props.phi * np.pi / 180, self.section_props.cx, - self.section_props.cy - ) - - # display the legend - ax.legend(loc='center left', bbox_to_anchor=(1, 0.5)) - - # finish the plot - post.finish_plot(ax, pause, title='Centroids')
- -
[docs] def display_mesh_info(self): - """Prints mesh statistics (number of nodes, elements and regions) to the command window. - - The following example displays the mesh statistics for a Tee section merged from two - rectangles:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - rec1 = sections.RectangularSection(d=100, b=25, shift=[-12.5, 0]) - rec2 = sections.RectangularSection(d=25, b=100, shift=[-50, 100]) - geometry = sections.MergedSection([rec1, rec2]) - mesh = geometry.create_mesh(mesh_sizes=[5, 2.5]) - section = CrossSection(geometry, mesh) - section.display_mesh_info() - - >>>Mesh Statistics: - >>>--4920 nodes - >>>--2365 elements - >>>--2 regions - """ - - print("Mesh Statistics:") - print("--{0} nodes".format(self.num_nodes)) - print("--{0} elements".format(len(self.elements))) - - regions = max(self.mesh_attributes) + 1 - text = "--{0} region".format(regions) - - if regions == 1: - text += "\n" - else: - text += "s\n" - - print(text)
- -
[docs] def display_results(self, fmt='8.6e'): - """Prints the results that have been calculated to the terminal. - - :param string fmt: Number formatting string - - The following example displays the geometric section properties for a 100D x 50W rectangle - with three digits after the decimal point:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.RectangularSection(d=100, b=50) - mesh = geometry.create_mesh(mesh_sizes=[5]) - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - - section.display_results(fmt='.3f') - """ - - post.print_results(self, fmt)
- -
[docs] def get_area(self): - """ - :return: Cross-section area - :rtype: float - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - area = section.get_area() - """ - - return self.section_props.area
- -
[docs] def get_perimeter(self): - """ - :return: Cross-section perimeter - :rtype: float - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - perimeter = section.get_perimeter() - """ - - return self.section_props.perimeter
- -
[docs] def get_ea(self): - """ - :return: Modulus weighted area (axial rigidity) - :rtype: float - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - ea = section.get_ea() - """ - - return self.section_props.ea
- -
[docs] def get_q(self): - """ - :return: First moments of area about the global axis *(qx, qy)* - :rtype: tuple(float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - (qx, qy) = section.get_q() - """ - - return (self.section_props.qx, self.section_props.qy)
- -
[docs] def get_ig(self): - """ - :return: Second moments of area about the global axis *(ixx_g, iyy_g, ixy_g)* - :rtype: tuple(float, float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - (ixx_g, iyy_g, ixy_g) = section.get_ig() - """ - - return (self.section_props.ixx_g, self.section_props.iyy_g, self.section_props.ixy_g)
- -
[docs] def get_c(self): - """ - :return: Elastic centroid *(cx, cy)* - :rtype: tuple(float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - (cx, cy) = section.get_c() - """ - - return (self.section_props.cx, self.section_props.cy)
- -
[docs] def get_ic(self): - """ - :return: Second moments of area centroidal axis *(ixx_c, iyy_c, ixy_c)* - :rtype: tuple(float, float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - (ixx_c, iyy_c, ixy_c) = section.get_ic() - """ - - return (self.section_props.ixx_c, self.section_props.iyy_c, self.section_props.ixy_c)
- -
[docs] def get_z(self): - """ - :return: Elastic section moduli about the centroidal axis with respect to the top and - bottom fibres *(zxx_plus, zxx_minus, zyy_plus, zyy_minus)* - :rtype: tuple(float, float, float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - (zxx_plus, zxx_minus, zyy_plus, zyy_minus) = section.get_z() - """ - - return ( - self.section_props.zxx_plus, self.section_props.zxx_minus, self.section_props.zyy_plus, - self.section_props.zyy_minus - )
- -
[docs] def get_rc(self): - """ - :return: Radii of gyration about the centroidal axis *(rx, ry)* - :rtype: tuple(float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - (rx, ry) = section.get_rc() - """ - - return (self.section_props.rx_c, self.section_props.ry_c)
- -
[docs] def get_ip(self): - """ - :return: Second moments of area about the principal axis *(i11_c, i22_c)* - :rtype: tuple(float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - (i11_c, i22_c) = section.get_ip() - """ - - return (self.section_props.i11_c, self.section_props.i22_c)
- -
[docs] def get_phi(self): - """ - :return: Principal bending axis angle - :rtype: float - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - phi = section.get_phi() - """ - - return self.section_props.phi
- -
[docs] def get_zp(self): - """ - :return: Elastic section moduli about the principal axis with respect to the top and bottom - fibres *(z11_plus, z11_minus, z22_plus, z22_minus)* - :rtype: tuple(float, float, float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - (z11_plus, z11_minus, z22_plus, z22_minus) = section.get_zp() - """ - - return ( - self.section_props.z11_plus, self.section_props.z11_minus, self.section_props.z22_plus, - self.section_props.z22_minus - )
- -
[docs] def get_rp(self): - """ - :return: Radii of gyration about the principal axis *(r11, r22)* - :rtype: tuple(float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - (r11, r22) = section.get_rp() - """ - - return (self.section_props.r11_c, self.section_props.r22_c)
- -
[docs] def get_j(self): - """ - :return: St. Venant torsion constant - :rtype: float - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_warping_properties() - j = section.get_j() - """ - - return self.section_props.j
- -
[docs] def get_sc(self): - """ - :return: Centroidal axis shear centre (elasticity approach) *(x_se, y_se)* - :rtype: tuple(float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_warping_properties() - (x_se, y_se) = section.get_sc() - """ - - if self.section_props.x_se is None: - return (None, None) - else: - # add centroid location to move section back to original location - x_se = self.section_props.x_se + self.section_props.cx - y_se = self.section_props.y_se + self.section_props.cy - - return (x_se, y_se)
- -
[docs] def get_sc_p(self): - """ - :return: Principal axis shear centre (elasticity approach) *(x11_se, y22_se)* - :rtype: tuple(float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_warping_properties() - (x11_se, y22_se) = section.get_sc_p() - """ - - if self.section_props.x11_se is None: - return (None, None) - else: - x11_se = self.section_props.x11_se - y22_se = self.section_props.y22_se - - return (x11_se, y22_se)
- -
[docs] def get_sc_t(self): - """ - :return: Centroidal axis shear centre (Trefftz's approach) *(x_st, y_st)* - :rtype: tuple(float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_warping_properties() - (x_st, y_st) = section.get_sc_t() - """ - - if self.section_props.x_st is None: - return (None, None) - else: - # add centroid location to move section back to original location - x_st = self.section_props.x_st + self.section_props.cx - y_st = self.section_props.y_st + self.section_props.cy - - return (x_st, y_st)
- -
[docs] def get_gamma(self): - """ - :return: Warping constant - :rtype: float - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_warping_properties() - gamma = section.get_gamma() - """ - - return self.section_props.gamma
- -
[docs] def get_As(self): - """ - :return: Shear area for loading about the centroidal axis *(A_sx, A_sy)* - :rtype: tuple(float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_warping_properties() - (A_sx, A_sy) = section.get_As() - """ - - return (self.section_props.A_sx, self.section_props.A_sy)
- -
[docs] def get_As_p(self): - """ - :return: Shear area for loading about the principal bending axis *(A_s11, A_s22)* - :rtype: tuple(float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_warping_properties() - (A_s11, A_s22) = section.get_As_p() - """ - - return (self.section_props.A_s11, self.section_props.A_s22)
- -
[docs] def get_beta(self): - """ - :return: Monosymmetry constant for bending about both global axes *(beta_x_plus, - beta_x_minus, beta_y_plus, beta_y_minus)*. The *plus* value relates to the top flange - in compression and the *minus* value relates to the bottom flange in compression. - :rtype: tuple(float, float, float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_warping_properties() - (beta_x_plus, beta_x_minus, beta_y_plus, beta_y_minus) = section.get_beta() - """ - - return ( - self.section_props.beta_x_plus, self.section_props.beta_x_minus, - self.section_props.beta_y_plus, self.section_props.beta_y_minus - )
- -
[docs] def get_beta_p(self): - """ - :return: Monosymmetry constant for bending about both principal axes *(beta_11_plus, - beta_11_minus, beta_22_plus, beta_22_minus)*. The *plus* value relates to the top - flange in compression and the *minus* value relates to the bottom flange in - compression. - :rtype: tuple(float, float, float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_warping_properties() - (beta_11_plus, beta_11_minus, beta_22_plus, beta_22_minus) = section.get_beta_p() - """ - - return ( - self.section_props.beta_11_plus, self.section_props.beta_11_minus, - self.section_props.beta_22_plus, self.section_props.beta_22_minus - )
- -
[docs] def get_pc(self): - """ - :return: Centroidal axis plastic centroid *(x_pc, y_pc)* - :rtype: tuple(float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_plastic_properties() - (x_pc, y_pc) = section.get_pc() - """ - - if self.section_props.x_pc is None: - return (None, None) - else: - # add centroid location to move section back to original location - x_pc = self.section_props.x_pc + self.section_props.cx - y_pc = self.section_props.y_pc + self.section_props.cy - - return (x_pc, y_pc)
- -
[docs] def get_pc_p(self): - """ - :return: Principal bending axis plastic centroid *(x11_pc, y22_pc)* - :rtype: tuple(float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_plastic_properties() - (x11_pc, y22_pc) = section.get_pc_p() - """ - - if self.section_props.x11_pc is None: - return (None, None) - else: - # determine the position of the plastic centroid in the global axis - (x_pc, y_pc) = fea.global_coordinate( - self.section_props.phi, self.section_props.x11_pc, self.section_props.y22_pc - ) - - # add centroid location to move section back to original location - return (x_pc + self.section_props.cx, y_pc + self.section_props.cy)
- -
[docs] def get_s(self): - """ - :return: Plastic section moduli about the centroidal axis *(sxx, syy)* - :rtype: tuple(float, float) - - If material properties have been specified, returns the plastic moment :math:`M_p = f_y S`. - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_plastic_properties() - (sxx, syy) = section.get_s() - """ - - return (self.section_props.sxx, self.section_props.syy)
- -
[docs] def get_sp(self): - """ - :return: Plastic section moduli about the principal bending axis *(s11, s22)* - :rtype: tuple(float, float) - - If material properties have been specified, returns the plastic moment - :math:`M_p = f_y S`. - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_plastic_properties() - (s11, s22) = section.get_sp() - """ - - return (self.section_props.s11, self.section_props.s22)
- -
[docs] def get_sf(self): - """ - :return: Centroidal axis shape factors with respect to the top and bottom fibres - *(sf_xx_plus, sf_xx_minus, sf_yy_plus, sf_yy_minus)* - :rtype: tuple(float, float, float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_plastic_properties() - (sf_xx_plus, sf_xx_minus, sf_yy_plus, sf_yy_minus) = section.get_sf() - """ - - return ( - self.section_props.sf_xx_plus, self.section_props.sf_xx_minus, - self.section_props.sf_yy_plus, self.section_props.sf_yy_minus - )
- -
[docs] def get_sf_p(self): - """ - :return: Principal bending axis shape factors with respect to the top and bottom fibres - *(sf_11_plus, sf_11_minus, sf_22_plus, sf_22_minus)* - :rtype: tuple(float, float, float, float) - - :: - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_plastic_properties() - (sf_11_plus, sf_11_minus, sf_22_plus, sf_22_minus) = section.get_sf_p() - """ - - return ( - self.section_props.sf_11_plus, self.section_props.sf_11_minus, - self.section_props.sf_22_plus, self.section_props.sf_22_minus - )
- - -
[docs]class PlasticSection: - """Class for the plastic analysis of cross-sections. - - Stores the finite element geometry and material information and provides methods to compute the - plastic section properties. - - :param geometry: Cross-section geometry object - :type geometry: :class:`~sectionproperties.pre.sections.Geometry` - :param materials: A list of material properties corresponding to various regions in the - geometry and mesh. - :type materials: list[:class:`~sectionproperties.pre.pre.Material`] - :param bool debug: If set to True, the geometry is plotted each time a new mesh is generated by - the plastic centroid algorithm. - - :cvar geometry: Deep copy of the cross-section geometry object provided to the constructor - :vartype geometry: :class:`~sectionproperties.pre.sections.Geometry` - :cvar materials: A list of material properties corresponding to various regions in the geometry - and mesh. - :vartype materials: list[:class:`~sectionproperties.pre.pre.Material`] - :cvar bool debug: If set to True, the geometry is plotted each time a new mesh is generated by - the plastic centroid algorithm. - :cvar mesh: Mesh object returned by meshpy - :vartype mesh: :class:`meshpy.triangle.MeshInfo` - :cvar mesh_nodes: Array of node coordinates from the mesh - :vartype mesh_nodes: :class:`numpy.ndarray` - :cvar mesh_elements: Array of connectivities from the mesh - :vartype mesh_elements: :class:`numpy.ndarray` - :cvar elements: List of finite element objects describing the cross-section mesh - :vartype elements: list[:class:`~sectionproperties.analysis.fea.Tri6`] - :cvar float f_top: Current force in the top region - :cvar c_top: Centroid of the force in the top region *(c_top_x, c_top_y)* - :type c_top: list[float, float] - :cvar c_bot: Centroid of the force in the bottom region *(c_bot_x, c_bot_y)* - :type c_bot: list[float, float] - """ - - def __init__(self, geometry, materials, debug): - """Inits the PlasticSection class.""" - - # make a deepcopy of the geometry & materials so that we can modify it - self.geometry = copy.deepcopy(geometry) - self.materials = copy.deepcopy(materials) - self.debug = debug - - if self.materials is not None: - # create dummy control point at the start of the list - (x_min, x_max, y_min, y_max) = geometry.calculate_extents() - self.geometry.control_points.insert(0, [x_min - 1, y_min - 1]) - - # create matching dummy material - self.materials.insert(0, pre.Material('default', 1, 0, 1)) - - # create simple mesh of the geometry - mesh = self.create_plastic_mesh() - - # get the elements of the mesh - (_, _, elements) = self.get_elements(mesh) - - # calculate centroid of the mesh - (cx, cy) = self.calculate_centroid(elements) - - # shift geometry such that the origin is at the centroid - self.geometry.shift = [-cx, -cy] - self.geometry.shift_section() - - # remesh the geometry and store the mesh - self.mesh = self.create_plastic_mesh() - - # store the nodes, elements and list of elements in the mesh - (self.mesh_nodes, self.mesh_elements, self.elements) = self.get_elements(self.mesh) - -
[docs] def get_elements(self, mesh): - """Extracts finite elements from the provided mesh and returns Tri6 finite elements with - their associated material properties. - - :param mesh: Mesh object returned by meshpy - :type mesh: :class:`meshpy.triangle.MeshInfo` - :return: A tuple containing an array of the nodes locations, element indicies and a list of - the finite elements. - :rtype: tuple(:class:`numpy.ndarray`, :class:`numpy.ndarray`, - list[:class:`~sectionproperties.analysis.fea.Tri6`]) - """ - - # extract mesh data - nodes = np.array(mesh.points, dtype=np.dtype(float)) - elements = np.array(mesh.elements, dtype=np.dtype(int)) - attributes = np.array(mesh.element_attributes, dtype=np.dtype(int)) - - # swap mid-node order to retain node ordering consistency - elements[:, [3, 4, 5]] = elements[:, [5, 3, 4]] - - # initialise list of Tri6 elements - element_list = [] - - # build the element list one element at a time - for (i, node_ids) in enumerate(elements): - x1 = nodes[node_ids[0]][0] - y1 = nodes[node_ids[0]][1] - x2 = nodes[node_ids[1]][0] - y2 = nodes[node_ids[1]][1] - x3 = nodes[node_ids[2]][0] - y3 = nodes[node_ids[2]][1] - x4 = nodes[node_ids[3]][0] - y4 = nodes[node_ids[3]][1] - x5 = nodes[node_ids[4]][0] - y5 = nodes[node_ids[4]][1] - x6 = nodes[node_ids[5]][0] - y6 = nodes[node_ids[5]][1] - - # create a list containing the vertex and mid-node coordinates - coords = np.array([[x1, x2, x3, x4, x5, x6], [y1, y2, y3, y4, y5, y6]]) - - # if materials are specified, get the material - if self.materials is not None: - # get attribute index of current element - att_el = attributes[i] - - # if the current element is assigned the default attribute - if att_el == 0: - # determine point within current element (centroid) - pt = [(x1 + x2 + x3) / 3, (y1 + y2 + y3) / 3] - - # search within original elements - find coinciding element - for el in self.elements: - # if the point lies within the current element - if el.point_within_element(pt): - material = el.material - break - else: - # fetch the material - material = self.materials[att_el] - # if there are no materials specified, use a default material - else: - material = pre.Material('default', 1, 0, 1) - - # add tri6 elements to the element list - element_list.append(fea.Tri6(i, coords, node_ids, material)) - - return (nodes, elements, element_list)
- -
[docs] def calculate_centroid(self, elements): - """Calculates the elastic centroid from a list of finite elements. - - :param elements: A list of Tri6 finite elements. - :type elements: list[:class:`~sectionproperties.analysis.fea.Tri6`] - :return: A tuple containing the x and y location of the elastic centroid. - :rtype: tuple(float, float) - """ - - ea = 0 - qx = 0 - qy = 0 - - # loop through all the elements - for el in elements: - (area, qx_el, qy_el, _, _, _, e, _) = el.geometric_properties() - ea += area * e - qx += qx_el * e - qy += qy_el * e - - return (qy / ea, qx / ea)
- -
[docs] def calculate_plastic_properties(self, cross_section, verbose): - """Calculates the location of the plastic centroid with respect to the centroidal and - principal bending axes, the plastic section moduli and shape factors and stores the results - to the supplied :class:`~sectionproperties.analysis.cross_section.CrossSection` object. - - :param cross_section: Cross section object that uses the same geometry and materials - specified in the class constructor - :type cross_section: :class:`~sectionproperties.analysis.cross_section.CrossSection` - :param bool verbose: If set to True, the number of iterations required for each plastic - axis is printed to the terminal. - """ - - # 1) Calculate plastic properties for centroidal axis - # calculate distances to the extreme fibres - fibres = self.calculate_extreme_fibres(0) - - # 1a) Calculate x-axis plastic centroid - (y_pc, r, f, c_top, c_bot) = self.pc_algorithm( - np.array([1, 0]), fibres[2:], 1, verbose) - - self.check_convergence(r, 'x-axis') - cross_section.section_props.y_pc = y_pc - cross_section.section_props.sxx = f * abs(c_top[1] - c_bot[1]) - - if verbose: - self.print_verbose(y_pc, r, 'x-axis') - - # 1b) Calculate y-axis plastic centroid - (x_pc, r, f, c_top, c_bot) = self.pc_algorithm(np.array([0, 1]), fibres[0:2], 2, verbose) - - self.check_convergence(r, 'y-axis') - cross_section.section_props.x_pc = x_pc - cross_section.section_props.syy = f * abs(c_top[0] - c_bot[0]) - - if verbose: - self.print_verbose(x_pc, r, 'y-axis') - - # 2) Calculate plastic properties for principal axis - # convert principal axis angle to radians - angle = cross_section.section_props.phi * np.pi / 180 - - # unit vectors in the axis directions - ux = np.array([np.cos(angle), np.sin(angle)]) - uy = np.array([-np.sin(angle), np.cos(angle)]) - - # calculate distances to the extreme fibres in the principal axis - fibres = self.calculate_extreme_fibres(cross_section.section_props.phi) - - # 2a) Calculate 11-axis plastic centroid - (y22_pc, r, f, c_top, c_bot) = self.pc_algorithm(ux, fibres[2:], 1, verbose) - - # calculate the centroids in the principal coordinate system - c_top_p = fea.principal_coordinate(cross_section.section_props.phi, c_top[0], c_top[1]) - c_bot_p = fea.principal_coordinate(cross_section.section_props.phi, c_bot[0], c_bot[1]) - - self.check_convergence(r, '11-axis') - cross_section.section_props.y22_pc = y22_pc - cross_section.section_props.s11 = f * abs(c_top_p[1] - c_bot_p[1]) - - if verbose: - self.print_verbose(y22_pc, r, '11-axis') - - # 2b) Calculate 22-axis plastic centroid - (x11_pc, r, f, c_top, c_bot) = self.pc_algorithm(uy, fibres[0:2], 2, verbose) - - # calculate the centroids in the principal coordinate system - c_top_p = fea.principal_coordinate(cross_section.section_props.phi, c_top[0], c_top[1]) - c_bot_p = fea.principal_coordinate(cross_section.section_props.phi, c_bot[0], c_bot[1]) - - self.check_convergence(r, '22-axis') - cross_section.section_props.x11_pc = x11_pc - cross_section.section_props.s22 = f * abs(c_top_p[0] - c_bot_p[0]) - - if verbose: - self.print_verbose(x11_pc, r, '22-axis') - - # if there are no materials specified, calculate shape factors - if cross_section.materials is None: - cross_section.section_props.sf_xx_plus = ( - cross_section.section_props.sxx / cross_section.section_props.zxx_plus - ) - cross_section.section_props.sf_xx_minus = ( - cross_section.section_props.sxx / cross_section.section_props.zxx_minus - ) - cross_section.section_props.sf_yy_plus = ( - cross_section.section_props.syy / cross_section.section_props.zyy_plus - ) - cross_section.section_props.sf_yy_minus = ( - cross_section.section_props.syy / cross_section.section_props.zyy_minus - ) - - cross_section.section_props.sf_11_plus = ( - cross_section.section_props.s11 / cross_section.section_props.z11_plus - ) - cross_section.section_props.sf_11_minus = ( - cross_section.section_props.s11 / cross_section.section_props.z11_minus - ) - cross_section.section_props.sf_22_plus = ( - cross_section.section_props.s22 / cross_section.section_props.z22_plus - ) - cross_section.section_props.sf_22_minus = ( - cross_section.section_props.s22 / cross_section.section_props.z22_minus - )
- -
[docs] def check_convergence(self, root_result, axis): - """Checks that the function solver converged and if not, raises a helpful error. - - :param root_result: Result object from the root finder - :type root_result: :class:`scipy.optimize.RootResults` - :param string axis: Axis being considered by the function sovler - :raises RuntimeError: If the function solver did not converge - """ - - if not root_result.converged: - str = "Plastic centroid calculation about the {0}".format(axis) - str += " failed. Contact robbie.vanleeuwen@gmail.com with your" - str += " analysis parameters. Termination flag: {0}".format(root_result.flag) - - raise RuntimeError(str)
- -
[docs] def print_verbose(self, d, root_result, axis): - """Prints information related to the function solver convergence to the terminal. - - :param float d: Location of the plastic centroid axis - :param root_result: Result object from the root finder - :type root_result: :class:`scipy.optimize.RootResults` - :param string axis: Axis being considered by the function sovler - """ - - str = "---{0} plastic centroid calculation converged at ".format(axis) - str += "{0:.5e} in {1} iterations.".format(d, root_result.iterations) - print(str)
- -
[docs] def calculate_extreme_fibres(self, angle): - """Calculates the locations of the extreme fibres along and perpendicular to the axis - specified by 'angle' using the elements stored in `self.elements`. - - :param float angle: Angle (in radians) along which to calculate the extreme fibre locations - :return: The location of the extreme fibres parallel (u) and perpendicular (v) to the axis - *(u_min, u_max, v_min, v_max)* - :rtype: tuple(float, float, float, float) - """ - - # loop through all nodes in the mesh - for (i, pt) in enumerate(self.mesh_nodes): - # determine the coordinate of the point wrt the axis - (u, v) = fea.principal_coordinate(angle, pt[0], pt[1]) - - # initialise min, max variables - if i == 0: - u_min = u - u_max = u - v_min = v - v_max = v - - # update the mins and maxs where necessary - u_min = min(u_min, u) - u_max = max(u_max, u) - v_min = min(v_min, v) - v_max = max(v_max, v) - - return (u_min, u_max, v_min, v_max)
- -
[docs] def evaluate_force_eq(self, d, u, u_p, verbose): - """Given a distance *d* from the centroid to an axis (defined by unit vector *u*), creates - a mesh including the new and axis and calculates the force equilibrium. The resultant - force, as a ratio of the total force, is returned. - - :param float d: Distance from the centroid to current axis - :param u: Unit vector defining the direction of the axis - :type u: :class:`numpy.ndarray` - :param u_p: Unit vector perpendicular to the direction of the axis - :type u_p: :class:`numpy.ndarray` - :param bool verbose: If set to True, the number of iterations required for each plastic - axis is printed to the terminal. - :return: The force equilibrium norm - :rtype: float - """ - - p = np.array([d * u_p[0], d * u_p[1]]) - - # create a mesh with the axis included - mesh = self.create_plastic_mesh([p, u]) - (nodes, elements, element_list) = self.get_elements(mesh) - - if self.debug: - self.plot_mesh(nodes, elements, element_list, self.materials) - - # calculate force equilibrium - (f_top, f_bot) = self.calculate_plastic_force(element_list, u, p) - - # calculate the force norm - f_norm = (f_top - f_bot) / (f_top + f_bot) - - # print verbose results - if verbose: - print("d = {0}; f_norm = {1}".format(d, f_norm)) - - # return the force norm - return f_norm
- -
[docs] def pc_algorithm(self, u, dlim, axis, verbose): - """An algorithm used for solving for the location of the plastic centroid. The algorithm - searches for the location of the axis, defined by unit vector *u* and within the section - depth, that satisfies force equilibrium. - - :param u: Unit vector defining the direction of the axis - :type u: :class:`numpy.ndarray` - :param dlim: List [dmax, dmin] containing the distances from the centroid to the extreme - fibres perpendicular to the axis - :type dlim: list[float, float] - :param int axis: The current axis direction: 1 (e.g. x or 11) or 2 (e.g. y or 22) - :param bool verbose: If set to True, the number of iterations required for each plastic - axis is printed to the terminal. - :return: The distance to the plastic centroid axis *d*, the result object *r*, the force in - the top of the section *f_top* and the location of the centroids of the top and bottom - areas *c_top* and *c_bottom* - :rtype: tuple(float, :class:`scipy.optimize.RootResults`, float, list[float, float], - list[float, float]) - """ - - # calculate vector perpendicular to u - if axis == 1: - u_p = np.array([-u[1], u[0]]) - else: - u_p = np.array([u[1], -u[0]]) - - a = dlim[0] - b = dlim[1] - - (d, r) = brentq( - self.evaluate_force_eq, a, b, args=(u, u_p, verbose), full_output=True, disp=False, - xtol=1e-6, rtol=1e-6 - ) - - return (d, r, self.f_top, self.c_top, self.c_bot)
- -
[docs] def calculate_plastic_force(self, elements, u, p): - """Sums the forces above and below the axis defined by unit vector *u* and point *p*. Also - returns the force centroid of the forces above and below the axis. - - :param elements: A list of Tri6 finite elements. - :type elements: list[:class:`~sectionproperties.analysis.fea.Tri6`] - :param u: Unit vector defining the direction of the axis - :type u: :class:`numpy.ndarray` - :param p: Point on the axis - :type p: :class:`numpy.ndarray` - :return: Force in the top and bottom areas *(f_top, f_bot)* - :rtype: tuple(float, float) - """ - - # initialise variables - (f_top, f_bot) = (0, 0) - (ea_top, ea_bot) = (0, 0) - (qx_top, qx_bot) = (0, 0) - (qy_top, qy_bot) = (0, 0) - - # loop through all elements in the mesh - for el in elements: - # calculate element force and area properties - (f_el, ea_el, qx_el, qy_el, is_above) = el.plastic_properties(u, p) - - # assign force and area properties to the top or bottom segments - if is_above: - f_top += f_el - ea_top += ea_el - qx_top += qx_el - qy_top += qy_el - else: - f_bot += f_el - ea_bot += ea_el - qx_bot += qx_el - qy_bot += qy_el - - # if there are no elements in the top/bottom prevent division by zero N.B. the algorithm - # will never converge at this point, this is purely done to ensure a 100% search range - if ea_top == 0: - ea_top = 1 - if ea_bot == 0: - ea_bot = 1 - - # calculate the centroid of the top and bottom segments and save - self.c_top = [qy_top / ea_top, qx_top / ea_top] - self.c_bot = [qy_bot / ea_bot, qx_bot / ea_bot] - self.f_top = f_top - - return (f_top, f_bot)
- -
[docs] def create_plastic_mesh(self, new_line=None): - """Generates a triangular mesh of a deep copy of the geometry stored in `self.geometry`. - Optionally, a line can be added to the copied geometry, which is defined by a point *p* and - a unit vector *u*. - - :param new_line: A point p and a unit vector u defining a line to add to the mesh - (new_line: p -> p + u) [*p*, *u*] - :type new_line: list[:class:`numpy.ndarray`, :class:`numpy.ndarray`] - :param mesh: Mesh object returned by meshpy - :type mesh: :class:`meshpy.triangle.MeshInfo` - """ - - # start with the initial geometry - geom = copy.deepcopy(self.geometry) - - # add line at new_line - if new_line is not None: - self.add_line(geom, new_line) - - # fast clean the geometry after adding the line - clean = pre.GeometryCleaner(geom, verbose=False) - clean.zip_points() - clean.remove_zero_length_facets() - clean.remove_unused_points() - geom = clean.geometry - - if self.debug: - if new_line is not None: - geom.plot_geometry(labels=True) - - # build mesh object - mesh = triangle.MeshInfo() # create mesh info object - mesh.set_points(geom.points) # set points - mesh.set_facets(geom.facets) # set facets - mesh.set_holes(geom.holes) # set holes - - # set regions - mesh.regions.resize(len(geom.control_points)) - region_id = 0 # initialise region ID variable - - for (i, cp) in enumerate(geom.control_points): - mesh.regions[i] = [cp[0], cp[1], region_id, 1] - region_id += 1 - - mesh = triangle.build(mesh, mesh_order=2, quality_meshing=False, attributes=True) - - return mesh
- -
[docs] def add_line(self, geometry, line): - """Adds a line a geometry object. Finds the intersection points of the line with the - current facets and splits the existing facets to accomodate the new line. - - :param geometry: Cross-section geometry object used to generate the mesh - :type geometry: :class:`~sectionproperties.pre.sections.Geometry` - :param line: A point p and a unit vector u defining a line to add to the mesh - (line: p -> p + u) - :type line: list[:class:`numpy.ndarray`, :class:`numpy.ndarray`] - """ - - # initialise intersection points and facet index list - int_pts = [] - fct_idx = [] - - # get current number of points in the geometry object - num_pts = len(geometry.points) - - # line: p -> p + r - p = line[0] - r = line[1] - - # loop through all the facets in the geometry to find intersection pts - for (idx, fct) in enumerate(geometry.facets): - # facet: q -> q + s - q = np.array(geometry.points[fct[0]]) - s = geometry.points[fct[1]] - q - - # cacluate intersection point between p -> p + r and q -> q + s N.B. make line - # p -> p + r inifintely long to find all intersects if the lines are not parallel - if np.cross(r, s) != 0: - # calculate t and u - t = np.cross(q - p, s) / np.cross(r, s) - u = np.cross(p - q, r) / np.cross(s, r) - - new_pt = p + t * r - - # if the line lies within q -> q + s and the point hasn't already been added - # (ignore t as it is infinitely long) - if (u >= 0 and u <= 1 and list(new_pt) not in [list(item) for item in int_pts]): - int_pts.append(new_pt) - fct_idx.append(idx) - - # if less than 2 intersection points are found, we are at the edge of the section, - # therefore no line to add - if len(int_pts) < 2: - return - - # sort intersection points and facet list first by x, then by y - int_pts = np.array(int_pts) - idx_sort = np.lexsort((int_pts[:, 0], int_pts[:, 1])) - int_pts = int_pts[idx_sort] - fct_idx = list(np.array(fct_idx)[idx_sort]) - - # add points to the geometry object - for pt in int_pts: - geometry.points.append([pt[0], pt[1]]) - - # add new facets by looping from the second facet index to the end - for (i, idx) in enumerate(fct_idx[1:]): - # get mid-point of proposed new facet - mid_pt = 0.5 * (int_pts[i] + int_pts[i+1]) - - # check to see if the mid-point is not in a hole - # add the facet - if self.point_within_element(mid_pt): - geometry.facets.append([num_pts + i, num_pts + i + 1]) - - # rebuild the intersected facet - self.rebuild_parent_facet(geometry, idx, num_pts + i + 1) - - # rebuild the first facet the looped skipped - if i == 0: - self.rebuild_parent_facet(geometry, fct_idx[0], num_pts + i) - - # sort list of facet indices (to be removed) in reverse order so as not to comprimise the - # indices during deletion - idx_to_remove = sorted(fct_idx, reverse=True) - - for idx in idx_to_remove: - geometry.facets.pop(idx)
- -
[docs] def rebuild_parent_facet(self, geometry, fct_idx, pt_idx): - """Splits and rebuilds a facet at a given point. - - :param geometry: Cross-section geometry object used to generate the mesh - :type geometry: :class:`~sectionproperties.pre.sections.Geometry` - :param int fct_idx: Index of the facet to be split - :param int pt_idx: Index of the point to insert into the facet - """ - - # get current facet - fct = geometry.facets[fct_idx] - - # rebuild facet - geometry.facets.append([fct[0], pt_idx]) - geometry.facets.append([pt_idx, fct[1]])
- -
[docs] def point_within_element(self, pt): - """Determines whether a point lies within an element in the mesh stored in - `self.mesh_elements`. - - :param pt: Point to check - :type pt: :class:`numpy.ndarray` - :return: Whether the point lies within an element - :rtype: bool - """ - - px = pt[0] - py = pt[1] - - # loop through elements in the mesh - for el in self.mesh_elements: - # get coordinates of corner points - x1 = self.mesh_nodes[el[0]][0] - y1 = self.mesh_nodes[el[0]][1] - x2 = self.mesh_nodes[el[1]][0] - y2 = self.mesh_nodes[el[1]][1] - x3 = self.mesh_nodes[el[2]][0] - y3 = self.mesh_nodes[el[2]][1] - - # compute variables alpha, beta and gamma - alpha = ( - ((y2 - y3) * (px - x3) + (x3 - x2) * (py - y3)) / - ((y2 - y3) * (x1 - x3) + (x3 - x2) * (y1 - y3)) - ) - beta = ( - ((y3 - y1) * (px - x3) + (x1 - x3) * (py - y3)) / - ((y2 - y3) * (x1 - x3) + (x3 - x2) * (y1 - y3)) - ) - gamma = 1.0 - alpha - beta - - # if the point lies within an element - if alpha >= 0 and beta >= 0 and gamma >= 0: - return True - - return False
- -
[docs] def plot_mesh(self, nodes, elements, element_list, materials): - """Watered down implementation of the CrossSection method to plot the finite element mesh, - showing material properties.""" - - (fig, ax) = plt.subplots() - post.setup_plot(ax, True) - - # plot the mesh - ax.triplot(nodes[:, 0], nodes[:, 1], elements[:, 0:3], lw=0.5, - color='black') - - color_array = [] - legend_list = [] - - if materials is not None: - # create an array of finite element colours - for el in element_list: - color_array.append(el.material.color) - - # create a list of unique material legend entries - for (i, mat) in enumerate(materials): - # if the material has not be entered yet - if i == 0 or mat not in materials[0:i]: - # add the material colour and name to the legend list - legend_list.append(mpatches.Patch(color=mat.color, label=mat.name)) - - cmap = ListedColormap(color_array) # custom colormap - c = np.arange(len(color_array)) # indicies of elements - - # plot the mesh colours - ax.tripcolor(nodes[:, 0], nodes[:, 1], elements[:, 0:3], c, cmap=cmap) - - # display the legend - ax.legend(loc='center left', bbox_to_anchor=(1, 0.5), handles=legend_list) - - # finish the plot - post.finish_plot(ax, True, title='Finite Element Mesh')
- - -
[docs]class StressPost: - """Class for post-processing finite element stress results. - - A StressPost object is created when a stress analysis is carried out and is returned as an - object to allow post-processing of the results. The StressPost object creates a deep copy of - the MaterialGroups within the cross-section to allow the calculation of stresses for each - material. Methods for post-processing the calculated stresses are provided. - - :param cross_section: Cross section object for stress calculation - :type cross_section: :class:`~sectionproperties.analysis.cross_section.CrossSection` - - :cvar cross_section: Cross section object for stress calculation - :vartype cross_section: :class:`~sectionproperties.analysis.cross_section.CrossSection` - :cvar material_groups: A deep copy of the `cross_section` material groups to allow a new stress - analysis - :vartype material_groups: list[:class:`~sectionproperties.pre.pre.MaterialGroup`] - """ - - def __init__(self, cross_section): - """Inits the StressPost class.""" - - self.cross_section = cross_section - - # make a deep copy of the material groups to the StressPost object such that stress results - # can be saved to a new material group - self.material_groups = copy.deepcopy(cross_section.material_groups) - -
[docs] def plot_stress_contour(self, sigs, title, pause): - """Plots filled stress contours over the finite element mesh. - - :param sigs: List of nodal stress values for each material - :type sigs: list[:class:`numpy.ndarray`] - :param string title: Plot title - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - """ - - # create plot and setup the plot - (fig, ax) = plt.subplots() - post.setup_plot(ax, pause) - - # plot the finite element mesh - self.cross_section.plot_mesh(ax, pause, alpha=0.5) - - # set up the colormap - cmap = cm.get_cmap(name='jet') - - # create triangulation - triang = tri.Triangulation( - self.cross_section.mesh_nodes[:, 0], self.cross_section.mesh_nodes[:, 1], - self.cross_section.mesh_elements[:, 0:3] - ) - - # determine minimum and maximum stress values for the contour list - sig_min = min([min(x) for x in sigs]) - sig_max = max([max(x) for x in sigs]) - v = np.linspace(sig_min, sig_max, 15, endpoint=True) - - if np.isclose(v[0], v[-1], atol=1e-12): - v = 15 - ticks = None - else: - ticks = v - - # plot the filled contour, looping through the materials - for (i, sig) in enumerate(sigs): - # create and set the mask for the current material - mask_array = np.ones(len(self.cross_section.elements), dtype=bool) - mask_array[self.material_groups[i].el_ids] = False - triang.set_mask(mask_array) - - # plot the filled contour - trictr = ax.tricontourf(triang, sig, v, cmap=cmap) - - # display the colourbar - fig.colorbar(trictr, label='Stress', format='%.4e', ticks=ticks) - - # TODO: display stress values in the toolbar (format_coord) - - # finish the plot - post.finish_plot(ax, pause, title)
- -
[docs] def plot_stress_vector(self, sigxs, sigys, title, pause): - """Plots stress vectors over the finite element mesh. - - :param sigxs: List of x-components of the nodal stress values for each material - :type sigxs: list[:class:`numpy.ndarray`] - :param sigys: List of y-components of the nodal stress values for each material - :type sigys: list[:class:`numpy.ndarray`] - :param string title: Plot title - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - """ - - # create plot and setup the plot - (fig, ax) = plt.subplots() - post.setup_plot(ax, pause) - - # plot the finite element mesh - self.cross_section.plot_mesh(ax, pause, alpha=0.5) - - # set up the colormap - cmap = cm.get_cmap(name='jet') - - # initialise quiver plot list max scale - quiv_list = [] - max_scale = 0 - - # plot the vectors - for (i, sigx) in enumerate(sigxs): - sigy = sigys[i] - - # scale the colour with respect to the magnitude of the vector - c = np.hypot(sigx, sigy) - - quiv = ax.quiver( - self.cross_section.mesh_nodes[:, 0], self.cross_section.mesh_nodes[:, 1], sigx, - sigy, c, cmap=cmap - ) - - # get the scale and store the max value - quiv._init() - max_scale = max(max_scale, quiv.scale) - quiv_list.append(quiv) - - # update the colormap values - if i == 0: - c_min = min(c) - c_max = max(c) - else: - c_min = min(c_min, min(c)) - c_max = max(c_max, max(c)) - - # apply the scale - for quiv_plot in quiv_list: - quiv_plot.scale = max_scale - - # apply the colourbar - v1 = np.linspace(c_min, c_max, 15, endpoint=True) - fig.colorbar(quiv, label='Stress', ticks=v1, format='%.4e') - - # finish the plot - post.finish_plot(ax, pause, title=title)
- -
[docs] def get_stress(self): - """Returns the stresses within each material belonging to the current - :class:`~sectionproperties.analysis.cross_section.StressPost` object. - - :return: A list of dictionaries containing the cross-section stresses for each material. - :rtype: list[dict] - - A dictionary is returned for each material in the cross-section, containing the following - keys and values: - - * *'Material'*: Material name - * *'sig_zz_n'*: Normal stress :math:`\sigma_{zz,N}` resulting from the axial load :math:`N` - * *'sig_zz_mxx'*: Normal stress :math:`\sigma_{zz,Mxx}` resulting from the bending moment - :math:`M_{xx}` - * *'sig_zz_myy'*: Normal stress :math:`\sigma_{zz,Myy}` resulting from the bending moment - :math:`M_{yy}` - * *'sig_zz_m11'*: Normal stress :math:`\sigma_{zz,M11}` resulting from the bending moment - :math:`M_{11}` - * *'sig_zz_m22'*: Normal stress :math:`\sigma_{zz,M22}` resulting from the bending moment - :math:`M_{22}` - * *'sig_zz_m'*: Normal stress :math:`\sigma_{zz,\Sigma M}` resulting from all bending - moments - * *'sig_zx_mzz'*: *x*-component of the shear stress :math:`\sigma_{zx,Mzz}` resulting from - the torsion moment - * *'sig_zy_mzz'*: *y*-component of the shear stress :math:`\sigma_{zy,Mzz}` resulting from - the torsion moment - * *'sig_zxy_mzz'*: Resultant shear stress :math:`\sigma_{zxy,Mzz}` resulting from the - torsion moment - * *'sig_zx_vx'*: *x*-component of the shear stress :math:`\sigma_{zx,Vx}` resulting from - the shear force :math:`V_{x}` - * *'sig_zy_vx'*: *y*-component of the shear stress :math:`\sigma_{zy,Vx}` resulting from - the shear force :math:`V_{x}` - * *'sig_zxy_vx'*: Resultant shear stress :math:`\sigma_{zxy,Vx}` resulting from the shear - force :math:`V_{x}` - * *'sig_zx_vy'*: *x*-component of the shear stress :math:`\sigma_{zx,Vy}` resulting from - the shear force :math:`V_{y}` - * *'sig_zy_vy'*: *y*-component of the shear stress :math:`\sigma_{zy,Vy}` resulting from - the shear force :math:`V_{y}` - * *'sig_zxy_vy'*: Resultant shear stress :math:`\sigma_{zxy,Vy}` resulting from the shear - force :math:`V_{y}` - * *'sig_zx_v'*: *x*-component of the shear stress :math:`\sigma_{zx,\Sigma V}` resulting - from all shear forces - * *'sig_zy_v'*: *y*-component of the shear stress :math:`\sigma_{zy,\Sigma V}` resulting - from all shear forces - * *'sig_zxy_v'*: Resultant shear stress :math:`\sigma_{zxy,\Sigma V}` resulting from all - shear forces - * *'sig_zz'*: Combined normal stress :math:`\sigma_{zz}` resulting from all actions - * *'sig_zx'*: *x*-component of the shear stress :math:`\sigma_{zx}` resulting from all - actions - * *'sig_zy'*: *y*-component of the shear stress :math:`\sigma_{zy}` resulting from all - actions - * *'sig_zxy'*: Resultant shear stress :math:`\sigma_{zxy}` resulting from all actions - * *'sig_vm'*: von Mises stress :math:`\sigma_{vM}` resulting from all actions - - The following example returns the normal stress within a 150x90x12 UA section resulting - from an axial force of 10 kN:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(N=10e3) - - stresses = stress_post.get_stress() - print('Material: {0}'.format(stresses[0]['Material'])) - print('Axial Stresses: {0}'.format(stresses[0]['sig_zz_n'])) - - $ Material: default - $ Axial Stresses: [3.6402569 3.6402569 3.6402569 ... 3.6402569 3.6402569 3.6402569] - """ - - stress = [] - - for group in self.material_groups: - stress.append({ - 'Material': group.material.name, - 'sig_zz_n': group.stress_result.sig_zz_n, - 'sig_zz_mxx': group.stress_result.sig_zz_mxx, - 'sig_zz_myy': group.stress_result.sig_zz_myy, - 'sig_zz_m11': group.stress_result.sig_zz_m11, - 'sig_zz_m22': group.stress_result.sig_zz_m22, - 'sig_zz_m': group.stress_result.sig_zz_m, - 'sig_zx_mzz': group.stress_result.sig_zx_mzz, - 'sig_zy_mzz': group.stress_result.sig_zy_mzz, - 'sig_zxy_mzz': group.stress_result.sig_zxy_mzz, - 'sig_zx_vx': group.stress_result.sig_zx_vx, - 'sig_zy_vx': group.stress_result.sig_zy_vx, - 'sig_zxy_vx': group.stress_result.sig_zxy_vx, - 'sig_zx_vy': group.stress_result.sig_zx_vy, - 'sig_zy_vy': group.stress_result.sig_zy_vy, - 'sig_zxy_vy': group.stress_result.sig_zxy_vy, - 'sig_zx_v': group.stress_result.sig_zx_v, - 'sig_zy_v': group.stress_result.sig_zy_v, - 'sig_zxy_v': group.stress_result.sig_zxy_v, - 'sig_zz': group.stress_result.sig_zz, - 'sig_zx': group.stress_result.sig_zx, - 'sig_zy': group.stress_result.sig_zy, - 'sig_zxy': group.stress_result.sig_zxy, - 'sig_vm': group.stress_result.sig_vm - }) - - return stress
- -
[docs] def plot_stress_n_zz(self, pause=True): - """Produces a contour plot of the normal stress :math:`\sigma_{zz,N}` resulting from the - axial load :math:`N`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the normal stress within a 150x90x12 UA section resulting from - an axial force of 10 kN:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(N=10e3) - - stress_post.plot_stress_n_zz() - - .. figure:: ../images/stress/stress_n_zz.png - :align: center - :scale: 75 % - - Contour plot of the axial stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zz,N}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zz_n) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_mxx_zz(self, pause=True): - """Produces a contour plot of the normal stress :math:`\sigma_{zz,Mxx}` resulting from the - bending moment :math:`M_{xx}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the normal stress within a 150x90x12 UA section resulting from - a bending moment about the x-axis of 5 kN.m:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Mxx=5e6) - - stress_post.plot_stress_mxx_zz() - - .. figure:: ../images/stress/stress_mxx_zz.png - :align: center - :scale: 75 % - - Contour plot of the bending stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zz,Mxx}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zz_mxx) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_myy_zz(self, pause=True): - """Produces a contour plot of the normal stress :math:`\sigma_{zz,Myy}` resulting from the - bending moment :math:`M_{yy}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the normal stress within a 150x90x12 UA section resulting from - a bending moment about the y-axis of 2 kN.m:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Myy=2e6) - - stress_post.plot_stress_myy_zz() - - .. figure:: ../images/stress/stress_myy_zz.png - :align: center - :scale: 75 % - - Contour plot of the bending stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zz,Myy}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zz_myy) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_m11_zz(self, pause=True): - """Produces a contour plot of the normal stress :math:`\sigma_{zz,M11}` resulting from the - bending moment :math:`M_{11}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the normal stress within a 150x90x12 UA section resulting from - a bending moment about the 11-axis of 5 kN.m:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(M11=5e6) - - stress_post.plot_stress_m11_zz() - - .. figure:: ../images/stress/stress_m11_zz.png - :align: center - :scale: 75 % - - Contour plot of the bending stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zz,M11}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zz_m11) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_m22_zz(self, pause=True): - """Produces a contour plot of the normal stress :math:`\sigma_{zz,M22}` resulting from the - bending moment :math:`M_{22}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the normal stress within a 150x90x12 UA section resulting from - a bending moment about the 22-axis of 2 kN.m:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(M22=5e6) - - stress_post.plot_stress_m22_zz() - - .. figure:: ../images/stress/stress_m22_zz.png - :align: center - :scale: 75 % - - Contour plot of the bending stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zz,M22}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zz_m22) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_m_zz(self, pause=True): - """Produces a contour plot of the normal stress :math:`\sigma_{zz,\Sigma M}` resulting from - all bending moments :math:`M_{xx} + M_{yy} + M_{11} + M_{22}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the normal stress within a 150x90x12 UA section resulting from - a bending moment about the x-axis of 5 kN.m, a bending moment about the y-axis of 2 kN.m - and a bending moment of 3 kN.m about the 11-axis:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Mxx=5e6, Myy=2e6, M11=3e6) - - stress_post.plot_stress_m_zz() - - .. figure:: ../images/stress/stress_m_zz.png - :align: center - :scale: 75 % - - Contour plot of the bending stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zz,\Sigma M}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zz_m) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_mzz_zx(self, pause=True): - """Produces a contour plot of the *x*-component of the shear stress :math:`\sigma_{zx,Mzz}` - resulting from the torsion moment :math:`M_{zz}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the x-component of the shear stress within a 150x90x12 UA - section resulting from a torsion moment of 1 kN.m:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Mzz=1e6) - - stress_post.plot_stress_mzz_zx() - - .. figure:: ../images/stress/stress_mzz_zx.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zx,Mzz}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zx_mzz) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_mzz_zy(self, pause=True): - """Produces a contour plot of the *y*-component of the shear stress :math:`\sigma_{zy,Mzz}` - resulting from the torsion moment :math:`M_{zz}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the y-component of the shear stress within a 150x90x12 UA - section resulting from a torsion moment of 1 kN.m:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Mzz=1e6) - - stress_post.plot_stress_mzz_zy() - - .. figure:: ../images/stress/stress_mzz_zy.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zy,Mzz}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zy_mzz) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_mzz_zxy(self, pause=True): - """Produces a contour plot of the resultant shear stress :math:`\sigma_{zxy,Mzz}` resulting - from the torsion moment :math:`M_{zz}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots a contour of the resultant shear stress within a 150x90x12 UA - section resulting from a torsion moment of 1 kN.m:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Mzz=1e6) - - stress_post.plot_stress_mzz_zxy() - - .. figure:: ../images/stress/stress_mzz_zxy.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zxy,Mzz}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zxy_mzz) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_vector_mzz_zxy(self, pause=True): - """Produces a vector plot of the resultant shear stress :math:`\sigma_{zxy,Mzz}` resulting - from the torsion moment :math:`M_{zz}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example generates a vector plot of the shear stress within a 150x90x12 UA - section resulting from a torsion moment of 1 kN.m:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Mzz=1e6) - - stress_post.plot_vector_mzz_zxy() - - .. figure:: ../images/stress/vector_mzz_zxy.png - :align: center - :scale: 75 % - - Vector plot of the shear stress. - """ - - title = 'Stress Vector Plot - $\sigma_{zxy,Mzz}$' - sigxs = [] - sigys = [] - - for group in self.material_groups: - sigxs.append(group.stress_result.sig_zx_mzz) - sigys.append(group.stress_result.sig_zy_mzz) - - self.plot_stress_vector(sigxs, sigys, title, pause)
- -
[docs] def plot_stress_vx_zx(self, pause=True): - """Produces a contour plot of the *x*-component of the shear stress :math:`\sigma_{zx,Vx}` - resulting from the shear force :math:`V_{x}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the x-component of the shear stress within a 150x90x12 UA - section resulting from a shear force in the x-direction of 15 kN:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Vx=15e3) - - stress_post.plot_stress_vx_zx() - - .. figure:: ../images/stress/stress_vx_zx.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zx,Vx}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zx_vx) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_vx_zy(self, pause=True): - """Produces a contour plot of the *y*-component of the shear stress :math:`\sigma_{zy,Vx}` - resulting from the shear force :math:`V_{x}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the y-component of the shear stress within a 150x90x12 UA - section resulting from a shear force in the x-direction of 15 kN:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Vx=15e3) - - stress_post.plot_stress_vx_zy() - - .. figure:: ../images/stress/stress_vx_zy.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zy,Vx}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zy_vx) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_vx_zxy(self, pause=True): - """Produces a contour plot of the resultant shear stress :math:`\sigma_{zxy,Vx}` resulting - from the shear force :math:`V_{x}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots a contour of the resultant shear stress within a 150x90x12 UA - section resulting from a shear force in the x-direction of 15 kN:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Vx=15e3) - - stress_post.plot_stress_vx_zxy() - - .. figure:: ../images/stress/stress_vx_zxy.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zxy,Vx}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zxy_vx) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_vector_vx_zxy(self, pause=True): - """Produces a vector plot of the resultant shear stress :math:`\sigma_{zxy,Vx}` resulting - from the shear force :math:`V_{x}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example generates a vector plot of the shear stress within a 150x90x12 UA - section resulting from a shear force in the x-direction of 15 kN:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Vx=15e3) - - stress_post.plot_vector_vx_zxy() - - .. figure:: ../images/stress/vector_vx_zxy.png - :align: center - :scale: 75 % - - Vector plot of the shear stress. - """ - - title = 'Stress Vector Plot - $\sigma_{zxy,Vx}$' - sigxs = [] - sigys = [] - - for group in self.material_groups: - sigxs.append(group.stress_result.sig_zx_vx) - sigys.append(group.stress_result.sig_zy_vx) - - self.plot_stress_vector(sigxs, sigys, title, pause)
- -
[docs] def plot_stress_vy_zx(self, pause=True): - """Produces a contour plot of the *x*-component of the shear stress :math:`\sigma_{zx,Vy}` - resulting from the shear force :math:`V_{y}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the x-component of the shear stress within a 150x90x12 UA - section resulting from a shear force in the y-direction of 30 kN:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Vy=30e3) - - stress_post.plot_stress_vy_zx() - - .. figure:: ../images/stress/stress_vy_zx.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zx,Vy}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zx_vy) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_vy_zy(self, pause=True): - """Produces a contour plot of the *y*-component of the shear stress :math:`\sigma_{zy,Vy}` - resulting from the shear force :math:`V_{y}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the y-component of the shear stress within a 150x90x12 UA - section resulting from a shear force in the y-direction of 30 kN:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Vy=30e3) - - stress_post.plot_stress_vy_zy() - - .. figure:: ../images/stress/stress_vy_zy.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zy,Vy}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zy_vy) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_vy_zxy(self, pause=True): - """Produces a contour plot of the resultant shear stress :math:`\sigma_{zxy,Vy}` resulting - from the shear force :math:`V_{y}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots a contour of the resultant shear stress within a 150x90x12 UA - section resulting from a shear force in the y-direction of 30 kN:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Vy=30e3) - - stress_post.plot_stress_vy_zxy() - - .. figure:: ../images/stress/stress_vy_zxy.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zxy,Vy}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zxy_vy) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_vector_vy_zxy(self, pause=True): - """Produces a vector plot of the resultant shear stress :math:`\sigma_{zxy,Vy}` resulting - from the shear force :math:`V_{y}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example generates a vector plot of the shear stress within a 150x90x12 UA - section resulting from a shear force in the y-direction of 30 kN:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Vy=30e3) - - stress_post.plot_vector_vy_zxy() - - .. figure:: ../images/stress/vector_vy_zxy.png - :align: center - :scale: 75 % - - Vector plot of the shear stress. - """ - - title = 'Stress Vector Plot - $\sigma_{zxy,Vy}$' - sigxs = [] - sigys = [] - - for group in self.material_groups: - sigxs.append(group.stress_result.sig_zx_vy) - sigys.append(group.stress_result.sig_zy_vy) - - self.plot_stress_vector(sigxs, sigys, title, pause)
- -
[docs] def plot_stress_v_zx(self, pause=True): - """Produces a contour plot of the *x*-component of the shear stress - :math:`\sigma_{zx,\Sigma V}` resulting from the sum of the applied shear forces - :math:`V_{x} + V_{y}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the x-component of the shear stress within a 150x90x12 UA - section resulting from a shear force of 15 kN in the x-direction and 30 kN in the - y-direction:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Vx=15e3, Vy=30e3) - - stress_post.plot_stress_v_zx() - - .. figure:: ../images/stress/stress_v_zx.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zx,\Sigma V}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zx_v) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_v_zy(self, pause=True): - """Produces a contour plot of the *y*-component of the shear stress - :math:`\sigma_{zy,\Sigma V}` resulting from the sum of the applied shear forces - :math:`V_{x} + V_{y}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the y-component of the shear stress within a 150x90x12 UA - section resulting from a shear force of 15 kN in the x-direction and 30 kN in the - y-direction:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Vx=15e3, Vy=30e3) - - stress_post.plot_stress_v_zy() - - .. figure:: ../images/stress/stress_v_zy.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zy,\Sigma V}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zy_v) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_v_zxy(self, pause=True): - """Produces a contour plot of the resultant shear stress - :math:`\sigma_{zxy,\Sigma V}` resulting from the sum of the applied shear forces - :math:`V_{x} + V_{y}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots a contour of the resultant shear stress within a 150x90x12 UA - section resulting from a shear force of 15 kN in the x-direction and 30 kN in the - y-direction:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Vx=15e3, Vy=30e3) - - stress_post.plot_stress_v_zxy() - - .. figure:: ../images/stress/stress_v_zxy.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zxy,\Sigma V}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zxy_v) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_vector_v_zxy(self, pause=True): - """Produces a vector plot of the resultant shear stress - :math:`\sigma_{zxy,\Sigma V}` resulting from the sum of the applied shear forces - :math:`V_{x} + V_{y}`. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example generates a vector plot of the shear stress within a 150x90x12 UA - section resulting from a shear force of 15 kN in the x-direction and 30 kN in the - y-direction:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Vx=15e3, Vy=30e3) - - stress_post.plot_vector_v_zxy() - - .. figure:: ../images/stress/vector_v_zxy.png - :align: center - :scale: 75 % - - Vector plot of the shear stress. - """ - - title = 'Stress Vector Plot - $\sigma_{zxy,\Sigma V}$' - sigxs = [] - sigys = [] - - for group in self.material_groups: - sigxs.append(group.stress_result.sig_zx_v) - sigys.append(group.stress_result.sig_zy_v) - - self.plot_stress_vector(sigxs, sigys, title, pause)
- -
[docs] def plot_stress_zz(self, pause=True): - """Produces a contour plot of the combined normal stress :math:`\sigma_{zz}` resulting from - all actions. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the normal stress within a 150x90x12 UA section resulting from - an axial force of 100 kN, a bending moment about the x-axis of 5 kN.m and a bending moment - about the y-axis of 2 kN.m:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(N=100e3, Mxx=5e6, Myy=2e6) - - stress_post.plot_stress_zz() - - .. figure:: ../images/stress/stress_zz.png - :align: center - :scale: 75 % - - Contour plot of the normal stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zz}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zz) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_zx(self, pause=True): - """Produces a contour plot of the *x*-component of the shear stress :math:`\sigma_{zx}` - resulting from all actions. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the x-component of the shear stress within a 150x90x12 UA - section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the - y-direction:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3) - - stress_post.plot_stress_zx() - - .. figure:: ../images/stress/stress_zx.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zx}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zx) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_zy(self, pause=True): - """Produces a contour plot of the *y*-component of the shear stress :math:`\sigma_{zy}` - resulting from all actions. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots the y-component of the shear stress within a 150x90x12 UA - section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the - y-direction:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3) - - stress_post.plot_stress_zy() - - .. figure:: ../images/stress/stress_zy.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zy}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zy) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_stress_zxy(self, pause=True): - """Produces a contour plot of the resultant shear stress :math:`\sigma_{zxy}` resulting - from all actions. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots a contour of the resultant shear stress within a 150x90x12 UA - section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the - y-direction:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3) - - stress_post.plot_stress_zxy() - - .. figure:: ../images/stress/stress_zxy.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - """ - - title = 'Stress Contour Plot - $\sigma_{zxy}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_zxy) - - self.plot_stress_contour(sigs, title, pause)
- -
[docs] def plot_vector_zxy(self, pause=True): - """Produces a vector plot of the resultant shear stress :math:`\sigma_{zxy}` resulting - from all actions. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example generates a vector plot of the shear stress within a 150x90x12 UA - section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the - y-direction:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3) - - stress_post.plot_vector_zxy() - - .. figure:: ../images/stress/vector_zxy.png - :align: center - :scale: 75 % - - Vector plot of the shear stress. - """ - - title = 'Stress Vector Plot - $\sigma_{zxy}$' - sigxs = [] - sigys = [] - - for group in self.material_groups: - sigxs.append(group.stress_result.sig_zx) - sigys.append(group.stress_result.sig_zy) - - self.plot_stress_vector(sigxs, sigys, title, pause)
- -
[docs] def plot_stress_vm(self, pause=True): - """Produces a contour plot of the von Mises stress :math:`\sigma_{vM}` resulting from all - actions. - - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - - The following example plots a contour of the von Mises stress within a 150x90x12 UA section - resulting from the following actions: - - * :math:`N = 50` kN - * :math:`M_{xx} = -5` kN.m - * :math:`M_{22} = 2.5` kN.m - * :math:`M_{zz} = 1.5` kN.m - * :math:`V_{x} = 10` kN - * :math:`V_{y} = 5` kN - - :: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - - section.calculate_geometric_properties() - section.calculate_warping_properties() - stress_post = section.calculate_stress( - N=50e3, Mxx=-5e6, M22=2.5e6, Mzz=0.5e6, Vx=10e3, Vy=5e3 - ) - - stress_post.plot_stress_vm() - - .. figure:: ../images/stress/stress_vm.png - :align: center - :scale: 75 % - - Contour plot of the von Mises stress. - """ - - title = 'Stress Contour Plot - $\sigma_{vM}$' - sigs = [] - - for group in self.material_groups: - sigs.append(group.stress_result.sig_vm) - - self.plot_stress_contour(sigs, title, pause)
- - -
[docs]class MaterialGroup: - """Class for storing elements of different materials. - - A MaterialGroup object contains the finite element objects for a specified `material`. The - `stress_result` variable provides storage for stresses related each material. - - :param material: Material object for the current MaterialGroup - :type material: :class:`~sectionproperties.pre.pre.Material` - :param int num_nods: Number of nodes for the entire cross-section - - :cvar material: Material object for the current MaterialGroup - :vartype material: :class:`~sectionproperties.pre.pre.Material` - :cvar stress_result: A StressResult object for saving the stresses of the current material - :vartype stress_result: :class:`~sectionproperties.analysis.cross_section.StressResult` - :cvar elements: A list of finite element objects that are of the current material type - :vartype elements: list[:class:`~sectionproperties.analysis.fea.Tri6`] - :cvar el_ids: A list of the element IDs of the elements that are of the current material type - :vartype el_ids: list[int] - """ - - def __init__(self, material, num_nodes): - """Inits the MaterialGroup class.""" - - self.material = material - self.stress_result = StressResult(num_nodes) - self.elements = [] - self.el_ids = [] - -
[docs] def add_element(self, element): - """Adds an element and its element ID to the MaterialGroup. - - :param element: Element to add to the MaterialGroup - :type element: :class:`~sectionproperties.analysis.fea.Tri6` - """ - - # add Tri6 element to the list of elements - self.elements.append(element) - self.el_ids.append(element.el_id)
- - -
[docs]class StressResult: - """Class for storing a stress result. - - Provides variables to store the results from a cross-section stress analysis. Also provides a - method to calculate combined stresses. - - :param int num_nodes: Number of nodes in the finite element mesh - - :cvar sig_zz_n: Normal stress (:math:`\sigma_{zz,N}`) resulting from an axial force - :vartype sig_zz_n: :class:`numpy.ndarray` - :cvar sig_zz_mxx: Normal stress (:math:`\sigma_{zz,Mxx}`) resulting from a bending moment about - the xx-axis - :vartype sig_zz_mxx: :class:`numpy.ndarray` - :cvar sig_zz_myy: Normal stress (:math:`\sigma_{zz,Myy}`) resulting from a bending moment about - the yy-axis - :vartype sig_zz_myy: :class:`numpy.ndarray` - :cvar sig_zz_m11: Normal stress (:math:`\sigma_{zz,M11}`) resulting from a bending moment about - the 11-axis - :vartype sig_zz_m11: :class:`numpy.ndarray` - :cvar sig_zz_m22: Normal stress (:math:`\sigma_{zz,M22}`) resulting from a bending moment about - the 22-axis - :vartype sig_zz_m22: :class:`numpy.ndarray` - :cvar sig_zx_mzz: Shear stress (:math:`\sigma_{zx,Mzz}`) resulting from a torsion moment about - the zz-axis - :vartype sig_zx_mzz: :class:`numpy.ndarray` - :cvar sig_zy_mzz: Shear stress (:math:`\sigma_{zy,Mzz}`) resulting from a torsion moment about - the zz-axis - :vartype sig_zy_mzz: :class:`numpy.ndarray` - :cvar sig_zx_vx: Shear stress (:math:`\sigma_{zx,Vx}`) resulting from a shear force in the - x-direction - :vartype sig_zx_vx: :class:`numpy.ndarray` - :cvar sig_zy_vx: Shear stress (:math:`\sigma_{zy,Vx}`) resulting from a shear force in the - x-direction - :vartype sig_zy_vx: :class:`numpy.ndarray` - :cvar sig_zx_vy: Shear stress (:math:`\sigma_{zx,Vy}`) resulting from a shear force in the - y-direction - :vartype sig_zx_vy: :class:`numpy.ndarray` - :cvar sig_zy_vy: Shear stress (:math:`\sigma_{zy,Vy}`) resulting from a shear force in the - y-direction - :vartype sig_zy_vy: :class:`numpy.ndarray` - :cvar sig_zz_m: Normal stress (:math:`\sigma_{zz,\Sigma M}`) resulting from all bending moments - :vartype sig_zz_m: :class:`numpy.ndarray` - :cvar sig_zxy_mzz: Resultant shear stress (:math:`\sigma_{zxy,Mzz}`) resulting from a torsion - moment in the zz-direction - :vartype sig_zxy_mzz: :class:`numpy.ndarray` - :cvar sig_zxy_vx: Resultant shear stress (:math:`\sigma_{zxy,Vx}`) resulting from a a shear - force in the x-direction - :vartype sig_zxy_vx: :class:`numpy.ndarray` - :cvar sig_zxy_vy: Resultant shear stress (:math:`\sigma_{zxy,Vy}`) resulting from a a shear - force in the y-direction - :vartype sig_zxy_vy: :class:`numpy.ndarray` - :cvar sig_zx_v: Shear stress (:math:`\sigma_{zx,\Sigma V}`) resulting from all shear forces - :vartype sig_zx_v: :class:`numpy.ndarray` - :cvar sig_zy_v: Shear stress (:math:`\sigma_{zy,\Sigma V}`) resulting from all shear forces - :vartype sig_zy_v: :class:`numpy.ndarray` - :cvar sig_zxy_v: Resultant shear stress (:math:`\sigma_{zxy,\Sigma V}`) resulting from all - shear forces - :vartype sig_zxy_v: :class:`numpy.ndarray` - :cvar sig_zz: Combined normal force (:math:`\sigma_{zz}`) resulting from all actions - :vartype sig_zz: :class:`numpy.ndarray` - :cvar sig_zx: Combined shear stress (:math:`\sigma_{zx}`) resulting from all actions - :vartype sig_zx: :class:`numpy.ndarray` - :cvar sig_zy: Combined shear stress (:math:`\sigma_{zy}`) resulting from all actions - :vartype sig_zy: :class:`numpy.ndarray` - :cvar sig_zxy: Combined resultant shear stress (:math:`\sigma_{zxy}`) resulting from all - actions - :vartype sig_zxy: :class:`numpy.ndarray` - :cvar sig_vm: von Mises stress (:math:`\sigma_{VM}`) resulting from all actions - :vartype sig_vm: :class:`numpy.ndarray` - """ - - def __init__(self, num_nodes): - """Inits the StressResult class.""" - - # allocate stresses arising directly from actions - self.sig_zz_n = np.zeros(num_nodes) - self.sig_zz_mxx = np.zeros(num_nodes) - self.sig_zz_myy = np.zeros(num_nodes) - self.sig_zz_m11 = np.zeros(num_nodes) - self.sig_zz_m22 = np.zeros(num_nodes) - self.sig_zx_mzz = np.zeros(num_nodes) - self.sig_zy_mzz = np.zeros(num_nodes) - self.sig_zx_vx = np.zeros(num_nodes) - self.sig_zy_vx = np.zeros(num_nodes) - self.sig_zx_vy = np.zeros(num_nodes) - self.sig_zy_vy = np.zeros(num_nodes) - - # allocate combined stresses - self.sig_zz_m = np.zeros(num_nodes) - self.sig_zxy_mzz = np.zeros(num_nodes) - self.sig_zxy_vx = np.zeros(num_nodes) - self.sig_zxy_vy = np.zeros(num_nodes) - self.sig_zx_v = np.zeros(num_nodes) - self.sig_zy_v = np.zeros(num_nodes) - self.sig_zxy_v = np.zeros(num_nodes) - self.sig_zz = np.zeros(num_nodes) - self.sig_zx = np.zeros(num_nodes) - self.sig_zy = np.zeros(num_nodes) - self.sig_zxy = np.zeros(num_nodes) - self.sig_vm = np.zeros(num_nodes) - -
[docs] def calculate_combined_stresses(self): - """Calculates the combined cross-section stresses.""" - - self.sig_zz_m = self.sig_zz_mxx + self.sig_zz_myy + self.sig_zz_m11 + self.sig_zz_m22 - self.sig_zxy_mzz = (self.sig_zx_mzz ** 2 + self.sig_zy_mzz ** 2) ** 0.5 - self.sig_zxy_vx = (self.sig_zx_vx ** 2 + self.sig_zy_vx ** 2) ** 0.5 - self.sig_zxy_vy = (self.sig_zx_vy ** 2 + self.sig_zy_vy ** 2) ** 0.5 - self.sig_zx_v = self.sig_zx_vx + self.sig_zx_vy - self.sig_zy_v = self.sig_zy_vx + self.sig_zy_vy - self.sig_zxy_v = (self.sig_zx_v ** 2 + self.sig_zy_v ** 2) ** 0.5 - self.sig_zz = self.sig_zz_n + self.sig_zz_m - self.sig_zx = self.sig_zx_mzz + self.sig_zx_v - self.sig_zy = self.sig_zy_mzz + self.sig_zy_v - self.sig_zxy = (self.sig_zx ** 2 + self.sig_zy ** 2) ** 0.5 - self.sig_vm = (self.sig_zz ** 2 + 3 * self.sig_zxy ** 2) ** 0.5
- - -
[docs]class SectionProperties: - """Class for storing section properties. - - Stores calculated section properties. Also provides methods to calculate section properties - entirely derived from other section properties. - - :cvar float area: Cross-sectional area - :cvar float perimeter: Cross-sectional perimeter - :cvar float ea: Modulus weighted area (axial rigidity) - :cvar float ga: Modulus weighted product of shear modulus and area - :cvar float nu_eff: Effective Poisson's ratio - :cvar float qx: First moment of area about the x-axis - :cvar float qy: First moment of area about the y-axis - :cvar float ixx_g: Second moment of area about the global x-axis - :cvar float iyy_g: Second moment of area about the global y-axis - :cvar float ixy_g: Second moment of area about the global xy-axis - :cvar float cx: X coordinate of the elastic centroid - :cvar float cy: Y coordinate of the elastic centroid - :cvar float ixx_c: Second moment of area about the centroidal x-axis - :cvar float iyy_c: Second moment of area about the centroidal y-axis - :cvar float ixy_c: Second moment of area about the centroidal xy-axis - :cvar float zxx_plus: Section modulus about the centroidal x-axis for stresses at the positive - extreme value of y - :cvar float zxx_minus: Section modulus about the centroidal x-axis for stresses at the negative - extreme value of y - :cvar float zyy_plus: Section modulus about the centroidal y-axis for stresses at the positive - extreme value of x - :cvar float zyy_minus: Section modulus about the centroidal y-axis for stresses at the negative - extreme value of x - :cvar float rx_c: Radius of gyration about the centroidal x-axis. - :cvar float ry_c: Radius of gyration about the centroidal y-axis. - :cvar float i11_c: Second moment of area about the centroidal 11-axis - :cvar float i22_c: Second moment of area about the centroidal 22-axis - :cvar float phi: Principal axis angle - :cvar float z11_plus: Section modulus about the principal 11-axis for stresses at the positive - extreme value of the 22-axis - :cvar float z11_minus: Section modulus about the principal 11-axis for stresses at the negative - extreme value of the 22-axis - :cvar float z22_plus: Section modulus about the principal 22-axis for stresses at the positive - extreme value of the 11-axis - :cvar float z22_minus: Section modulus about the principal 22-axis for stresses at the negative - extreme value of the 11-axis - :cvar float r11_c: Radius of gyration about the principal 11-axis. - :cvar float r22_c: Radius of gyration about the principal 22-axis. - :cvar float j: Torsion constant - :cvar omega: Warping function - :vartype omega: :class:`numpy.ndarray` - :cvar psi_shear: Psi shear function - :vartype psi_shear: :class:`numpy.ndarray` - :cvar phi_shear: Phi shear function - :vartype phi_shear: :class:`numpy.ndarray` - :cvar float Delta_s: Shear factor - :cvar float x_se: X coordinate of the shear centre (elasticity approach) - :cvar float y_se: Y coordinate of the shear centre (elasticity approach) - :cvar float x11_se: 11 coordinate of the shear centre (elasticity approach) - :cvar float y22_se: 22 coordinate of the shear centre (elasticity approach) - :cvar float x_st: X coordinate of the shear centre (Trefftz's approach) - :cvar float y_st: Y coordinate of the shear centre (Trefftz's approach) - :cvar float gamma: Warping constant - :cvar float A_sx: Shear area about the x-axis - :cvar float A_sy: Shear area about the y-axis - :cvar float A_sxy: Shear area about the xy-axis - :cvar float A_s11: Shear area about the 11 bending axis - :cvar float A_s22: Shear area about the 22 bending axis - :cvar float beta_x_plus: Monosymmetry constant for bending about the x-axis with the top flange - in compression - :cvar float beta_x_minus: Monosymmetry constant for bending about the x-axis with the bottom - flange in compression - :cvar float beta_y_plus: Monosymmetry constant for bending about the y-axis with the top flange - in compression - :cvar float beta_y_minus: Monosymmetry constant for bending about the y-axis with the bottom - flange in compression - :cvar float beta_11_plus: Monosymmetry constant for bending about the 11-axis with the top - flange in compression - :cvar float beta_11_minus: Monosymmetry constant for bending about the 11-axis with the bottom - flange in compression - :cvar float beta_22_plus: Monosymmetry constant for bending about the 22-axis with the top - flange in compression - :cvar float beta_22_minus: Monosymmetry constant for bending about the 22-axis with the bottom - flange in compression - :cvar float x_pc: X coordinate of the global plastic centroid - :cvar float y_pc: Y coordinate of the global plastic centroid - :cvar float x11_pc: 11 coordinate of the principal plastic centroid - :cvar float y22_pc: 22 coordinate of the principal plastic centroid - :cvar float sxx: Plastic section modulus about the centroidal x-axis - :cvar float syy: Plastic section modulus about the centroidal y-axis - :cvar float sf_xx_plus: Shape factor for bending about the x-axis with respect to the top fibre - :cvar float sf_xx_minus: Shape factor for bending about the x-axis with respect to the bottom - fibre - :cvar float sf_yy_plus: Shape factor for bending about the y-axis with respect to the top fibre - :cvar float sf_yy_minus: Shape factor for bending about the y-axis with respect to the bottom - fibre - :cvar float s11: Plastic section modulus about the 11-axis - :cvar float s22: Plastic section modulus about the 22-axis - :cvar float sf_11_plus: Shape factor for bending about the 11-axis with respect to the top - fibre - :cvar float sf_11_minus: Shape factor for bending about the 11-axis with respect to the bottom - fibre - :cvar float sf_22_plus: Shape factor for bending about the 22-axis with respect to the top - fibre - :cvar float sf_22_minus: Shape factor for bending about the 22-axis with respect to the bottom - fibre - """ - - def __init__(self): - """Inits the SectionProperties class.""" - - self.area = None - self.perimeter = None - self.ea = None - self.ga = None - self.nu_eff = None - self.qx = None - self.qy = None - self.ixx_g = None - self.iyy_g = None - self.ixy_g = None - self.cx = None - self.cy = None - self.ixx_c = None - self.iyy_c = None - self.ixy_c = None - self.zxx_plus = None - self.zxx_minus = None - self.zyy_plus = None - self.zyy_minus = None - self.rx_c = None - self.ry_c = None - self.i11_c = None - self.i22_c = None - self.phi = None - self.z11_plus = None - self.z11_minus = None - self.z22_plus = None - self.z22_minus = None - self.r11_c = None - self.r22_c = None - self.j = None - self.omega = None - self.psi_shear = None - self.phi_shear = None - self.Delta_s = None - self.x_se = None - self.y_se = None - self.x11_se = None - self.y22_se = None - self.x_st = None - self.y_st = None - self.gamma = None - self.A_sx = None - self.A_sy = None - self.A_sxy = None - self.A_s11 = None - self.A_s22 = None - self.beta_x_plus = None - self.beta_x_minus = None - self.beta_y_plus = None - self.beta_y_minus = None - self.beta_11_plus = None - self.beta_11_minus = None - self.beta_22_plus = None - self.beta_22_minus = None - self.x_pc = None - self.y_pc = None - self.x11_pc = None - self.y22_pc = None - self.sxx = None - self.syy = None - self.sf_xx_plus = None - self.sf_xx_minus = None - self.sf_yy_plus = None - self.sf_yy_minus = None - self.s11 = None - self.s22 = None - self.sf_11_plus = None - self.sf_11_minus = None - self.sf_22_plus = None - self.sf_22_minus = None - -
[docs] def calculate_elastic_centroid(self): - """Calculates the elastic centroid based on the cross-section area and first moments of - area. - """ - - self.cx = self.qy / self.ea - self.cy = self.qx / self.ea
- -
[docs] def calculate_centroidal_properties(self, mesh): - """Calculates the geometric section properties about the centroidal and principal axes - based on the results about the global axis. - """ - - # calculate second moments of area about the centroidal xy axis - self.ixx_c = self.ixx_g - self.qx ** 2 / self.ea - self.iyy_c = self.iyy_g - self.qy ** 2 / self.ea - self.ixy_c = self.ixy_g - self.qx * self.qy / self.ea - - # calculate section moduli about the centroidal xy axis - nodes = np.array(mesh.points) - xmax = nodes[:, 0].max() - xmin = nodes[:, 0].min() - ymax = nodes[:, 1].max() - ymin = nodes[:, 1].min() - self.zxx_plus = self.ixx_c / abs(ymax - self.cy) - self.zxx_minus = self.ixx_c / abs(ymin - self.cy) - self.zyy_plus = self.iyy_c / abs(xmax - self.cx) - self.zyy_minus = self.iyy_c / abs(xmin - self.cx) - - # calculate radii of gyration about centroidal xy axis - self.rx_c = (self.ixx_c / self.ea) ** 0.5 - self.ry_c = (self.iyy_c / self.ea) ** 0.5 - - # calculate prinicpal 2nd moments of area about the centroidal xy axis - Delta = (((self.ixx_c - self.iyy_c) / 2) ** 2 + self.ixy_c ** 2) ** 0.5 - self.i11_c = (self.ixx_c + self.iyy_c) / 2 + Delta - self.i22_c = (self.ixx_c + self.iyy_c) / 2 - Delta - - # calculate initial principal axis angle - if abs(self.ixx_c - self.i11_c) < 1e-12 * self.i11_c: - self.phi = 0 - else: - self.phi = np.arctan2( - self.ixx_c - self.i11_c, self.ixy_c) * 180 / np.pi - - # calculate section moduli about the principal axis - for (i, pt) in enumerate(nodes): - x = pt[0] - self.cx - y = pt[1] - self.cy - # determine the coordinate of the point wrt the principal axis - (x1, y2) = fea.principal_coordinate(self.phi, x, y) - - # initialise min, max variables - if i == 0: - x1max = x1 - x1min = x1 - y2max = y2 - y2min = y2 - - # update the mins and maxs where necessary - x1max = max(x1max, x1) - x1min = min(x1min, x1) - y2max = max(y2max, y2) - y2min = min(y2min, y2) - - # evaluate principal section moduli - self.z11_plus = self.i11_c / abs(y2max) - self.z11_minus = self.i11_c / abs(y2min) - self.z22_plus = self.i22_c / abs(x1max) - self.z22_minus = self.i22_c / abs(x1min) - - # calculate radii of gyration about centroidal principal axis - self.r11_c = (self.i11_c / self.ea) ** 0.5 - self.r22_c = (self.i22_c / self.ea) ** 0.5
-
- -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/_modules/sectionproperties/analysis/fea.html b/docs/build/html/_modules/sectionproperties/analysis/fea.html deleted file mode 100644 index 10a98c11..00000000 --- a/docs/build/html/_modules/sectionproperties/analysis/fea.html +++ /dev/null @@ -1,905 +0,0 @@ - - - - - - - - - - - sectionproperties.analysis.fea — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- -
    - -
  • Docs »
  • - -
  • Module code »
  • - -
  • sectionproperties.analysis.fea
  • - - -
  • - -
  • - -
- - -
-
-
-
- -

Source code for sectionproperties.analysis.fea

-import numpy as np
-
-
-
[docs]class Tri6: - """Class for a six noded quadratic triangular element. - - Provides methods for the calculation of section properties based on the finite element method. - - :param int el_id: Unique element id - :param coords: A 2 x 6 array of the coordinates of the tri-6 nodes. The first three columns - relate to the vertices of the triangle and the last three columns correspond to the - mid-nodes. - :type coords: :class:`numpy.ndarray` - :param node_ids: A list of the global node ids for the current element - :type node_ids: list[int] - :param material: Material object for the current finite element. - :type material: :class:`~sectionproperties.pre.pre.Material` - - :cvar int el_id: Unique element id - :cvar coords: A 2 x 6 array of the coordinates of the tri-6 nodes. The first three columns - relate to the vertices of the triangle and the last three columns correspond to the - mid-nodes. - :vartype coords: :class:`numpy.ndarray` - :cvar node_ids: A list of the global node ids for the current element - :vartype node_ids: list[int] - :cvar material: Material of the current finite element. - :vartype material: :class:`~sectionproperties.pre.pre.Material` - """ - - def __init__(self, el_id, coords, node_ids, material): - """Inits the Tri6 class.""" - - self.el_id = el_id - self.coords = coords - self.node_ids = node_ids - self.material = material - -
[docs] def geometric_properties(self): - """Calculates the geometric properties for the current finite element. - - :return: Tuple containing the geometric properties and the elastic and shear moduli of the - element: *(area, qx, qy, ixx, iyy, ixy, e, g)* - :rtype: tuple(float) - """ - - # initialise geometric properties - area = 0 - qx = 0 - qy = 0 - ixx = 0 - iyy = 0 - ixy = 0 - - # Gauss points for 6 point Gaussian integration - gps = gauss_points(6) - - # loop through each Gauss point - for gp in gps: - # determine shape function, shape function derivative and jacobian - (N, _, j) = shape_function(self.coords, gp) - - area += gp[0] * j - qx += gp[0] * np.dot(N, np.transpose(self.coords[1, :])) * j - qy += gp[0] * np.dot(N, np.transpose(self.coords[0, :])) * j - ixx += gp[0] * np.dot(N, np.transpose(self.coords[1, :])) ** 2 * j - iyy += gp[0] * np.dot(N, np.transpose(self.coords[0, :])) ** 2 * j - ixy += ( - gp[0] * np.dot(N, np.transpose(self.coords[1, :])) * np.dot( - N, np.transpose(self.coords[0, :])) * j - ) - - return ( - area, qx, qy, ixx, iyy, ixy, self.material.elastic_modulus, self.material.shear_modulus - )
- -
[docs] def torsion_properties(self): - """Calculates the element stiffness matrix used for warping analysis and the torsion load - vector. - - :return: Element stiffness matrix *(k_el)* and element torsion load vector *(f_el)* - :rtype: tuple(:class:`numpy.ndarray`, :class:`numpy.ndarray`) - """ - - # initialise stiffness matrix and load vector - k_el = 0 - f_el = 0 - - # Gauss points for 6 point Gaussian integration - gps = gauss_points(6) - - for gp in gps: - # determine shape function, shape function derivative and jacobian - (N, B, j) = shape_function(self.coords, gp) - - # determine x and y position at Gauss point - Nx = np.dot(N, np.transpose(self.coords[0, :])) - Ny = np.dot(N, np.transpose(self.coords[1, :])) - - # calculated modulus weighted stiffness matrix and load vector - k_el += gp[0] * np.dot(np.transpose(B), B) * j * (self.material.elastic_modulus) - f_el += ( - gp[0] * np.dot(np.transpose(B), np.transpose(np.array([Ny, -Nx]))) * - j * self.material.elastic_modulus - ) - - return (k_el, f_el)
- -
[docs] def shear_load_vectors(self, ixx, iyy, ixy, nu): - """Calculates the element shear load vectors used to evaluate the shear functions. - - :param float ixx: Second moment of area about the centroidal x-axis - :param float iyy: Second moment of area about the centroidal y-axis - :param float ixy: Second moment of area about the centroidal xy-axis - :param float nu: Effective Poisson's ratio for the cross-section - - :return: Element shear load vector psi *(f_psi)* and phi *(f_phi)* - :rtype: tuple(:class:`numpy.ndarray`, :class:`numpy.ndarray`) - """ - - # initialise force vectors - f_psi = 0 - f_phi = 0 - - # Gauss points for 6 point Gaussian integration - gps = gauss_points(6) - - for gp in gps: - # determine shape function, shape function derivative and jacobian - (N, B, j) = shape_function(self.coords, gp) - - # determine x and y position at Gauss point - Nx = np.dot(N, np.transpose(self.coords[0, :])) - Ny = np.dot(N, np.transpose(self.coords[1, :])) - - # determine shear parameters - r = Nx ** 2 - Ny ** 2 - q = 2 * Nx * Ny - d1 = ixx * r - ixy * q - d2 = ixy * r + ixx * q - h1 = -ixy * r + iyy * q - h2 = -iyy * r - ixy * q - - f_psi += ( - gp[0] * (nu / 2 * np.transpose(np.transpose(B).dot(np.array([[d1], [d2]])))[0] + - 2 * (1 + nu) * np.transpose(N) * (ixx * Nx - ixy * Ny)) * j * - self.material.elastic_modulus - ) - f_phi += ( - gp[0] * (nu / 2 * np.transpose(np.transpose(B).dot(np.array([[h1], [h2]])))[0] + - 2 * (1 + nu) * np.transpose(N) * (iyy * Ny - ixy * Nx)) * j * - self.material.elastic_modulus - ) - - return (f_psi, f_phi)
- -
[docs] def shear_warping_integrals(self, ixx, iyy, ixy, omega): - """Calculates the element shear centre and warping integrals required for shear analysis of - the cross-section. - - :param float ixx: Second moment of area about the centroidal x-axis - :param float iyy: Second moment of area about the centroidal y-axis - :param float ixy: Second moment of area about the centroidal xy-axis - :param omega: Values of the warping function at the element nodes - :type omega: :class:`numpy.ndarray` - - :return: Shear centre integrals about the x and y-axes *(sc_xint, sc_yint)*, warping - integrals *(q_omega, i_omega, i_xomega, i_yomega)* - :rtype: tuple(float, float, float, float, float, float) - """ - - # initialise integrals - sc_xint = 0 - sc_yint = 0 - q_omega = 0 - i_omega = 0 - i_xomega = 0 - i_yomega = 0 - - # Gauss points for 6 point Gaussian integration - gps = gauss_points(6) - - for gp in gps: - # determine shape function, shape function derivative and jacobian - (N, B, j) = shape_function(self.coords, gp) - - # determine x and y position at Gauss point - Nx = np.dot(N, np.transpose(self.coords[0, :])) - Ny = np.dot(N, np.transpose(self.coords[1, :])) - Nomega = np.dot(N, np.transpose(omega)) - - sc_xint += ( - gp[0] * (iyy * Nx + ixy * Ny) * (Nx ** 2 + Ny ** 2) * - j * self.material.elastic_modulus - ) - sc_yint += ( - gp[0] * (ixx * Ny + ixy * Nx) * (Nx ** 2 + Ny ** 2) * - j * self.material.elastic_modulus - ) - q_omega += gp[0] * Nomega * j * self.material.elastic_modulus - i_omega += gp[0] * Nomega ** 2 * j * self.material.elastic_modulus - i_xomega += gp[0] * Nx * Nomega * j * self.material.elastic_modulus - i_yomega += gp[0] * Ny * Nomega * j * self.material.elastic_modulus - - return (sc_xint, sc_yint, q_omega, i_omega, i_xomega, i_yomega)
- -
[docs] def shear_coefficients(self, ixx, iyy, ixy, psi_shear, phi_shear, nu): - """Calculates the variables used to determine the shear deformation coefficients. - - :param float ixx: Second moment of area about the centroidal x-axis - :param float iyy: Second moment of area about the centroidal y-axis - :param float ixy: Second moment of area about the centroidal xy-axis - :param psi_shear: Values of the psi shear function at the element nodes - :type psi_shear: :class:`numpy.ndarray` - :param phi_shear: Values of the phi shear function at the element nodes - :type phi_shear: :class:`numpy.ndarray` - :param float nu: Effective Poisson's ratio for the cross-section - - :return: Shear deformation variables *(kappa_x, kappa_y, kappa_xy)* - :rtype: tuple(float, float, float) - """ - - # initialise properties - kappa_x = 0 - kappa_y = 0 - kappa_xy = 0 - - # Gauss points for 6 point Gaussian integration - gps = gauss_points(6) - - for gp in gps: - # determine shape function, shape function derivative and jacobian - (N, B, j) = shape_function(self.coords, gp) - - # determine x and y position at Gauss point - Nx = np.dot(N, np.transpose(self.coords[0, :])) - Ny = np.dot(N, np.transpose(self.coords[1, :])) - - # determine shear parameters - r = Nx ** 2 - Ny ** 2 - q = 2 * Nx * Ny - d1 = ixx * r - ixy * q - d2 = ixy * r + ixx * q - h1 = -ixy * r + iyy * q - h2 = -iyy * r - ixy * q - - kappa_x += ( - gp[0] * (psi_shear.dot(np.transpose(B)) - nu / 2 * np.array([d1, d2])).dot( - B.dot(psi_shear) - nu / 2 * np.array([d1, d2])) * j * - self.material.elastic_modulus - ) - kappa_y += ( - gp[0] * (phi_shear.dot(np.transpose(B)) - nu / 2 * np.array([h1, h2])).dot( - B.dot(phi_shear) - nu / 2 * np.array([h1, h2])) * j * - self.material.elastic_modulus - ) - kappa_xy += ( - gp[0] * (psi_shear.dot(np.transpose(B)) - nu / 2 * np.array([d1, d2])).dot( - B.dot(phi_shear) - nu / 2 * np.array([h1, h2])) * j * - self.material.elastic_modulus - ) - - return (kappa_x, kappa_y, kappa_xy)
- -
[docs] def monosymmetry_integrals(self, phi): - """Calculates the integrals used to evaluate the monosymmetry constant about both global - axes and both prinicipal axes. - - :param float phi: Principal bending axis angle - - :return: Integrals used to evaluate the monosymmetry constants *(int_x, int_y, int_11, - int_22)* - :rtype: tuple(float, float, float, float) - """ - - # initialise properties - int_x = 0 - int_y = 0 - int_11 = 0 - int_22 = 0 - - # Gauss points for 6 point Gaussian integration - gps = gauss_points(6) - - for gp in gps: - # determine shape function and jacobian - (N, _, j) = shape_function(self.coords, gp) - - # determine x and y position at Gauss point - Nx = np.dot(N, np.transpose(self.coords[0, :])) - Ny = np.dot(N, np.transpose(self.coords[1, :])) - - # determine 11 and 22 position at Gauss point - (Nx_11, Ny_22) = principal_coordinate(phi, Nx, Ny) - - # weight the monosymmetry integrals by the section elastic modulus - int_x += gp[0] * (Nx * Nx * Ny + Ny * Ny * Ny) * j * self.material.elastic_modulus - int_y += gp[0] * (Ny * Ny * Nx + Nx * Nx * Nx) * j * self.material.elastic_modulus - int_11 += ( - gp[0] * (Nx_11 * Nx_11 * Ny_22 + Ny_22 * Ny_22 * Ny_22) * j * - self.material.elastic_modulus - ) - int_22 += ( - gp[0] * (Ny_22 * Ny_22 * Nx_11 + Nx_11 * Nx_11 * Nx_11) * j * - self.material.elastic_modulus - ) - - return (int_x, int_y, int_11, int_22)
- -
[docs] def plastic_properties(self, u, p): - """Calculates total force resisted by the element when subjected to a stress equal to the - yield strength. Also returns the modulus weighted area and first moments of area, and - determines whether or not the element is above or below the line defined by the unit - vector *u* and point *p*. - - :param u: Unit vector in the direction of the line - :type u: :class:`numpy.ndarray` - :param p: Point on the line - :type p: :class:`numpy.ndarray` - - :return: Element force *(force)*, modulus weighted area properties *(ea, e.qx, e.qy)* and - whether or not the element is above the line - :rtype: tuple(float, float, float, float, bool) - """ - - # initialise geometric properties - e = self.material.elastic_modulus - area = 0 - qx = 0 - qy = 0 - force = 0 - - # Gauss points for 3 point Gaussian integration - gps = gauss_points(3) - - # loop through each Gauss point - for gp in gps: - # determine shape function, shape function derivative and jacobian - (N, _, j) = shape_function(self.coords, gp) - - area += gp[0] * j - qx += gp[0] * np.dot(N, np.transpose(self.coords[1, :])) * j - qy += gp[0] * np.dot(N, np.transpose(self.coords[0, :])) * j - force += gp[0] * j * self.material.yield_strength - - # calculate element centroid - (cx, cy) = (qy / area, qx / area) - - # determine if the element is above the line p + u - is_above = point_above_line(u, p[0], p[1], cx, cy) - - return (force, area * e, qx * e, qy * e, is_above)
- -
[docs] def element_stress(self, N, Mxx, Myy, M11, M22, Mzz, Vx, Vy, ea, cx, cy, ixx, iyy, ixy, i11, - i22, phi, j, nu, omega, psi_shear, phi_shear, Delta_s): - """Calculates the stress within an element resulting from a specified loading. Also returns - the shape function weights. - - :param float N: Axial force - :param float Mxx: Bending moment about the centroidal xx-axis - :param float Myy: Bending moment about the centroidal yy-axis - :param float M11: Bending moment about the centroidal 11-axis - :param float M22: Bending moment about the centroidal 22-axis - :param float Mzz: Torsion moment about the centroidal zz-axis - :param float Vx: Shear force acting in the x-direction - :param float Vy: Shear force acting in the y-direction - :param float ea: Modulus weighted area - :param float cx: x position of the elastic centroid - :param float cy: y position of the elastic centroid - :param float ixx: Second moment of area about the centroidal x-axis - :param float iyy: Second moment of area about the centroidal y-axis - :param float ixy: Second moment of area about the centroidal xy-axis - :param float i11: Second moment of area about the principal 11-axis - :param float i22: Second moment of area about the principal 22-axis - :param float phi: Principal bending axis angle - :param float j: St. Venant torsion constant - :param float nu: Effective Poisson's ratio for the cross-section - :param omega: Values of the warping function at the element nodes - :type omega: :class:`numpy.ndarray` - :param psi_shear: Values of the psi shear function at the element nodes - :type psi_shear: :class:`numpy.ndarray` - :param phi_shear: Values of the phi shear function at the element nodes - :type phi_shear: :class:`numpy.ndarray` - :param float Delta_s: Cross-section shear factor - :return: Tuple containing element stresses and integration weights - (:math:`\sigma_{zz,n}`, :math:`\sigma_{zz,mxx}`, - :math:`\sigma_{zz,myy}`, :math:`\sigma_{zz,m11}`, - :math:`\sigma_{zz,m22}`, :math:`\sigma_{zx,mzz}`, - :math:`\sigma_{zy,mzz}`, :math:`\sigma_{zx,vx}`, - :math:`\sigma_{zy,vx}`, :math:`\sigma_{zx,vy}`, - :math:`\sigma_{zy,vy}`, :math:`w_i`) - :rtype: tuple(:class:`numpy.ndarray`, :class:`numpy.ndarray`, ...) - """ - - # calculate axial stress - sig_zz_n = N * np.ones(6) * self.material.elastic_modulus / ea - - # initialise stresses at the gauss points - sig_zz_mxx_gp = np.zeros((6, 1)) - sig_zz_myy_gp = np.zeros((6, 1)) - sig_zz_m11_gp = np.zeros((6, 1)) - sig_zz_m22_gp = np.zeros((6, 1)) - sig_zxy_mzz_gp = np.zeros((6, 2)) - sig_zxy_vx_gp = np.zeros((6, 2)) - sig_zxy_vy_gp = np.zeros((6, 2)) - - # Gauss points for 6 point Gaussian integration - gps = gauss_points(6) - - for (i, gp) in enumerate(gps): - # determine x and y positions with respect to the centroidal axis - coords_c = np.zeros((2, 6)) - coords_c[0, :] = self.coords[0, :] - cx - coords_c[1, :] = self.coords[1, :] - cy - - # determine shape function, shape function derivative and jacobian - (N, B, _) = shape_function(coords_c, gp) - - # determine x and y position at Gauss point - Nx = np.dot(N, np.transpose(coords_c[0, :])) - Ny = np.dot(N, np.transpose(coords_c[1, :])) - - # determine 11 and 22 position at Gauss point - (Nx_11, Ny_22) = principal_coordinate(phi, Nx, Ny) - - # determine shear parameters - r = Nx ** 2 - Ny ** 2 - q = 2 * Nx * Ny - d1 = ixx * r - ixy * q - d2 = ixy * r + ixx * q - h1 = -ixy * r + iyy * q - h2 = -iyy * r - ixy * q - - # calculate element stresses - sig_zz_mxx_gp[i, :] = ( - self.material.elastic_modulus * (-(ixy * Mxx) / (ixx * iyy - ixy ** 2) * Nx + ( - iyy * Mxx) / (ixx * iyy - ixy ** 2) * Ny) - ) - sig_zz_myy_gp[i, :] = ( - self.material.elastic_modulus * (-(ixx * Myy) / (ixx * iyy - ixy ** 2) * Nx + ( - ixy * Myy) / (ixx * iyy - ixy ** 2) * Ny) - ) - sig_zz_m11_gp[i, :] = self.material.elastic_modulus * M11 / i11 * Ny_22 - sig_zz_m22_gp[i, :] = self.material.elastic_modulus * -M22 / i22 * Nx_11 - - if Mzz != 0: - sig_zxy_mzz_gp[i, :] = ( - self.material.elastic_modulus * Mzz / j * (B.dot(omega) - np.array([Ny, -Nx])) - ) - - if Vx != 0: - sig_zxy_vx_gp[i, :] = ( - self.material.elastic_modulus * Vx / Delta_s * ( - B.dot(psi_shear) - nu / 2 * np.array([d1, d2])) - ) - - if Vy != 0: - sig_zxy_vy_gp[i, :] = ( - self.material.elastic_modulus * Vy / Delta_s * ( - B.dot(phi_shear) - nu / 2 * np.array([h1, h2])) - ) - - # extrapolate results to nodes - sig_zz_mxx = extrapolate_to_nodes(sig_zz_mxx_gp[:, 0]) - sig_zz_myy = extrapolate_to_nodes(sig_zz_myy_gp[:, 0]) - sig_zz_m11 = extrapolate_to_nodes(sig_zz_m11_gp[:, 0]) - sig_zz_m22 = extrapolate_to_nodes(sig_zz_m22_gp[:, 0]) - sig_zx_mzz = extrapolate_to_nodes(sig_zxy_mzz_gp[:, 0]) - sig_zy_mzz = extrapolate_to_nodes(sig_zxy_mzz_gp[:, 1]) - sig_zx_vx = extrapolate_to_nodes(sig_zxy_vx_gp[:, 0]) - sig_zy_vx = extrapolate_to_nodes(sig_zxy_vx_gp[:, 1]) - sig_zx_vy = extrapolate_to_nodes(sig_zxy_vy_gp[:, 0]) - sig_zy_vy = extrapolate_to_nodes(sig_zxy_vy_gp[:, 1]) - - return (sig_zz_n, sig_zz_mxx, sig_zz_myy, sig_zz_m11, sig_zz_m22, sig_zx_mzz, sig_zy_mzz, - sig_zx_vx, sig_zy_vx, sig_zx_vy, sig_zy_vy, gps[:, 0])
- -
[docs] def point_within_element(self, pt): - """Determines whether a point lies within the current element. - - :param pt: Point to check *(x, y)* - :type pt: list[float, float] - :return: Whether the point lies within an element - :rtype: bool - """ - - px = pt[0] - py = pt[1] - - # get coordinates of corner points - x1 = self.coords[0][0] - y1 = self.coords[1][0] - x2 = self.coords[0][1] - y2 = self.coords[1][1] - x3 = self.coords[0][2] - y3 = self.coords[1][2] - - # compute variables alpha, beta and gamma - alpha = ( - ((y2 - y3) * (px - x3) + (x3 - x2) * (py - y3)) / - ((y2 - y3) * (x1 - x3) + (x3 - x2) * (y1 - y3)) - ) - beta = ( - ((y3 - y1) * (px - x3) + (x1 - x3) * (py - y3)) / - ((y2 - y3) * (x1 - x3) + (x3 - x2) * (y1 - y3)) - ) - gamma = 1.0 - alpha - beta - - # if the point lies within an element - if alpha >= 0 and beta >= 0 and gamma >= 0: - return True - else: - return False
- - -
[docs]def gauss_points(n): - """Returns the Gaussian weights and locations for *n* point Gaussian integration of a quadratic - triangular element. - - :param int n: Number of Gauss points (1, 3 or 6) - :return: An *n x 4* matrix consisting of the integration weight and the eta, xi and zeta - locations for *n* Gauss points - :rtype: :class:`numpy.ndarray` - """ - - if n == 1: - # one point gaussian integration - return np.array([[1, 1.0 / 3, 1.0 / 3, 1.0 / 3]]) - - elif n == 3: - # three point gaussian integration - return np.array([ - [1.0 / 3, 2.0 / 3, 1.0 / 6, 1.0 / 6], - [1.0 / 3, 1.0 / 6, 2.0 / 3, 1.0 / 6], - [1.0 / 3, 1.0 / 6, 1.0 / 6, 2.0 / 3] - ]) - elif n == 6: - # six point gaussian integration - g1 = 1.0 / 18 * (8 - np.sqrt(10) + np.sqrt(38 - 44 * np.sqrt(2.0 / 5))) - g2 = 1.0 / 18 * (8 - np.sqrt(10) - np.sqrt(38 - 44 * np.sqrt(2.0 / 5))) - w1 = (620 + np.sqrt(213125 - 53320 * np.sqrt(10))) / 3720 - w2 = (620 - np.sqrt(213125 - 53320 * np.sqrt(10))) / 3720 - - return np.array([ - [w2, 1 - 2 * g2, g2, g2], - [w2, g2, 1 - 2 * g2, g2], - [w2, g2, g2, 1 - 2 * g2], - [w1, g1, g1, 1 - 2 * g1], - [w1, 1 - 2 * g1, g1, g1], - [w1, g1, 1 - 2 * g1, g1] - ])
- - -
[docs]def shape_function(coords, gauss_point): - """Computes shape functions, shape function derivatives and the determinant of the Jacobian - matrix for a tri 6 element at a given Gauss point. - - :param coords: Global coordinates of the quadratic triangle vertices [2 x 6] - :type coords: :class:`numpy.ndarray` - :param gauss_point: Gaussian weight and isoparametric location of the Gauss point - :type gauss_point: :class:`numpy.ndarray` - :return: The value of the shape functions *N(i)* at the given Gauss point [1 x 6], the - derivative of the shape functions in the j-th global direction *B(i,j)* [2 x 6] and the - determinant of the Jacobian matrix *j* - :rtype: tuple(:class:`numpy.ndarray`, :class:`numpy.ndarray`, float) - """ - - # location of isoparametric co-ordinates for each Gauss point - eta = gauss_point[1] - xi = gauss_point[2] - zeta = gauss_point[3] - - # value of the shape functions - N = np.array([ - eta * (2 * eta - 1), - xi * (2 * xi - 1), - zeta * (2 * zeta - 1), - 4 * eta * xi, - 4 * xi * zeta, - 4 * eta * zeta - ]) - - # derivatives of the shape functions wrt the isoparametric co-ordinates - B_iso = np.array([ - [4 * eta - 1, 0, 0, 4 * xi, 0, 4 * zeta], - [0, 4 * xi - 1, 0, 4 * eta, 4 * zeta, 0], - [0, 0, 4 * zeta - 1, 0, 4 * xi, 4 * eta] - ]) - - # form Jacobian matrix - J_upper = np.array([[1, 1, 1]]) - J_lower = np.dot(coords, np.transpose(B_iso)) - J = np.vstack((J_upper, J_lower)) - - # calculate the jacobian - j = 0.5 * np.linalg.det(J) - - # if the area of the element is not zero - if j != 0: - # cacluate the P matrix - P = np.dot(np.linalg.inv(J), np.array([[0, 0], [1, 0], [0, 1]])) - - # calculate the B matrix in terms of cartesian co-ordinates - B = np.transpose(np.dot(np.transpose(B_iso), P)) - else: - B = np.zeros((2, 6)) # empty B matrix - - return (N, B, j)
- - -
[docs]def extrapolate_to_nodes(w): - """Extrapolates results at six Gauss points to the six noes of a quadratic triangular element. - - :param w: Result at the six Gauss points [1 x 6] - :type w: :class:`numpy.ndarray` - :return: Extrapolated nodal values at the six nodes [1 x 6] - :rtype: :class:`numpy.ndarray` - """ - - H_inv = np.array([ - [1.87365927351160, 0.138559587411935, 0.138559587411935, - -0.638559587411936, 0.126340726488397, -0.638559587411935], - [0.138559587411935, 1.87365927351160, 0.138559587411935, - -0.638559587411935, -0.638559587411935, 0.126340726488397], - [0.138559587411935, 0.138559587411935, 1.87365927351160, - 0.126340726488396, -0.638559587411935, -0.638559587411935], - [0.0749010751157440, 0.0749010751157440, 0.180053080734478, - 1.36051633430762, -0.345185782636792, -0.345185782636792], - [0.180053080734478, 0.0749010751157440, 0.0749010751157440, - -0.345185782636792, 1.36051633430762, -0.345185782636792], - [0.0749010751157440, 0.180053080734478, 0.0749010751157440, - -0.345185782636792, -0.345185782636792, 1.36051633430762] - ]) - - return H_inv.dot(w)
- - -
[docs]def principal_coordinate(phi, x, y): - """Determines the coordinates of the cartesian point *(x, y)* in the - principal axis system given an axis rotation angle phi. - - :param float phi: Prinicpal bending axis angle (degrees) - :param float x: x coordinate in the global axis - :param float y: y coordinate in the global axis - :return: Principal axis coordinates *(x1, y2)* - :rtype: tuple(float, float) - """ - - # convert principal axis angle to radians - phi_rad = phi * np.pi / 180 - - # form rotation matrix - R = np.array([ - [np.cos(phi_rad), np.sin(phi_rad)], - [-np.sin(phi_rad), np.cos(phi_rad)] - ]) - - # calculate rotated x and y coordinates - x_rotated = R.dot(np.array([x, y])) - - return (x_rotated[0], x_rotated[1])
- - -
[docs]def global_coordinate(phi, x11, y22): - """Determines the global coordinates of the principal axis point *(x1, y2)* given principal - axis rotation angle phi. - - :param float phi: Prinicpal bending axis angle (degrees) - :param float x11: 11 coordinate in the principal axis - :param float y22: 22 coordinate in the principal axis - :return: Global axis coordinates *(x, y)* - :rtype: tuple(float, float) - """ - - # convert principal axis angle to radians - phi_rad = phi * np.pi / 180 - - # form transposed rotation matrix - R = np.array([ - [np.cos(phi_rad), -np.sin(phi_rad)], - [np.sin(phi_rad), np.cos(phi_rad)] - ]) - # calculate rotated x_1 and y_2 coordinates - x_rotated = R.dot(np.array([x11, y22])) - - return (x_rotated[0], x_rotated[1])
- - -
[docs]def point_above_line(u, px, py, x, y): - """Determines whether a point *(x, y)* is a above or below the line defined by the parallel - unit vector *u* and the point *(px, py)*. - - :param u: Unit vector parallel to the line [1 x 2] - :type u: :class:`numpy.ndarray` - :param float px: x coordinate of a point on the line - :param float py: y coordinate of a point on the line - :param float x: x coordinate of the point to be tested - :param float y: y coordinate of the point to be tested - :return: This method returns *True* if the point is above the line or *False* if the point is - below the line - :rtype: bool - """ - - # vector from point to point on line - PQ = np.array([px - x, py - y]) - return np.cross(PQ, u) > 0
-
- -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/_modules/sectionproperties/analysis/solver.html b/docs/build/html/_modules/sectionproperties/analysis/solver.html deleted file mode 100644 index 832e79e4..00000000 --- a/docs/build/html/_modules/sectionproperties/analysis/solver.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - - - - - - - sectionproperties.analysis.solver — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- -
    - -
  • Docs »
  • - -
  • Module code »
  • - -
  • sectionproperties.analysis.solver
  • - - -
  • - -
  • - -
- - -
-
-
-
- -

Source code for sectionproperties.analysis.solver

-import time
-import numpy as np
-from scipy.sparse import linalg
-from scipy.sparse.linalg import spsolve
-
-
-
[docs]def solve_cgs(k, f, m=None, tol=1e-5): - """Solves a linear system of equations (Ku = f) using the CGS iterative method. - - :param k: N x N matrix of the linear system - :type k: :class:`scipy.sparse.csc_matrix` - :param f: N x 1 right hand side of the linear system - :type f: :class:`numpy.ndarray` - :param float tol: Tolerance for the solver to acheieve. The algorithm terminates when either - the relative or the absolute residual is below tol. - :param m: Preconditioner for the linear matrix approximating the inverse of k - :type m: :class:`scipy.linalg.LinearOperator` - - :return: The solution vector to the linear system of equations - :rtype: :class:`numpy.ndarray` - - :raises RuntimeError: If the CGS iterative method does not converge - """ - - (u, exit) = linalg.cgs(k, f, tol=tol, M=m) - - if (exit != 0): - raise RuntimeError("CGS iterative method did not converge.") - - return u
- - -
[docs]def solve_cgs_lagrange(k_lg, f, tol=1e-5, m=None): - """Solves a linear system of equations (Ku = f) using the CGS iterative method and the - Lagrangian multiplier method. - - :param k: (N+1) x (N+1) Lagrangian multiplier matrix of the linear system - :type k: :class:`scipy.sparse.csc_matrix` - :param f: N x 1 right hand side of the linear system - :type f: :class:`numpy.ndarray` - :param float tol: Tolerance for the solver to acheieve. The algorithm terminates when either - the relative or the absolute residual is below tol. - :param m: Preconditioner for the linear matrix approximating the inverse of k - :type m: :class:`scipy.linalg.LinearOperator` - - :return: The solution vector to the linear system of equations - :rtype: :class:`numpy.ndarray` - - :raises RuntimeError: If the CGS iterative method does not converge or the error from the - Lagrangian multiplier method exceeds the tolerance - """ - - (u, exit) = linalg.cgs(k_lg, np.append(f, 0), tol=tol, M=m) - - if (exit != 0): - raise RuntimeError("CGS iterative method did not converge.") - - # compute error - err = u[-1] / max(np.absolute(u)) - - if err > tol: - err = "Lagrangian multiplier method error exceeds tolerance." - raise RuntimeError(err) - - return u[:-1]
- - -
[docs]def solve_direct(k, f): - """Solves a linear system of equations (Ku = f) using the direct solver method. - - :param k: N x N matrix of the linear system - :type k: :class:`scipy.sparse.csc_matrix` - :param f: N x 1 right hand side of the linear system - :type f: :class:`numpy.ndarray` - - :return: The solution vector to the linear system of equations - :rtype: :class:`numpy.ndarray` - """ - - return spsolve(k, f)
- - -
[docs]def solve_direct_lagrange(k_lg, f): - """Solves a linear system of equations (Ku = f) using the direct solver method and the - Lagrangian multiplier method. - - :param k: (N+1) x (N+1) Lagrangian multiplier matrix of the linear system - :type k: :class:`scipy.sparse.csc_matrix` - :param f: N x 1 right hand side of the linear system - :type f: :class:`numpy.ndarray` - - :return: The solution vector to the linear system of equations - :rtype: :class:`numpy.ndarray` - - :raises RuntimeError: If the Lagrangian multiplier method exceeds a tolerance of 1e-5 - """ - - u = spsolve(k_lg, np.append(f, 0)) - - # compute error - err = u[-1] / max(np.absolute(u)) - - if err > 1e-5: - err = "Lagrangian multiplier method error exceeds tolerance of 1e-5." - raise RuntimeError(err) - - return u[:-1]
- - -
[docs]def function_timer(text, function, *args): - """Displays the message *text* and returns the time taken for a function, with arguments - *args*, to execute. The value returned by the timed function is also returned. - - :param string text: Message to display - :param function: Function to time and execute - :type function: function - :param args: Function arguments - :return: Value returned from the function - """ - - start_time = time.time() - - if text != "": - print(text) - - result = function(*args) - - if text != "": - print("----completed in {0:.6f} seconds---".format( - time.time() - start_time)) - - return result
-
- -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/_modules/sectionproperties/post/post.html b/docs/build/html/_modules/sectionproperties/post/post.html deleted file mode 100644 index 69ee4dc5..00000000 --- a/docs/build/html/_modules/sectionproperties/post/post.html +++ /dev/null @@ -1,519 +0,0 @@ - - - - - - - - - - - sectionproperties.post.post — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- -
    - -
  • Docs »
  • - -
  • Module code »
  • - -
  • sectionproperties.post.post
  • - - -
  • - -
  • - -
- - -
-
-
-
- -

Source code for sectionproperties.post.post

-import numpy as np
-import matplotlib.pyplot as plt
-
-
-
[docs]def setup_plot(ax, pause): - """Executes code required to set up a matplotlib figure. - - :param ax: Axes object on which to plot - :type ax: :class:`matplotlib.axes.Axes` - :param bool pause: If set to true, the figure pauses the script until the window is closed. If - set to false, the script continues immediately after the window is rendered. - """ - - if not pause: - plt.ion() - plt.show() - else: - plt.ioff()
- - -
[docs]def finish_plot(ax, pause, title=''): - """Executes code required to finish a matplotlib figure. - - :param ax: Axes object on which to plot - :type ax: :class:`matplotlib.axes.Axes` - :param bool pause: If set to true, the figure pauses the script until the window is closed. If - set to false, the script continues immediately after the window is rendered. - :param string title: Plot title - """ - - ax.set_title(title) - ax.set_aspect('equal', anchor='C') - plt.tight_layout() - - if pause: - plt.show() - else: - plt.draw() - plt.pause(0.001)
- - -
[docs]def draw_principal_axis(ax, phi, cx, cy): - """ - Draws the principal axis on a plot. - - :param ax: Axes object on which to plot - :type ax: :class:`matplotlib.axes.Axes` - :param float phi: Principal axis angle in radians - :param float cx: x-location of the centroid - :param float cy: y-location of the centroid - """ - - # get current axis limits - (xmin, xmax) = ax.get_xlim() - (ymin, ymax) = ax.get_ylim() - lims = [xmin, xmax, ymin, ymax] - - # form rotation matrix - R = np.array([[np.cos(phi), -np.sin(phi)], - [np.sin(phi), np.cos(phi)]]) - - # get basis vectors in the directions of the principal axes - x11_basis = R.dot(np.array([1, 0])) - y22_basis = R.dot(np.array([0, 1])) - - def add_point(vec, basis, centroid, num, denom): - """Adds a point to the list *vec* if there is an intersection.""" - - if denom != 0: - point = basis * num / denom + centroid - vec.append([point[0], point[1]]) - - def get_prinicipal_points(basis, lims, centroid): - """Determines the intersections of the prinicpal axis with the four lines defining a - bounding box around the limits of the cross-section. The middle two intersection points are - returned for plotting. - - :param basis: Basis (unit) vector in the direction of the principal axis - :type basis: :class:`numpy.ndarray` - :param lims: Tuple containing the axis limits *(xmin, xmax, ymin, ymax)* - :type lims: tuple(float, float, float, float) - :param centroid: Centroid *(cx, cy)* of the cross-section, through which the principal axis - passes - :type centroid: list[float, float] - """ - - pts = [] # initialise list containing the intersection points - - # add intersection points to the list - add_point(pts, basis, centroid, lims[0] - centroid[0], basis[0]) - add_point(pts, basis, centroid, lims[1] - centroid[0], basis[0]) - add_point(pts, basis, centroid, lims[2] - centroid[1], basis[1]) - add_point(pts, basis, centroid, lims[3] - centroid[1], basis[1]) - - # sort point vector - pts = np.array(pts) - pts = pts[pts[:, 0].argsort()] # stackoverflow sort numpy array by col - - # if there are four points, take the middle two points - if len(pts) == 4: - return pts[1:3, :] - - return pts - - # get intersection points for the 11 and 22 axes - x11 = get_prinicipal_points(x11_basis, lims, [cx, cy]) - y22 = get_prinicipal_points(y22_basis, lims, [cx, cy]) - - # plot the principal axis - ax.plot(x11[:, 0], x11[:, 1], 'k--', alpha=0.5, label='11-axis') - ax.plot(y22[:, 0], y22[:, 1], 'k-.', alpha=0.5, label='22-axis')
- - - -
- -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/_modules/sectionproperties/pre/nastran_sections.html b/docs/build/html/_modules/sectionproperties/pre/nastran_sections.html deleted file mode 100644 index d7a2137c..00000000 --- a/docs/build/html/_modules/sectionproperties/pre/nastran_sections.html +++ /dev/null @@ -1,2434 +0,0 @@ - - - - - - - - - - - sectionproperties.pre.nastran_sections — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- -
    - -
  • Docs »
  • - -
  • Module code »
  • - -
  • sectionproperties.pre.nastran_sections
  • - - -
  • - -
  • - -
- - -
-
-
-
- -

Source code for sectionproperties.pre.nastran_sections

-from sectionproperties.pre.sections import (
-    Geometry, RectangularSection, CustomSection, MergedSection
-)
-from sectionproperties.pre.pre import create_mesh
-import numpy as np
-
-
-
[docs]class BARSection(Geometry): - """Constructs a BAR section with the center at the origin *(0, 0)*, with two parameters - defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ [5]_ for definition of - parameters. Added by JohnDN90. - - :param float DIM1: Width (x) of bar - :param float DIM2: Depth (y) of bar - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a BAR cross-section with a depth of 1.5 and width of 2.0, and - generates a mesh with a maximum triangular area of 0.001:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.BARSection(DIM1=2.0, DIM2=1.5) - mesh = geometry.create_mesh(mesh_sizes=[0.001]) - - .. figure:: ../images/sections/bar_geometry.png - :align: center - :scale: 75 % - - BAR section geometry. - - .. figure:: ../images/sections/bar_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, shift=[0, 0]): - """Inits the BARSection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - - # assign control point - control_points = [[0., 0.]] - - # shift = [-0.5*DIM1+shift[0], -0.5*DIM2+shift[1]] - super().__init__(control_points, shift) - - # construct the points and facets - self.points = [ - [-0.5*DIM1, -0.5*DIM2], [0.5*DIM1, -0.5*DIM2], - [0.5*DIM1, 0.5*DIM2], [-0.5*DIM1, 0.5*DIM2] - ] - self.facets = [[0, 1], [1, 2], [2, 3], [3, 0]] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5*self.DIM1-shift[0], 0.5*self.DIM2-shift[1]) - D = (0.5*self.DIM1-shift[0], -0.5*self.DIM2-shift[1]) - E = (-0.5*self.DIM1-shift[0], -0.5*self.DIM2-shift[1]) - F = (-0.5*self.DIM1-shift[0], 0.5*self.DIM2-shift[1]) - - return C, D, E, F
- - -
[docs]class BOXSection(Geometry): - """ Constructs a BOX section with the center at the origin *(0, 0)*, with four parameters - defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ [5]_ for definition of - parameters. Added by JohnDN90. - - :param float DIM1: Width (x) of box - :param float DIM2: Depth (y) of box - :param float DIM3: Thickness of box in y direction - :param float DIM4: Thickness of box in x direction - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a BOX cross-section with a depth of 3.0 and width of 4.0, and - generates a mesh with a maximum triangular area of 0.001:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.BOXSection(DIM1=4.0, DIM2=3.0, DIM3=0.375, DIM4=0.5) - mesh = geometry.create_mesh(mesh_sizes=[0.001]) - - .. figure:: ../images/sections/box_geometry.png - :align: center - :scale: 75 % - - BOX section geometry. - - .. figure:: ../images/sections/box_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, shift=[0, 0]): - """Inits the BOXSection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - - # Ensure dimensions are physically relevant - np.testing.assert_(2.0*DIM4 < DIM1, "Invalid geometry specified.") - np.testing.assert_(2.0*DIM3 < DIM2, "Invalid geometry specified.") - - # assign control point - control_points = [[0., 0.5*DIM2 - 0.5*DIM3]] - - super().__init__(control_points, shift) - - # specify a hole in the centre of the Box - self.holes = [[0., 0.]] - - # construct the points and facets - self.points = [ - [-0.5*DIM1, -0.5*DIM2], [0.5*DIM1, -0.5*DIM2], [0.5*DIM1, 0.5*DIM2], - [-0.5*DIM1, 0.5*DIM2], [-0.5*DIM1 + DIM4, -0.5*DIM2 + DIM3], - [0.5*DIM1 - DIM4, -0.5*DIM2 + DIM3], [0.5*DIM1 - DIM4, 0.5*DIM2 - DIM3], - [-0.5*DIM1 + DIM4, 0.5*DIM2 - DIM3] - ] - self.facets = [[0, 1], [1, 2], [2, 3], [3, 0], [4, 5], [5, 6], [6, 7], [7, 4]] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5*self.DIM1-shift[0], 0.5*self.DIM2-shift[1]) - D = (0.5*self.DIM1-shift[0], -0.5*self.DIM2-shift[1]) - E = (-0.5*self.DIM1-shift[0], -0.5*self.DIM2-shift[1]) - F = (-0.5*self.DIM1-shift[0], 0.5*self.DIM2-shift[1]) - - return C, D, E, F
- - -
[docs]class BOX1Section(Geometry): - """Constructs a BOX1 section with the center at the origin *(0, 0)*, with six parameters - defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ for more details. Added by - JohnDN90. - - :param float DIM1: Width (x) of box - :param float DIM2: Depth (y) of box - :param float DIM3: Thickness of top wall - :param float DIM4: Thickness of bottom wall - :param float DIM5: Thickness of left wall - :param float DIM6: Thickness of right wall - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a BOX1 cross-section with a depth of 3.0 and width of 4.0, and - generates a mesh with a maximum triangular area of 0.007:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.BOX1Section( - DIM1=4.0, DIM2=3.0, DIM3=0.375, DIM4=0.5, DIM5=0.25, DIM6=0.75 - ) - mesh = geometry.create_mesh(mesh_sizes=[0.007]) - - .. figure:: ../images/sections/box1_geometry.png - :align: center - :scale: 75 % - - BOX1 section geometry. - - .. figure:: ../images/sections/box1_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, DIM5, DIM6, shift=[0, 0]): - """Inits the Box1Section class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - DIM5 *= 1.0 - DIM6 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - self.DIM5 = DIM5 - self.DIM6 = DIM6 - - # Ensure dimensions are physically relevant - np.testing.assert_(DIM5+DIM6 < DIM1, "Invalid geometry specified.") - np.testing.assert_(DIM3+DIM4 < DIM2, "Invalid geometry specified.") - - # assign control point - control_points = [[0.5*DIM1, 0.5*DIM4]] - - shift = [-0.5*DIM1+shift[0], -0.5*DIM2+shift[1]] - super().__init__(control_points, shift) - - # specify a hole in the centre of the Box - self.holes = [[DIM6 + 0.5*(DIM1-DIM5), DIM4+0.5*(DIM2-DIM3)]] - - # construct the points and facets - self.points = [ - [0., 0.], [DIM1, 0.], [DIM1, DIM2], [0., DIM2], [DIM6, DIM4], [DIM1-DIM5, DIM4], - [DIM1-DIM5, DIM2-DIM3], [DIM6, DIM2-DIM3] - ] - self.facets = [[0, 1], [1, 2], [2, 3], [3, 0], [4, 5], [5, 6], [6, 7], [7, 4]] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """ Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5*self.DIM1-shift[0], 0.5*self.DIM2-shift[1]) - D = (0.5*self.DIM1-shift[0], -0.5*self.DIM2-shift[1]) - E = (-0.5*self.DIM1-shift[0], -0.5*self.DIM2-shift[1]) - F = (-0.5*self.DIM1-shift[0], 0.5*self.DIM2-shift[1]) - - return C, D, E, F
- - -
[docs]class CHANSection(Geometry): - """ Constructs a CHAN (C-Channel) section with the web's middle center at the origin *(0, 0)*, - with four parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ for - more details. Added by JohnDN90. - - :param float DIM1: Width (x) of the CHAN-section - :param float DIM2: Depth (y) of the CHAN-section - :param float DIM3: Thickness of web (vertical portion) - :param float DIM4: Thickness of flanges (top/bottom portion) - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a CHAN cross-section with a depth of 4.0 and width of 2.0, and - generates a mesh with a maximum triangular area of 0.008:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.CHANSection(DIM1=2.0, DIM2=4.0, DIM3=0.25, DIM4=0.5) - mesh = geometry.create_mesh(mesh_sizes=[0.008]) - - .. figure:: ../images/sections/chan_geometry.png - :align: center - :scale: 75 % - - CHAN section geometry. - - .. figure:: ../images/sections/chan_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, shift=[0, 0]): - """Inits the CHANSection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - - # Ensure dimensions are physically relevant - np.testing.assert_(2.0*DIM4 < DIM2, "Invalid geometry specified.") - np.testing.assert_(DIM3 < DIM1, "Invalid geometry specified.") - - # assign control point - control_points = [[0.5*DIM1, 0.5*DIM4]] - - shift = [-0.5*DIM3+shift[0], -0.5*DIM2+shift[1]] - super().__init__(control_points, shift) - - # construct the points and facets - self.points = [ - [0., 0.], [DIM1, 0.], [DIM1, DIM4], [DIM3, DIM4], [DIM3, DIM2-DIM4], [DIM1, DIM2-DIM4], - [DIM1, DIM2], [0., DIM2] - ] - self.facets = [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 0]] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """ Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (self.DIM1-0.5*self.DIM3-shift[0], 0.5*self.DIM2-shift[1]) - D = (self.DIM1-0.5*self.DIM3-shift[0], -0.5*self.DIM2-shift[1]) - E = (-0.5*self.DIM3-shift[0], -0.5*self.DIM2-shift[1]) - F = (-0.5*self.DIM3-shift[0], 0.5*self.DIM2-shift[1]) - - return C, D, E, F
- - -
[docs]class CHAN1Section(Geometry): - """ Constructs a CHAN1 (C-Channel) section with the web's middle center at the origin *(0, 0)*, - with four parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ for - more details. Added by JohnDN90. - - :param float DIM1: Width (x) of channels - :param float DIM2: Thicknesss (x) of web - :param float DIM3: Spacing between channels (length of web) - :param float DIM4: Depth (y) of CHAN1-section - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a CHAN1 cross-section with a depth of 4.0 and width of 1.75, and - generates a mesh with a maximum triangular area of 0.01:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.CHAN1Section(DIM1=0.75, DIM2=1.0, DIM3=3.5, DIM4=4.0) - mesh = geometry.create_mesh(mesh_sizes=[0.01]) - - .. figure:: ../images/sections/chan1_geometry.png - :align: center - :scale: 75 % - - CHAN1 section geometry. - - .. figure:: ../images/sections/chan1_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, shift=[0, 0]): - """Inits the CHAN1Section class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - - # Ensure dimensions are physically relevant - np.testing.assert_(DIM4 > DIM3, "Invalid geometry specified.") - - # assign control point - control_points = [[0.5*DIM1, 0.5*DIM4]] - - shift = [-0.5*DIM2+shift[0], -0.5*DIM4+shift[1]] - super().__init__(control_points, shift) - - # construct the points and facets - tf = 0.5 * (DIM4 - DIM3) - self.points = [ - [0, 0], [DIM1+DIM2, 0], [DIM1+DIM2, tf], [DIM2, tf], [DIM2, tf+DIM3], - [DIM2+DIM1, tf+DIM3], [DIM2+DIM1, DIM4], [0, DIM4] - ] - self.facets = [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 0]] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """ Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5*self.DIM2+self.DIM1-shift[0], 0.5*self.DIM4-shift[1]) - D = (0.5*self.DIM2+self.DIM1-shift[0], -0.5*self.DIM4-shift[1]) - E = (-0.5*self.DIM2-shift[0], -0.5*self.DIM4-shift[1]) - F = (-0.5*self.DIM2-shift[0], 0.5*self.DIM4-shift[1]) - - return C, D, E, F
- - -
[docs]class CHAN2Section(Geometry): - """ Constructs a CHAN2 (C-Channel) section with the bottom web's middle center at the origin - *(0, 0)*, with four parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ - [4]_ for more details. Added by JohnDN90. - - :param float DIM1: Thickness of channels - :param float DIM2: Thickness of web - :param float DIM3: Depth (y) of CHAN2-section - :param float DIM4: Width (x) of CHAN2-section - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a CHAN2 cross-section with a depth of 2.0 and width of 4.0, and - generates a mesh with a maximum triangular area of 0.01:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.CHAN2Section(DIM1=0.375, DIM2=0.5, DIM3=2.0, DIM4=4.0) - mesh = geometry.create_mesh(mesh_sizes=[0.01]) - - .. figure:: ../images/sections/chan2_geometry.png - :align: center - :scale: 75 % - - CHAN2 section geometry. - - .. figure:: ../images/sections/chan2_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, shift=[0, 0]): - """Inits the CHAN2Section class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - - # Ensure dimensions are physically relevant - np.testing.assert_(DIM4 > 2.0*DIM1, "Invalid geometry specified.") - np.testing.assert_(DIM3 > DIM2, "Invalid geometry specified.") - - # assign control point - control_points = [[0.5*DIM4, 0.5*DIM2]] - - shift = [-0.5*DIM4+shift[0], -0.5*DIM2+shift[1]] - super().__init__(control_points, shift) - - # construct the points and facets - self.points = [ - [0., 0.], [DIM4, 0.], [DIM4, DIM3], [DIM4-DIM1, DIM3], [DIM4-DIM1, DIM2], [DIM1, DIM2], - [DIM1, DIM3], [0., DIM3] - ] - self.facets = [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 0]] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """ Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5*self.DIM4-shift[0], self.DIM3-0.5*self.DIM2-shift[1]) - D = (0.5*self.DIM4-shift[0], -0.5*self.DIM2-shift[1]) - E = (-0.5*self.DIM4-shift[0], -0.5*self.DIM2-shift[1]) - F = (-0.5*self.DIM4-shift[0], self.DIM3-0.5*self.DIM2-shift[1]) - - return C, D, E, F
- - -
[docs]class CROSSSection(Geometry): - """ Constructs Nastran's cruciform/cross section with the intersection's middle center at the - origin *(0, 0)*, with four parameters defining dimensions. See Nastran documentation [1]_ [2]_ - [3]_ [4]_ for more details. Added by JohnDN90. - - :param float DIM1: Twice the width of horizontal member protruding from the vertical center - member - :param float DIM2: Thickness of the vertical member - :param float DIM3: Depth (y) of the CROSS-section - :param float DIM4: Thickness of the horizontal members - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a rectangular cross-section with a depth of 3.0 and width of - 1.875, and generates a mesh with a maximum triangular area of 0.008:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.CROSSSection(DIM1=1.5, DIM2=0.375, DIM3=3.0, DIM4=0.25) - mesh = geometry.create_mesh(mesh_sizes=[0.008]) - - .. figure:: ../images/sections/cross_geometry.png - :align: center - :scale: 75 % - - Cruciform/cross section geometry. - - .. figure:: ../images/sections/cross_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, shift=[0, 0]): - """Inits the CROSSSection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - - # Ensure dimensions are physically relevant - np.testing.assert_(DIM4 < DIM3, "Invalid geometry specified.") - - # assign control point - control_points = [[0.5*DIM1+0.5*DIM2, 0.5*DIM3]] - - shift = [-(0.5*DIM1+0.5*DIM2)+shift[0], -(0.5*DIM3)+shift[1]] - super().__init__(control_points, shift) - - # construct the points and facets - d = 0.5*(DIM3 - DIM4) - self.points = [ - [0.5*DIM1, 0], [0.5*DIM1+DIM2, 0], [0.5*DIM1+DIM2, d], [DIM1+DIM2, d], - [DIM1+DIM2, d+DIM4], [0.5*DIM1+DIM2, d+DIM4], [0.5*DIM1+DIM2, DIM3], [0.5*DIM1, DIM3], - [0.5*DIM1, d+DIM4], [0, d+DIM4], [0, d], [0.5*DIM1, d] - ] - self.facets = [ - [0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], - [10, 11], [11, 0] - ] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (-shift[0], 0.5*self.DIM3-shift[1]) - D = (0.5*(self.DIM1+self.DIM2)-shift[0], -shift[1]) - E = (-shift[0], -0.5*self.DIM3-shift[1]) - F = (-0.5*(self.DIM1+self.DIM2)-shift[0], -shift[1]) - - return C, D, E, F
- - -
[docs]class FCROSSSection(Geometry): - """ Constructs a flanged cruciform/cross section with the intersection's middle center at the - origin *(0, 0)*, with eight parameters defining dimensions. Added by JohnDN90. - - :param float DIM1: Depth (y) of flanged cruciform - :param float DIM2: Width (x) of flanged cruciform - :param float DIM3: Thickness of vertical web - :param float DIM4: Thickness of horizontal web - :param float DIM5: Length of flange attached to vertical web - :param float DIM6: Thickness of flange attached to vertical web - :param float DIM7: Length of flange attached to horizontal web - :param float DIM8: Thickness of flange attached to horizontal web - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example demonstrates the creation of a flanged cross section:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.FCROSSSection( - DIM1=9.0, DIM2=6.0, DIM3=0.75, DIM4=0.625, DIM5=2.1, DIM6=0.375, DIM7=4.5, DIM8=0.564 - ) - mesh = geometry.create_mesh(mesh_sizes=[0.03]) - - .. figure:: ../images/sections/fcross_geometry.png - :align: center - :scale: 75 % - - Flanged Cruciform/cross section geometry. - - .. figure:: ../images/sections/fcross_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, DIM5, DIM6, DIM7, DIM8, shift=[0, 0]): - """Inits the FCROSSSection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - DIM5 *= 1.0 - DIM6 *= 1.0 - DIM7 *= 1.0 - DIM8 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - self.DIM5 = DIM5 - self.DIM6 = DIM6 - self.DIM7 = DIM7 - self.DIM7 = DIM8 - - # Ensure dimensions are physically relevant - # TODO: Finish dimension checks. - np.testing.assert_(DIM5 > DIM3, "Invalid geometry specified.") - np.testing.assert_(DIM7 > DIM4, "Invalid geometry specified.") - np.testing.assert_(DIM7 < DIM1, "Invalid geometry specified.") - np.testing.assert_(DIM5 < DIM2, "Invalid geometry specified.") - np.testing.assert_(DIM8 < (0.5*DIM2-0.5*DIM3), "Invalid geometry specified.") - np.testing.assert_(DIM6 < (0.5*DIM1-0.5*DIM4), "Invalid geometry specified.") - - # assign control point - control_points = [[0.0, 0.0]] - - shift = [shift[0], shift[1]] - super().__init__(control_points, shift) - - # construct the points and facets - self.points = [ - [0.5*DIM3, -0.5*DIM4], [0.5*DIM2-DIM8, -0.5*DIM4], [0.5*DIM2-DIM8, -0.5*DIM7], - [0.5*DIM2, -0.5*DIM7], [0.5*DIM2, 0.5*DIM7], [0.5*DIM2-DIM8, 0.5*DIM7], - [0.5*DIM2-DIM8, 0.5*DIM4], [0.5*DIM3, 0.5*DIM4], [0.5*DIM3, 0.5*DIM1-DIM6], - [0.5*DIM5, 0.5*DIM1-DIM6], [0.5*DIM5, 0.5*DIM1], [-0.5*DIM5, 0.5*DIM1], - [-0.5*DIM5, 0.5*DIM1-DIM6], [-0.5*DIM3, 0.5*DIM1-DIM6], [-0.5*DIM3, 0.5*DIM4], - [-0.5*DIM2+DIM8, 0.5*DIM4], [-0.5*DIM2+DIM8, 0.5*DIM7], [-0.5*DIM2, 0.5*DIM7], - [-0.5*DIM2, -0.5*DIM7], [-0.5*DIM2+DIM8, -0.5*DIM7], [-0.5*DIM2+DIM8, -0.5*DIM4], - [-0.5*DIM3, -0.5*DIM4], [-0.5*DIM3, -0.5*DIM1+DIM6], [-0.5*DIM5, -0.5*DIM1+DIM6], - [-0.5*DIM5, -0.5*DIM1], [0.5*DIM5, -0.5*DIM1], [0.5*DIM5, -0.5*DIM1+DIM6], - [0.5*DIM3, -0.5*DIM1+DIM6] - ] - self.facets = [ - [0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], - [10, 11], [11, 12], [12, 13], [13, 14], [14, 15], [15, 16], [16, 17], [17, 18], - [18, 19], [19, 20], [20, 21], [21, 22], [22, 23], [23, 24], [24, 25], [25, 26], - [26, 27], [27, 0] - ] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (-shift[0], 0.5*self.DIM1-shift[1]) - D = (0.5*self.DIM2-shift[0], -shift[1]) - E = (-shift[0], -0.5*self.DIM1-shift[1]) - F = (-0.5*self.DIM2-shift[0], -shift[1]) - - return C, D, E, F
- - -
[docs]class DBOXSection(Geometry): - """ Constructs a DBOX section with the center at the origin *(0, 0)*, with ten parameters - defining dimensions. See MSC Nastran documentation [1]_ for more details. Added by JohnDN90. - - :param float DIM1: Width (x) of the DBOX-section - :param float DIM2: Depth (y) of the DBOX-section - :param float DIM3: Width (x) of left-side box - :param float DIM4: Thickness of left wall - :param float DIM5: Thickness of center wall - :param float DIM6: Thickness of right wall - :param float DIM7: Thickness of top left wall - :param float DIM8: Thickness of bottom left wall - :param float DIM9: Thickness of top right wall - :param float DIM10: Thickness of bottom right wall - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a DBOX cross-section with a depth of 3.0 and width of 8.0, and - generates a mesh with a maximum triangular area of 0.01:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.DBOXSection( - DIM1=8.0, DIM2=3.0, DIM3=3.0, DIM4=0.5, DIM5=0.625, DIM6=0.75, DIM7=0.375, DIM8=0.25, - DIM9=0.5, DIM10=0.375 - ) - mesh = geometry.create_mesh(mesh_sizes=[0.01]) - - .. figure:: ../images/sections/dbox_geometry.png - :align: center - :scale: 75 % - - DBOX section geometry. - - .. figure:: ../images/sections/dbox_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, DIM5, DIM6, DIM7, DIM8, DIM9, DIM10, shift=[0, 0]): - """Inits the DBOXSection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - DIM5 *= 1.0 - DIM6 *= 1.0 - DIM7 *= 1.0 - DIM8 *= 1.0 - DIM9 *= 1.0 - DIM10 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - self.DIM5 = DIM5 - self.DIM6 = DIM6 - self.DIM7 = DIM7 - self.DIM8 = DIM8 - self.DIM9 = DIM9 - self.DIM10 = DIM10 - - # Ensure dimensions are physically relevant - np.testing.assert_((DIM4+DIM5+DIM6) < DIM1, "Invalid geometry specified.") - np.testing.assert_((DIM4+0.5*DIM5) < DIM3, "Invalid geometry specified.") - np.testing.assert_((DIM7+DIM8) < DIM2, "Invalid geometry specified.") - np.testing.assert_((DIM9+DIM10) < DIM2, "Invalid geometry specified.") - - # assign control point - control_points = [[0.5*DIM3, 0.5*DIM8]] - - shift = [-0.5*DIM1+shift[0], -0.5*DIM2+shift[1]] - super().__init__(control_points, shift) - - # specify a hole in the centre of the Box - d2 = 0.5*(DIM1 - DIM6 - DIM3 - 0.5*DIM5) - self.holes = [ - [DIM4 + 0.5*(DIM3 - DIM4 - 0.5*DIM5), DIM8 + 0.5*(DIM2 - DIM8 - DIM7)], - [DIM3 + 0.5*DIM5 + d2, DIM10 + 0.5*(DIM2 - DIM10 - DIM9)] - ] - - # construct the points and facets - self.points = [ - [0., 0.], [DIM1, 0.], [DIM1, DIM2], [0., DIM2], [DIM4, DIM8], [DIM3-DIM5/2., DIM8], - [DIM3-DIM5/2., DIM2-DIM7], [DIM4, DIM2-DIM7], [DIM3+DIM5/2., DIM10], - [DIM1-DIM6, DIM10], [DIM1-DIM6, DIM2-DIM9], [DIM3+DIM5/2., DIM2-DIM9] - ] - self.facets = [ - [0, 1], [1, 2], [2, 3], [3, 0], [4, 5], [5, 6], [6, 7], [7, 4], [8, 9], [9, 10], - [10, 11], [11, 8] - ] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """ - Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5 * self.DIM1 - shift[0], 0.5 * self.DIM2 - shift[1]) - D = (0.5 * self.DIM1 - shift[0], -0.5 * self.DIM2 - shift[1]) - E = (-0.5 * self.DIM1 - shift[0], -0.5 * self.DIM2 - shift[1]) - F = (-0.5 * self.DIM1 - shift[0], 0.5 * self.DIM2 - shift[1]) - - return C, D, E, F
- - -
[docs]class GBOXSection(Geometry): - """ Constructs a GBOX section with the center at the origin *(0, 0)*, with six parameters - defining dimensions. See ASTROS documentation [5]_ for more details. Added by JohnDN90. - - :param float DIM1: Width (x) of the GBOX-section - :param float DIM2: Depth (y) of the GBOX-section - :param float DIM3: Thickness of top flange - :param float DIM4: Thickness of bottom flange - :param float DIM5: Thickness of webs - :param float DIM6: Spacing between webs - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a GBOX cross-section with a depth of 2.5 and width of 6.0, and - generates a mesh with a maximum triangular area of 0.01:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.GBOXSection( - DIM1=6.0, DIM2=2.5, DIM3=0.375, DIM4=0.25, DIM5=0.625, DIM6=1.0 - ) - mesh = geometry.create_mesh(mesh_sizes=[0.01]) - - .. figure:: ../images/sections/gbox_geometry.png - :align: center - :scale: 75 % - - GBOX section geometry. - - .. figure:: ../images/sections/gbox_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, DIM5, DIM6, shift=[0, 0]): - """Inits the GBOXSection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - DIM5 *= 1.0 - DIM6 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - self.DIM5 = DIM5 - self.DIM6 = DIM6 - - # Ensure dimensions are physically relevant - np.testing.assert_((DIM3+DIM4) < DIM2, "Invalid geometry specified.") - np.testing.assert_((2.0*DIM5+DIM6) < DIM1, "Invalid geometry specified.") - - # assign control point - control_points = [[0.5*DIM1, 0.5*DIM4]] - - shift = [-(0.5*DIM1)+shift[0], -(DIM4 + 0.5*(DIM2-DIM3-DIM4))+shift[1]] - super().__init__(control_points, shift) - - # specify a hole in the centre of the GBOX - self.holes = [[0.5*DIM1, 0.5*DIM2]] - - # construct the points and facets - d = 0.5*(DIM1 - DIM6 - 2.0 * DIM5) - self.points = [ - [0., 0.], [DIM1, 0.], [DIM1, DIM4], [d + 2. * DIM5 + DIM6, DIM4], - [d + 2. * DIM5 + DIM6, DIM2 - DIM3], [DIM1, DIM2 - DIM3], [DIM1, DIM2], [0., DIM2], - [0., DIM2 - DIM3], [d, DIM2 - DIM3], [d, DIM4], [0., DIM4], [d + DIM5, DIM4], - [d + DIM5 + DIM6, DIM4], [d + DIM5 + DIM6, DIM2 - DIM3], [d + DIM5, DIM2 - DIM3] - ] - self.facets = [ - [0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], - [10, 11], [11, 0], [12, 13], [13, 14], [14, 15], [15, 12] - ] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5*self.DIM1-shift[0], 0.5*self.DIM2-shift[1]) - D = (0.5*self.DIM1-shift[0], -0.5*self.DIM2-shift[1]) - E = (-0.5*self.DIM1-shift[0], -0.5*self.DIM2-shift[1]) - F = (-0.5*self.DIM1-shift[0], 0.5*self.DIM2-shift[1]) - - return C, D, E, F
- - -
[docs]class HSection(Geometry): - """Constructs a H section with the middle web's middle center at the origin *(0, 0)*, with four - parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ for more details. - Added by JohnDN90. - - :param float DIM1: Spacing between vertical flanges (length of web) - :param float DIM2: Twice the thickness of the vertical flanges - :param float DIM3: Depth (y) of the H-section - :param float DIM4: Thickness of the middle web - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a H cross-section with a depth of 3.5 and width of 2.75, and - generates a mesh with a maximum triangular area of 0.005:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.HSection(DIM1=2.0, DIM2=0.75, DIM3=3.5, DIM4=0.25) - mesh = geometry.create_mesh(mesh_sizes=[0.005]) - - .. figure:: ../images/sections/h_geometry.png - :align: center - :scale: 75 % - - H section geometry. - - .. figure:: ../images/sections/h_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, shift=[0, 0]): - """Inits the HSection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - - # Ensure dimensions are physically relevant - np.testing.assert_(DIM4 < DIM3, "Invalid geometry specified.") - - d1 = 0.5 * (DIM3 - DIM4) - d2 = 0.5 * DIM2 - - # assign control point - control_points = [[0.5*d2, 0.5*DIM3]] - - shift = [-0.5*(DIM2+DIM1)+shift[0], -0.5*DIM3+shift[1]] - super().__init__(control_points, shift) - - # construct the points and facets - self.points = [ - [0, 0], [d2, 0], [d2, d1], [d2+DIM1, d1], [d2+DIM1, 0], [DIM1+DIM2, 0], - [DIM1+DIM2, DIM3], [DIM1+DIM2-d2, DIM3], [DIM1+DIM2-d2, d1+DIM4], [d2, d1+DIM4], - [d2, DIM3], [0, DIM3] - ] - self.facets = [ - [0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], - [10, 11], [11, 0] - ] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5*(self.DIM1+self.DIM2)-shift[0], 0.5*self.DIM3-shift[1]) - D = (0.5*(self.DIM1+self.DIM2)-shift[0], -0.5*self.DIM3-shift[1]) - E = (-0.5*(self.DIM1+self.DIM2)-shift[0], -0.5*self.DIM3-shift[1]) - F = (-0.5*(self.DIM1+self.DIM2)-shift[0], 0.5*self.DIM3-shift[1]) - - return C, D, E, F
- - -
[docs]class HATSection(Geometry): - """Constructs a Hat section with the top most section's middle center at the origin *(0, 0)*, - with four parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ for - more details. Note that HAT in ASTROS is actually HAT1 in this code. Added by JohnDN90. - - :param float DIM1: Depth (y) of HAT-section - :param float DIM2: Thickness of HAT-section - :param float DIM3: Width (x) of top most section - :param float DIM4: Width (x) of bottom sections - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a HAT cross-section with a depth of 1.25 and width of 2.5, and - generates a mesh with a maximum triangular area of 0.001:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.HATSection(DIM1=1.25, DIM2=0.25, DIM3=1.5, DIM4=0.5) - mesh = geometry.create_mesh(mesh_sizes=[0.001]) - - .. figure:: ../images/sections/hat_geometry.png - :align: center - :scale: 75 % - - HAT section geometry. - - .. figure:: ../images/sections/hat_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, shift=[0, 0]): - """Inits the HATSection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - - # Ensure dimensions are physically relevant - np.testing.assert_(2.0*DIM2 < DIM1, "Invalid geometry specified.") - - # assign control point - control_points = [[0.5*DIM4, 0.5*DIM2]] - - shift = [-DIM4-0.5*DIM3+shift[0], -DIM1+0.5*DIM2+shift[1]] - super().__init__(control_points, shift) - - # construct the points and facets - self.points = [ - [0., 0.], [DIM4+DIM2, 0.], [DIM4+DIM2, DIM1-DIM2], [DIM4+DIM3-DIM2, DIM1-DIM2], - [DIM4+DIM3-DIM2, 0.], [2*DIM4+DIM3, 0.], [2.*DIM4+DIM3, DIM2], [DIM4+DIM3, DIM2], - [DIM4+DIM3, DIM1], [DIM4, DIM1], [DIM4, DIM2], [0., DIM2] - ] - self.facets = [ - [0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], - [10, 11], [11, 0] - ] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the origin by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5*self.DIM3 - shift[0], 0.5*self.DIM2 - shift[1]) - D = (0.5*self.DIM3 + self.DIM4 - shift[0], -self.DIM1 + self.DIM2 - shift[1]) - E = (-0.5*self.DIM3 - self.DIM4 - shift[0], -self.DIM1 + self.DIM2 - shift[1]) - F = (-0.5*self.DIM3 - shift[0], 0.5*self.DIM2 - shift[1]) - - return C, D, E, F
- - -
[docs]class HAT1Section(Geometry): - """ Constructs a HAT1 section with the bottom plate's bottom center at the origin *(0, 0)*, - with five parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [5]_ for - definition of parameters. Note that in ASTROS, HAT1 is called HAT. Added by JohnDN90. - - :param float DIM1: Width(x) of the HAT1-section - :param float DIM2: Depth (y) of the HAT1-section - :param float DIM3: Width (x) of hat's top flange - :param float DIM4: Thickness of hat stiffener - :param float DIM5: Thicknesss of bottom plate - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a HAT1 cross-section with a depth of 2.0 and width of 4.0, and - generates a mesh with a maximum triangular area of 0.005:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.HAT1Section(DIM1=4.0, DIM2=2.0, DIM3=1.5, DIM4=0.1875, DIM5=0.375) - mesh = geometry.create_mesh(mesh_sizes=[0.005]) - - .. figure:: ../images/sections/hat1_geometry.png - :align: center - :scale: 75 % - - HAT1 section geometry. - - .. figure:: ../images/sections/hat1_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, DIM5, shift=[0, 0]): - """Inits the HAT1Section class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - DIM5 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - self.DIM5 = DIM5 - - # Ensure dimensions are physically relevant - np.testing.assert_((2.0*DIM4+DIM5) < DIM2, "Invalid geometry specified.") - np.testing.assert_(DIM3 < DIM1, "Invalid geometry specified.") - - shift = [-0.5*DIM1+shift[0], shift[1]] - - # create bottom rectangular plate - bottom_plate = RectangularSection(d=DIM5, b=DIM1, shift=shift) - - # create the hat stiffener - d1 = DIM2 - DIM5 - d2 = DIM4 - d4 = 0.5*(DIM1 - DIM3) - - # specify a hole in the combined plate and hat structure - holes = [[0.5*DIM1, 0.5*DIM2]] - - # assign control point - control_points = [[0.5*d4, DIM5 + 0.5*DIM4]] - - super().__init__(control_points, shift) - - # construct the points and facets - points = [ - [0., DIM5 + 0.], [d4 + d2, DIM5 + 0.], [d4 + d2, DIM5 + d1 - d2], - [d4 + DIM3 - d2, DIM5 + d1 - d2], [d4 + DIM3 - d2, DIM5 + 0.], - [2. * d4 + DIM3, DIM5 + 0.], [2. * d4 + DIM3, DIM5 + d2], [d4 + DIM3, DIM5 + d2], - [d4 + DIM3, DIM5 + d1], [d4, DIM5 + d1], [d4, DIM5 + d2], [0, DIM5 + d2] - ] - facets = [ - [0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], - [10, 11], [11, 0] - ] - - hat = CustomSection(points, facets, holes, control_points, shift=shift) - - # Create a list of the sections to merge - section_list = [bottom_plate, hat] - - # Merge the three sections into one geometry - geometry = MergedSection(section_list) - - # Clean the geometry and print information to the terminal - geometry.clean_geometry(verbose=False) - - self.control_points = geometry.control_points - self.shift = geometry.shift - self.points = geometry.points - self.facets = geometry.facets - self.holes = geometry.holes - -
[docs] def create_mesh(self, mesh_sizes): - """Creates a quadratic triangular mesh from the Geometry object. This is overloaded here to - allow specifying only one mesh_size which is used for both regions in the Hat1 section. - - :param mesh_sizes: A list of maximum element areas corresponding to each region within the - cross-section geometry. - :type mesh_size: list[float] - - :return: Object containing generated mesh data - :rtype: :class:`meshpy.triangle.MeshInfo` - - :raises AssertionError: If the number of mesh sizes does not match the number of regions - """ - - mesh_sizes *= 2 - - str = "Number of mesh_sizes ({0}), should match the number of regions ({1})".format( - len(mesh_sizes), len(self.control_points) - ) - assert(len(mesh_sizes) == len(self.control_points)), str - - return create_mesh(self.points, self.facets, self.holes, self.control_points, mesh_sizes)
- -
[docs] def getStressPoints(self, shift=(0., 0.)): - """ Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the origin by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (-0.5*self.DIM1 - shift[0], -shift[1]) - D = (0.5*self.DIM1 - shift[0], -shift[1]) - E = (-0.5*self.DIM3 - shift[0], self.DIM2 - shift[1]) - F = (0.5*self.DIM3 - shift[0], self.DIM2 - shift[1]) - - return C, D, E, F
- - -
[docs]class HEXASection(Geometry): - """ Constructs a HEXA (hexagon) section with the center at the origin *(0, 0)*, with three - parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ for more details. - Added by JohnDN90. - - :param float DIM1: Spacing between bottom right point and right most point - :param float DIM2: Width (x) of hexagon - :param float DIM3: Depth (y) of hexagon - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a rectangular cross-section with a depth of 1.5 and width of 2.0, - and generates a mesh with a maximum triangular area of 0.005:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.HEXASection(DIM1=0.5, DIM2=2.0, DIM3=1.5) - mesh = geometry.create_mesh(mesh_sizes=[0.005]) - - .. figure:: ../images/sections/hexa_geometry.png - :align: center - :scale: 75 % - - HEXA section geometry. - - .. figure:: ../images/sections/hexa_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, shift=[0, 0]): - """Inits the HEXASection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - - # Ensure dimensions are physically relevant - np.testing.assert_(DIM2 > DIM1, "Invalid geometry specified.") - - # assign control point - control_points = [[0.5*DIM2, 0.5*DIM3]] - - shift = [-0.5*DIM2+shift[0], -0.5*DIM3+shift[1]] - super().__init__(control_points, shift) - - # construct the points and facets - self.points = [ - [DIM1, 0.], [DIM2-DIM1, 0.], [DIM2, 0.5*DIM3], [DIM2-DIM1, DIM3], [DIM1, DIM3], - [0., 0.5*DIM3] - ] - self.facets = [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 0]] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (-shift[0], 0.5*self.DIM3-shift[1]) - D = (-shift[0], -0.5*self.DIM3-shift[1]) - E = (0.5*self.DIM2-shift[0], -shift[1]) - F = (-0.5*self.DIM2-shift[0], -shift[1]) - - return C, D, E, F
- - -
[docs]class NISection(Geometry): - """Constructs Nastran's I section with the bottom flange's middle center at the origin - *(0, 0)*, with six parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ - [4]_ for definition of parameters. Added by JohnDN90. - - :param float DIM1: Depth(y) of the I-section - :param float DIM2: Width (x) of bottom flange - :param float DIM3: Width (x) of top flange - :param float DIM4: Thickness of web - :param float DIM5: Thickness of bottom web - :param float DIM6: Thickness of top web - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a Nastran I cross-section with a depth of 5.0, and generates a - mesh with a maximum triangular area of 0.008:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.NISection( - DIM1=5.0, DIM2=2.0, DIM3=3.0, DIM4=0.25, DIM5=0.375, DIM6=0.5 - ) - mesh = geometry.create_mesh(mesh_sizes=[0.008]) - - .. figure:: ../images/sections/ni_geometry.png - :align: center - :scale: 75 % - - Nastran's I section geometry. - - .. figure:: ../images/sections/ni_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, DIM5, DIM6, shift=[0, 0]): - """Inits the NISection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - DIM5 *= 1.0 - DIM6 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - self.DIM5 = DIM5 - self.DIM6 = DIM6 - - # Ensure dimensions are physically relevant - np.testing.assert_((DIM5 + DIM6) < DIM1, "Invalid geometry specified.") - np.testing.assert_(DIM4 < DIM3, "Invalid geometry specified.") - np.testing.assert_(DIM4 < DIM2, "Invalid geometry specified.") - - # assign control point - control_points = [[0.5*DIM2, 0.5*DIM5]] - - shift = [-0.5*DIM2+shift[0], -0.5*DIM1+shift[1]] - super().__init__(control_points, shift) - - # construct the points and facets - db = 0.5*(DIM2 - DIM4) - dt = 0.5*(DIM3 - DIM4) - self.points = [ - [0., 0.], [DIM2, 0.], [DIM2, DIM5], [db+DIM4, DIM5], [db + DIM4, DIM1-DIM6], - [db+DIM4+dt, DIM1-DIM6], [db+DIM4+dt, DIM1], [db-dt, DIM1], [db-dt, DIM1-DIM6], - [db, DIM1-DIM6], [db, DIM5], [0, DIM5] - ] - self.facets = [ - [0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], - [10, 11], [11, 0] - ] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5*self.DIM3-shift[0], 0.5*self.DIM1-shift[1]) - D = (0.5*self.DIM3-shift[0], -0.5*self.DIM1-shift[1]) - E = (-0.5*self.DIM3-shift[0], -0.5*self.DIM1-shift[1]) - F = (-0.5*self.DIM3-shift[0], 0.5*self.DIM1-shift[1]) - - return C, D, E, F
- - -
[docs]class I1Section(Geometry): - """Constructs a I1 section with the web's middle center at the origin *(0, 0)*, with four - parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ for more details. - Added by JohnDN90. - - :param float DIM1: Twice distance from web end to flange end - :param float DIM2: Thickness of web - :param float DIM3: Length of web (spacing between flanges) - :param float DIM4: Depth (y) of the I1-section - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a I1 cross-section with a depth of - 5.0 and width of 1.75, and generates a mesh with a maximum triangular area of - 0.02:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.I1Section(DIM1=1.0, DIM2=0.75, DIM3=4.0, DIM4=5.0) - mesh = geometry.create_mesh(mesh_sizes=[0.02]) - - .. figure:: ../images/sections/i1_geometry.png - :align: center - :scale: 75 % - - I1 section geometry. - - .. figure:: ../images/sections/i1_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, shift=[0, 0]): - """Inits the I1section class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - - # Ensure dimensions are physically relevant - np.testing.assert_(DIM4 > DIM3, "Invalid geometry specified.") - - shift = [-0.5*(DIM1+DIM2)+shift[0], -0.5*DIM4+shift[1]] - - # assign control point - control_points = [[0.5*(DIM1+DIM2), 0.5*DIM4]] - - super().__init__(control_points, shift) - - # construct the points and facets - t = 0.5*(DIM4 - DIM3) - self.points = [ - [0., 0.], [DIM1+DIM2, 0.], [DIM1+DIM2, t], [0.5*DIM1+DIM2, t], [0.5*DIM1+DIM2, t+DIM3], - [DIM1+DIM2, t+DIM3], [DIM1+DIM2, DIM4], [0., DIM4], [0., t+DIM3], [0.5*DIM1, t+DIM3], - [0.5*DIM1, t], [0., t] - ] - self.facets = [ - [0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], - [10, 11], [11, 0] - ] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5*(self.DIM1+self.DIM2)-shift[0], 0.5*self.DIM4-shift[1]) - D = (0.5*(self.DIM1+self.DIM2)-shift[0], -0.5*self.DIM4-shift[1]) - E = (-0.5*(self.DIM1+self.DIM2)-shift[0], -0.5*self.DIM4-shift[1]) - F = (-0.5*(self.DIM1+self.DIM2)-shift[0], 0.5*self.DIM4-shift[1]) - - return C, D, E, F
- - -
[docs]class LSection(Geometry): - """Constructs a L section with the intersection's center at the origin *(0, 0)*, with four - parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ for more details. - Added by JohnDN90. - - :param float DIM1: Width (x) of the L-section - :param float DIM2: Depth (y) of the L-section - :param float DIM3: Thickness of flange (horizontal portion) - :param float DIM4: Thickness of web (vertical portion) - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a L cross-section with a depth of 6.0 and width of 3.0, and - generates a mesh with a maximum triangular area of 0.01:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.LSection(DIM1=3.0, DIM2=6.0, DIM3=0.375, DIM4=0.625) - mesh = geometry.create_mesh(mesh_sizes=[0.01]) - - .. figure:: ../images/sections/l_geometry.png - :align: center - :scale: 75 % - - L section geometry. - - .. figure:: ../images/sections/l_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, shift=[0, 0]): - """Inits the LSection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - - # Ensure dimensions are physically relevant - np.testing.assert_(DIM4 < DIM1, "Invalid geometry specified.") - np.testing.assert_(DIM3 < DIM2, "Invalid geometry specified.") - - # assign control point - control_points = [[0.5*DIM1, 0.5*DIM3]] - - shift = [-0.5*DIM4+shift[0], -0.5*DIM3+shift[1]] - super().__init__(control_points, shift) - - # construct the points and facets - self.points = [[0, 0], [DIM1, 0], [DIM1, DIM3], [DIM4, DIM3], [DIM4, DIM2], [0, DIM2]] - self.facets = [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 0]] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5*self.DIM4-shift[0], self.DIM2-0.5*self.DIM3-shift[1]) - D = (self.DIM1-0.5*self.DIM4-shift[0], -0.5*self.DIM3-shift[1]) - E = (-0.5*self.DIM4-shift[0], -0.5*self.DIM3-shift[1]) - F = (-0.5*self.DIM4-shift[0], self.DIM2-0.5*self.DIM3-shift[1]) - - return C, D, E, F
- - -
[docs]class RODSection(Geometry): - """Constructs a circular rod section with the center at the origin *(0, 0)*, with one parameter - defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ for more details. Added by - JohnDN90. - - :param float DIM1: Radius of the circular rod section - :param int n: Number of points discretising the circle - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a circular rod with a radius of 3.0 and 50 points discretizing - the boundary, and generates a mesh with a maximum triangular area of 0.01:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.RODSection(DIM1=3.0, n=50) - mesh = geometry.create_mesh(mesh_sizes=[0.01]) - - .. figure:: ../images/sections/rod_geometry.png - :align: center - :scale: 75 % - - Rod section geometry. - - .. figure:: ../images/sections/rod_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, n, shift=[0, 0]): - """Inits the RODSection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - self.DIM1 = DIM1 - - # assign control point - control_points = [[0, 0]] - - super().__init__(control_points, shift) - - # loop through each point on the circle - d = 2.0*DIM1 - - for i in range(n): - # determine polar angle - theta = i * 2 * np.pi * 1.0 / n - - # calculate location of the point - x = 0.5 * d * np.cos(theta) - y = 0.5 * d * np.sin(theta) - - # append the current point to the points list - self.points.append([x, y]) - - # if we are not at the last point - if i != n - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the circle - else: - self.facets.append([i, 0]) - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param float DIM1: Radius of the circular rod section - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (-shift[0], self.DIM1-shift[1]) - D = (self.DIM1-shift[0], -shift[1]) - E = (-shift[0], -self.DIM1-shift[1]) - F = (-self.DIM1-shift[0], -shift[1]) - - return C, D, E, F
- - -
[docs]class TSection(Geometry): - """Constructs a T section with the top flange's middle center at the origin *(0, 0)*, with four - parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ [5]_ for more - details. Added by JohnDN90. - - :param float DIM1: Width (x) of top flange - :param float DIM2: Depth (y) of the T-section - :param float DIM3: Thickness of top flange - :param float DIM4: Thickness of web - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a T cross-section with a depth of 4.0 and width of 3.0, and - generates a mesh with a maximum triangular area of 0.001:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.TSection(DIM1=3.0, DIM2=4.0, DIM3=0.375, DIM4=0.25) - mesh = geometry.create_mesh(mesh_sizes=[0.001]) - - .. figure:: ../images/sections/t_geometry.png - :align: center - :scale: 75 % - - T section geometry. - - .. figure:: ../images/sections/t_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, shift=[0, 0]): - """Inits the TSection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - - # Ensure dimensions are physically relevant - np.testing.assert_(DIM4 < DIM1, "Invalid geometry specified.") - np.testing.assert_(DIM3 < DIM2, "Invalid geometry specified.") - - d = DIM2 - b = DIM1 - t_f = DIM3 - t_w = DIM4 - r = 0 - n_r = 1 - shift = [-DIM1/2.0+shift[0], -(DIM2-DIM3/2.0)+shift[1]] - - # assign control point - control_points = [[b * 0.5, d - t_f * 0.5]] - - super().__init__(control_points, shift) - - # add first two points - self.points.append([b * 0.5 - t_w * 0.5, 0]) - self.points.append([b * 0.5 + t_w * 0.5, 0]) - - # construct the top right radius - pt = [b * 0.5 + t_w * 0.5 + r, d - t_f - r] - self.draw_radius(pt, r, np.pi, n_r, False) - - # add next four points - self.points.append([b, d - t_f]) - self.points.append([b, d]) - self.points.append([0, d]) - self.points.append([0, d - t_f]) - - # construct the top left radius - pt = [b * 0.5 - t_w * 0.5 - r, d - t_f - r] - self.draw_radius(pt, r, 0.5 * np.pi, n_r, False) - - # build the facet list - for i in range(len(self.points)): - # if we are not at the last point - if i != len(self.points) - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the loop - else: - self.facets.append([len(self.points) - 1, 0]) - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """ - Returns the coordinates of the stress evaluation points relative to the origin - of the cross-section. The shift parameter can be used to make the coordinates - relative to the centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (-shift[0], 0.5*self.DIM3-shift[1]) - D = (0.5*self.DIM1-shift[0], 0.5*self.DIM3-shift[1]) - E = (-shift[0], 0.5*self.DIM3-self.DIM2-shift[1]) - F = (-0.5*self.DIM1-shift[0], 0.5*self.DIM3-shift[1]) - - return C, D, E, F
- - -
[docs]class T1Section(Geometry): - """Constructs a T1 section with the right flange's middle center at the origin *(0, 0)*, with - four parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ for more - details. Added by JohnDN90. - - :param float DIM1: Depth (y) of T1-section - :param float DIM2: Length (x) of web - :param float DIM3: Thickness of right flange - :param float DIM4: Thickness of web - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a T1 cross-section with a depth of 3.0 and width of 3.875, and - generates a mesh with a maximum triangular area of 0.001:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.T1Section(DIM1=3.0, DIM2=3.5, DIM3=0.375, DIM4=0.25) - mesh = geometry.create_mesh(mesh_sizes=[0.001]) - - .. figure:: ../images/sections/t1_geometry.png - :align: center - :scale: 75 % - - T1 section geometry. - - .. figure:: ../images/sections/t1_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, shift=[0, 0]): - """Inits the T1section class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - - # Ensure dimensions are physically relevant - np.testing.assert_(DIM4 < DIM1, "Invalid geometry specified.") - - shift = [-0.5*DIM3+shift[0], -0.5*DIM1+shift[1]] - - # assign control point - control_points = [[0.5*DIM3, 0.5*DIM1]] - - super().__init__(control_points, shift) - - # construct the points and facets - d1 = (DIM1 - DIM4) / 2.0 - self.points = [ - [0, 0], [DIM3, 0], [DIM3, DIM1], [0, DIM1], [0, d1 + DIM4], [-DIM2, d1 + DIM4], - [-DIM2, d1], [0, d1] - ] - self.facets = [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 0]] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5*self.DIM3-shift[0], -shift[1]) - D = (0.5*self.DIM3-shift[0], -0.5*self.DIM1-shift[1]) - E = (-0.5*self.DIM3-self.DIM2-shift[0], -shift[1]) - F = (0.5*self.DIM3-shift[0], 0.5*self.DIM1-shift[1]) - - return C, D, E, F
- - -
[docs]class T2Section(Geometry): - """Constructs a T2 section with the bottom flange's middle center at the origin *(0, 0)*, with - four parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ for more - details. Added by JohnDN90. - - :param float DIM1: Width (x) of T2-section - :param float DIM2: Depth (y) of T2-section - :param float DIM3: Thickness of bottom flange - :param float DIM4: Thickness of web - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a T2 cross-section with a depth of 4.0 and width of 3.0, and - generates a mesh with a maximum triangular area of 0.005:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.T2Section(DIM1=3.0, DIM2=4.0, DIM3=0.375, DIM4=0.5) - mesh = geometry.create_mesh(mesh_sizes=[0.005]) - - .. figure:: ../images/sections/t2_geometry.png - :align: center - :scale: 75 % - - T2 section geometry. - - .. figure:: ../images/sections/t2_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, shift=[0, 0]): - """Inits the T2Section class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - - # Ensure dimensions are physically relevant - np.testing.assert_(DIM4 < DIM1, "Invalid geometry specified.") - np.testing.assert_(DIM3 < DIM2, "Invalid geometry specified.") - - # assign control point - control_points = [[0.5*DIM1, 0.5*DIM3]] - - shift = [-0.5*DIM1+shift[0], -0.5*DIM3+shift[1]] - super().__init__(control_points, shift) - - # construct the points and facets - d1 = 0.5*(DIM1 - DIM4) - self.points = [ - [0., 0.], [DIM1, 0.], [DIM1, DIM3], [DIM1-d1, DIM3], [DIM1-d1, DIM2], [d1, DIM2], - [d1, DIM3], [0, DIM3] - ] - self.facets = [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 0]] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5*self.DIM4-shift[0], self.DIM2-0.5*self.DIM3-shift[1]) - D = (0.5*self.DIM1-shift[0], -0.5*self.DIM3-shift[1]) - E = (-0.5*self.DIM1-shift[0], -0.5*self.DIM3-shift[1]) - F = (-0.5*self.DIM4-shift[0], self.DIM2-0.5*self.DIM3-shift[1]) - - return C, D, E, F
- - -
[docs]class TUBESection(Geometry): - """Constructs a circular tube section with the center at the origin *(0, 0)*, with two - parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ for more - details. Added by JohnDN90. - - :param float DIM1: Outer radius of the circular tube section - :param float DIM2: Inner radius of the circular tube section - :param int n: Number of points discretising the circle - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a circular tube cross-section with an outer radius of 3.0 and an - inner radius of 2.5, and generates a mesh with 37 points discretizing the boundaries and a - maximum triangular area of 0.01:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.TUBESection(DIM1=3.0, DIM2=2.5, n=37) - mesh = geometry.create_mesh(mesh_sizes=[0.01]) - - .. figure:: ../images/sections/tube_geometry.png - :align: center - :scale: 75 % - - TUBE section geometry. - - .. figure:: ../images/sections/tube_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, n, shift=[0, 0]): - """Inits the TUBESection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - - # Ensure dimensions are physically relevant - np.testing.assert_(DIM2 < DIM1, "Invalid geometry specified.") - - d = 2.0*DIM1 - t = DIM1-DIM2 - - # assign control point - control_points = [[d * 0.5 - t * 0.5, 0]] - - super().__init__(control_points, shift) - - # specify a hole in the centre of the CHS - self.holes = [[0., 0.]] - - # loop through each point of the CHS - for i in range(n): - # determine polar angle - theta = i * 2 * np.pi * 1.0 / n - - # calculate location of outer and inner points - x_outer = 0.5 * d * np.cos(theta) - y_outer = 0.5 * d * np.sin(theta) - x_inner = (0.5 * d - t) * np.cos(theta) - y_inner = (0.5 * d - t) * np.sin(theta) - - # append the current points to the points list - self.points.append([x_outer, y_outer]) - self.points.append([x_inner, y_inner]) - - # if we are not at the last point - if i != n - 1: - self.facets.append([i * 2, i * 2 + 2]) - self.facets.append([i * 2 + 1, i * 2 + 3]) - # if we are at the last point, complete the circle - else: - self.facets.append([i * 2, 0]) - self.facets.append([i * 2 + 1, 1]) - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (-shift[0], self.DIM1-shift[1]) - D = (self.DIM1-shift[0], -shift[1]) - E = (-shift[0], -self.DIM1-shift[1]) - F = (-self.DIM1-shift[0], -shift[1]) - - return C, D, E, F
- - -
[docs]class TUBE2Section(Geometry): - """Constructs a circular TUBE2 section with the center at the origin *(0, 0)*, with two - parameters defining dimensions. See MSC Nastran documentation [1]_ for more details. Added by - JohnDN90. - - :param float DIM1: Outer radius of the circular tube section - :param float DIM2: Thickness of wall - :param int n: Number of points discretising the circle - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a ciruclar TUBE2 cross-section with an outer radius of 3.0 and a - wall thickness of 0.5, and generates a mesh with 37 point discritizing the boundary and a - maximum triangular area of 0.01:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.TUBE2Section(DIM1=3.0, DIM2=0.5, n=37) - mesh = geometry.create_mesh(mesh_sizes=[0.01]) - - .. figure:: ../images/sections/tube2_geometry.png - :align: center - :scale: 75 % - - TUBE2 section geometry. - - .. figure:: ../images/sections/tube2_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, n, shift=[0, 0]): - """Inits the TUBE2Section class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - - # Ensure dimensions are physically relevant - np.testing.assert_(DIM2 < DIM1, "Invalid geometry specified.") - - d = 2.0*DIM1 - t = DIM2 - - # assign control point - control_points = [[d * 0.5 - t * 0.5, 0]] - - super().__init__(control_points, shift) - - # specify a hole in the centre of the section - self.holes = [[0., 0.]] - - # loop through each point of the section - for i in range(n): - # determine polar angle - theta = i * 2 * np.pi * 1.0 / n - - # calculate location of outer and inner points - x_outer = 0.5 * d * np.cos(theta) - y_outer = 0.5 * d * np.sin(theta) - x_inner = (0.5 * d - t) * np.cos(theta) - y_inner = (0.5 * d - t) * np.sin(theta) - - # append the current points to the points list - self.points.append([x_outer, y_outer]) - self.points.append([x_inner, y_inner]) - - # if we are not at the last point - if i != n - 1: - self.facets.append([i * 2, i * 2 + 2]) - self.facets.append([i * 2 + 1, i * 2 + 3]) - # if we are at the last point, complete the circle - else: - self.facets.append([i * 2, 0]) - self.facets.append([i * 2 + 1, 1]) - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (-shift[0], self.DIM1-shift[1]) - D = (self.DIM1-shift[0], -shift[1]) - E = (-shift[0], -self.DIM1-shift[1]) - F = (-self.DIM1-shift[0], -shift[1]) - - return C, D, E, F
- - -
[docs]class ZSection(Geometry): - """Constructs a Z section with the web's middle center at the origin *(0, 0)*, with four - parameters defining dimensions. See Nastran documentation [1]_ [2]_ [3]_ [4]_ for more details. - Added by JohnDN90. - - :param float DIM1: Width (x) of horizontal members - :param float DIM2: Thickness of web - :param float DIM3: Spacing between horizontal members (length of web) - :param float DIM4: Depth (y) of Z-section - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a rectangular cross-section with a depth of 4.0 and width of - 2.75, and generates a mesh with a maximum triangular area of 0.005:: - - import sectionproperties.pre.nastran_sections as nsections - - geometry = nsections.ZSection(DIM1=1.125, DIM2=0.5, DIM3=3.5, DIM4=4.0) - mesh = geometry.create_mesh(mesh_sizes=[0.005]) - - .. figure:: ../images/sections/z_geometry.png - :align: center - :scale: 75 % - - Z section geometry. - - .. figure:: ../images/sections/z_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, DIM1, DIM2, DIM3, DIM4, shift=[0, 0]): - """Inits the ZSection class.""" - - # force dimensions to be floating point values - DIM1 *= 1.0 - DIM2 *= 1.0 - DIM3 *= 1.0 - DIM4 *= 1.0 - self.DIM1 = DIM1 - self.DIM2 = DIM2 - self.DIM3 = DIM3 - self.DIM4 = DIM4 - - # Ensure dimensions are physically relevant - np.testing.assert_(DIM4 > DIM3, "Invalid geometry specified.") - - # assign control point - control_points = [[DIM1+0.5*DIM2, 0.5*DIM4]] - - shift = [-0.5*(DIM1+DIM2)+shift[0], -0.5*DIM4+shift[1]] - super().__init__(control_points, shift) - - # construct the points and facets - t = 0.5*(DIM4 - DIM3) - self.points = [ - [DIM1, 0.], [2.*DIM1+DIM2, 0.], [2.*DIM1+DIM2, t], [DIM1+DIM2, t], [DIM1+DIM2, DIM4], - [0., DIM4], [0., DIM4-t], [DIM1, DIM4-t] - ] - self.facets = [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 0]] - - self.shift_section() - -
[docs] def getStressPoints(self, shift=(0., 0.)): - """Returns the coordinates of the stress evaluation points relative to the origin of the - cross-section. The shift parameter can be used to make the coordinates relative to the - centroid or the shear center. - - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: tuple(float, float) - :returns: Stress evaluation points relative to shifted origin - C, D, E, F - """ - - C = (0.5*self.DIM2-shift[0], 0.5*self.DIM4-shift[1]) - D = (0.5*self.DIM2+self.DIM1-shift[0], -0.5*self.DIM4-shift[1]) - E = (-0.5*self.DIM2-shift[0], -0.5*self.DIM4-shift[1]) - F = (-0.5*self.DIM2-self.DIM1-shift[0], 0.5*self.DIM4-shift[1]) - - return C, D, E, F
-
- -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/_modules/sectionproperties/pre/pre.html b/docs/build/html/_modules/sectionproperties/pre/pre.html deleted file mode 100644 index 0d0e8752..00000000 --- a/docs/build/html/_modules/sectionproperties/pre/pre.html +++ /dev/null @@ -1,746 +0,0 @@ - - - - - - - - - - - sectionproperties.pre.pre — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- -
    - -
  • Docs »
  • - -
  • Module code »
  • - -
  • sectionproperties.pre.pre
  • - - -
  • - -
  • - -
- - -
-
-
-
- -

Source code for sectionproperties.pre.pre

-import numpy as np
-import meshpy.triangle as triangle
-
-
-
[docs]class Material: - """Class for structural materials. - - Provides a way of storing material properties related to a specific material. The color can be - a multitude of different formats, refer to https://matplotlib.org/api/colors_api.html and - https://matplotlib.org/examples/color/named_colors.html for more information. - - :param string name: Material name - :param float elastic_modulus: Material modulus of elasticity - :param float poissons_ratio: Material Poisson's ratio - :param float yield_strength: Material yield strength - :param color: Material color for rendering - :type color: :class:`matplotlib.colors` - - :cvar string name: Material name - :cvar float elastic_modulus: Material modulus of elasticity - :cvar float poissons_ratio: Material Poisson's ratio - :cvar float shear_modulus: Material shear modulus, derived from the elastic modulus and - Poisson's ratio assuming an isotropic material - :cvar float yield_strength: Material yield strength - :cvar color: Material color for rendering - :vartype color: :class:`matplotlib.colors` - - The following example creates materials for concrete, steel and timber:: - - from sectionproperties.pre.pre import Material - - concrete = Material( - name='Concrete', elastic_modulus=30.1e3, poissons_ratio=0.2, yield_strength=32, - color='lightgrey' - ) - steel = Material( - name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500, - color='grey' - ) - timber = Material( - name='Timber', elastic_modulus=8e3, poissons_ratio=0.35, yield_strength=20, - color='burlywood' - ) - """ - - def __init__(self, name, elastic_modulus, poissons_ratio, yield_strength, - color='w'): - """Inits the Material class""" - - self.name = name - self.elastic_modulus = elastic_modulus - self.poissons_ratio = poissons_ratio - self.shear_modulus = elastic_modulus / (2 * (1 + poissons_ratio)) - self.yield_strength = yield_strength - self.color = color
- - -
[docs]class GeometryCleaner: - """Class for cleaning :class:`~sectionproperties.pre.sections.Geometry` objects. - - :param geometry: Geometry object to clean - :type geometry: :class:`~sectionproperties.pre.sections.Geometry` - :param bool verbose: If set to true, information related to the geometry cleaning process is - printed to the terminal. - - Provides methods to clean various aspects of the geometry including: - - * Zipping nodes - Find nodes that are close together (relative and absolute tolerance) and - deletes one of the nodes and rejoins the facets to the remaining node. - * Removing zero length facets - Removes facets that start and end at the same point. - * Remove duplicate facets - Removes facets that have the same starting and ending point as an - existing facet. - * Removing overlapping facets - Searches for facets that overlap each other, given a tolerance - angle, and reconstructs a unique set of facets along the overlapping region. - * Remove unused points - Removes points that are not connected to any facets. - * Intersect facets - Searches for intersections between two facets and adds the intersection - point to the points list and splits the intersected facets. - - Note that a geometry cleaning method is provided to all - :class:`~sectionproperties.pre.sections.Geometry` objects. - - :cvar geometry: Geometry object to clean - :vartype geometry: :class:`~sectionproperties.pre.sections.Geometry` - :cvar bool verbose: If set to true, information related to the geometry cleaning process is - printed to the terminal. - - The following example creates a back-to-back 200PFC geometry, rotates the geometry by 30 - degrees, and cleans the geometry before meshing:: - - import sectionproperties.pre.sections as sections - - pfc_right = sections.PfcSection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8) - pfc_left = sections.PfcSection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8) - pfc_left.mirror_section(axis='y', mirror_point=[0, 0]) - geometry = sections.MergedSection([pfc_left, pfc_right]) - geometry.rotate_section(angle=30) - geometry.clean_geometry(verbose=True) - mesh = geometry.create_mesh(mesh_sizes=[5, 5]) - - .. warning:: If the geometry were not cleaned in the previous example, the meshing algorithm - would crash (most likely return a segment error). Cleaning the geometry is always recommended - when creating a merged section, which may result in overlapping or intersecting facets, or - duplicate nodes. - """ - - def __init__(self, geometry, verbose): - """Inits the GeometryCleaner class.""" - - self.geometry = geometry - self.verbose = verbose - -
[docs] def clean_geometry(self): - """Performs a full geometry clean on the `geometry` object.""" - - self.zip_points() - self.remove_zero_length_facets() - self.remove_duplicate_facets() - self.remove_overlapping_facets() - self.remove_unused_points() - self.intersect_facets() - - return self.geometry
- -
[docs] def zip_points(self, atol=1e-8, rtol=1e-5): - """Zips points that are close to each other. Searches through the point list and merges two - points if there are deemed to be sufficiently close. The average value of the coordinates - is used for the new point. One of the points is deleted from the point list and the facet - list is updated to remove references to the old points and renumber the remaining point - indices in the facet list. - - :param float atol: Absolute tolerance for point zipping - :param float rtol: Relative tolerance (to geometry extents) for point zipping - """ - - idx_to_remove = [] - - # determine rtol - (x_min, x_max, y_min, y_max) = self.geometry.calculate_extents() - geom_range = max(x_max - x_min, y_max - y_min) - rel_tol = rtol * geom_range - - # loop through the list of points - for (i, pt1) in enumerate(self.geometry.points): - # check all other points - for (j, pt2) in enumerate(self.geometry.points[i + 1:]): - # get point indices - idx_1 = i - idx_2 = i + j + 1 - - # determine distance between two points - dist = ((pt2[0] - pt1[0]) ** 2 + (pt2[1] - pt1[1]) ** 2) ** 0.5 - - # if the points are close together and the point has not already been removed - if (dist < atol or dist < rel_tol) and idx_2 not in idx_to_remove: - # update point1 (average of point1 + point2) - pt1[0] = 0.5 * (pt1[0] + pt2[0]) - pt1[1] = 0.5 * (pt1[1] + pt2[1]) - - # join facets connected to pt2 to pt1 instead - self.replace_point_id(idx_2, idx_1) - - # add pt2 to the list of points to remove - idx_to_remove.append(idx_2) - - if self.verbose: - str = "Zipped point {0} to point {1}".format(idx_2, idx_1) - print(str) - - # sort list of indices to remove in reverse order so as not to comprimise the indices - idx_to_remove = sorted(idx_to_remove, reverse=True) - - for idx in idx_to_remove: - self.remove_point_id(idx)
- -
[docs] def remove_zero_length_facets(self): - """Searches through all facets and removes those that have the same starting and ending - point.""" - - idx_to_remove = [] - - # loop through the list of facets - for (idx, fct) in enumerate(self.geometry.facets): - if fct[0] == fct[1]: - idx_to_remove.append(idx) - - # sort list of indices to remove in reverse order so as not to comprimise the indices - idx_to_remove = sorted(idx_to_remove, reverse=True) - - for idx in idx_to_remove: - self.geometry.facets.pop(idx) - - if self.verbose: - print("Removed zero length facet {0}".format(idx))
- -
[docs] def remove_overlapping_facets(self): - """Searches through all facet combinations and fixes facets that overlap within a - tolerance.""" - - cleaning = True - - while cleaning: - # loop through the list of facets - for (i, fct1) in enumerate(self.geometry.facets): - broken = False - - # check all other facets - for (j, fct2) in enumerate(self.geometry.facets[i + 1:]): - # get facet indices - idx_1 = i - idx_2 = i + j + 1 - - # get facets points - # facet 1: p -> p + r - p = np.array(self.geometry.points[fct1[0]]) - r = self.geometry.points[fct1[1]] - p - - # facet 2: q -> q + s - q = np.array(self.geometry.points[fct2[0]]) - s = self.geometry.points[fct2[1]] - q - - pts = self.is_overlap(p, q, r, s, fct1, fct2) - - if pts is not None: - # delete both facets - idx_to_remove = sorted([idx_1, idx_2], reverse=True) - for idx in idx_to_remove: - self.geometry.facets.pop(idx) - - # add new facets - for i in range(len(pts) - 1): - self.geometry.facets.append([pts[i], pts[i + 1]]) - - # remove duplicate facets - self.remove_duplicate_facets() - - if self.verbose: - str = "Removed overlapping facets {0}...".format(idx_to_remove) - str += "Rebuilt with points: {0}".format(pts) - print(str) - - # break both loops and loop through all facets again - broken = True - break - - if broken: - break - - # if we've arrived at the end without detecting any overlaps - if not broken: - cleaning = False
- -
[docs] def remove_unused_points(self): - """Searches through all facets and removes points that are not connected to any facets.""" - - idx_to_remove = [] - facet_flattened = [i for fct in self.geometry.facets for i in fct] - - # loop through number of points - for pt in range(len(self.geometry.points)): - if pt not in facet_flattened: - idx_to_remove.append(pt) - - if self.verbose: - print("Removed unused point {0}".format(pt)) - - # sort list of indices to remove in reverse order so as not to comprimise the indices - idx_to_remove = sorted(idx_to_remove, reverse=True) - - for idx in idx_to_remove: - self.remove_point_id(idx)
- -
[docs] def intersect_facets(self): - """Searches through all facet combinations and finds facets that intersect each other. The - intersection point is added and the facets rebuilt.""" - - cleaning = True - - while cleaning: - # loop through the list of facets - for (i, fct1) in enumerate(self.geometry.facets): - broken = False - - # check all other facets - for (j, fct2) in enumerate(self.geometry.facets[i + 1:]): - # get facet indices - idx_1 = i - idx_2 = i + j + 1 - - # get facets points - # facet 1: p -> p + r - p = np.array(self.geometry.points[fct1[0]]) - r = self.geometry.points[fct1[1]] - p - - # facet 2: q -> q + s - q = np.array(self.geometry.points[fct2[0]]) - s = self.geometry.points[fct2[1]] - q - - pt = self.is_intersect(p, q, r, s) - - if pt is not None: - # add point - self.geometry.points.append([pt[0], pt[1]]) - pt_idx = len(self.geometry.points) - 1 - - # delete both facets - idx_to_remove = sorted([idx_1, idx_2], reverse=True) - for idx in idx_to_remove: - self.geometry.facets.pop(idx) - - # rebuild facet 1 - self.geometry.facets.append([fct1[0], pt_idx]) - self.geometry.facets.append([pt_idx, fct1[1]]) - - # rebuild facet 2 - self.geometry.facets.append([fct2[0], pt_idx]) - self.geometry.facets.append([pt_idx, fct2[1]]) - - if self.verbose: - str = "Intersected facets" - str += " {0} and {1}".format(idx_1, idx_2) - str += " at point: {0}".format(pt) - print(str) - - # break both loops and loop through all facets again - broken = True - break - - if broken: - break - - # if we've arrived at the end without detecting any overlaps - if not broken: - cleaning = False
- -
[docs] def replace_point_id(self, id_old, id_new): - """Searches all facets and replaces references to point id_old with id_new. - - :param int id_old: Point index to be replaced - :param int id_new: Point index to replace point id_old - """ - - # loop through all facets - for (i, facet) in enumerate(self.geometry.facets): - # loop through the point indices defining the facet - for (j, point_id) in enumerate(facet): - if point_id == id_old: - self.geometry.facets[i][j] = id_new
- -
[docs] def remove_point_id(self, point_id): - """Removes point point_id from the points list and renumbers the references to points after - point_id in the facet list. - - :param int point_id: Index of point to be removed - """ - - # remove index point_id from the points list - self.geometry.points.pop(point_id) - - # renumber facet references to points after point_id - for (i, facet) in enumerate(self.geometry.facets): - # loop through the point indices defining the facet - for (j, p_id) in enumerate(facet): - # if the point index is greater the point to be deleted - if p_id > point_id: - # decrement the point index - self.geometry.facets[i][j] -= 1
- -
[docs] def is_duplicate_facet(self, fct1, fct2): - """Checks to see if to facets are duplicates. - - :param fct1: First facet to compare - :type fct1: list[int, int] - :param fct2: Second facet to compare - :type fct2: list[int, int] - :return: Whether or not the facets are identical - :rtype: bool - """ - - # check for a facet duplicate - if fct1 == fct2 or fct1 == list(reversed(fct2)): - return True - else: - return False
- -
[docs] def is_intersect(self, p, q, r, s): - """Determines if the line segment p->p+r intersects q->q+s. Implements Gareth Rees's - answer: https://stackoverflow.com/questions/563198. - - :param p: Starting point of the first line segment - :type p: :class:`numpy.ndarray` [float, float] - :param q: Starting point of the second line segment - :type q: :class:`numpy.ndarray` [float, float] - :param r: Vector of the first line segment - :type r: :class:`numpy.ndarray` [float, float] - :param s: Vector of the second line segment - :type s: :class:`numpy.ndarray` [float, float] - :returns: The intersection point of the line segments. If there is no intersection, returns - None. - :rtype: :class:`numpy.ndarray` [float, float] - """ - - if np.cross(r, s) != 0: - # calculate t and u - t = np.cross(q - p, s) / np.cross(r, s) - u = np.cross(p - q, r) / np.cross(s, r) - - # modify from closed inequality (<=) to open (<) so end intersections are not picked up - if (t > 0 and t < 1) and (u > 0 and u < 1): - return p + t * r - else: - return None
- -
[docs] def is_overlap(self, p, q, r, s, fct1, fct2): - """Determines if the line segment p->p+r overlaps q->q+s. Implements Gareth Rees's answer: - https://stackoverflow.com/questions/563198. - - :param p: Starting point of the first line segment - :type p: :class:`numpy.ndarray` [float, float] - :param q: Starting point of the second line segment - :type q: :class:`numpy.ndarray` [float, float] - :param r: Vector of the first line segment - :type r: :class:`numpy.ndarray` [float, float] - :param s: Vector of the second line segment - :type s: :class:`numpy.ndarray` [float, float] - :param fct1: sadkjas;dkas;dj - :returns: A list containing the points required for facet rebuilding. If there is no - rebuild to be done, returns None. - :rtype: list[list[float, float]] - """ - - tol = 1e-3 # minimum angle tolerance (smaller is considered overlap) - float_tol = 1e-12 # rounding error tolerance - - # relativise tolerance by length of smallest vector - tol *= min(np.linalg.norm(r), np.linalg.norm(s)) - - # are the line segments collinear? - if abs(np.cross(r, s)) < tol: - if abs(np.cross(q - p, r)) < tol: - # CASE 1: two line segments are collinear - # calculate end points of second segment in terms of the equation of the first line - # segment (p + t * r) - if np.dot(s, r) >= 0: - t0 = np.dot(q - p, r) / np.dot(r, r) - t1 = np.dot(q + s - p, r) / np.dot(r, r) - else: - t0 = np.dot(q + s - p, r) / np.dot(r, r) - t1 = np.dot(q - p, r) / np.dot(r, r) - - # check interval [t0, t1] intersects (0, 1) - if t0 < 1 - float_tol and float_tol < t1: - # recalculate t0 and t1 based on original assumptions - t0 = np.dot(q - p, r) / np.dot(r, r) - t1 = np.dot(q + s - p, r) / np.dot(r, r) - - t = sorted(list(set([0.0, t0, 1.0, t1]))) - idx_list = [] - - # loop through new points - for pt in t: - if pt == 0.0: - idx_list.append(fct1[0]) - elif pt == 1.0: - idx_list.append(fct1[1]) - elif pt == t0: - idx_list.append(fct2[0]) - elif pt == t1: - idx_list.append(fct2[1]) - - return idx_list - else: - # collinear and disjoint - return None - else: - return None
- -
[docs] def remove_duplicate_facets(self): - """Searches through all facets and removes facets that are duplicates, independent of the - point order.""" - - idx_to_remove = [] - - # loop through the list of facets - for (i, fct1) in enumerate(self.geometry.facets): - # check all other facets - for (j, fct2) in enumerate(self.geometry.facets[i + 1:]): - # get facet indices - idx_1 = i - idx_2 = i + j + 1 - - # check for a duplicate facet that has not already been deleted - if (self.is_duplicate_facet(fct1, fct2) and - idx_2 not in idx_to_remove): - idx_to_remove.append(idx_2) - - if self.verbose: - str = "Removed duplicate facet: {0}".format(idx_2) - str += " (identical to facet: {0})".format(idx_1) - print(str) - - # sort list of indices to remove in reverse order so as not to comprimise the indices - idx_to_remove = sorted(idx_to_remove, reverse=True) - - for idx in idx_to_remove: - self.geometry.facets.pop(idx)
- - -
[docs]def create_mesh(points, facets, holes, control_points, mesh_sizes): - """Creates a quadratic triangular mesh using the meshpy module, which utilises the code - 'Triangle', by Jonathan Shewchuk. - - :param points: List of points *(x, y)* defining the vertices of the cross-section - :type points: list[list[float, float]] - :param facets: List of point index pairs *(p1, p2)* defining the edges of the cross-section - :type points: list[list[int, int]] - :param holes: List of points *(x, y)* defining the locations of holes within the cross-section. - If there are no holes, provide an empty list []. - :type holes: list[list[float, float]] - :param control_points: A list of points *(x, y)* that define different regions of the - cross-section. A control point is an arbitrary point within a region enclosed by facets. - :type control_points: list[list[float, float]] - :param mesh_sizes: List of maximum element areas for each region defined by a control point - :type mesh_sizes: list[float] - - :return: Object containing generated mesh data - :rtype: :class:`meshpy.triangle.MeshInfo` - """ - - mesh = triangle.MeshInfo() # create mesh info object - mesh.set_points(points) # set points - mesh.set_facets(facets) # set facets - mesh.set_holes(holes) # set holes - - # set regions - mesh.regions.resize(len(control_points)) # resize regions list - region_id = 0 # initialise region ID variable - - for (i, cp) in enumerate(control_points): - mesh.regions[i] = [cp[0], cp[1], region_id, mesh_sizes[i]] - region_id += 1 - - mesh = triangle.build( - mesh, min_angle=30, mesh_order=2, quality_meshing=True, - attributes=True, volume_constraints=True) - - return mesh
-
- -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/_modules/sectionproperties/pre/sections.html b/docs/build/html/_modules/sectionproperties/pre/sections.html deleted file mode 100644 index 181003d6..00000000 --- a/docs/build/html/_modules/sectionproperties/pre/sections.html +++ /dev/null @@ -1,2461 +0,0 @@ - - - - - - - - - - - sectionproperties.pre.sections — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- -
    - -
  • Docs »
  • - -
  • Module code »
  • - -
  • sectionproperties.pre.sections
  • - - -
  • - -
  • - -
- - -
-
-
-
- -

Source code for sectionproperties.pre.sections

-import numpy as np
-import matplotlib.pyplot as plt
-import sectionproperties.pre.pre as pre
-import sectionproperties.post.post as post
-
-
-
[docs]class Geometry: - """Parent class for a cross-section geometry input. - - Provides an interface for the user to specify the geometry defining a cross-section. A method - is provided for generating a triangular mesh, for translating the cross-section by *(x, y)* and - for plotting the geometry. - - :cvar points: List of points *(x, y)* defining the vertices of the cross-section - :vartype points: list[list[float, float]] - :cvar facets: List of point index pairs *(p1, p2)* defining the edges of the cross-section - :vartype facets: list[list[int, int]] - :cvar holes: List of points *(x, y)* defining the locations of holes within the cross-section. - If there are no holes, provide an empty list []. - :vartype holes: list[list[float, float]] - :cvar control_points: A list of points *(x, y)* that define different regions of the - cross-section. A control point is an arbitrary point within a region enclosed by facets. - :vartype control_points: list[list[float, float]] - :cvar shift: Vector that shifts the cross-section by *(x, y)* - :vartype shift: list[float, float] - :cvar perimeter: List of facet indices defining the perimeter of the cross-section - :vartype perimeter: list[int] - """ - - def __init__(self, control_points, shift): - """Inits the Geometry class.""" - - self.control_points = control_points - self.shift = shift - self.points = [] - self.facets = [] - self.holes = [] - self.perimeter = [] - -
[docs] def create_mesh(self, mesh_sizes): - """Creates a quadratic triangular mesh from the Geometry object. - - :param mesh_sizes: A list of maximum element areas corresponding to each region within the - cross-section geometry. - :type mesh_size: list[float] - - :return: Object containing generated mesh data - :rtype: :class:`meshpy.triangle.MeshInfo` - - :raises AssertionError: If the number of mesh sizes does not match the number of regions - - The following example creates a circular cross-section with a diameter of 50 with 64 - points, and generates a mesh with a maximum triangular area of 2.5:: - - import sectionproperties.pre.sections as sections - - geometry = sections.CircularSection(d=50, n=64) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - - .. figure:: ../images/sections/circle_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - str = "Number of mesh_sizes ({0}), should match the number of regions ({1})".format( - len(mesh_sizes), len(self.control_points) - ) - assert(len(mesh_sizes) == len(self.control_points)), str - - return pre.create_mesh( - self.points, self.facets, self.holes, self.control_points, mesh_sizes)
- -
[docs] def shift_section(self): - """Shifts the cross-section parameters by the class variable vector *shift*.""" - - for point in self.points: - point[0] += self.shift[0] - point[1] += self.shift[1] - - for hole in self.holes: - hole[0] += self.shift[0] - hole[1] += self.shift[1] - - for cp in self.control_points: - cp[0] += self.shift[0] - cp[1] += self.shift[1]
- -
[docs] def rotate_section(self, angle, rot_point=None): - """Rotates the geometry and specified angle about a point. If the rotation point is not - provided, rotates the section about the first control point in the list of control points - of the :class:`~sectionproperties.pre.sections.Geometry` object. - - :param float angle: Angle (degrees) by which to rotate the section. A positive angle leads - to a counter-clockwise rotation. - :param rot_point: Point *(x, y)* about which to rotate the section - :type rot_point: list[float, float] - - The following example rotates a 200UB25 section clockwise by 30 degrees:: - - import sectionproperties.pre.sections as sections - - geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8) - geometry.rotate_section(angle=-30) - """ - - # convert angle to radians - rot_phi = angle * np.pi / 180 - - def get_r(pt1, pt2): - """Returns the distance between two points.""" - - return ((pt1[0] - pt2[0]) ** 2 + (pt1[1] - pt2[1]) ** 2) ** 0.5 - - def get_phi(pt1, pt2): - """Returns the angle between two points.""" - - return np.arctan2(pt1[1] - pt2[1], pt1[0] - pt2[0]) - - def rotate_point(pt, rot_point, rot_phi): - """Rotates a point given a rotation point and rotation angle.""" - - r = get_r(pt, rot_point) - phi = get_phi(pt, rot_point) - - pt[0] = r * np.cos(phi + rot_phi) + rot_point[0] - pt[1] = r * np.sin(phi + rot_phi) + rot_point[1] - - # use the first control point if no rotation point is specified - if rot_point is None: - rot_point = self.control_points[0] - - # rotate all the points - for point in self.points: - rotate_point(point, rot_point, rot_phi) - - # rotate all the holes - for hole in self.holes: - rotate_point(hole, rot_point, rot_phi) - - # rotate all the control points - for cp in self.control_points: - rotate_point(cp, rot_point, rot_phi)
- -
[docs] def mirror_section(self, axis='x', mirror_point=None): - """Mirrors the geometry about a point on either the x or y-axis. If no point is provided, - mirrors the geometry about the first control point in the list of control points of the - :class:`~sectionproperties.pre.sections.Geometry` object. - - :param string axis: Axis about which to mirror the geometry, *'x'* or *'y'* - :param mirror_point: Point about which to mirror the geometry *(x, y)* - :type mirror_point: list[float, float] - - The following example mirrors a 200PFC section about the y-axis and the point (0, 0):: - - import sectionproperties.pre.sections as sections - - geometry = sections.PfcSection(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8) - geometry.mirror_section(axis='y', mirror_point=[0, 0]) - """ - - # use the first control point if no mirror point is specified - if mirror_point is None: - mirror_point = self.control_points[0] - - # select the axis to mirror - if axis == 'x': - i = 1 - elif axis == 'y': - i = 0 - else: - raise RuntimeError("Enter a valid axis: 'x' or 'y'") - - # mirror all points - for point in self.points: - point[i] = 2 * mirror_point[i] - point[i] - - # mirror all holes - for hole in self.holes: - hole[i] = 2 * mirror_point[i] - hole[i] - - # mirror all control points - for cp in self.control_points: - cp[i] = 2 * mirror_point[i] - cp[i]
- -
[docs] def add_point(self, point): - """Adds a point to the geometry and returns the added point id. - - :param point: Location of the point - :type point: list[float, float] - :return: Point id - :rtype: int - """ - - self.points.append(point) - return len(self.points) - 1
- -
[docs] def add_facet(self, facet): - """Adds a facet to the geometry and returns the added facet id. - - :param facet: Point indices of the facet - :type facet: list[float, float] - :return: Facet id - :rtype: int - """ - - self.facets.append(facet) - return len(self.facets) - 1
- -
[docs] def add_hole(self, hole): - """Adds a hole location to the geometry and returns the added hole id. - - :param hole: Location of the hole - :type hole: list[float, float] - :return: Hole id - :rtype: int - """ - - self.holes.append(hole) - return len(self.holes) - 1
- -
[docs] def add_control_point(self, control_point): - """Adds a control point to the geometry and returns the added control - point id. - - :param hole: Location of the control point - :type hole: list[float, float] - :return: Control point id - :rtype: int - """ - - self.control_points.append(control_point) - return len(self.control_points) - 1
- -
[docs] def clean_geometry(self, verbose=False): - """Peforms a full clean on the geometry. - - :param bool verbose: If set to true, information related to the geometry cleaning process - is printed to the terminal. - - .. note:: Cleaning the geometry is always recommended when creating a merged section, - which may result in overlapping or intersecting facets, or duplicate nodes. - """ - - self = pre.GeometryCleaner(self, verbose).clean_geometry()
- -
[docs] def plot_geometry(self, ax=None, pause=True, labels=False, perimeter=False): - """Plots the geometry defined by the input section. If no axes object is supplied a new - figure and axis is created. - - :param ax: Axes object on which the mesh is plotted - :type ax: :class:`matplotlib.axes.Axes` - :param bool pause: If set to true, the figure pauses the script until the window is closed. - If set to false, the script continues immediately after the window is rendered. - :param bool labels: If set to true, node and facet labels are displayed - :param bool perimeter: If set to true, boldens the perimeter of the cross-section - - The following example creates a CHS discretised with 64 points, with a diameter of 48 and - thickness of 3.2, and plots the geometry:: - - import sectionproperties.pre.sections as sections - - geometry = sections.Chs(d=48, t=3.2, n=64) - geometry.plot_geometry() - - .. figure:: ../images/sections/chs_geometry.png - :align: center - :scale: 75 % - - Geometry generated by the above example. - """ - - # if no axes object is supplied, create and setup the plot - if ax is None: - ax_supplied = False - (fig, ax) = plt.subplots() - post.setup_plot(ax, pause) - else: - ax_supplied = True - - for (i, f) in enumerate(self.facets): - if perimeter: - if i in self.perimeter: - linewidth = 3 - else: - linewidth = 1.5 - else: - linewidth = 1.5 - - # plot the points and facets - if i == 0: - ax.plot([self.points[f[0]][0], self.points[f[1]][0]], - [self.points[f[0]][1], self.points[f[1]][1]], - 'ko-', markersize=2, linewidth=linewidth, label='Points & Facets') - else: - ax.plot([self.points[f[0]][0], self.points[f[1]][0]], - [self.points[f[0]][1], self.points[f[1]][1]], - 'ko-', markersize=2, linewidth=linewidth) - - for (i, h) in enumerate(self.holes): - # plot the holes - if i == 0: - ax.plot(h[0], h[1], 'rx', markerSize=5, label='Holes') - else: - ax.plot(h[0], h[1], 'rx', markerSize=5) - - for (i, cp) in enumerate(self.control_points): - # plot the control points - if i == 0: - ax.plot(cp[0], cp[1], 'bo', markerSize=5, - label='Control Points') - else: - ax.plot(cp[0], cp[1], 'bo', markerSize=5) - - # display the legend - ax.legend(loc='center left', bbox_to_anchor=(1, 0.5)) - - # display the labels - if labels: - # plot node labels - for (i, pt) in enumerate(self.points): - ax.annotate(str(i), xy=pt, color='r') - - # plot facet labels - for (i, fct) in enumerate(self.facets): - pt1 = self.points[fct[0]] - pt2 = self.points[fct[1]] - xy = [(pt1[0] + pt2[0]) / 2, (pt1[1] + pt2[1]) / 2] - - ax.annotate(str(i), xy=xy, color='b') - - # if no axes object is supplied, finish the plot - if not ax_supplied: - post.finish_plot(ax, pause, title='Cross-Section Geometry')
- -
[docs] def calculate_extents(self): - """Calculates the minimum and maximum x and y-values amongst the list of points. - - :return: Minimum and maximum x and y-values *(x_min, x_max, y_min, y_max)* - :rtype: tuple(float, float, float, float) - """ - - # loop through all points - for (i, pt) in enumerate(self.points): - x = pt[0] - y = pt[1] - - # initialise min, max variables - if i == 0: - x_min = x - x_max = x - y_min = y - y_max = y - - # update the mins and maxs where necessary - x_min = min(x_min, x) - x_max = max(x_max, x) - y_min = min(y_min, y) - y_max = max(y_max, y) - - return (x_min, x_max, y_min, y_max)
- -
[docs] def draw_radius(self, pt, r, theta, n, anti=True): - """Adds a quarter radius of points to the points list - centered at point *pt*, with radius - *r*, starting at angle *theta*, with *n* points. If r = 0, adds pt only. - - :param pt: Centre of radius *(x,y)* - :type pt: list[float, float] - :param float r: Radius - :param float theta: Initial angle - :param int n: Number of points - :param bool anti: Anticlockwise rotation? - """ - - if r == 0: - self.points.append(pt) - return - - if anti: - mult = 1 - else: - mult = -1 - - # calculate radius of points - for i in range(n): - # determine angle - t = theta + mult * i * 1.0 / max(1, n - 1) * np.pi * 0.5 - - x = pt[0] + r * np.cos(t) - y = pt[1] + r * np.sin(t) - self.points.append([x, y])
- -
[docs] def calculate_facet_length(self, facet): - """Calculates the length of the facet. - - :param facet: Point index pair *(p1, p2)* defining a facet - :vartype facets: list[int, int] - - :return: Facet length - :rtype: float - """ - - # get facet points - p1 = self.points[facet[0]] - p2 = self.points[facet[1]] - - # calculate distance between two points - return np.sqrt((p2[0] - p1[0]) ** 2 + (p2[1] - p1[1]) ** 2)
- -
[docs] def calculate_perimeter(self): - """Calculates the perimeter of the cross-section by summing the length of all facets in the - ``perimeter`` class variable. - - :return: Cross-section perimeter, returns 0 if there is no perimeter defined - :rtype: float - """ - - # check to see if there are any facets in the perimeter variable - if len(self.perimeter) == 0: - return 0 - - # initialise perimeter variable - perimeter = 0 - - # loop through all the facets along the perimeter - for facet_idx in self.perimeter: - perimeter += self.calculate_facet_length(self.facets[facet_idx]) - - return perimeter
- - -
[docs]class CustomSection(Geometry): - """Constructs a cross-section from a list of points, facets, holes and a user specified control - point. - - :param points: List of points *(x, y)* defining the vertices of the cross-section - :type points: list[list[float, float]] - :param facets: List of point index pairs *(p1, p2)* defining the edges of the cross-section - :type facets: list[list[int, int]] - :param holes: List of points *(x, y)* defining the locations of holes within the cross-section. - If there are no holes, provide an empty list []. - :type holes: list[list[float, float]] - :param control_points: A list of points *(x, y)* that define different regions of the - cross-section. A control point is an arbitrary point within a region enclosed by facets. - :type control_points: list[list[float, float]] - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - :param perimeter: List of facet indices defining the perimeter of the cross-section - :vartype perimeter: list[int] - - The following example creates a hollow trapezium with a base width of 100, top width of 50, - height of 50 and a wall thickness of 10. A mesh is generated with a maximum triangular area of - 2.0:: - - import sectionproperties.pre.sections as sections - - points = [[0, 0], [100, 0], [75, 50], [25, 50], [15, 10], [85, 10], [70, 40], [30, 40]] - facets = [[0, 1], [1, 2], [2, 3], [3, 0], [4, 5], [5, 6], [6, 7], [7, 4]] - holes = [[50, 25]] - control_points = [[5, 5]] - perimeter = [0, 1, 2, 3] - - geometry = sections.CustomSection( - points, facets, holes, control_points, perimeter=perimeter - ) - mesh = geometry.create_mesh(mesh_sizes=[2.0]) - - .. figure:: ../images/sections/custom_geometry.png - :align: center - :scale: 75 % - - Custom section geometry. - - .. figure:: ../images/sections/custom_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, points, facets, holes, control_points, shift=[0, 0], perimeter=[]): - """Inits the CustomSection class.""" - - super().__init__(control_points, shift) - - self.points = points - self.facets = facets - self.holes = holes - self.perimeter = perimeter - - self.shift_section()
- - -
[docs]class RectangularSection(Geometry): - """Constructs a rectangular section with the bottom left corner at the origin *(0, 0)*, with - depth *d* and width *b*. - - :param float d: Depth (y) of the rectangle - :param float b: Width (x) of the rectangle - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a rectangular cross-section with a depth of 100 and width of 50, - and generates a mesh with a maximum triangular area of 5:: - - import sectionproperties.pre.sections as sections - - geometry = sections.RectangularSection(d=100, b=50) - mesh = geometry.create_mesh(mesh_sizes=[5]) - - .. figure:: ../images/sections/rectangle_geometry.png - :align: center - :scale: 75 % - - Rectangular section geometry. - - .. figure:: ../images/sections/rectangle_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, d, b, shift=[0, 0]): - """Inits the RectangularSection class.""" - - # assign control point - control_points = [[0.5 * b, 0.5 * d]] - - super().__init__(control_points, shift) - - # construct the points and facets - self.points = [[0, 0], [b, 0], [b, d], [0, d]] - self.facets = [[0, 1], [1, 2], [2, 3], [3, 0]] - self.perimeter = list(range(len(self.facets))) - - self.shift_section()
- - -
[docs]class CircularSection(Geometry): - """Constructs a solid circle centered at the origin *(0, 0)* with diameter *d* and using *n* - points to construct the circle. - - :param float d: Diameter of the circle - :param int n: Number of points discretising the circle - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a circular cross-section with a diameter of 50 with 64 points, - and generates a mesh with a maximum triangular area of 2.5:: - - import sectionproperties.pre.sections as sections - - geometry = sections.CircularSection(d=50, n=64) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - - .. figure:: ../images/sections/circle_geometry.png - :align: center - :scale: 75 % - - Circular section geometry. - - .. figure:: ../images/sections/circle_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, d, n, shift=[0, 0]): - """Inits the CircularSection class.""" - - # assign control point - control_points = [[0, 0]] - - super().__init__(control_points, shift) - - # loop through each point on the circle - for i in range(n): - # determine polar angle - theta = i * 2 * np.pi * 1.0 / n - - # calculate location of the point - x = 0.5 * d * np.cos(theta) - y = 0.5 * d * np.sin(theta) - - # append the current point to the points list - self.points.append([x, y]) - - # if we are not at the last point - if i != n - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the circle - else: - self.facets.append([i, 0]) - - self.perimeter = list(range(len(self.facets))) - - self.shift_section()
- - -
[docs]class Chs(Geometry): - """Constructs a circular hollow section centered at the origin *(0, 0)*, with diameter *d* and - thickness *t*, using *n* points to construct the inner and outer circles. - - :param float d: Outer diameter of the CHS - :param float t: Thickness of the CHS - :param int n: Number of points discretising the inner and outer circles - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a CHS discretised with 64 points, with a diameter of 48 and - thickness of 3.2, and generates a mesh with a maximum triangular area of 1.0:: - - import sectionproperties.pre.sections as sections - - geometry = sections.Chs(d=48, t=3.2, n=64) - mesh = geometry.create_mesh(mesh_sizes=[1.0]) - - .. figure:: ../images/sections/chs_geometry.png - :align: center - :scale: 75 % - - CHS geometry. - - .. figure:: ../images/sections/chs_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, d, t, n, shift=[0, 0]): - """Inits the Chs class.""" - - # assign control point - control_points = [[d * 0.5 - t * 0.5, 0]] - - super().__init__(control_points, shift) - - # specify a hole in the centre of the CHS - self.holes = [[0, 0]] - - # loop through each point of the CHS - for i in range(n): - # determine polar angle - theta = i * 2 * np.pi * 1.0 / n - - # calculate location of outer and inner points - x_outer = 0.5 * d * np.cos(theta) - y_outer = 0.5 * d * np.sin(theta) - x_inner = (0.5 * d - t) * np.cos(theta) - y_inner = (0.5 * d - t) * np.sin(theta) - - # append the current points to the points list - self.points.append([x_outer, y_outer]) - self.points.append([x_inner, y_inner]) - - # if we are not at the last point - if i != n - 1: - self.facets.append([i * 2, i * 2 + 2]) - self.facets.append([i * 2 + 1, i * 2 + 3]) - # if we are at the last point, complete the circle - else: - self.facets.append([i * 2, 0]) - self.facets.append([i * 2 + 1, 1]) - - self.perimeter = list(range(0, len(self.facets), 2)) - - self.shift_section()
- - -
[docs]class EllipticalSection(Geometry): - """Constructs a solid ellipse centered at the origin *(0, 0)* with vertical diameter *d_y* and - horizontal diameter *d_x*, using *n* points to construct the ellipse. - - :param float d_y: Diameter of the ellipse in the y-dimension - :param float d_x: Diameter of the ellipse in the x-dimension - :param int n: Number of points discretising the ellipse - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates an elliptical cross-section with a vertical diameter of 25 and - horizontal diameter of 50, with 40 points, and generates a mesh with a maximum triangular area - of 1.0:: - - import sectionproperties.pre.sections as sections - - geometry = sections.EllipticalSection(d_y=25, d_x=50, n=40) - mesh = geometry.create_mesh(mesh_sizes=[1.0]) - - .. figure:: ../images/sections/ellipse_geometry.png - :align: center - :scale: 75 % - - Elliptical section geometry. - - .. figure:: ../images/sections/ellipse_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, d_y, d_x, n, shift=[0, 0]): - """Inits the EllipticalSection class.""" - - # assign control point centered at zero - control_points = [[0, 0]] - - super().__init__(control_points, shift) - - # loop through each point on the ellipse - for i in range(n): - # determine polar angle - theta = i * 2 * np.pi * 1.0 / n - - # calculate location of the point - x = 0.5 * d_x * np.cos(theta) - y = 0.5 * d_y * np.sin(theta) - - # append the current point to the points list - self.points.append([x, y]) - - # if we are not at the last point - if i != n - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the ellipse - else: - self.facets.append([i, 0]) - - self.perimeter = list(range(len(self.facets))) - - self.shift_section()
- - -
[docs]class Ehs(Geometry): - """Constructs an elliptical hollow section centered at the origin *(0, 0)*, with outer vertical - diameter *d_y*, outer horizontal diameter *d_x*, and thickness *t*, using *n* points to - construct the inner and outer ellipses. - - :param float d_y: Diameter of the ellipse in the y-dimension - :param float d_x: Diameter of the ellipse in the x-dimension - :param float t: Thickness of the EHS - :param int n: Number of points discretising the inner and outer ellipses - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a EHS discretised with 30 points, with a outer vertical diameter - of 25, outer horizontal diameter of 50, and thickness of 2.0, and generates a mesh with a - maximum triangular area of 0.5:: - - import sectionproperties.pre.sections as sections - - geometry = sections.Ehs(d_y=25, d_x=50, t=2.0, n=64) - mesh = geometry.create_mesh(mesh_sizes=[0.5]) - - .. figure:: ../images/sections/ehs_geometry.png - :align: center - :scale: 75 % - - EHS geometry. - - .. figure:: ../images/sections/ehs_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, d_y, d_x, t, n, shift=[0, 0]): - """Inits the Ehs class.""" - - # assign control point - control_points = [[(d_x * 0.5) - (t * 0.5), 0]] - - super().__init__(control_points, shift) - - # specify a hole in the centre of the EHS - self.holes = [[0, 0]] - - # loop through each point of the EHS - for i in range(n): - # determine polar angle - theta = i * 2 * np.pi * 1.0 / n - - # calculate location of outer and inner points - x_outer = 0.5 * d_x * np.cos(theta) - y_outer = 0.5 * d_y * np.sin(theta) - x_inner = ((0.5 * d_x) - t) * np.cos(theta) - y_inner = ((0.5 * d_y) - t) * np.sin(theta) - - # append the current points to the points list - self.points.append([x_outer, y_outer]) - self.points.append([x_inner, y_inner]) - - # if we are not at the last point - if i != n - 1: - self.facets.append([i * 2, i * 2 + 2]) - self.facets.append([i * 2 + 1, i * 2 + 3]) - # if we are at the last point, complete the circle - else: - self.facets.append([i * 2, 0]) - self.facets.append([i * 2 + 1, 1]) - - self.perimeter = list(range(0, len(self.facets), 2)) - - self.shift_section()
- - -
[docs]class Rhs(Geometry): - """Constructs a rectangular hollow section centered at *(b/2, d/2)*, with depth *d*, width *b*, - thickness *t* and outer radius *r_out*, using *n_r* points to construct the inner and outer - radii. If the outer radius is less than the thickness of the RHS, the inner radius is set to - zero. - - :param float d: Depth of the RHS - :param float b: Width of the RHS - :param float t: Thickness of the RHS - :param float r_out: Outer radius of the RHS - :param int n_r: Number of points discretising the inner and outer radii - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates an RHS with a depth of 100, a width of 50, a thickness of 6 and - an outer radius of 9, using 8 points to discretise the inner and outer radii. A mesh is - generated with a maximum triangular area of 2.0:: - - import sectionproperties.pre.sections as sections - - geometry = sections.Rhs(d=100, b=50, t=6, r_out=9, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.0]) - - .. figure:: ../images/sections/rhs_geometry.png - :align: center - :scale: 75 % - - RHS geometry. - - .. figure:: ../images/sections/rhs_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, d, b, t, r_out, n_r, shift=[0, 0]): - """Inits the Rhs class.""" - - # assign control point - control_points = [[b - t * 0.5, d * 0.5]] - - super().__init__(control_points, shift) - - # specify a hole in the centre of the RHS - self.holes = [[b * 0.5, d * 0.5]] - - # calculate internal radius - r_in = max(r_out - t, 0) - - # construct the outer radius points - self.draw_radius([r_out, r_out], r_out, np.pi, n_r) - self.draw_radius([b - r_out, r_out], r_out, 1.5 * np.pi, n_r) - self.draw_radius([b - r_out, d - r_out], r_out, 0, n_r) - self.draw_radius([r_out, d - r_out], r_out, 0.5 * np.pi, n_r) - - # construct the outer radius facet list - n_outer = len(self.points) - for i in range(n_outer): - # if we are not at the last point - if i != n_outer - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the loop - else: - self.facets.append([i, 0]) - - # construct the inner radius points - self.draw_radius([t + r_in, t + r_in], r_in, np.pi, n_r) - self.draw_radius([b - t - r_in, t + r_in], r_in, 1.5 * np.pi, n_r) - self.draw_radius([b - t - r_in, d - t - r_in], r_in, 0, n_r) - self.draw_radius([t + r_in, d - t - r_in], r_in, 0.5 * np.pi, n_r) - - # construct the inner radius facet list - n_inner = len(self.points) - n_outer - for i in range(n_inner): - # if we are not at the last point - if i != n_inner - 1: - self.facets.append([i + n_outer, i + n_outer + 1]) - # if we are at the last point, complete the loop - else: - self.facets.append([i + n_outer, n_outer]) - - self.perimeter = list(range(int(len(self.facets) / 2))) - - self.shift_section()
- - -
[docs]class ISection(Geometry): - """Constructs an I-section centered at *(b/2, d/2)*, with depth *d*, width *b*, flange - thickness *t_f*, web thickness *t_w*, and root radius *r*, using *n_r* points to construct the - root radius. - - :param float d: Depth of the I-section - :param float b: Width of the I-section - :param float t_f: Flange thickness of the I-section - :param float t_w: Web thickness of the I-section - :param float r: Root radius of the I-section - :param int n_r: Number of points discretising the root radius - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates an I-section with a depth of 203, a width of 133, a flange - thickness of 7.8, a web thickness of 5.8 and a root radius of 8.9, using 16 points to - discretise the root radius. A mesh is generated with a maximum triangular area of 3.0:: - - import sectionproperties.pre.sections as sections - - geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=16) - mesh = geometry.create_mesh(mesh_sizes=[3.0]) - - .. figure:: ../images/sections/isection_geometry.png - :align: center - :scale: 75 % - - I-section geometry. - - .. figure:: ../images/sections/isection_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, d, b, t_f, t_w, r, n_r, shift=[0, 0]): - """Inits the ISection class.""" - - # assign control point - control_points = [[b * 0.5, d * 0.5]] - - super().__init__(control_points, shift) - - # add first three points - self.points.append([0, 0]) - self.points.append([b, 0]) - self.points.append([b, t_f]) - - # construct the bottom right radius - pt = [b * 0.5 + t_w * 0.5 + r, t_f + r] - self.draw_radius(pt, r, 1.5 * np.pi, n_r, False) - - # construct the top right radius - pt = [b * 0.5 + t_w * 0.5 + r, d - t_f - r] - self.draw_radius(pt, r, np.pi, n_r, False) - - # add the next four points - self.points.append([b, d - t_f]) - self.points.append([b, d]) - self.points.append([0, d]) - self.points.append([0, d - t_f]) - - # construct the top left radius - pt = [b * 0.5 - t_w * 0.5 - r, d - t_f - r] - self.draw_radius(pt, r, 0.5 * np.pi, n_r, False) - - # construct the bottom left radius - pt = [b * 0.5 - t_w * 0.5 - r, t_f + r] - self.draw_radius(pt, r, 0, n_r, False) - - # add the last point - self.points.append([0, t_f]) - - # build the facet list - for i in range(len(self.points)): - # if we are not at the last point - if i != len(self.points) - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the loop - else: - self.facets.append([len(self.points) - 1, 0]) - - self.perimeter = list(range(len(self.facets))) - - self.shift_section()
- - -
[docs]class MonoISection(Geometry): - """Constructs a monosymmetric I-section centered at *(max(b_t, b_b)/2, d/2)*, with depth *d*, - top flange width *b_t*, bottom flange width *b_b*, top flange thickness *t_ft*, top flange - thickness *t_fb*, web thickness *t_w*, and root radius *r*, using *n_r* points to construct the - root radius. - - :param float d: Depth of the I-section - :param float b_t: Top flange width - :param float b_b: Bottom flange width - :param float t_ft: Top flange thickness of the I-section - :param float t_fb: Bottom flange thickness of the I-section - :param float t_w: Web thickness of the I-section - :param float r: Root radius of the I-section - :param int n_r: Number of points discretising the root radius - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a monosymmetric I-section with a depth of 200, a top flange width - of 50, a top flange thickness of 12, a bottom flange width of 130, a bottom flange thickness of - 8, a web thickness of 6 and a root radius of 8, using 16 points to discretise the root radius. - A mesh is generated with a maximum triangular area of 3.0:: - - import sectionproperties.pre.sections as sections - - geometry = sections.MonoISection( - d=200, b_t=50, b_b=130, t_ft=12, t_fb=8, t_w=6, r=8, n_r=16 - ) - mesh = geometry.create_mesh(mesh_sizes=[3.0]) - - .. figure:: ../images/sections/monoisection_geometry.png - :align: center - :scale: 75 % - - I-section geometry. - - .. figure:: ../images/sections/monoisection_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, d, b_t, b_b, t_fb, t_ft, t_w, r, n_r, shift=[0, 0]): - """Inits the ISection class.""" - - # assign control point - control_points = [[max(b_t, b_b) * 0.5, d * 0.5]] - - super().__init__(control_points, shift) - - # calculate central axis - x_central = max(b_t, b_b) * 0.5 - - # add first three points - self.points.append([x_central - b_b * 0.5, 0]) - self.points.append([x_central + b_b * 0.5, 0]) - self.points.append([x_central + b_b * 0.5, t_fb]) - - # construct the bottom right radius - pt = [x_central + t_w * 0.5 + r, t_fb + r] - self.draw_radius(pt, r, 1.5 * np.pi, n_r, False) - - # construct the top right radius - pt = [x_central + t_w * 0.5 + r, d - t_ft - r] - self.draw_radius(pt, r, np.pi, n_r, False) - - # add the next four points - self.points.append([x_central + b_t * 0.5, d - t_ft]) - self.points.append([x_central + b_t * 0.5, d]) - self.points.append([x_central - b_t * 0.5, d]) - self.points.append([x_central - b_t * 0.5, d - t_ft]) - - # construct the top left radius - pt = [x_central - t_w * 0.5 - r, d - t_ft - r] - self.draw_radius(pt, r, 0.5 * np.pi, n_r, False) - - # construct the bottom left radius - pt = [x_central - t_w * 0.5 - r, t_fb + r] - self.draw_radius(pt, r, 0, n_r, False) - - # add the last point - self.points.append([x_central - b_b * 0.5, t_fb]) - - # build the facet list - for i in range(len(self.points)): - # if we are not at the last point - if i != len(self.points) - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the loop - else: - self.facets.append([len(self.points) - 1, 0]) - - self.perimeter = list(range(len(self.facets))) - - self.shift_section()
- - -
[docs]class TaperedFlangeISection(Geometry): - """Constructs a Tapered Flange I-section centered at *(b/2, d/2)*, with depth *d*, width *b*, - mid-flange thickness *t_f*, web thickness *t_w*, root radius *r_r*, flange radius *r_f* and - flange angle *alpha*, using *n_r* points to construct the radii. - - :param float d: Depth of the Tapered Flange I-section - :param float b: Width of the Tapered Flange I-section - :param float t_f: Mid-flange thickness of the Tapered Flange I-section (measured at the point - equidistant from the face of the web to the edge of the flange) - :param float t_w: Web thickness of the Tapered Flange I-section - :param float r_r: Root radius of the Tapered Flange I-section - :param float r_f: Flange radius of the Tapered Flange I-section - :param float alpha: Flange angle of the Tapered Flange I-section (degrees) - :param int n_r: Number of points discretising the radii - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a Tapered Flange I-section with a depth of 588, a width of 191, a - mid-flange thickness of 27.2, a web thickness of 15.2, a root radius of 17.8, a flange radius - of 8.9 and a flange angle of 8°, using 16 points to discretise the radii. A mesh is generated - with a maximum triangular area of 20.0:: - - import sectionproperties.pre.sections as sections - - geometry = sections.TaperedFlangeISection( - d=588, b=191, t_f=27.2, t_w=15.2, r_r=17.8, r_f=8.9, alpha=8, n_r=16 - ) - mesh = geometry.create_mesh(mesh_sizes=[20.0]) - - .. figure:: ../images/sections/taperedisection_geometry.png - :align: center - :scale: 75 % - - I-section geometry. - - .. figure:: ../images/sections/taperedisection_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, d, b, t_f, t_w, r_r, r_f, alpha, n_r, shift=[0, 0]): - """Inits the ISection class.""" - - # assign control point - control_points = [[b * 0.5, d * 0.5]] - - super().__init__(control_points, shift) - - # calculate alpha in radians - alpha_rad = np.pi * alpha / 180 - - # calculate the height of the flange toe and dimensions of the straight - x1 = b * 0.25 - t_w * 0.25 - r_f * (1 - np.sin(alpha_rad)) - y1 = x1 * np.tan(alpha_rad) - x2 = b * 0.25 - t_w * 0.25 - r_r * (1 - np.sin(alpha_rad)) - y2 = x2 * np.tan(alpha_rad) - y_t = t_f - y1 - r_f * np.cos(alpha_rad) - - # add first two points - self.points.append([0, 0]) - self.points.append([b, 0]) - - # construct the bottom right flange toe radius - if r_f == 0: - self.points.append([b, y_t]) - else: - for i in range(n_r): - # determine polar angle - theta = i * 1.0 / max(1, n_r - 1) * (np.pi * 0.5 - alpha_rad) - - # calculate the locations of the radius points - x = b - r_f + r_f * np.cos(theta) - y = y_t + r_f * np.sin(theta) - - # append the current points to the points list - self.points.append([x, y]) - - # construct the bottom right root radius - if r_r == 0: - self.points.append([b * 0.5 + t_w * 0.5, t_f + y2]) - else: - for i in range(n_r): - # determine polar angle - theta = ( - 3.0 / 2 * np.pi - alpha_rad) - (i * 1.0 / max(1, n_r - 1) * ( - np.pi * 0.5 - alpha_rad) - ) - - # calculate the locations of the radius points - x = b * 0.5 + t_w * 0.5 + r_r + r_r * np.cos(theta) - y = t_f + y2 + r_r * np.cos(alpha_rad) + r_r * np.sin(theta) - - # append the current points to the points list - self.points.append([x, y]) - - # construct the top right root radius - if r_r == 0: - self.points.append([b * 0.5 + t_w * 0.5, d - t_f - y2]) - else: - for i in range(n_r): - # determine polar angle - theta = np.pi - i * 1.0 / max(1, n_r - 1) * (np.pi * 0.5 - alpha_rad) - - # calculate the locations of the radius points - x = b * 0.5 + t_w * 0.5 + r_r + r_r * np.cos(theta) - y = d - t_f - y2 - r_r * np.cos(alpha_rad) + r_r * np.sin(theta) - - # append the current points to the points list - self.points.append([x, y]) - - # construct the top right flange toe radius - if r_f == 0: - self.points.append([b, d - y_t]) - else: - for i in range(n_r): - # determine polar angle - theta = ( - 3.0 * np.pi / 2 + alpha_rad) + i * 1.0 / max(1, n_r - 1) * ( - np.pi * 0.5 - alpha_rad - ) - - # calculate the locations of the radius points - x = b - r_f + r_f * np.cos(theta) - y = d - y_t + r_f * np.sin(theta) - - # append the current points to the points list - self.points.append([x, y]) - - # add the next two points - self.points.append([b, d]) - self.points.append([0, d]) - - # construct the top left flange toe radius - if r_f == 0: - self.points.append([0, d - y_t]) - else: - for i in range(n_r): - # determine polar angle - theta = np.pi + (i * 1.0 / max(1, n_r - 1) * (np.pi * 0.5 - alpha_rad)) - - # calculate the locations of the radius points - x = r_f + r_f * np.cos(theta) - y = d - y_t + r_f * np.sin(theta) - - # append the current points to the points list - self.points.append([x, y]) - - # construct the top left root radius - if r_r == 0: - self.points.append([b * 0.5 - t_w * 0.5, d - t_f - y2]) - else: - for i in range(n_r): - # determine polar angle - theta = ( - np.pi * 0.5 - alpha_rad) - (i * 1.0 / max(1, n_r - 1) * ( - np.pi * 0.5 - alpha_rad) - ) - - # calculate the locations of the radius points - x = b * 0.5 - t_w * 0.5 - r_r + r_r * np.cos(theta) - y = d - t_f - y2 - r_r * np.cos(alpha_rad) + r_r * np.sin(theta) - - # append the current points to the points list - self.points.append([x, y]) - - # construct the bottom left root radius - if r_r == 0: - self.points.append([b * 0.5 - t_w * 0.5, t_f + y2]) - else: - for i in range(n_r): - # determine polar angle - theta = -i * 1.0 / max(1, n_r - 1) * (np.pi * 0.5 - alpha_rad) - - # calculate the locations of the radius points - x = b * 0.5 - t_w * 0.5 - r_r + r_r * np.cos(theta) - y = t_f + y2 + r_r * np.cos(alpha_rad) + r_r * np.sin(theta) - - # append the current points to the points list - self.points.append([x, y]) - - # construct the bottom left flange toe radius - if r_f == 0: - self.points.append([0, y_t]) - else: - for i in range(n_r): - # determine polar angle - theta = ( - np.pi * 0.5 + alpha_rad) + (i * 1.0 / max(1, n_r - 1) * ( - np.pi * 0.5 - alpha_rad) - ) - - # calculate the locations of the radius points - x = r_f + r_f * np.cos(theta) - y = y_t + r_f * np.sin(theta) - - # append the current points to the points list - self.points.append([x, y]) - - # build the facet list - for i in range(len(self.points)): - # if we are not at the last point - if i != len(self.points) - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the loop - else: - self.facets.append([len(self.points) - 1, 0]) - - self.perimeter = list(range(len(self.facets))) - - self.shift_section()
- - -
[docs]class PfcSection(Geometry): - """Constructs a PFC section with the bottom left corner at the origin *(0, 0)*, with depth *d*, - width *b*, flange thickness *t_f*, web thickness *t_w* and root radius *r*, using *n_r* points - to construct the root radius. - - :param float d: Depth of the PFC section - :param float b: Width of the PFC section - :param float t_f: Flange thickness of the PFC section - :param float t_w: Web thickness of the PFC section - :param float r: Root radius of the PFC section - :param int n_r: Number of points discretising the root radius - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a PFC section with a depth of 250, a width of 90, a flange - thickness of 15, a web thickness of 8 and a root radius of 12, using 8 points to discretise the - root radius. A mesh is generated with a maximum triangular area of 5.0:: - - import sectionproperties.pre.sections as sections - - geometry = sections.PfcSection(d=250, b=90, t_f=15, t_w=8, r=12, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[5.0]) - - .. figure:: ../images/sections/pfc_geometry.png - :align: center - :scale: 75 % - - PFC geometry. - - .. figure:: ../images/sections/pfc_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, d, b, t_f, t_w, r, n_r, shift=[0, 0]): - """Inits the PfcSection class.""" - - # assign control point - control_points = [[t_w * 0.5, d * 0.5]] - - super().__init__(control_points, shift) - - # add first three points - self.points.append([0, 0]) - self.points.append([b, 0]) - self.points.append([b, t_f]) - - # construct the bottom right radius - pt = [t_w + r, t_f + r] - self.draw_radius(pt, r, 1.5 * np.pi, n_r, False) - - # construct the top right radius - pt = [t_w + r, d - t_f - r] - self.draw_radius(pt, r, np.pi, n_r, False) - - # add last three points - self.points.append([b, d - t_f]) - self.points.append([b, d]) - self.points.append([0, d]) - - # build the facet list - for i in range(len(self.points)): - # if we are not at the last point - if i != len(self.points) - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the loop - else: - self.facets.append([len(self.points) - 1, 0]) - - self.perimeter = list(range(len(self.facets))) - - self.shift_section()
- - -
[docs]class TaperedFlangeChannel(Geometry): - """Constructs a Tapered Flange Channel section with the bottom left corner at the origin - *(0, 0)*, with depth *d*, width *b*, mid-flange thickness *t_f*, web thickness *t_w*, root - radius *r_r*, flange radius *r_f* and flange angle *alpha*, using *n_r* points to construct the - radii. - - :param float d: Depth of the Tapered Flange Channel section - :param float b: Width of the Tapered Flange Channel section - :param float t_f: Mid-flange thickness of the Tapered Flange Channel section (measured at the - point equidistant from the face of the web to the edge of the flange) - :param float t_w: Web thickness of the Tapered Flange Channel section - :param float r_r: Root radius of the Tapered Flange Channel section - :param float r_f: Flange radius of the Tapered Flange Channel section - :param float alpha: Flange angle of the Tapered Flange Channel section (degrees) - :param int n_r: Number of points discretising the radii - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a Tapered Flange Channel section with a depth of 10, a width of - 3.5, a mid-flange thickness of 0.575, a web thickness of 0.475, a root radius of 0.575, a - flange radius of 0.4 and a flange angle of 8°, using 16 points to discretise the radii. A mesh - is generated with a maximum triangular area of 0.02:: - - import sectionproperties.pre.sections as sections - - geometry = sections.TaperedFlangeChannel( - d=10, b=3.5, t_f=0.575, t_w=0.475, r_r=0.575, r_f=0.4, alpha=8, n_r=16 - ) - mesh = geometry.create_mesh(mesh_sizes=[0.02]) - - .. figure:: ../images/sections/taperedchannel_geometry.png - :align: center - :scale: 75 % - - I-section geometry. - - .. figure:: ../images/sections/taperedchannel_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, d, b, t_f, t_w, r_r, r_f, alpha, n_r, shift=[0, 0]): - """Inits the ISection class.""" - - # assign control point - control_points = [[t_w * 0.5, d * 0.5]] - - super().__init__(control_points, shift) - - # calculate alpha in radians - alpha_rad = np.pi * alpha / 180 - - # calculate the height of the flange toe and dimensions of the straight - x1 = b * 0.5 - t_w * 0.5 - r_f * (1 - np.sin(alpha_rad)) - y1 = x1 * np.tan(alpha_rad) - x2 = b * 0.5 - t_w * 0.5 - r_r * (1 - np.sin(alpha_rad)) - y2 = x2 * np.tan(alpha_rad) - y_t = t_f - y1 - r_f * np.cos(alpha_rad) - - # add first two points - self.points.append([0, 0]) - self.points.append([b, 0]) - - # construct the bottom right flange toe radius - if r_f == 0: - self.points.append([b, y_t]) - else: - for i in range(n_r): - # determine polar angle - theta = i * 1.0 / max(1, n_r - 1) * (np.pi * 0.5 - alpha_rad) - - # calculate the locations of the radius points - x = b - r_f + r_f * np.cos(theta) - y = y_t + r_f * np.sin(theta) - - # append the current points to the points list - self.points.append([x, y]) - - # construct the bottom right root radius - if r_r == 0: - self.points.append([t_w, t_f + y2]) - else: - for i in range(n_r): - # determine polar angle - theta = ( - 3.0 / 2 * np.pi - alpha_rad) - (i * 1.0 / max(1, n_r - 1) * ( - np.pi * 0.5 - alpha_rad) - ) - - # calculate the locations of the radius points - x = t_w + r_r + r_r * np.cos(theta) - y = t_f + y2 + r_r * np.cos(alpha_rad) + r_r * np.sin(theta) - - # append the current points to the points list - self.points.append([x, y]) - - # construct the top right root radius - if r_r == 0: - self.points.append([t_w, d - t_f - y2]) - else: - for i in range(n_r): - # determine polar angle - theta = np.pi - i * 1.0 / max(1, n_r - 1) * (np.pi * 0.5 - alpha_rad) - - # calculate the locations of the radius points - x = t_w + r_r + r_r * np.cos(theta) - y = d - t_f - y2 - r_r * np.cos(alpha_rad) + r_r * np.sin( - theta) - - # append the current points to the points list - self.points.append([x, y]) - - # construct the top right flange toe radius - if r_f == 0: - self.points.append([b, d - y_t]) - else: - for i in range(n_r): - # determine polar angle - theta = ( - 3.0 * np.pi / 2 + alpha_rad) + (i * 1.0 / max(1, n_r - 1) * ( - np.pi * 0.5 - alpha_rad) - ) - - # calculate the locations of the radius points - x = b - r_f + r_f * np.cos(theta) - y = d - y_t + r_f * np.sin(theta) - - # append the current points to the points list - self.points.append([x, y]) - - # add the final two points - self.points.append([b, d]) - self.points.append([0, d]) - - # build the facet list - for i in range(len(self.points)): - # if we are not at the last point - if i != len(self.points) - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the loop - else: - self.facets.append([len(self.points) - 1, 0]) - - self.perimeter = list(range(len(self.facets))) - - self.shift_section()
- - -
[docs]class TeeSection(Geometry): - """Constructs a Tee section with the top left corner at *(0, d)*, with depth *d*, width *b*, - flange thickness *t_f*, web thickness *t_w* and root radius *r*, using *n_r* points to - construct the root radius. - - :param float d: Depth of the Tee section - :param float b: Width of the Tee section - :param float t_f: Flange thickness of the Tee section - :param float t_w: Web thickness of the Tee section - :param float r: Root radius of the Tee section - :param int n_r: Number of points discretising the root radius - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a Tee section with a depth of 200, a width of 100, a flange - thickness of 12, a web thickness of 6 and a root radius of 8, using 8 points to discretise the - root radius. A mesh is generated with a maximum triangular area of 3.0:: - - import sectionproperties.pre.sections as sections - - geometry = sections.TeeSection(d=200, b=100, t_f=12, t_w=6, r=8, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[3.0]) - - .. figure:: ../images/sections/tee_geometry.png - :align: center - :scale: 75 % - - Tee section geometry. - - .. figure:: ../images/sections/tee_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, d, b, t_f, t_w, r, n_r, shift=[0, 0]): - """Inits the TeeSection class.""" - - # assign control point - control_points = [[b * 0.5, d - t_f * 0.5]] - - super().__init__(control_points, shift) - - # add first two points - self.points.append([b * 0.5 - t_w * 0.5, 0]) - self.points.append([b * 0.5 + t_w * 0.5, 0]) - - # construct the top right radius - pt = [b * 0.5 + t_w * 0.5 + r, d - t_f - r] - self.draw_radius(pt, r, np.pi, n_r, False) - - # add next four points - self.points.append([b, d - t_f]) - self.points.append([b, d]) - self.points.append([0, d]) - self.points.append([0, d - t_f]) - - # construct the top left radius - pt = [b * 0.5 - t_w * 0.5 - r, d - t_f - r] - self.draw_radius(pt, r, 0.5 * np.pi, n_r, False) - - # build the facet list - for i in range(len(self.points)): - # if we are not at the last point - if i != len(self.points) - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the loop - else: - self.facets.append([len(self.points) - 1, 0]) - - self.perimeter = list(range(len(self.facets))) - - self.shift_section()
- - -
[docs]class AngleSection(Geometry): - """Constructs an angle section with the bottom left corner at the origin *(0, 0)*, with depth - *d*, width *b*, thickness *t*, root radius *r_r* and toe radius *r_t*, using *n_r* points to - construct the radii. - - :param float d: Depth of the angle section - :param float b: Width of the angle section - :param float t: Thickness of the angle section - :param float r_r: Root radius of the angle section - :param float r_t: Toe radius of the angle section - :param int n_r: Number of points discretising the radii - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates an angle section with a depth of 150, a width of 100, a thickness - of 8, a root radius of 12 and a toe radius of 5, using 16 points to discretise the radii. A - mesh is generated with a maximum triangular area of 2.0:: - - import sectionproperties.pre.sections as sections - - geometry = sections.AngleSection(d=150, b=100, t=8, r_r=12, r_t=5, n_r=16) - mesh = geometry.create_mesh(mesh_sizes=[2.0]) - - .. figure:: ../images/sections/angle_geometry.png - :align: center - :scale: 75 % - - Angle section geometry. - - .. figure:: ../images/sections/angle_mesh.png - :align: center - :scale: 75 % - """ - - def __init__(self, d, b, t, r_r, r_t, n_r, shift=[0, 0]): - """Inits the AngleSection class.""" - - # assign control point - control_points = [[t * 0.5, t * 0.5]] - - super().__init__(control_points, shift) - - # add first two points - self.points.append([0, 0]) - self.points.append([b, 0]) - - # construct the bottom toe radius - pt = [b - r_t, t - r_t] - self.draw_radius(pt, r_t, 0, n_r) - - # construct the root radius - pt = [t + r_r, t + r_r] - self.draw_radius(pt, r_r, 1.5 * np.pi, n_r, False) - - # construct the top toe radius - pt = [t - r_t, d - r_t] - self.draw_radius(pt, r_t, 0, n_r) - - # add the next point - self.points.append([0, d]) - - # build the facet list - for i in range(len(self.points)): - # if we are not at the last point - if i != len(self.points) - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the loop - else: - self.facets.append([len(self.points) - 1, 0]) - - self.perimeter = list(range(len(self.facets))) - - self.shift_section()
- - -
[docs]class CeeSection(Geometry): - """Constructs a Cee section with the bottom left corner at the origin *(0, 0)*, with depth *d*, - width *b*, lip *l*, thickness *t* and outer radius *r_out*, using *n_r* points to construct the - radius. If the outer radius is less than the thickness of the Cee Section, the inner radius is - set to zero. - - :param float d: Depth of the Cee section - :param float b: Width of the Cee section - :param float l: Lip of the Cee section - :param float t: Thickness of the Cee section - :param float r_out: Outer radius of the Cee section - :param int n_r: Number of points discretising the outer radius - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - :raises Exception: Lip length must be greater than the outer radius - - The following example creates a Cee section with a depth of 125, a width of 50, a lip of 30, a - thickness of 1.5 and an outer radius of 6, using 8 points to discretise the radius. A mesh is - generated with a maximum triangular area of 0.25:: - - import sectionproperties.pre.sections as sections - - geometry = sections.CeeSection(d=125, b=50, l=30, t=1.5, r_out=6, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[0.25]) - - .. figure:: ../images/sections/cee_geometry.png - :align: center - :scale: 75 % - - Cee section geometry. - - .. figure:: ../images/sections/cee_mesh.png - :align: center - :scale: 75 % - """ - - def __init__(self, d, b, l, t, r_out, n_r, shift=[0, 0]): - """Inits the CeeSection class.""" - - # ensure the lip length is greater than the outer radius - if l < r_out: - raise Exception('Lip length must be greater than the outer radius') - - # assign control point - control_points = [[t * 0.5, d * 0.5]] - - super().__init__(control_points, shift) - - # calculate internal radius - r_in = max(r_out - t, 0) - - # construct the outer bottom left radius - self.draw_radius([r_out, r_out], r_out, np.pi, n_r) - - # construct the outer bottom right radius - self.draw_radius([b - r_out, r_out], r_out, 1.5 * np.pi, n_r) - - if r_out != l: - # add next two points - self.points.append([b, l]) - self.points.append([b - t, l]) - - # construct the inner bottom right radius - self.draw_radius([b - t - r_in, t + r_in], r_in, 0, n_r, False) - - # construct the inner bottom left radius - self.draw_radius([t + r_in, t + r_in], r_in, 1.5 * np.pi, n_r, False) - - # construct the inner top left radius - self.draw_radius([t + r_in, d - t - r_in], r_in, np.pi, n_r, False) - - # construct the inner top right radius - self.draw_radius( - [b - t - r_in, d - t - r_in], r_in, 0.5 * np.pi, n_r, False) - - if r_out != l: - # add next two points - self.points.append([b - t, d - l]) - self.points.append([b, d - l]) - - # construct the outer top right radius - self.draw_radius([b - r_out, d - r_out], r_out, 0, n_r) - - # construct the outer top left radius - self.draw_radius([r_out, d - r_out], r_out, 0.5 * np.pi, n_r) - - # build the facet list - for i in range(len(self.points)): - # if we are not at the last point - if i != len(self.points) - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the loop - else: - self.facets.append([len(self.points) - 1, 0]) - - self.perimeter = list(range(len(self.facets))) - - self.shift_section()
- - -
[docs]class ZedSection(Geometry): - """Constructs a Zed section with the bottom left corner at the origin *(0, 0)*, with depth *d*, - left flange width *b_l*, right flange width *b_r*, lip *l*, thickness *t* and outer radius - *r_out*, using *n_r* points to construct the radius. If the outer radius is less than the - thickness of the Zed Section, the inner radius is set to zero. - - :param float d: Depth of the Zed section - :param float b_l: Left flange width of the Zed section - :param float b_r: Right flange width of the Zed section - :param float l: Lip of the Zed section - :param float t: Thickness of the Zed section - :param float r_out: Outer radius of the Zed section - :param int n_r: Number of points discretising the outer radius - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - :raises Exception: Lip length must be greater than the outer radius - - The following example creates a Zed section with a depth of 100, a left flange width of 40, a - right flange width of 50, a lip of 20, a thickness of 1.2 and an outer radius of 5, using 8 - points to discretise the radius. A mesh is generated with a maximum triangular area of 0.15:: - - import sectionproperties.pre.sections as sections - - geometry = sections.ZedSection(d=100, b_l=40, b_r=50, l=20, t=1.2, r_out=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[0.15]) - - .. figure:: ../images/sections/zed_geometry.png - :align: center - :scale: 75 % - - Zed section geometry. - - .. figure:: ../images/sections/zed_mesh.png - :align: center - :scale: 75 % - """ - - def __init__(self, d, b_l, b_r, l, t, r_out, n_r, shift=[0, 0]): - """Inits the ZedSection class.""" - - # ensure the lip length is greater than the outer radius - if l < r_out: - raise Exception('Lip length must be greater than the outer radius') - - # assign control point - control_points = [[t * 0.5, d * 0.5]] - - super().__init__(control_points, shift) - - # calculate internal radius - r_in = max(r_out - t, 0) - - # construct the outer bottom left radius - self.draw_radius([r_out, r_out], r_out, np.pi, n_r) - - # construct the outer bottom right radius - self.draw_radius([b_r - r_out, r_out], r_out, 1.5 * np.pi, n_r) - - if r_out != l: - # add next two points - self.points.append([b_r, l]) - self.points.append([b_r - t, l]) - - # construct the inner bottom right radius - self.draw_radius([b_r - t - r_in, t + r_in], r_in, 0, n_r, False) - - # construct the inner bottom left radius - self.draw_radius([t + r_in, t + r_in], r_in, 1.5 * np.pi, n_r, False) - - # construct the outer top right radius - self.draw_radius([t - r_out, d - r_out], r_out, 0, n_r) - - # construct the outer top left radius - self.draw_radius([t - b_l + r_out, d - r_out], r_out, 0.5 * np.pi, n_r) - - if r_out != l: - # add the next two points - self.points.append([t - b_l, d - l]) - self.points.append([t - b_l + t, d - l]) - - # construct the inner top left radius - self.draw_radius([2 * t - b_l + r_in, d - t - r_in], r_in, np.pi, n_r, False) - - # construct the inner top right radius - self.draw_radius([-r_in, d - t - r_in], r_in, 0.5 * np.pi, n_r, False) - - # build the facet list - for i in range(len(self.points)): - # if we are not at the last point - if i != len(self.points) - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the loop - else: - self.facets.append([len(self.points) - 1, 0]) - - self.perimeter = list(range(len(self.facets))) - - self.shift_section()
- - -
[docs]class CruciformSection(Geometry): - """Constructs a cruciform section centered at the origin *(0, 0)*, with depth *d*, width *b*, - thickness *t* and root radius *r*, using *n_r* points to construct the root radius. - - :param float d: Depth of the cruciform section - :param float b: Width of the cruciform section - :param float t: Thickness of the cruciform section - :param float r: Root radius of the cruciform section - :param int n_r: Number of points discretising the root radius - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a cruciform section with a depth of 250, a width of 175, a - thickness of 12 and a root radius of 16, using 16 points to discretise the radius. A mesh is - generated with a maximum triangular area of 5.0:: - - import sectionproperties.pre.sections as sections - - geometry = sections.CruciformSection(d=250, b=175, t=12, r=16, n_r=16) - mesh = geometry.create_mesh(mesh_sizes=[5.0]) - - .. figure:: ../images/sections/cruciform_geometry.png - :align: center - :scale: 75 % - - Cruciform section geometry. - - .. figure:: ../images/sections/cruciform_mesh.png - :align: center - :scale: 75 % - """ - - def __init__(self, d, b, t, r, n_r, shift=[0, 0]): - """Inits the CruciformSection class.""" - - # assign control point - control_points = [[0, 0]] - - super().__init__(control_points, shift) - - # add first two points - self.points.append([-t * 0.5, -d * 0.5]) - self.points.append([t * 0.5, -d * 0.5]) - - # construct the bottom right radius - pt = [0.5 * t + r, -0.5 * t - r] - self.draw_radius(pt, r, np.pi, n_r, False) - - # add the next two points - self.points.append([0.5 * b, -t * 0.5]) - self.points.append([0.5 * b, t * 0.5]) - - # construct the top right radius - pt = [0.5 * t + r, 0.5 * t + r] - self.draw_radius(pt, r, 1.5 * np.pi, n_r, False) - - # add the next two points - self.points.append([t * 0.5, 0.5 * d]) - self.points.append([-t * 0.5, 0.5 * d]) - - # construct the top left radius - pt = [-0.5 * t - r, 0.5 * t + r] - self.draw_radius(pt, r, 0, n_r, False) - - # add the next two points - self.points.append([-0.5 * b, t * 0.5]) - self.points.append([-0.5 * b, -t * 0.5]) - - # construct the bottom left radius - pt = [-0.5 * t - r, -0.5 * t - r] - self.draw_radius(pt, r, 0.5 * np.pi, n_r, False) - - # build the facet list - for i in range(len(self.points)): - # if we are not at the last point - if i != len(self.points) - 1: - self.facets.append([i, i + 1]) - # if we are at the last point, complete the loop - else: - self.facets.append([len(self.points) - 1, 0]) - - self.perimeter = list(range(len(self.facets))) - - self.shift_section()
- - -
[docs]class PolygonSection(Geometry): - """Constructs a regular hollow polygon section centered at *(0, 0)*, with a pitch circle - diameter of bounding polygon *d*, thickness *t*, number of sides *n_sides* and an optional - inner radius *r_in*, using *n_r* points to construct the inner and outer radii (if radii is - specified). - - :param float d: Pitch circle diameter of the outer bounding polygon (i.e. diameter of circle - that passes through all vertices of the outer polygon) - :param float t: Thickness of the polygon section wall - :param float r_in: Inner radius of the polygon corners. By default, if not specified, a polygon - with no corner radii is generated. - :param int n_r: Number of points discretising the inner and outer radii, ignored if no inner - radii is specified - :param rot: Initial counterclockwise rotation in degrees. By default bottom face is aligned - with x axis. - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - :raises Exception: Number of sides in polygon must be greater than or equal to 3 - - The following example creates an Octagonal section (8 sides) with a diameter of 200, a - thickness of 6 and an inner radius of 20, using 12 points to discretise the inner and outer - radii. A mesh is generated with a maximum triangular area of 5:: - - import sectionproperties.pre.sections as sections - - geometry = sections.PolygonSection(d=200, t=6, n_sides=8, r_in=20, n_r=12) - mesh = geometry.create_mesh(mesh_sizes=[5]) - - .. figure:: ../images/sections/polygon_geometry.png - :align: center - :scale: 75 % - - Octagonal section geometry. - - .. figure:: ../images/sections/polygon_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, d, t, n_sides, r_in=0, n_r=1, rot=0, shift=[0, 0]): - """Inits the PolygonSection class.""" - - if n_sides < 3: - msg = 'n_sides required to be greater than 3 for PolygonSection class' - raise Exception(msg) - - # initial rotation - rot = rot * np.pi / 180 # radians - - # determine triangular segment angle - alpha = 2 * np.pi / n_sides # radians - - # determine distance from origin to point perpendicular on face of side - a_out = d / 2 * np.cos(alpha / 2) - a_in = a_out - t - - # determine side length for outer & inner faces neglecting radii - side_length_out = d * np.sin(alpha / 2) - side_length_in = a_in / a_out * side_length_out - - # check limit on internal radii, if exceeded then radii merge to circle - if r_in > a_in: - r_in = a_in - circle = True - else: - circle = False - - # calculate external radius, if r_in is zero, r_out also is zero - if r_in == 0: - r_out = 0 - n_r = 1 - else: - r_out = r_in + t - - # equivalent side length of half the corner radii triangular segment - c_out = r_out * (side_length_out / 2) / a_out - c_in = r_in * (side_length_in / 2) / a_in - - # determine straight side length between corner radii (if present) - side_length_straight_out = side_length_out - (2 * c_out) - side_length_straight_in = side_length_in - (2 * c_in) - - # assign control point central on bottom side length & rotate to initial rotation specified - control_points = [self.rotate([0, -a_out + t / 2], rot)] - - super().__init__(control_points, shift) - - # temp list for repeating geometry - base_points = [] - - # specify a hole in the centre of the Polygon section - self.holes = [[0, 0]] - - # start at bottom face, constructing one corner radii, then rotate by initial rotation + - # alpha and repeat for n_side number of times to form full section perimeter - - # construct the first radius (bottom right) - for i in range(n_r): - # determine polar angle - theta = 1 / 2 * np.pi + i * 1.0 / max(1, n_r - 1) * alpha - - # calculate location of inner and outer points - x_outer = side_length_straight_out / 2 - r_out * np.cos(theta) - y_outer = -a_out + r_out - r_out * np.sin(theta) - x_inner = side_length_straight_in / 2 - r_in * np.cos(theta) - y_inner = -a_in + r_in - r_in * np.sin(theta) - - # append the current temporary points to the temporary points list - base_points.append([x_outer, y_outer]) - base_points.append([x_inner, y_inner]) - - # if radii merged to circle with an outer diameter of a_out then skip last point as causes - # overlapping end points which causes meshing issues if geometry is not cleaned by user - if circle: - base_points = base_points[0:-2] - - # iterate and add subsequent corner radii one point at a time for each side - for i in range(n_sides): - for point in base_points: - point_new = self.rotate(point, alpha * i + rot) - self.points.append(point_new) - - # build the facet list - num_points = int(len(self.points) / 2) - for i in range(num_points): - # if we are not at the last point - if i != num_points - 1: - self.facets.append([i * 2, i * 2 + 2]) - self.facets.append([i * 2 + 1, i * 2 + 3]) - # if we are at the last point, complete the loop - else: - self.facets.append([i * 2, 0]) - self.facets.append([i * 2 + 1, 1]) - - self.perimeter = list(range(0, len(self.facets), 2)) - - self.shift_section() - - def rotate(self, point, angle): - """ - Rotate a point counterclockwise by a given angle around origin [0, 0] - - :param list point: Point coordinates to be rotated - :param float angle: Angle to rotate point coordinates - :return: Coordinates of rotated point - :rtype: list[float, float] - """ - - pt_x, pt_y = point - - c = np.cos(angle) - s = np.sin(angle) - - new_x = c * pt_x - s * pt_y - new_y = s * pt_x + c * pt_y - - return [new_x, new_y]
- - -
[docs]class BoxGirderSection(Geometry): - """Constructs a Box Girder section centered at at *(max(b_t, b_b)/2, d/2)*, with depth *d*, top - width *b_t*, bottom width *b_b*, top flange thickness *t_ft*, bottom flange thickness *t_fb* - and web thickness *t_w*. - - :param float d: Depth of the Box Girder section - :param float b_t: Top width of the Box Girder section - :param float b_b: Bottom width of the Box Girder section - :param float t_ft: Top lange thickness of the Box Girder section - :param float t_fb: Bottom flange thickness of the Box Girder section - :param float t_w: Web thickness of the Box Girder section - :param shift: Vector that shifts the cross-section by *(x, y)* - :type shift: list[float, float] - - The following example creates a Box Gider section with a depth of 1200, a top width of 1200, a - bottom width of 400, a top flange thickness of 16, a bottom flange thickness of 12 and a web - thickness of 8. A mesh is generated with a maximum triangular area of 5.0:: - - import sectionproperties.pre.sections as sections - - geometry = sections.BoxGirderSection(d=1200, b_t=1200, b_b=400, t_ft=100, t_fb=80, t_w=50) - mesh = geometry.create_mesh(mesh_sizes=[200.0]) - - .. figure:: ../images/sections/box_girder_geometry.png - :align: center - :scale: 75 % - - Box Girder geometry. - - .. figure:: ../images/sections/box_girder_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - """ - - def __init__(self, d, b_t, b_b, t_ft, t_fb, t_w, shift=[0, 0]): - """Inits the BoxGirderSection class.""" - - # assign control point - control_points = [[max(b_t, b_b) * 0.5, t_fb * 0.5]] - - super().__init__(control_points, shift) - - # calculate central axis - x_c = max(b_t, b_b) * 0.5 - - # specify a hole in the centre of the Box Girder - self.holes = [[x_c, d * 0.5]] - - # determine side wall angle - if b_t < b_b: - phi_b = np.arctan2(d, 0.5 * (b_b - b_t)) - phi_t = np.pi - phi_b - else: - phi_t = np.arctan2(d, 0.5 * (b_t - b_b)) - phi_b = np.pi - phi_t - - # determine inner wall x-offsets - x_bot = t_fb / np.tan(np.pi - phi_b) - x_top = t_ft / np.tan(np.pi - phi_t) - web_x = abs(t_w / np.sin(np.pi - phi_b)) - - # add outer points - self.points.append([x_c - 0.5 * b_b, 0]) - self.points.append([x_c + 0.5 * b_b, 0]) - self.points.append([x_c + 0.5 * b_t, d]) - self.points.append([x_c - 0.5 * b_t, d]) - - # add inner points - self.points.append([x_c - 0.5 * b_b - x_bot + web_x, t_fb]) - self.points.append([x_c + 0.5 * b_b + x_bot - web_x, t_fb]) - self.points.append([x_c + 0.5 * b_t + x_top - web_x, d - t_ft]) - self.points.append([x_c - 0.5 * b_t - x_top + web_x, d - t_ft]) - - # build facet list - self.facets = [[0, 1], [1, 2], [2, 3], [3, 0], [4, 5], [5, 6], [6, 7], [7, 4]] - self.perimeter = [0, 1, 2, 3] - - self.shift_section()
- - -
[docs]class MergedSection(Geometry): - """Merges a number of section geometries into one geometry. Note that for the meshing algorithm - to work, there needs to be connectivity between all regions of the provided geometries. - Overlapping of geometries is permitted. - - :param sections: A list of geometry objects to merge into one - :class:`~sectionproperties.pre.sections.Geometry` object - :type sections: list[:class:`~sectionproperties.pre.sections.Geometry`] - - The following example creates a combined cross-section with a 150x100x6 RHS placed on its side - on top of a 200UB25.4. A mesh is generated with a maximum triangle size of 5.0 for the - I-section and 2.5 for the RHS:: - - import sectionproperties.pre.sections as sections - - isection = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8) - box = sections.Rhs(d=100, b=150, t=6, r_out=15, n_r=8, shift=[-8.5, 203]) - - geometry = sections.MergedSection([isection, box]) - geometry.clean_geometry() - mesh = geometry.create_mesh(mesh_sizes=[5.0, 2.5]) - - .. figure:: ../images/sections/merged_geometry.png - :align: center - :scale: 75 % - - Merged section geometry. - - .. figure:: ../images/sections/merged_mesh.png - :align: center - :scale: 75 % - """ - - def __init__(self, sections): - """Inits the MergedSection class.""" - - super().__init__([], [0, 0]) - - point_count = 0 - - # loop through all sections - for section in sections: - # add facets - for facet in section.facets: - self.facets.append([facet[0] + point_count, facet[1] + point_count]) - - # add points and count points - for point in section.points: - self.points.append([point[0], point[1]]) - point_count += 1 - - # add holes - for hole in section.holes: - self.holes.append([hole[0], hole[1]]) - - # add control points - for control_point in section.control_points: - self.control_points.append([control_point[0], control_point[1]])
-
- -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/_sources/index.rst.txt b/docs/build/html/_sources/index.rst.txt deleted file mode 100644 index 8354b47c..00000000 --- a/docs/build/html/_sources/index.rst.txt +++ /dev/null @@ -1,76 +0,0 @@ -.. sectionproperties documentation master file, created by - sphinx-quickstart on Wed Jul 11 20:01:55 2018. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -.. image:: images/logo.png - :width: 100 % - :alt: sectionproperties - :align: left - -Documentation -============= - -*sectionproperties* is a python package for the analysis of arbitrary cross-sections using the -finite element method written by Robbie van Leeuwen. *sectionproperties* can be used to determine -section properties to be used in structural design and visualise cross-sectional stresses resulting -from combinations of applied forces and bending moments. - -A list of the `current features of the package and implementation goals for future releases -`_ -can be found in the README file on github. - -.. toctree:: - :maxdepth: 1 - :caption: Contents: - - rst/installation - rst/structure - rst/geom_mesh - rst/analysis - rst/post - rst/examples - rst/api - rst/theory - -Here's a quick example that harnesses some of the power of *sectionproperties* and shows its simplicity:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - # create geometry of the cross-section - geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8) - - # generate a finite element mesh - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - - # create a CrossSection object for analysis - section = CrossSection(geometry, mesh) - - # calculate various cross-section properties - section.calculate_geometric_properties() - section.calculate_warping_properties() - - # print some of the calculated section properties - print(section.get_area()) # cross-section area - >>>3231.80 - print(section.get_ic()) # second moments of area about the centroidal axis - >>>(23544664.29, 3063383.07, 0.00) - print(section.get_j()) # torsion constant - >>>62907.79 - print(section.get_As()) # shear areas in the x & y directions - >>>(1842.17, 1120.18) - -Support -------- - -Contact me on my email robbie.vanleeuwen@gmail.com or raise an issue on the github issue -tracker using one of the `issue templates -`_. -If you have a request for a feature to be added to the *sectionproperties* package, -please don't hesitate to get in touch - -License -------- - -The project is licensed under the MIT license. diff --git a/docs/build/html/_sources/rst/analysis.rst.txt b/docs/build/html/_sources/rst/analysis.rst.txt deleted file mode 100644 index 6bb01498..00000000 --- a/docs/build/html/_sources/rst/analysis.rst.txt +++ /dev/null @@ -1,80 +0,0 @@ -.. _label-analysis: - -Running an Analysis -=================== - -The first step in running a cross-section analysis is the creation of a -:class:`~sectionproperties.analysis.cross_section.CrossSection` object. This class -stores the structural geometry and finite element mesh and provides methods to -perform various types of cross-section analyses. - -.. autoclass:: sectionproperties.analysis.cross_section.CrossSection - :show-inheritance: - :noindex: - -Checking the Mesh Quality -------------------------- - -Before carrying out a cross-section analysis it is a good idea to check the quality -of the finite element mesh. Some useful methods are provided to display mesh statistics -and to plot the finite element mesh: - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.display_mesh_info - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.plot_mesh - :noindex: - -Geometric Analysis ------------------- - -A geometric analysis calculates the area properties of the cross-section. - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.calculate_geometric_properties - :noindex: - -Plastic Analysis ----------------- - -A plastic analysis calculates the plastic properties of the cross-section. - -.. note:: A geometric analysis must be performed on the CrossSection object before - a plastic analysis is carried out. - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.calculate_plastic_properties - :noindex: - -Warping Analysis ----------------- - -A warping analysis calculates the torsion and shear properties of the cross-section. - -.. note:: A geometric analysis must be performed on the CrossSection object before - a warping analysis is carried out. - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.calculate_warping_properties - :noindex: - -Stress Analysis ---------------- - -A stress analysis calculates the cross-section stresses arising from a set of forces -and moments. Executing this method returns a :class:`~sectionproperties.analysis.cross_section.StressResult` -object which stores the cross-section stresses and provides stress plotting functions. - -.. note:: A geometric and warping analysis must be performed on the CrossSection - object before a stress analysis is carried out. - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.calculate_stress - :noindex: - -Calculating Frame Properties ----------------------------- - -Calculates the cross-section properties required for a 2D or 3D frame analysis. - -.. note:: This method is significantly faster than performing a geometric and - a warping analysis and has no prerequisites. - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.calculate_frame_properties - :noindex: diff --git a/docs/build/html/_sources/rst/api.rst.txt b/docs/build/html/_sources/rst/api.rst.txt deleted file mode 100644 index 15d23a50..00000000 --- a/docs/build/html/_sources/rst/api.rst.txt +++ /dev/null @@ -1,406 +0,0 @@ -Python API Documentation -======================== - -Pre-Processor Package ---------------------- - -.. _label-sections-module: - -*sections* Module -^^^^^^^^^^^^^^^^^ - -Geometry Class -"""""""""""""" -.. autoclass:: sectionproperties.pre.sections.Geometry - :members: - -CustomSection Class -""""""""""""""""""" -.. autoclass:: sectionproperties.pre.sections.CustomSection - :show-inheritance: - -RectangularSection Class -"""""""""""""""""""""""" -.. autoclass:: sectionproperties.pre.sections.RectangularSection - :show-inheritance: - -CircularSection Class -""""""""""""""""""""" -.. autoclass:: sectionproperties.pre.sections.CircularSection - :show-inheritance: - -Chs Class -""""""""" -.. autoclass:: sectionproperties.pre.sections.Chs - :show-inheritance: - -EllipticalSection Class -""""""""""""""""""""""" -.. autoclass:: sectionproperties.pre.sections.EllipticalSection - :show-inheritance: - -Ehs Class -""""""""" -.. autoclass:: sectionproperties.pre.sections.Ehs - :show-inheritance: - -Rhs Class -""""""""" -.. autoclass:: sectionproperties.pre.sections.Rhs - :show-inheritance: - -ISection Class -"""""""""""""" - .. autoclass:: sectionproperties.pre.sections.ISection - :show-inheritance: - -MonoISection Class -"""""""""""""""""" - .. autoclass:: sectionproperties.pre.sections.MonoISection - :show-inheritance: - -TaperedFlangeISection Class -""""""""""""""""""""""""""" - .. autoclass:: sectionproperties.pre.sections.TaperedFlangeISection - :show-inheritance: - -PfcSection Class -"""""""""""""""" - .. autoclass:: sectionproperties.pre.sections.PfcSection - :show-inheritance: - -TaperedFlangeChannel Class -"""""""""""""""""""""""""" - .. autoclass:: sectionproperties.pre.sections.TaperedFlangeChannel - :show-inheritance: - -TeeSection Class -"""""""""""""""" - .. autoclass:: sectionproperties.pre.sections.TeeSection - :show-inheritance: - -AngleSection Class -"""""""""""""""""" - .. autoclass:: sectionproperties.pre.sections.AngleSection - :show-inheritance: - -CeeSection Class -"""""""""""""""" - .. autoclass:: sectionproperties.pre.sections.CeeSection - :show-inheritance: - -ZedSection Class -"""""""""""""""" - .. autoclass:: sectionproperties.pre.sections.ZedSection - :show-inheritance: - -CruciformSection Class -"""""""""""""""""""""" - .. autoclass:: sectionproperties.pre.sections.CruciformSection - :show-inheritance: - -PolygonSection Class -"""""""""""""""""""" - .. autoclass:: sectionproperties.pre.sections.PolygonSection - :show-inheritance: - -BoxGirderSection Class -"""""""""""""""""""""" - .. autoclass:: sectionproperties.pre.sections.BoxGirderSection - :show-inheritance: - -MergedSection Class -""""""""""""""""""" - .. autoclass:: sectionproperties.pre.sections.MergedSection - :show-inheritance: - - -*pre* Module -^^^^^^^^^^^^ - -Material Class -"""""""""""""" - - .. autoclass:: sectionproperties.pre.pre.Material - :show-inheritance: - :members: - -GeometryCleaner Class -""""""""""""""""""""" - - .. autoclass:: sectionproperties.pre.pre.GeometryCleaner - :show-inheritance: - :members: - -pre Functions -""""""""""""" - -.. autofunction:: sectionproperties.pre.pre.create_mesh - - -*offset* Module -^^^^^^^^^^^^^^^ - -.. autofunction:: sectionproperties.pre.offset.offset_perimeter - - -*nastran_sections* Module -^^^^^^^^^^^^^^^^^^^^^^^^^ -This module contains cross-sections as defined by Nastran and Nastran-based programs, -such as MYSTRAN and ASTROS. - -BARSection Class -"""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.BARSection - :show-inheritance: - :members: - -BOXSection Class -"""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.BOXSection - :show-inheritance: - :members: - -BOX1Section Class -""""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.BOX1Section - :show-inheritance: - :members: - -CHANSection Class -""""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.CHANSection - :show-inheritance: - :members: - -CHAN1Section Class -"""""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.CHAN1Section - :show-inheritance: - :members: - -CHAN2Section Class -"""""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.CHAN2Section - :show-inheritance: - :members: - -CROSSSection Class -""""""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.CROSSSection - :show-inheritance: - :members: - -DBOXSection Class -""""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.DBOXSection - :show-inheritance: - :members: - -FCROSSSection Class -""""""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.FCROSSSection - :show-inheritance: - :members: - -GBOXSection Class -""""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.GBOXSection - :show-inheritance: - :members: - -HSection Class -"""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.HSection - :show-inheritance: - :members: - -HATSection Class -"""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.HATSection - :show-inheritance: - :members: - -HAT1Section Class -""""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.HAT1Section - :show-inheritance: - :members: - -HEXASection Class -""""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.HEXASection - :show-inheritance: - :members: - -NISection Class -""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.NISection - :show-inheritance: - :members: - -I1Section Class -""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.I1Section - :show-inheritance: - :members: - -LSection Class -"""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.LSection - :show-inheritance: - :members: - -RODSection Class -"""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.RODSection - :show-inheritance: - :members: - -TSection Class -"""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.TSection - :show-inheritance: - :members: - -T1Section Class -""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.T1Section - :show-inheritance: - :members: - -T2Section Class -""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.T2Section - :show-inheritance: - :members: - -TUBESection Class -""""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.TUBESection - :show-inheritance: - :members: - -TUBE2Section Class -"""""""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.TUBE2Section - :show-inheritance: - :members: - -ZSection Class -"""""""""""""" -.. autoclass:: sectionproperties.pre.nastran_sections.ZSection - :show-inheritance: - :members: - -References -"""""""""" -.. [1] MSC Nastran Quick Reference Guide 2012, - PBEAML - Simple Beam Cross-Section Property, pp. 2890-2894 - https://simcompanion.mscsoftware.com/infocenter/index?page=content&id=DOC10351 -.. [2] Siemens NX Nastran 12 Quick Reference Guide, - PBEAML, pp. 16-59 - 16-62 - https://docs.plm.automation.siemens.com/data_services/resources/nxnastran/12/help/tdoc/en_US/pdf/QRG.pdf -.. [3] AutoDesk Nastran Online Documentation, Nastran Reference Guide, - Section 4 - Bulk Data, PBEAML - http://help.autodesk.com/view/NSTRN/2018/ENU/?guid=GUID-B7044BA7-3C26-49DA-9EE7-DA7505FD4B2C -.. [4] Users Reference Manual for the MYSTRAN General Purpose Finite Element Structural Analysis Computer Program, - Jan. 2019, Section 6.4.1.53 - PBARL, pp. 154-156 - https://www.mystran.com/Executable/MYSTRAN-Users-Manual.pdf -.. [5] Astros Enhancements - Volume III - Astros Theoretical Manual, - Section 5.1.3.2, pp. 56 - https://apps.dtic.mil/dtic/tr/fulltext/u2/a308134.pdf - -Analysis Package ----------------- - -*cross_section* Module -^^^^^^^^^^^^^^^^^^^^^^ - -CrossSection Class -"""""""""""""""""" - - .. autoclass:: sectionproperties.analysis.cross_section.CrossSection - :show-inheritance: - :members: - -PlasticSection Class -"""""""""""""""""""" - - .. autoclass:: sectionproperties.analysis.cross_section.PlasticSection - :show-inheritance: - :members: - -StressPost Class -"""""""""""""""" - -.. autoclass:: sectionproperties.analysis.cross_section.StressPost - :show-inheritance: - :members: - -MaterialGroup Class -""""""""""""""""""" - - .. autoclass:: sectionproperties.analysis.cross_section.MaterialGroup - :show-inheritance: - :members: - -StressResult Class -"""""""""""""""""" - -.. autoclass:: sectionproperties.analysis.cross_section.StressResult - :show-inheritance: - :members: - -SectionProperties Class -""""""""""""""""""""""" - -.. autoclass:: sectionproperties.analysis.cross_section.SectionProperties - :show-inheritance: - :members: - -*fea* Module -^^^^^^^^^^^^ - -Tri6 Class -"""""""""" - -.. autoclass:: sectionproperties.analysis.fea.Tri6 - :show-inheritance: - :members: - -fea Functions -""""""""""""" - -.. autofunction:: sectionproperties.analysis.fea.gauss_points -.. autofunction:: sectionproperties.analysis.fea.shape_function -.. autofunction:: sectionproperties.analysis.fea.extrapolate_to_nodes -.. autofunction:: sectionproperties.analysis.fea.principal_coordinate -.. autofunction:: sectionproperties.analysis.fea.global_coordinate -.. autofunction:: sectionproperties.analysis.fea.point_above_line - -*solver* Module -^^^^^^^^^^^^^^^ - -solver Functions -"""""""""""""""" - -.. autofunction:: sectionproperties.analysis.solver.solve_cgs -.. autofunction:: sectionproperties.analysis.solver.solve_cgs_lagrange -.. autofunction:: sectionproperties.analysis.solver.solve_direct -.. autofunction:: sectionproperties.analysis.solver.solve_direct_lagrange -.. autofunction:: sectionproperties.analysis.solver.function_timer - -Post-Processor Package ----------------------- - -*post* Module -^^^^^^^^^^^^^ - -post Functions -"""""""""""""" - -.. autofunction:: sectionproperties.post.post.setup_plot -.. autofunction:: sectionproperties.post.post.finish_plot -.. autofunction:: sectionproperties.post.post.draw_principal_axis -.. autofunction:: sectionproperties.post.post.print_results diff --git a/docs/build/html/_sources/rst/examples.rst.txt b/docs/build/html/_sources/rst/examples.rst.txt deleted file mode 100644 index 9a96e622..00000000 --- a/docs/build/html/_sources/rst/examples.rst.txt +++ /dev/null @@ -1,1130 +0,0 @@ -.. _label-examples: - -Examples -======== - -The following examples are located in the ``sectionproperties.examples`` -package. - -Simple Example --------------- - -The following example calculates the geometric, warping and plastic properties -of a 50 mm diameter circle. The circle is discretised with 64 points and a mesh -size of 2.5 mm\ :sup:`2`. - -The geometry and mesh are plotted, and the mesh information printed to the terminal -before the analysis is carried out. Detailed time information is printed to the -terminal during the cross-section analysis stage. Once the analysis is complete, -the cross-section properties are printed to the terminal. The centroidal -axis second moments of area and torsion constant are saved to variables and it -is shown that, for a circle, the torsion constant is equal to the sum of the -second moments of area:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - # create a 50 diameter circle discretised by 64 points - geometry = sections.CircularSection(d=50, n=64) - geometry.plot_geometry() # plot the geometry - - # create a mesh with a mesh size of 2.5 - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - - section = CrossSection(geometry, mesh) # create a CrossSection object - section.display_mesh_info() # display the mesh information - section.plot_mesh() # plot the generated mesh - - # perform a geometric, warping and plastic analysis, displaying the time info - section.calculate_geometric_properties(time_info=True) - section.calculate_warping_properties(time_info=True) - section.calculate_plastic_properties(time_info=True) - - # print the results to the terminal - section.display_results() - - # get the second moments of area and the torsion constant - (ixx_c, iyy_c, ixy_c) = section.get_ic() - j = section.get_j() - - # print the sum of the second moments of area and the torsion constant - print("Ixx + Iyy = {0:.3f}".format(ixx_c + iyy_c)) - print("J = {0:.3f}".format(j)) - -The following plots are generated by the above example: - -.. figure:: ../images/sections/circle_geometry.png - :align: center - :scale: 75 % - - Circular section geometry. - -.. figure:: ../images/sections/circle_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - -The following is printed to the terminal: - -.. code-block:: text - - Mesh Statistics: - --2562 nodes - --1247 elements - --1 region - - --Calculating geometric section properties... - ----completed in 0.765906 seconds--- - - --Assembing 2562x2562 stiffness matrix and load vector... - ----completed in 1.107300 seconds--- - --Solving for the warping function using the direct solver... - ----completed in 0.023138 seconds--- - --Computing the torsion constant... - ----completed in 0.000254 seconds--- - --Assembling shear function load vectors... - ----completed in 1.150968 seconds--- - --Solving for the shear functions using the direct solver... - ----completed in 0.136840 seconds--- - --Assembling shear centre and warping moment integrals... - ----completed in 0.688029 seconds--- - --Calculating shear centres... - ----completed in 0.000054 seconds--- - --Assembling shear deformation coefficients... - ----completed in 1.184013 seconds--- - --Assembling monosymmetry integrals... - ----completed in 0.784923 seconds--- - - --Calculating plastic properties... - ----completed in 0.669841 seconds--- - - Section Properties: - A = 1.960343e+03 - Qx = 1.900702e-13 - Qy = 3.451461e-12 - cx = 1.760642e-15 - cy = 9.695762e-17 - Ixx_g = 3.058119e+05 - Iyy_g = 3.058119e+05 - Ixy_g = -2.785328e-12 - Ixx_c = 3.058119e+05 - Iyy_c = 3.058119e+05 - Ixy_c = -2.785328e-12 - Zxx+ = 1.223248e+04 - Zxx- = 1.223248e+04 - Zyy+ = 1.223248e+04 - Zyy- = 1.223248e+04 - rx = 1.248996e+01 - ry = 1.248996e+01 - phi = 0.000000e+00 - I11_c = 3.058119e+05 - I22_c = 3.058119e+05 - Z11+ = 1.223248e+04 - Z11- = 1.223248e+04 - Z22+ = 1.223248e+04 - Z22- = 1.223248e+04 - r11 = 1.248996e+01 - r22 = 1.248996e+01 - J = 6.116232e+05 - Iw = 4.700106e-02 - x_se = -8.788834e-06 - y_se = -2.644033e-06 - x_st = -8.788834e-06 - y_st = -2.644033e-06 - x1_se = -8.788834e-06 - y2_se = -2.644033e-06 - A_sx = 1.680296e+03 - A_sy = 1.680296e+03 - A_s11 = 1.680296e+03 - A_s22 = 1.680296e+03 - betax+ = -5.288066e-06 - betax- = 5.288066e-06 - betay+ = -1.757767e-05 - betay- = 1.757767e-05 - beta11+= -5.288066e-06 - beta11-= 5.288066e-06 - beta22+= -1.757767e-05 - beta22-= 1.757767e-05 - x_pc = 5.313355e-15 - y_pc = 3.649671e-15 - Sxx = 2.078317e+04 - Syy = 2.078317e+04 - SF_xx+ = 1.699016e+00 - SF_xx- = 1.699016e+00 - SF_yy+ = 1.699016e+00 - SF_yy- = 1.699016e+00 - x11_pc = 5.313355e-15 - y22_pc = 3.649671e-15 - S11 = 2.078317e+04 - S22 = 2.078317e+04 - SF_11+ = 1.699016e+00 - SF_11- = 1.699016e+00 - SF_22+ = 1.699016e+00 - SF_22- = 1.699016e+00 - - Ixx + Iyy = 611623.837 - J = 611623.214 - -Creating a Nastran Section --------------------------- - -The following example demonstrates how to create a cross-section defined in -a Nastran-based finite element analysis program. The following creates a -HAT1 cross-section and calculates the geometric, warping and plastic properties. -The HAT1 cross-section is meshed with a maximum elemental area of 0.005. - -The geometry and mesh are plotted, and the mesh information printed to the terminal -before the analysis is carried out. Detailed time information is printed to the -terminal during the cross-section analysis stage. Once the analysis is complete, -the cross-section properties are printed to the terminal. The centroidal -axis second moments of area and torsion constant are saved to variables and it -is shown that, for non-circular sections, the torsion constant is not equal to the -sum of the second moments of area:: - - import sectionproperties.pre.nastran_sections as nsections - from sectionproperties.analysis.cross_section import CrossSection - - # create a HAT1 section - geometry = nsections.HAT1Section(DIM1=4.0, DIM2=2.0, DIM3=1.5, DIM4=0.1875, DIM5=0.375) - geometry.plot_geometry() # plot the geometry - - # create a mesh with a maximum elemental area of 0.005 - mesh = geometry.create_mesh(mesh_sizes=[0.005]) - - section = CrossSection(geometry, mesh) # create a CrossSection object - section.display_mesh_info() # display the mesh information - section.plot_mesh() # plot the generated mesh` - - # perform a geometric, warping and plastic anaylsis, displaying the time info - section.calculate_geometric_properties(time_info=True) - section.calculate_warping_properties(time_info=True) - section.calculate_plastic_properties(time_info=True) - - # print the results to the terminal - section.display_results() - - # get the second moments of area and the torsion constant - (ixx_c, iyy_c, ixy_c) = section.get_ic() - j = section.get_j() - - # print the sum of the second moments of area and the torsion constant - print("Ixx + Iyy = {0:.3f}".format(ixx_c + iyy_c)) - print("J = {0:.3f}".format(j)) - -The following plots are generated by the above example: - -.. figure:: ../images/sections/hat1_geometry.png - :align: center - :scale: 75 % - - Circular section geometry. - -.. figure:: ../images/sections/hat1_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - -The following is printed to the terminal: - -.. code-block:: text - - Mesh Statistics: - --2038 nodes - --926 elements - --2 regions - - --Calculating geometric section properties... - ----completed in 0.367074 seconds--- - - --Assembing 2038x2038 stiffness matrix and load vector... - ----completed in 0.515934 seconds--- - --Solving for the warping function using the direct solver... - ----completed in 0.005604 seconds--- - --Computing the torsion constant... - ----completed in 0.000104 seconds--- - --Assembling shear function load vectors... - ----completed in 0.525532 seconds--- - --Solving for the shear functions using the direct solver... - ----completed in 0.064247 seconds--- - --Assembling shear centre and warping moment integrals... - ----completed in 0.331969 seconds--- - --Calculating shear centres... - ----completed in 0.000043 seconds--- - --Assembling shear deformation coefficients... - ----completed in 0.511631 seconds--- - --Assembling monosymmetry integrals... - ----completed in 0.389498 seconds--- - - --Calculating plastic properties... - ----completed in 0.131321 seconds--- - - Section Properties: - A = 2.789062e+00 - Qx = 1.626709e+00 - Qy = -1.424642e-16 - cx = -5.107959e-17 - cy = 5.832458e-01 - Ixx_g = 1.935211e+00 - Iyy_g = 3.233734e+00 - Ixy_g = -1.801944e-16 - Ixx_c = 9.864400e-01 - Iyy_c = 3.233734e+00 - Ixy_c = -9.710278e-17 - Zxx+ = 6.962676e-01 - Zxx- = 1.691294e+00 - Zyy+ = 1.616867e+00 - Zyy- = 1.616867e+00 - rx = 5.947113e-01 - ry = 1.076770e+00 - phi = -9.000000e+01 - I11_c = 3.233734e+00 - I22_c = 9.864400e-01 - Z11+ = 1.616867e+00 - Z11- = 1.616867e+00 - Z22+ = 1.691294e+00 - Z22- = 6.962676e-01 - r11 = 1.076770e+00 - r22 = 5.947113e-01 - J = 9.878443e-01 - Iw = 1.160810e-01 - x_se = 4.822719e-05 - y_se = 4.674792e-01 - x_st = 4.822719e-05 - y_st = 4.674792e-01 - x1_se = 1.157666e-01 - y2_se = 4.822719e-05 - A_sx = 1.648312e+00 - A_sy = 6.979733e-01 - A_s11 = 6.979733e-01 - A_s22 = 1.648312e+00 - betax+ = -2.746928e-01 - betax- = 2.746928e-01 - betay+ = 9.645438e-05 - betay- = -9.645438e-05 - beta11+ = 9.645438e-05 - beta11- = -9.645438e-05 - beta22+ = 2.746928e-01 - beta22- = -2.746928e-01 - x_pc = -5.107959e-17 - y_pc = 3.486328e-01 - Sxx = 1.140530e+00 - Syy = 2.603760e+00 - SF_xx+ = 1.638062e+00 - SF_xx- = 6.743533e-01 - SF_yy+ = 1.610373e+00 - SF_yy- = 1.610373e+00 - x11_pc = -3.671369e-17 - y22_pc = 3.486328e-01 - S11 = 2.603760e+00 - S22 = 1.140530e+00 - SF_11+ = 1.610374e+00 - SF_11- = 1.610374e+00 - SF_22+ = 6.743539e-01 - SF_22- = 1.638064e+00 - - Ixx + Iyy = 4.220 - J = 0.988 - -Creating Custom Geometry ------------------------- - -The following example demonstrates how geometry objects can be created from a -list of points, facets, holes and control points. An straight angle section with -a plate at its base is created from a list of points and facets. The bottom plate -is assigned a separate control point meaning two discrete regions are created. -Creating separate regions allows the user to control the mesh size in each region -and assign material properties to different regions. The geometry is cleaned to -remove the overlapping facet at the junction of the angle and the plate. A -geometric, warping and plastic analysis is then carried out. - -The geometry and mesh are plotted before the analysis is carried out. Once the -analysis is complete, a plot of the various calculated centroids is generated:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - # define parameters for the angle section - a = 1 - b = 2 - t = 0.1 - - # build the lists of points, facets, holes and control points - points = [[-t/2, -2*a], [t/2, -2*a], [t/2, -t/2], [a, -t/2], [a, t/2], - [-t/2, t/2], [-b/2, -2*a], [b/2, -2*a], [b/2, -2*a-t], - [-b/2, -2*a-t]] - facets = [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 0], [6, 7], [7, 8], - [8, 9], [9, 6]] - holes = [] - control_points = [[0, 0], [0, -2*a-t/2]] - - # create the custom geometry object - geometry = sections.CustomSection(points, facets, holes, control_points) - geometry.clean_geometry() # clean the geometry - geometry.plot_geometry() # plot the geometry - - # create the mesh - use a smaller refinement for the angle region - mesh = geometry.create_mesh(mesh_sizes=[0.0005, 0.001]) - - # create a CrossSection object - section = CrossSection(geometry, mesh) - section.plot_mesh() # plot the generated mesh - - # perform a geometric, warping and plastic analysis - section.calculate_geometric_properties() - section.calculate_warping_properties() - section.calculate_plastic_properties() - - # plot the centroids - section.plot_centroids() - -The following plots are generated by the above example: - -.. figure:: ../images/examples/custom_geometry.png - :align: center - :scale: 75 % - - Plot of the generated geometry object. - -.. figure:: ../images/examples/custom_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - -.. figure:: ../images/examples/custom_centroids.png - :align: center - :scale: 75 % - - Plot of the centroids and the principal axis. - -Creating a Merged Section -------------------------- - -The following example demonstrates how to merge multiple geometry objects into -a single geometry object. A 150x100x6 RHS is modelled with a solid 50x50 triangular -section on its top and a 100x100x6 EA section on its right side. The three geometry -objects are merged together using the :class:`~sectionproperties.pre.sections.MergedSection` -class. The order of the geometry objects in the list that is passed into the constructor of the -:class:`~sectionproperties.pre.sections.MergedSection` class is important, as this same -order relates to specifying mesh sizes and material properties. - -Once the geometry has been merged, it is vital to clean the geometry to remove -any artefacts that may impede the meshing algorithm. A mesh is created with a mesh -size of 2.5 mm\ :sup:`2` for the RHS (first in ``section_list``), 5 mm\ :sup:`2` for the triangle (second -in ``section_list``) and 3 mm\ :sup:`2` for the angle (last in ``section_list``). - -The geometry and mesh are plotted, and the mesh information printed to the terminal -before the analysis is carried out. Detailed time information is printed to the -terminal during the cross-section analysis stage. Once the analysis is complete, -the centroids are plotted:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - # create a 150x100x6 RHS - rhs = sections.Rhs(d=150, b=100, t=6, r_out=15, n_r=8) - - # create a triangular section on top of the RHS - points = [[0, 0], [50, 0], [25, 50]] - facets = [[0, 1], [1, 2], [2, 0]] - holes = [] - control_points = [[25, 25]] - triangle = sections.CustomSection(points, facets, holes, control_points, - shift=[25, 150]) - - # create a 100x100x6 EA on the right of the RHS - angle = sections.AngleSection(d=100, b=100, t=6, r_r=8, r_t=5, n_r=8, - shift=[100, 25]) - - # create a list of the sections to be merged - section_list = [rhs, triangle, angle] - - # merge the three sections into one geometry object - geometry = sections.MergedSection(section_list) - - # clean the geometry - print cleaning information to the terminal - geometry.clean_geometry(verbose=True) - geometry.plot_geometry() # plot the geometry - - # create a mesh - use a mesh size of 2.5 for the RHS, 5 for the triangle and - # 3 for the angle - mesh = geometry.create_mesh(mesh_sizes=[2.5, 5, 3]) - - # create a CrossSection object - section = CrossSection(geometry, mesh) - section.display_mesh_info() # display the mesh information - section.plot_mesh() # plot the generated mesh - - # perform a geometric, warping and plastic analysis, displaying the time info - # and the iteration info for the plastic analysis - section.calculate_geometric_properties(time_info=True) - section.calculate_warping_properties(time_info=True) - section.calculate_plastic_properties(time_info=True, verbose=True) - - # plot the centroids - section.plot_centroids() - -The following plots are generated by the above example: - -.. figure:: ../images/examples/merged_geometry.png - :align: center - :scale: 75 % - - Plot of the generated geometry object. - -.. figure:: ../images/examples/merged_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - -.. figure:: ../images/examples/merged_centroids.png - :align: center - :scale: 75 % - - Plot of the centroids and the principal axis. - -The following is printed to the terminal: - -.. code-block:: text - - Removed overlapping facets... Rebuilt with points: [30, 67, 93, 32] - Removed overlapping facets... Rebuilt with points: [46, 65, 64, 48] - Mesh Statistics: - --6053 nodes - --2755 elements - --3 regions - - --Calculating geometric section properties... - ----completed in 1.730845 seconds--- - - --Assembing 6053x6053 stiffness matrix and load vector... - ----completed in 2.793801 seconds--- - --Solving for the warping function using the direct solver... - ----completed in 0.021323 seconds--- - --Computing the torsion constant... - ----completed in 0.000316 seconds--- - --Assembling shear function load vectors... - ----completed in 2.552404 seconds--- - --Solving for the shear functions using the direct solver... - ----completed in 0.604847 seconds--- - --Assembling shear centre and warping moment integrals... - ----completed in 1.578075 seconds--- - --Calculating shear centres... - ----completed in 0.000068 seconds--- - --Assembling shear deformation coefficients... - ----completed in 2.438405 seconds--- - - --Calculating plastic properties... - ---x-axis plastic centroid calculation converged at 1.66608e+00 in 7 iterations. - ---y-axis plastic centroid calculation converged at -5.83761e+00 in 10 iterations. - ---11-axis plastic centroid calculation converged at -1.43134e+00 in 7 iterations. - ---22-axis plastic centroid calculation converged at -1.21319e+01 in 9 iterations. - ----completed in 2.710146 seconds--- - -Mirroring and Rotating Geometry -------------------------------- - -The following example demonstrates how geometry objects can be mirrored and -rotated. A 200PFC and 150PFC are placed back-to-back by using the -:func:`~sectionproperties.pre.sections.Geometry.mirror_section` method and are -rotated counter-clockwise by 30 degrees by using the -:func:`~sectionproperties.pre.sections.Geometry.rotate_section` method. The -geometry is cleaned to ensure there are no overlapping facets along the junction -between the two PFCs. A geometric, warping and plastic analysis is then carried out. - -The geometry and mesh are plotted, and the mesh information printed to the terminal -before the analysis is carried out. Detailed time information is printed to the -terminal during the cross-section analysis stage and iteration information printed -for the plastic analysis. Once the analysis is complete, a plot of the various -calculated centroids is generated:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - # create a 200PFC and a 150PFC - pfc1 = sections.PfcSection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8) - pfc2 = sections.PfcSection(d=150, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8, - shift=[0, 26.5]) - - # mirror the 200 PFC about the y-axis - pfc1.mirror_section(axis='y', mirror_point=[0, 0]) - - # merge the pfc sections - geometry = sections.MergedSection([pfc1, pfc2]) - - # rotate the geometry counter-clockwise by 30 degrees - geometry.rotate_section(angle=30) - - # clean the geometry - print cleaning information to the terminal - geometry.clean_geometry(verbose=True) - geometry.plot_geometry() # plot the geometry - - # create a mesh - use a mesh size of 5 for the 200PFC and 4 for the 150PFC - mesh = geometry.create_mesh(mesh_sizes=[5, 4]) - - # create a CrossSection object - section = CrossSection(geometry, mesh) - section.display_mesh_info() # display the mesh information - section.plot_mesh() # plot the generated mesh - - # perform a geometric, warping and plastic analysis, displaying the time info - # and the iteration info for the plastic analysis - section.calculate_geometric_properties(time_info=True) - section.calculate_warping_properties(time_info=True) - section.calculate_plastic_properties(time_info=True, verbose=True) - - # plot the centroids - section.plot_centroids() - -The following plots are generated by the above example: - -.. figure:: ../images/examples/mirr_rot_geometry.png - :align: center - :scale: 75 % - - Plot of the generated geometry object. - -.. figure:: ../images/examples/mirr_rot_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - -.. figure:: ../images/examples/mirr_rot_centroids.png - :align: center - :scale: 75 % - - Plot of the centroids and the principal axis. - -The following is printed to the terminal: - -.. code-block:: text - - Removed overlapping facets... Rebuilt with points: [21, 43, 22, 0] - Mesh Statistics: - --4841 nodes - --2152 elements - --2 regions - - --Calculating geometric section properties... - ----completed in 1.350236 seconds--- - - --Assembing 4841x4841 stiffness matrix and load vector... - ----completed in 2.002365 seconds--- - --Solving for the warping function using the direct solver... - ----completed in 0.013307 seconds--- - --Computing the torsion constant... - ----completed in 0.000222 seconds--- - --Assembling shear function load vectors... - ----completed in 1.910170 seconds--- - --Solving for the shear functions using the direct solver... - ----completed in 0.623121 seconds--- - --Assembling shear centre and warping moment integrals... - ----completed in 1.163591 seconds--- - --Calculating shear centres... - ----completed in 0.000059 seconds--- - --Assembling shear deformation coefficients... - ----completed in 1.831169 seconds--- - - --Calculating plastic properties... - ---x-axis plastic centroid calculation converged at 2.77651e+00 in 9 iterations. - ---y-axis plastic centroid calculation converged at 3.02247e+00 in 5 iterations. - ---11-axis plastic centroid calculation converged at -2.41585e-13 in 3 iterations. - ---22-axis plastic centroid calculation converged at 6.10669e-01 in 5 iterations. - ----completed in 0.860817 seconds--- - -Performing a Stress Analysis ----------------------------- - -The following example demonstrates how a stress analysis can be performed on a -cross-section. A 150x100x6 RHS is modelled on its side with a maximum mesh area -of 2 mm\ :sup:`2`. The pre-requisite geometric and warping analyses are performed -before two separate stress analyses are undertaken. The first combines bending -and shear about the x-axis with a torsion moment and the second combines bending -and shear about the y-axis with a torsion moment. - -After the analysis is performed, various plots of the stresses are generated:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - # create a 150x100x6 RHS on its side - geometry = sections.Rhs(d=100, b=150, t=6, r_out=15, n_r=8) - - # create a mesh with a maximum area of 2 - mesh = geometry.create_mesh(mesh_sizes=[2]) - - # create a CrossSection object - section = CrossSection(geometry, mesh) - - # perform a geometry and warping analysis - section.calculate_geometric_properties() - section.calculate_warping_properties() - - # perform a stress analysis with Mx = 5 kN.m; Vx = 10 kN and Mzz = 3 kN.m - case1 = section.calculate_stress(Mxx=5e6, Vx=10e3, Mzz=3e6) - - # perform a stress analysis with My = 15 kN.m; Vy = 30 kN and Mzz = 1.5 kN.m - case2 = section.calculate_stress(Myy=15e6, Vy=30e3, Mzz=1.5e6) - - case1.plot_stress_m_zz(pause=False) # plot the bending stress for case1 - case1.plot_vector_mzz_zxy(pause=False) # plot the torsion vectors for case1 - case2.plot_stress_v_zxy(pause=False) # plot the shear stress for case1 - case1.plot_stress_vm(pause=False) # plot the von mises stress for case1 - case2.plot_stress_vm() # plot the von mises stress for case2 - -The following plots are generated by the above example: - -.. figure:: ../images/examples/stress_m.png - :align: center - :scale: 75 % - - Contour plot of the bending stress for case 1. - -.. figure:: ../images/examples/stress_mzz.png - :align: center - :scale: 75 % - - Vector plot of the torsion stress for case 1. - -.. figure:: ../images/examples/stress_v.png - :align: center - :scale: 75 % - - Contour plot of the shear stress for case 2. - -.. figure:: ../images/examples/stress_vm1.png - :align: center - :scale: 75 % - - Contour plot of the von Mises stress for case 1. - -.. figure:: ../images/examples/stress_vm2.png - :align: center - :scale: 75 % - - Contour plot of the von Mises stress for case 2. - -Creating a Composite Cross-Section ----------------------------------- - -The following example demonstrates how to create a composite cross-section by assigning -different material properties to various regions of the mesh. A steel 310UB40.4 is modelled -with a 50Dx600W timber panel placed on its top flange. - -The geometry and mesh are plotted, and the mesh information printed to the terminal -before the analysis is carried out. All types of cross-section analyses are carried -out, with an axial force, bending moment and shear force applied during the stress -analysis. Once the analysis is complete, the cross-section properties are printed -to the terminal and a plot of the centroids and cross-section stresses generated:: - - import sectionproperties.pre.sections as sections - from sectionproperties.pre.pre import Material - from sectionproperties.analysis.cross_section import CrossSection - - # create material properties - steel = Material(name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, - yield_strength=500, color='grey') - timber = Material(name='Timber', elastic_modulus=8e3, poissons_ratio=0.35, - yield_strength=20, color='burlywood') - - # create 310UB40.4 - ub = sections.ISection(d=304, b=165, t_f=10.2, t_w=6.1, r=11.4, n_r=8) - - # create timber panel on top of the UB - panel = sections.RectangularSection(d=50, b=600, shift=[-217.5, 304]) - - # merge the two sections into one geometry object - geometry = sections.MergedSection([ub, panel]) - geometry.clean_geometry() # clean the geometry - geometry.plot_geometry() # plot the geometry - - # create a mesh - use a mesh size of 5 for the UB, 20 for the panel - mesh = geometry.create_mesh(mesh_sizes=[5, 20]) - - # create a CrossSection object - take care to list the materials in the same - # order as entered into the MergedSection - section = CrossSection(geometry, mesh, materials=[steel, timber]) - section.display_mesh_info() # display the mesh information - - # plot the mesh with coloured materials and a line transparency of 0.5 - section.plot_mesh(materials=True, alpha=0.5) - - # perform a geometric, warping and plastic analysis - section.calculate_geometric_properties(time_info=True) - section.calculate_warping_properties(time_info=True) - section.calculate_plastic_properties(time_info=True, verbose=True) - - # perform a stress analysis with N = 100 kN, Mxx = 120 kN.m and Vy = 75 kN - stress_post = section.calculate_stress(N=-100e3, Mxx=-120e6, Vy=-75e3, - time_info=True) - - # print the results to the terminal - section.display_results() - - # plot the centroids - section.plot_centroids() - - stress_post.plot_stress_n_zz(pause=False) # plot the axial stress - stress_post.plot_stress_m_zz(pause=False) # plot the bending stress - stress_post.plot_stress_v_zxy() # plot the shear stress - -The following plots are generated by the above example: - -.. figure:: ../images/examples/composite_geometry.png - :align: center - :scale: 75 % - - Plot of the generated geometry object. - -.. figure:: ../images/examples/composite_mesh.png - :align: center - :scale: 75 % - - Mesh generated from the above geometry. - -.. figure:: ../images/examples/composite_centroids.png - :align: center - :scale: 75 % - - Plot of the centroids and the principal axis. - -.. figure:: ../images/examples/composite_stress_n.png - :align: center - :scale: 75 % - - Contour plot of the axial stress. - -.. figure:: ../images/examples/composite_stress_m.png - :align: center - :scale: 75 % - - Contour plot of the bending stress. - -.. figure:: ../images/examples/composite_stress_v.png - :align: center - :scale: 75 % - - Contour plot of the shear stress. - -The following is printed to the terminal: - -.. code-block:: text - - Mesh Statistics: - --8972 nodes - --4189 elements - --2 regions - - --Calculating geometric section properties... - ----completed in 2.619151 seconds--- - - --Assembing 8972x8972 stiffness matrix and load vector... - ----completed in 4.814592 seconds--- - --Solving for the warping function using the direct solver... - ----completed in 0.032710 seconds--- - --Computing the torsion constant... - ----completed in 0.000281 seconds--- - --Assembling shear function load vectors... - ----completed in 3.648590 seconds--- - --Solving for the shear functions using the direct solver... - ----completed in 0.073731 seconds--- - --Assembling shear centre and warping moment integrals... - ----completed in 2.288843 seconds--- - --Calculating shear centres... - ----completed in 0.000064 seconds--- - --Assembling shear deformation coefficients... - ----completed in 3.597728 seconds--- - --Assembling monosymmetry integrals... - ----completed in 2.519333 seconds--- - - --Calculating plastic properties... - d = -185.13088495027134; f_norm = 1.0 - d = 168.86911504972866; f_norm = -1.0 - d = -8.130884950271337; f_norm = 0.1396051884674814 - d = 13.552166872240885; f_norm = 0.0983423820518053 - d = 60.60270845168385; f_norm = 0.008805290832496546 - d = 64.90008929872263; f_norm = 0.0006273832465500235 - d = 65.22746216923525; f_norm = 4.393296044849056e-06 - d = 65.22976962543858; f_norm = 2.2112746988930985e-09 - d = 65.2298027403234; f_norm = -6.080628821651535e-08 - ---x-axis plastic centroid calculation converged at 6.52298e+01 in 8 iterations. - d = -300.0; f_norm = -1.0 - d = 300.0; f_norm = 1.0 - d = 0.0; f_norm = 2.1790636349700628e-16 - d = -5e-07; f_norm = -4.7730935851751974e-08 - ---y-axis plastic centroid calculation converged at 0.00000e+00 in 3 iterations. - d = -185.13088495027134; f_norm = 1.0 - d = 168.86911504972866; f_norm = -1.0 - d = -8.130884950271337; f_norm = 0.1396051884674814 - d = 13.552166872240885; f_norm = 0.0983423820518053 - d = 60.60270845168385; f_norm = 0.008805290832496546 - d = 64.90008929872263; f_norm = 0.0006273832465500235 - d = 65.22746216923525; f_norm = 4.393296044849056e-06 - d = 65.22976962543858; f_norm = 2.2112746988930985e-09 - d = 65.2298027403234; f_norm = -6.080628821651535e-08 - ---11-axis plastic centroid calculation converged at 6.52298e+01 in 8 iterations. - d = -300.0; f_norm = -1.0 - d = 300.0; f_norm = 1.0 - d = 0.0; f_norm = 2.1790636349700628e-16 - d = -5e-07; f_norm = -4.7730935851751974e-08 - ---22-axis plastic centroid calculation converged at 0.00000e+00 in 3 iterations. - ----completed in 0.794056 seconds--- - - --Calculating cross-section stresses... - ----completed in 4.240446 seconds--- - - Section Properties: - A = 3.521094e+04 - E.A = 1.282187e+09 - E.Qx = 2.373725e+11 - E.Qy = 1.057805e+11 - cx = 8.250000e+01 - cy = 1.851309e+02 - E.Ixx_g= 6.740447e+13 - E.Iyy_g= 1.745613e+13 - E.Ixy_g= 1.958323e+13 - E.Ixx_c= 2.345949e+13 - E.Iyy_c= 8.729240e+12 - E.Ixy_c= -7.421875e-02 - E.Zxx+ = 1.389212e+11 - E.Zxx- = 1.267184e+11 - E.Zyy+ = 2.909747e+10 - E.Zyy- = 2.909747e+10 - rx = 1.352644e+02 - ry = 8.251112e+01 - phi = 0.000000e+00 - E.I11_c= 2.345949e+13 - E.I22_c= 8.729240e+12 - E.Z11+ = 1.389212e+11 - E.Z11- = 1.267184e+11 - E.Z22+ = 2.909747e+10 - E.Z22- = 2.909747e+10 - r11 = 1.352644e+02 - r22 = 8.251112e+01 - G.J = 1.439379e+11 - G.Iw = 2.554353e+16 - x_se = 8.250071e+01 - y_se = 2.863400e+02 - x_st = 8.250070e+01 - y_st = 2.857074e+02 - x1_se = 7.063407e-04 - y2_se = 1.012091e+02 - A_sx = 1.104723e+04 - A_sy = 1.021183e+04 - A_s11 = 1.104723e+04 - A_s22 = 1.021183e+04 - betax+ = 2.039413e+02 - betax- = -2.039413e+02 - betay+ = 1.412681e-03 - betay- = -1.412681e-03 - beta11+= 2.039413e+02 - beta11-= -2.039413e+02 - beta22+= 1.412681e-03 - beta22-= -1.412681e-03 - x_pc = 8.250000e+01 - y_pc = 2.503607e+02 - M_p,xx = 3.932542e+08 - M_p,yy = 1.610673e+08 - x11_pc = 8.250000e+01 - y22_pc = 2.503607e+02 - M_p,11 = 3.932542e+08 - M_p,22 = 1.610673e+08 - -Frame Analysis Example ----------------------- - -The following example demonstrates how *sectionproperties* can be used to -calculate the cross-section properties required for a frame analysis. Using this -method is preferred over executing a geometric and warping analysis as only variables -required for a frame analysis are computed. In this example the torsion constant of -a rectangular section is calculated for a number of different mesh sizes and the -accuracy of the result compared with the time taken to obtain the solution:: - - import time - import numpy as np - import matplotlib.pyplot as plt - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - # create a rectangular section - geometry = sections.RectangularSection(d=100, b=50) - - # create a list of mesh sizes to analyse - mesh_sizes = [1.5, 2, 2.5, 3, 4, 5, 10, 15, 20, 25, 30, 40, 50, 75, 100] - j_calc = [] # list to store torsion constants - t_calc = [] # list to store computation times - - # loop through mesh sizes - for mesh_size in mesh_sizes: - mesh = geometry.create_mesh(mesh_sizes=[mesh_size]) # create mesh - section = CrossSection(geometry, mesh) # create a CrossSection object - start_time = time.time() # start timing - # calculate the frame properties - (_, _, _, _, j, _) = section.calculate_frame_properties() - t = time.time() - start_time # stop timing - t_calc.append(t) # save the time - j_calc.append(j) # save the torsion constant - # print the result - str = "Mesh Size: {0}; ".format(mesh_size) - str += "Solution Time {0:.5f} s; ".format(t) - str += "Torsion Constant: {0:.12e}".format(j) - print(str) - - correct_val = j_calc[0] # assume the finest mesh gives the 'correct' value - j_np = np.array(j_calc) # convert results to a numpy array - error_vals = (j_calc - correct_val) / j_calc * 100 # compute the error - - # produce a plot of the accuracy of the torsion constant with computation time - plt.loglog(t_calc[1:], error_vals[1:], 'kx-') - plt.xlabel("Solver Time [s]") - plt.ylabel("Torsion Constant Error [%]") - plt.show() - -.. figure:: ../images/examples/frame_graph.png - :align: center - :scale: 75 % - - Plot of the torsion constant as a function of the solution time. - -Advanced Examples ------------------ - -The following examples demonstrates how *sectionproperties* can be used for more academic purposes. - -Torsion Constant of a Rectangle -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -In this example, the aspect ratio of a rectangular section is varied whilst keeping a constant -cross-sectional area and the torsion constant calculated. The variation of the torsion constant -with the aspect ratio is then plotted:: - - import numpy as np - import matplotlib.pyplot as plt - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - # rectangle dimensions - d_list = [] - b_list = np.linspace(0.2, 1, 20) - j_list = [] # list holding torsion constant results - - # number of elements for each analysis - n = 500 - - # loop through all the widths - for b in b_list: - # calculate d assuming area = 1 - d = 1 / b - d_list.append(d) - - # compute mesh size - ms = d * b / n - - # perform a warping analysis on rectangle - geometry = sections.RectangularSection(d=d, b=b) - mesh = geometry.create_mesh(mesh_sizes=[ms]) - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_warping_properties() - - # get the torsion constant - j = section.get_j() - print("d/b = {0:.3f}; J = {1:.5e}".format(d/b, j)) - j_list.append(j) - - # plot the torsion constant as a function of the aspect ratio - (fig, ax) = plt.subplots() - ax.plot(np.array(d_list) / b_list, j_list, 'kx-') - ax.set_xlabel("Aspect Ratio [d/b]") - ax.set_ylabel("Torsion Constant [J]") - ax.set_title("Rectangular Section Torsion Constant") - plt.show() - -.. figure:: ../images/examples/advanced1.png - :align: center - :scale: 75 % - - Plot of the torsion constant as a function of the aspect ratio. - -Mesh Refinement -^^^^^^^^^^^^^^^ - -In this example the convergence of the torsion constant is investigated through an analysis of an -I-section. The mesh is refined both by modifying the mesh size and by specifying the number of -points making up the root radius. The figure below the example code shows that mesh refinement -adjacent to the root radius is a far more efficient method in obtaining fast convergence when -compared to reducing the mesh area size for the entire section:: - - import numpy as np - import matplotlib.pyplot as plt - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - # define mesh sizes - mesh_size_list = [50, 20, 10, 5, 3, 2, 1] - nr_list = [4, 8, 12, 16, 20, 24, 32, 64] - - # initialise result lists - mesh_results = [] - mesh_elements = [] - nr_results = [] - nr_elements = [] - - # calculate reference solution - geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=64) - mesh = geometry.create_mesh(mesh_sizes=[0.5]) # create mesh - section = CrossSection(geometry, mesh) # create a CrossSection object - section.calculate_geometric_properties() - section.calculate_warping_properties() - j_reference = section.get_j() # get the torsion constant - - # run through mesh_sizes with n_r = 16 - for mesh_size in mesh_size_list: - geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=16) - mesh = geometry.create_mesh(mesh_sizes=[mesh_size]) # create mesh - section = CrossSection(geometry, mesh) # create a CrossSection object - section.calculate_geometric_properties() - section.calculate_warping_properties() - - mesh_elements.append(len(section.elements)) - mesh_results.append(section.get_j()) - - # run through n_r with mesh_size = 3 - for n_r in nr_list: - geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=n_r) - mesh = geometry.create_mesh(mesh_sizes=[3]) # create mesh - section = CrossSection(geometry, mesh) # create a CrossSection object - section.calculate_geometric_properties() - section.calculate_warping_properties() - - nr_elements.append(len(section.elements)) - nr_results.append(section.get_j()) - - # convert results to a numpy array - mesh_results = np.array(mesh_results) - nr_results = np.array(nr_results) - - # compute the error - mesh_error_vals = (mesh_results - j_reference) / mesh_results * 100 - nr_error_vals = (nr_results - j_reference) / nr_results * 100 - - # plot the results - (fig, ax) = plt.subplots() - ax.loglog(mesh_elements, mesh_error_vals, 'kx-', label='Mesh Size Refinement') - ax.loglog(nr_elements, nr_error_vals, 'rx-', label='Root Radius Refinement') - plt.xlabel("Number of Elements") - plt.ylabel("Torsion Constant Error [%]") - plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) - plt.tight_layout() - plt.show() - -.. figure:: ../images/examples/advanced2.png - :align: center - :scale: 75 % - - Plot of the torsion constant error as a function of number of elements used in the analysis for - both general mesh refinement and root radius refinement. diff --git a/docs/build/html/_sources/rst/geom_mesh.rst.txt b/docs/build/html/_sources/rst/geom_mesh.rst.txt deleted file mode 100644 index 15cea62a..00000000 --- a/docs/build/html/_sources/rst/geom_mesh.rst.txt +++ /dev/null @@ -1,241 +0,0 @@ -.. _label-geom_mesh: - -Creating a Geometry, Mesh and Material Properties -================================================= - -Before performing a cross-section analysis, the geometry of the cross-section and a finite element -mesh must be created. Optionally, material properties can be applied to different regions of the -cross-section. - -Cross-Section Geometry ----------------------- - -The geometry of a cross-section defines its dimensions and shape and involves the creation of a -:class:`~sectionproperties.pre.sections.Geometry` object. This geometry object stores all the -information needed to create a finite element mesh. - -.. autoclass:: sectionproperties.pre.sections.Geometry - :noindex: - -Different regions of the geometry can be specified by defining a list of ``control_points``, which -are located within unique enclosed areas of the geometry. Different regions can be used to specify -different mesh sizes and/or different material properties within the structural cross-section. See -the :ref:`label-examples` for some example scripts in which different regions are specified through -a list of control points. - - -Creating Common Structural Geometries ---------------------------------------- - -In order to make your life easier, there are a number of built-in classes that generate typical -structural cross-sections that inherit from the :class:`~sectionproperties.pre.sections.Geometry` -class. Note that these classes automatically assign a ``control_point`` to the geometry object. - -Rectangular Section -^^^^^^^^^^^^^^^^^^^ -.. autoclass:: sectionproperties.pre.sections.RectangularSection - :show-inheritance: - :noindex: - -Circular Section -^^^^^^^^^^^^^^^^ -.. autoclass:: sectionproperties.pre.sections.CircularSection - :show-inheritance: - :noindex: - -Circular Hollow Section (CHS) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. autoclass:: sectionproperties.pre.sections.Chs - :show-inheritance: - :noindex: - -Elliptical Section -^^^^^^^^^^^^^^^^^^ -.. autoclass:: sectionproperties.pre.sections.EllipticalSection - :show-inheritance: - :noindex: - -Elliptical Hollow Section (EHS) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. autoclass:: sectionproperties.pre.sections.Ehs - :show-inheritance: - :noindex: - -Rectangular Hollow Section (RHS) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. autoclass:: sectionproperties.pre.sections.Rhs - :show-inheritance: - :noindex: - -I-Section -^^^^^^^^^ - .. autoclass:: sectionproperties.pre.sections.ISection - :show-inheritance: - :noindex: - -Monosymmetric I-Section -^^^^^^^^^^^^^^^^^^^^^^^ - .. autoclass:: sectionproperties.pre.sections.MonoISection - :show-inheritance: - :noindex: - -Tapered Flange I-Section -^^^^^^^^^^^^^^^^^^^^^^^^ - .. autoclass:: sectionproperties.pre.sections.TaperedFlangeISection - :show-inheritance: - :noindex: - -Parallel Flange Channel (PFC) Section -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - .. autoclass:: sectionproperties.pre.sections.PfcSection - :show-inheritance: - :noindex: - -Tapered Flange Channel Section -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - .. autoclass:: sectionproperties.pre.sections.TaperedFlangeChannel - :show-inheritance: - :noindex: - -Tee Section -^^^^^^^^^^^ - .. autoclass:: sectionproperties.pre.sections.TeeSection - :show-inheritance: - :noindex: - -Angle Section -^^^^^^^^^^^^^ - .. autoclass:: sectionproperties.pre.sections.AngleSection - :show-inheritance: - :noindex: - -Cee Section -^^^^^^^^^^^ - .. autoclass:: sectionproperties.pre.sections.CeeSection - :show-inheritance: - :noindex: - -Zed Section -^^^^^^^^^^^ - .. autoclass:: sectionproperties.pre.sections.ZedSection - :show-inheritance: - :noindex: - -Cruciform Section -^^^^^^^^^^^^^^^^^ - .. autoclass:: sectionproperties.pre.sections.CruciformSection - :show-inheritance: - :noindex: - -Polygon Section -^^^^^^^^^^^^^^^ - .. autoclass:: sectionproperties.pre.sections.PolygonSection - :show-inheritance: - :noindex: - -Box Girder Section -^^^^^^^^^^^^^^^^^^ - .. autoclass:: sectionproperties.pre.sections.BoxGirderSection - :show-inheritance: - :noindex: - -Arbitrary Cross-Section Geometries ----------------------------------- - -If none of the above classes gives you what you need, you can create a -:class:`~sectionproperties.pre.sections.CustomSection` geometry object, which is defined by a list -of points (nodes), facets (node connectivities) and hole locations: - -.. autoclass:: sectionproperties.pre.sections.CustomSection - :show-inheritance: - :noindex: - -.. note:: Ensure that the ``control_points`` you choose lie within the - :class:`~sectionproperties.pre.sections.CustomSection`. If any of the ``control_points`` are - outside the region, on an edge or within a hole, the meshing algorithm will likely not treat - distinct areas within the :class:`~sectionproperties.pre.sections.CustomSection` as a separate - regions and mesh refinements may not work as anticipated. - -.. note:: In order to calculate the perimeter of the cross-section be sure to enter the facet - indices that correspond to the perimeter of your cross-section. - -Merging Geometries ------------------- - -If you wish to merge multiple :class:`~sectionproperties.pre.sections.Geometry` objects into a -single object, you can use the :class:`~sectionproperties.pre.sections.MergedSection` class: - -.. autoclass:: sectionproperties.pre.sections.MergedSection - :show-inheritance: - :noindex: - -.. note:: There must be connectivity between the :class:`~sectionproperties.pre.sections.Geometry` - objects that you wish to merge. It is currently not possible to analyse a cross-section that is - composed of two or more unconnected domains. - -.. note:: You may need to overwrite the perimeter facets list if predefined sections are used. - Enabling labels while plotting the geometry is an easy way to manually identify the facet indices - that make up the perimeter of the cross-section. - -Cleaning the Geometry ---------------------- - -When creating a merged section often there are overlapping facets or duplicate nodes. These -geometry artefacts can cause difficulty for the meshing algorithm. It is therefore recommended to -clean the geometry after merging sections which may result in overlapping or intersecting facets, -or duplicate nodes. Cleaning the geometry can be carried out by using the -:func:`~sectionproperties.pre.sections.Geometry.clean_geometry` method: - -.. automethod:: sectionproperties.pre.sections.Geometry.clean_geometry - :noindex: - -Perimeter Offset ----------------- - -The perimeter of a cross-section geometry can be offset by using the -:func:`~sectionproperties.pre.offset.offset_perimeter` method: - -.. autofunction:: sectionproperties.pre.offset.offset_perimeter - :noindex: - -.. note:: All the built-in sections in the ``sections`` module are built using an anti-clockwise - facet direction. As a result, side='left' will reduce the cross-section, while side='right' will - increase the cross-section. - -.. note:: The ``control_points`` may need to be manually re-assigned if reducing the cross-section - moves the control_point outside the geometry. - -.. warning:: This feature is a *beta* addition and as a result may produce some errors if the - offsetting drastically changes the geometry. - -Visualising the Geometry ------------------------- - -Geometry objects can be visualised by using the -:func:`~sectionproperties.pre.sections.Geometry.plot_geometry` method: - -.. automethod:: sectionproperties.pre.sections.Geometry.plot_geometry - :noindex: - -Generating a Mesh ------------------ - -A finite element mesh is required to perform a cross-section analysis. A finite element mesh can -be created by using the :func:`~sectionproperties.pre.sections.Geometry.create_mesh` method: - -.. automethod:: sectionproperties.pre.sections.Geometry.create_mesh - :noindex: - -.. warning:: The length of ``mesh_sizes`` must match the number of regions - in the geometry object. - -Defining Material Properties ----------------------------- - -Composite cross-sections can be analysed by specifying different material properties for each -section of the mesh. Materials are defined in *sectionproperties* by creating a -:class:`~sectionproperties.pre.pre.Material` object: - -.. autoclass:: sectionproperties.pre.pre.Material - :noindex: - :show-inheritance: diff --git a/docs/build/html/_sources/rst/installation.rst.txt b/docs/build/html/_sources/rst/installation.rst.txt deleted file mode 100644 index 1f094921..00000000 --- a/docs/build/html/_sources/rst/installation.rst.txt +++ /dev/null @@ -1,50 +0,0 @@ -Installation -============ - -These instructions will get you a copy of *sectionproperties* up and running on -your local machine. You will need a working copy of python>=3.5 on your machine. - -Installing *sectionproperties* ------------------------------- - -*sectionproperties* uses *meshpy* to efficiently generate a conforming triangular -mesh in order to perform a finite element analysis of the structural cross-section. -The installation procedure for of *meshpy* depends on your local machine. - -UNIX (MacOS/Linux) -^^^^^^^^^^^^^^^^^^ - -*sectionproperties* and all of its dependencies can be installed through the -python package index:: - - $ pip install sectionproperties - -If you have any issues installing *meshpy*, refer to the installation instructions -on its `github page -`_ or its -`documentation -`_. - -Windows -^^^^^^^ - -Install *meshpy* by downloading the appropriate `installation wheel -`_. - -Navigate to the location of the downloaded wheel and install using pip:: - - $ cd Downloads - $ pip install MeshPy‑2018.2.1‑cp36‑cp36m‑win_amd64.whl - -Once *meshpy* has been installed, the rest of the *sectionproperties* package can -be installed using the python package index:: - - $ pip install sectionproperties - -Testing the Installation ------------------------- - -Python *unittest* modules are located in the *sectionpropertes.tests* package. -To see if your installation is working correctly, run this simple test:: - - $ python -m unittest sectionproperties.tests.test_rectangle diff --git a/docs/build/html/_sources/rst/post.rst.txt b/docs/build/html/_sources/rst/post.rst.txt deleted file mode 100644 index 37504ea7..00000000 --- a/docs/build/html/_sources/rst/post.rst.txt +++ /dev/null @@ -1,350 +0,0 @@ -.. _label-post: - -Viewing the Results -=================== - -Printing a List of the Section Properties ------------------------------------------ - -A list of section properties that have been calculated by various analyses can -be printed to the terminal using the :func:`~sectionproperties.analysis.cross_section.CrossSection.display_results` -method that belongs to every -:class:`~sectionproperties.analysis.cross_section.CrossSection` object. - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.display_results - :noindex: - -Getting Specific Section Properties ------------------------------------ - -Alternatively, there are a number of methods that can be called on the -:class:`~sectionproperties.analysis.cross_section.CrossSection` object to return -a specific section property: - -Cross-Section Area -^^^^^^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_area - :noindex: - -Cross-Section Perimeter -^^^^^^^^^^^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_perimeter - :noindex: - -Axial Rigidity -^^^^^^^^^^^^^^ - -If material properties have been specified, returns the axial rigidity of the -section. - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_ea - :noindex: - -First Moments of Area -^^^^^^^^^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_q - :noindex: - -Second Moments of Area -^^^^^^^^^^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_ig - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_ic - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_ip - :noindex: - -Elastic Centroid -^^^^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_c - :noindex: - - -Section Moduli -^^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_z - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_zp - :noindex: - -Radii of Gyration -^^^^^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_rc - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_rp - :noindex: - - -Principal Axis Angle -^^^^^^^^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_phi - :noindex: - - -Torsion Constant -^^^^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_j - :noindex: - -Shear Centre -^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_sc - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_sc_p - :noindex: - -Trefftz's Shear Centre -^^^^^^^^^^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_sc_t - :noindex: - -Warping Constant -^^^^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_gamma - :noindex: - -Shear Area -^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_As - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_As_p - :noindex: - -Monosymmetry Constants -^^^^^^^^^^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_beta - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_beta_p - :noindex: - -Plastic Centroid -^^^^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_pc - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_pc_p - :noindex: - -Plastic Section Moduli -^^^^^^^^^^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_s - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_sp - :noindex: - - -Shape Factors -^^^^^^^^^^^^^ - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_sf - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.get_sf_p - :noindex: - - -Section Property Centroids Plots --------------------------------- - -A plot of the centroids (elastic, plastic and shear centre) can be produced with -the finite element mesh in the background: - -.. automethod:: sectionproperties.analysis.cross_section.CrossSection.plot_centroids - :noindex: - - -Plotting Cross-Section Stresses -------------------------------- - -There are a number of methods that can be called from a :class:`~sectionproperties.analysis.cross_section.StressResult` -object to plot the various cross-section stresses. These methods take the following form: - - :class:`~sectionproperties.analysis.cross_section.StressResult`.plot_(*stress/vector*)_(*action*)_(*stresstype*) - -where: - -- *stress* denotes a contour plot and *vector* denotes a vector plot. -- *action* denotes the type of action causing the stress e.g. *mxx* for bending moment about the x-axis. Note that the action is omitted for stresses caused by the application of all actions. -- *stresstype* denotes the type of stress that is being plotted e.g. *zx* for the *x*-component of shear stress. - -The examples shown in the methods below are performed on a 150x90x12 UA -(unequal angle) section. The :class:`~sectionproperties.analysis.cross_section.CrossSection` -object is created below:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - section = CrossSection(geometry, mesh) - -Primary Stress Plots -^^^^^^^^^^^^^^^^^^^^ - -Axial Stress (:math:`\sigma_{zz,N}`) -"""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_n_zz - :noindex: - -Bending Stress (:math:`\sigma_{zz,Mxx}`) -"""""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_mxx_zz - :noindex: - -Bending Stress (:math:`\sigma_{zz,Myy}`) -"""""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_myy_zz - :noindex: - -Bending Stress (:math:`\sigma_{zz,M11}`) -"""""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_m11_zz - :noindex: - -Bending Stress (:math:`\sigma_{zz,M22}`) -"""""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_m22_zz - :noindex: - -Bending Stress (:math:`\sigma_{zz,\Sigma M}`) -""""""""""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_m_zz - :noindex: - -Torsion Stress (:math:`\sigma_{zx,Mzz}`) -"""""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_mzz_zx - :noindex: - -Torsion Stress (:math:`\sigma_{zy,Mzz}`) -"""""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_mzz_zy - :noindex: - -Torsion Stress (:math:`\sigma_{zxy,Mzz}`) -""""""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_mzz_zxy - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_vector_mzz_zxy - :noindex: - -Shear Stress (:math:`\sigma_{zx,Vx}`) -""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_vx_zx - :noindex: - -Shear Stress (:math:`\sigma_{zy,Vx}`) -""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_vx_zy - :noindex: - -Shear Stress (:math:`\sigma_{zxy,Vx}`) -"""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_vx_zxy - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_vector_vx_zxy - :noindex: - -Shear Stress (:math:`\sigma_{zx,Vy}`) -""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_vy_zx - :noindex: - -Shear Stress (:math:`\sigma_{zy,Vy}`) -""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_vy_zy - :noindex: - -Shear Stress (:math:`\sigma_{zxy,Vy}`) -"""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_vy_zxy - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_vector_vy_zxy - :noindex: - -Shear Stress (:math:`\sigma_{zx,\Sigma V}`) -""""""""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_v_zx - :noindex: - -Shear Stress (:math:`\sigma_{zy,\Sigma V}`) -""""""""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_v_zy - :noindex: - -Shear Stress (:math:`\sigma_{zxy,\Sigma V}`) -"""""""""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_v_zxy - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_vector_v_zxy - :noindex: - -Combined Stress Plots -^^^^^^^^^^^^^^^^^^^^^ - -Normal Stress (:math:`\sigma_{zz}`) -"""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_zz - :noindex: - -Shear Stress (:math:`\sigma_{zx}`) -""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_zx - :noindex: - -Shear Stress (:math:`\sigma_{zy}`) -""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_zy - :noindex: - -Shear Stress (:math:`\sigma_{zxy}`) -"""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_zxy - :noindex: - -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_vector_zxy - :noindex: - -von Mises Stress (:math:`\sigma_{vM}`) -""""""""""""""""""""""""""""""""""""""" -.. automethod:: sectionproperties.analysis.cross_section.StressPost.plot_stress_vm - :noindex: - - -Retrieving Cross-Section Stress -------------------------------- - -All cross-section stresses can be recovered using the :func:`~sectionproperties.analysis.cross_section.StressPost.get_stress` -method that belongs to every -:class:`~sectionproperties.analysis.cross_section.StressPost` object: - -.. automethod:: sectionproperties.analysis.cross_section.StressPost.get_stress - :noindex: diff --git a/docs/build/html/_sources/rst/structure.rst.txt b/docs/build/html/_sources/rst/structure.rst.txt deleted file mode 100644 index 7ccbc7d4..00000000 --- a/docs/build/html/_sources/rst/structure.rst.txt +++ /dev/null @@ -1,182 +0,0 @@ -Structure of an Analysis -======================== - -The process of performing a cross-section analysis with *sectionproperties* can -be broken down into three stages: - -1. Pre-Processor: The input geometry and finite element mesh is created. -2. Solver: The cross-section properties are determined. -3. Post-Processor: The results are presented in a number of different formats. - -Creating a Geometry and Mesh ----------------------------- - -The dimensions and shape of the cross-section to be analysed define the *geometry* -of the cross-section. The :ref:`label-sections-module` provides a number of classes -to easily generate either commonly used structural sections or an arbitrary -cross-section, defined by a list of points, facets and holes. All of the classes -in the :ref:`label-sections-module` inherit from the -:class:`~sectionproperties.pre.sections.Geometry` class. - -The final stage in the pre-processor involves generating a finite element mesh of -the *geometry* that the solver can use to calculate the cross-section properties. -This can easily be performed using the :func:`~sectionproperties.pre.sections.Geometry.create_mesh` -method that all :class:`~sectionproperties.pre.sections.Geometry` objects have -access to. - -The following example creates a geometry object with a circular cross-section. -The diameter of the circle is 50 and 64 points are used to discretise the circumference -of the circle. A finite element mesh is generated with a maximum triangular area -of 2.5:: - - import sectionproperties.pre.sections as sections - - geometry = sections.CircularSection(d=50, n=64) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - -.. figure:: ../images/sections/circle_mesh.png - :align: center - :scale: 75 % - - Finite element mesh generated by the above example. - -If you are analysing a composite section, or would like to include material properties -in your model, material properties can be created using the :class:`~sectionproperties.pre.pre.Material` -class. The following example creates a steel material object:: - - from sectionproperties.pre.pre import Material - - steel = Material(name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500, - color='grey') - -Refer to :ref:`label-geom_mesh` for a more detailed explanation of the pre-processing -stage. - -Running an Analysis -------------------- - -The solver operates on a :class:`~sectionproperties.analysis.cross_section.CrossSection` -object and can perform four different analysis types: - -- Geometric Analysis: calculates area properties. -- Plastic Analysis: calculates plastic properties. -- Warping Analysis: calculates torsion and shear properties. -- Stress Analysis: calculates cross-section stresses. - -The geometric analysis can be performed individually. However in order to perform -a warping or plastic analysis, a geometric analysis must first be performed. Further, -in order to carry out a stress analysis, both a geometric and warping analysis must -have already been executed. The program will display a helpful error if you try -to run any of these analyses without first performing the prerequisite analyses. - -The following example performs a geometric and warping analysis on the circular -cross-section defined in the previous section with steel used as the material -property:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - from sectionproperties.pre.pre import Material - - geometry = sections.CircularSection(d=50, n=64) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - steel = Material(name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500, - color='grey') - - section = CrossSection(geometry, mesh, [steel]) - section.calculate_geometric_properties() - section.calculate_warping_properties() - -Refer to :ref:`label-analysis` for a more detailed explanation of the solver stage. - -Viewing the Results -------------------- - -Once an analysis has been performed, a number of methods belonging to the -:class:`~sectionproperties.analysis.cross_section.CrossSection` object can be called -to present the cross-section results in a number of different formats. For example -the cross-section properties can be printed to the terminal, a plot of the centroids -displayed and the cross-section stresses visualised in a contour plot. - -The following example analyses a 200 PFC section. The cross-section properties -are printed to the terminal and a plot of the centroids is displayed:: - - import sectionproperties.pre.sections as sections - from sectionproperties.analysis.cross_section import CrossSection - - geometry = sections.PfcSection(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8) - mesh = geometry.create_mesh(mesh_sizes=[2.5]) - - section = CrossSection(geometry, mesh) - section.calculate_geometric_properties() - section.calculate_plastic_properties() - section.calculate_warping_properties() - - section.plot_centroids() - section.display_results() - -.. figure:: ../images/pfc_centroids.png - :align: center - :scale: 75 % - - Plot of the elastic centroid and shear centre for the above example generated - by :func:`~sectionproperties.analysis.cross_section.CrossSection.plot_centroids` - -Output generated by the :func:`~sectionproperties.analysis.cross_section.CrossSection.display_results` -method:: - - Section Properties: - A = 2.919699e+03 - Qx = 2.919699e+05 - Qy = 7.122414e+04 - cx = 2.439434e+01 - cy = 1.000000e+02 - Ixx_g = 4.831277e+07 - Iyy_g = 3.392871e+06 - Ixy_g = 7.122414e+06 - Ixx_c = 1.911578e+07 - Iyy_c = 1.655405e+06 - Ixy_c = -6.519258e-09 - Zxx+ = 1.911578e+05 - Zxx- = 1.911578e+05 - Zyy+ = 3.271186e+04 - Zyy- = 6.786020e+04 - rx = 8.091461e+01 - ry = 2.381130e+01 - phi = 0.000000e+00 - I11_c = 1.911578e+07 - I22_c = 1.655405e+06 - Z11+ = 1.911578e+05 - Z11- = 1.911578e+05 - Z22+ = 3.271186e+04 - Z22- = 6.786020e+04 - r11 = 8.091461e+01 - r22 = 2.381130e+01 - J = 1.011522e+05 - Iw = 1.039437e+10 - x_se = -2.505109e+01 - y_se = 1.000000e+02 - x_st = -2.505109e+01 - y_st = 1.000000e+02 - x1_se = -4.944543e+01 - y2_se = 4.905074e-06 - A_sx = 9.468851e+02 - A_sy = 1.106943e+03 - x_pc = 1.425046e+01 - y_pc = 1.000000e+02 - Sxx = 2.210956e+05 - Syy = 5.895923e+04 - SF_xx+ = 1.156613e+00 - SF_xx- = 1.156613e+00 - SF_yy+ = 1.802381e+00 - SF_yy- = 8.688337e-01 - x11_pc = 1.425046e+01 - y22_pc = 1.000000e+02 - S11 = 2.210956e+05 - S22 = 5.895923e+04 - SF_11+ = 1.156613e+00 - SF_11- = 1.156613e+00 - SF_22+ = 1.802381e+00 - SF_22- = 8.688337e-01 - -Refer to :ref:`label-post` for a more detailed explanation of the post-processing -stage. diff --git a/docs/build/html/_sources/rst/theory.rst.txt b/docs/build/html/_sources/rst/theory.rst.txt deleted file mode 100644 index 3d631553..00000000 --- a/docs/build/html/_sources/rst/theory.rst.txt +++ /dev/null @@ -1,12 +0,0 @@ -Theoretical Background -====================== - -*coming soon...* - -.. Mention that Poisson's ratios should be relatively close as if the Poisson’s - ratio is largely variable, the basic contention that sig_x = sig_y = sig_xy = 0 - ceases to be applicable. - -.. In this program an effective Poisson's ratio is calculated by determining a - weighted E and G and then deriving a nu that is effective for the entire - cross-section. diff --git a/docs/build/html/_static/basic.css b/docs/build/html/_static/basic.css deleted file mode 100644 index 01192852..00000000 --- a/docs/build/html/_static/basic.css +++ /dev/null @@ -1,768 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; - word-wrap: break-word; - overflow-wrap : break-word; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox form.search { - overflow: hidden; -} - -div.sphinxsidebar #searchbox input[type="text"] { - float: left; - width: 80%; - padding: 0.25em; - box-sizing: border-box; -} - -div.sphinxsidebar #searchbox input[type="submit"] { - float: left; - width: 20%; - border-left: none; - padding: 0.25em; - box-sizing: border-box; -} - - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; - margin-left: auto; - margin-right: auto; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable ul { - margin-top: 0; - margin-bottom: 0; - list-style-type: none; -} - -table.indextable > tbody > tr > td > ul { - padding-left: 0em; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- domain module index --------------------------------------------------- */ - -table.modindextable td { - padding: 2px; - border-collapse: collapse; -} - -/* -- general body styles --------------------------------------------------- */ - -div.body { - min-width: 450px; - max-width: 800px; -} - -div.body p, div.body dd, div.body li, div.body blockquote { - -moz-hyphens: auto; - -ms-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; -} - -a.headerlink { - visibility: hidden; -} - -a.brackets:before, -span.brackets > a:before{ - content: "["; -} - -a.brackets:after, -span.brackets > a:after { - content: "]"; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -img.align-default, .figure.align-default { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-default { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table.align-center { - margin-left: auto; - margin-right: auto; -} - -table.align-default { - margin-left: auto; - margin-right: auto; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -th > p:first-child, -td > p:first-child { - margin-top: 0px; -} - -th > p:last-child, -td > p:last-child { - margin-bottom: 0px; -} - -/* -- figures --------------------------------------------------------------- */ - -div.figure { - margin: 0.5em; - padding: 0.5em; -} - -div.figure p.caption { - padding: 0.3em; -} - -div.figure p.caption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text { -} - -/* -- field list styles ----------------------------------------------------- */ - -table.field-list td, table.field-list th { - border: 0 !important; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.field-name { - -moz-hyphens: manual; - -ms-hyphens: manual; - -webkit-hyphens: manual; - hyphens: manual; -} - -/* -- hlist styles ---------------------------------------------------------- */ - -table.hlist td { - vertical-align: top; -} - - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -li > p:first-child { - margin-top: 0px; -} - -li > p:last-child { - margin-bottom: 0px; -} - -dl.footnote > dt, -dl.citation > dt { - float: left; -} - -dl.footnote > dd, -dl.citation > dd { - margin-bottom: 0em; -} - -dl.footnote > dd:after, -dl.citation > dd:after { - content: ""; - clear: both; -} - -dl.field-list { - display: grid; - grid-template-columns: fit-content(30%) auto; -} - -dl.field-list > dt { - font-weight: bold; - word-break: break-word; - padding-left: 0.5em; - padding-right: 5px; -} - -dl.field-list > dt:after { - content: ":"; -} - -dl.field-list > dd { - padding-left: 0.5em; - margin-top: 0em; - margin-left: 0em; - margin-bottom: 0em; -} - -dl { - margin-bottom: 15px; -} - -dd > p:first-child { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, span.highlighted { - background-color: #fbe54e; -} - -rect.highlighted { - fill: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -.classifier:before { - font-style: normal; - margin: 0.5em; - content: ":"; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -span.pre { - -moz-hyphens: none; - -ms-hyphens: none; - -webkit-hyphens: none; - hyphens: none; -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -div.code-block-caption { - padding: 2px 5px; - font-size: small; -} - -div.code-block-caption code { - background-color: transparent; -} - -div.code-block-caption + div > div.highlight > pre { - margin-top: 0; -} - -div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */ - user-select: none; -} - -div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.code-block-caption span.caption-text { -} - -div.literal-block-wrapper { - padding: 1em 1em 0; -} - -div.literal-block-wrapper div.highlight { - margin: 0; -} - -code.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -code.descclassname { - background-color: transparent; -} - -code.xref, a code { - background-color: transparent; - font-weight: bold; -} - -h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -span.eqno a.headerlink { - position: relative; - left: 0px; - z-index: 1; -} - -div.math:hover a.headerlink { - visibility: visible; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/docs/build/html/_static/css/badge_only.css b/docs/build/html/_static/css/badge_only.css deleted file mode 100644 index 3c33cef5..00000000 --- a/docs/build/html/_static/css/badge_only.css +++ /dev/null @@ -1 +0,0 @@ -.fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../fonts/fontawesome-webfont.eot");src:url("../fonts/fontawesome-webfont.eot?#iefix") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff") format("woff"),url("../fonts/fontawesome-webfont.ttf") format("truetype"),url("../fonts/fontawesome-webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} diff --git a/docs/build/html/_static/css/theme.css b/docs/build/html/_static/css/theme.css deleted file mode 100644 index aed8cef0..00000000 --- a/docs/build/html/_static/css/theme.css +++ /dev/null @@ -1,6 +0,0 @@ -/* sphinx_rtd_theme version 0.4.3 | MIT license */ -/* Built 20190212 16:02 */ -*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}[hidden]{display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:hover,a:active{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;color:#000;text-decoration:none}mark{background:#ff0;color:#000;font-style:italic;font-weight:bold}pre,code,.rst-content tt,.rst-content code,kbd,samp{font-family:monospace,serif;_font-family:"courier new",monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:before,q:after{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}ul,ol,dl{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:0;margin:0;padding:0}label{cursor:pointer}legend{border:0;*margin-left:-7px;padding:0;white-space:normal}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*width:13px;*height:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top;resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none !important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{html,body,section{background:none !important}*{box-shadow:none !important;text-shadow:none !important;filter:none !important;-ms-filter:none !important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:.5cm}p,h2,.rst-content .toctree-wrapper p.caption,h3{orphans:3;widows:3}h2,.rst-content .toctree-wrapper p.caption,h3{page-break-after:avoid}}.fa:before,.wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content .code-block-caption .headerlink:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo,.rst-content .admonition,.btn,input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"],select,textarea,.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a,.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a,.wy-nav-top a{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}/*! - * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:'FontAwesome';src:url("../fonts/fontawesome-webfont.eot?v=4.7.0");src:url("../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff2?v=4.7.0") format("woff2"),url("../fonts/fontawesome-webfont.woff?v=4.7.0") format("woff"),url("../fonts/fontawesome-webfont.ttf?v=4.7.0") format("truetype"),url("../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular") format("svg");font-weight:normal;font-style:normal}.fa,.wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink,.rst-content table>caption .headerlink,.rst-content .code-block-caption .headerlink,.rst-content tt.download span:first-child,.rst-content code.download span:first-child,.icon{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.2857142857em;text-align:center}.fa-ul{padding-left:0;margin-left:2.1428571429em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.1428571429em;width:2.1428571429em;top:.1428571429em;text-align:center}.fa-li.fa-lg{left:-1.8571428571em}.fa-border{padding:.2em .25em .15em;border:solid 0.08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.wy-menu-vertical li span.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a span.fa-pull-left.toctree-expand,.wy-menu-vertical li.current>a span.fa-pull-left.toctree-expand,.rst-content .fa-pull-left.admonition-title,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content dl dt .fa-pull-left.headerlink,.rst-content p.caption .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.rst-content code.download span.fa-pull-left:first-child,.fa-pull-left.icon{margin-right:.3em}.fa.fa-pull-right,.wy-menu-vertical li span.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a span.fa-pull-right.toctree-expand,.wy-menu-vertical li.current>a span.fa-pull-right.toctree-expand,.rst-content .fa-pull-right.admonition-title,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content dl dt .fa-pull-right.headerlink,.rst-content p.caption .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.rst-content code.download span.fa-pull-right:first-child,.fa-pull-right.icon{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.wy-menu-vertical li span.pull-left.toctree-expand,.wy-menu-vertical li.on a span.pull-left.toctree-expand,.wy-menu-vertical li.current>a span.pull-left.toctree-expand,.rst-content .pull-left.admonition-title,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content dl dt .pull-left.headerlink,.rst-content p.caption .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content .code-block-caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.rst-content code.download span.pull-left:first-child,.pull-left.icon{margin-right:.3em}.fa.pull-right,.wy-menu-vertical li span.pull-right.toctree-expand,.wy-menu-vertical li.on a span.pull-right.toctree-expand,.wy-menu-vertical li.current>a span.pull-right.toctree-expand,.rst-content .pull-right.admonition-title,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content dl dt .pull-right.headerlink,.rst-content p.caption .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content .code-block-caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.rst-content code.download span.pull-right:first-child,.pull-right.icon{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-remove:before,.fa-close:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-gear:before,.fa-cog:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-rotate-right:before,.fa-repeat:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.rst-content .admonition-title:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-warning:before,.fa-exclamation-triangle:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-gears:before,.fa-cogs:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-save:before,.fa-floppy-o:before{content:""}.fa-square:before{content:""}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.wy-dropdown .caret:before,.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-unsorted:before,.fa-sort:before{content:""}.fa-sort-down:before,.fa-sort-desc:before{content:""}.fa-sort-up:before,.fa-sort-asc:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-legal:before,.fa-gavel:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-flash:before,.fa-bolt:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-paste:before,.fa-clipboard:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-unlink:before,.fa-chain-broken:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:""}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:""}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:""}.fa-euro:before,.fa-eur:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-rupee:before,.fa-inr:before{content:""}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:""}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:""}.fa-won:before,.fa-krw:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-turkish-lira:before,.fa-try:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li span.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-institution:before,.fa-bank:before,.fa-university:before{content:""}.fa-mortar-board:before,.fa-graduation-cap:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:""}.fa-file-zip-o:before,.fa-file-archive-o:before{content:""}.fa-file-sound-o:before,.fa-file-audio-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:""}.fa-ge:before,.fa-empire:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-send:before,.fa-paper-plane:before{content:""}.fa-send-o:before,.fa-paper-plane-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-hotel:before,.fa-bed:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-yc:before,.fa-y-combinator:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-tv:before,.fa-television:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before,.icon-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:""}.fa-audio-description:before{content:""}.fa-volume-control-phone:before{content:""}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:""}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-signing:before,.fa-sign-language:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:""}.fa-pied-piper:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-vcard:before,.fa-address-card:before{content:""}.fa-vcard-o:before,.fa-address-card-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:""}.fa-id-badge:before{content:""}.fa-drivers-license:before,.fa-id-card:before{content:""}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:""}.fa-free-code-camp:before{content:""}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:""}.fa-shower:before{content:""}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:""}.fa-podcast:before{content:""}.fa-window-maximize:before{content:""}.fa-window-minimize:before{content:""}.fa-window-restore:before{content:""}.fa-times-rectangle:before,.fa-window-close:before{content:""}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:""}.fa-bandcamp:before{content:""}.fa-grav:before{content:""}.fa-etsy:before{content:""}.fa-imdb:before{content:""}.fa-ravelry:before{content:""}.fa-eercast:before{content:""}.fa-microchip:before{content:""}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:""}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:""}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink,.rst-content table>caption .headerlink,.rst-content .code-block-caption .headerlink,.rst-content tt.download span:first-child,.rst-content code.download span:first-child,.icon,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context{font-family:inherit}.fa:before,.wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content .code-block-caption .headerlink:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before{font-family:"FontAwesome";display:inline-block;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa,a .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li a span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,a .rst-content .admonition-title,.rst-content a .admonition-title,a .rst-content h1 .headerlink,.rst-content h1 a .headerlink,a .rst-content h2 .headerlink,.rst-content h2 a .headerlink,a .rst-content h3 .headerlink,.rst-content h3 a .headerlink,a .rst-content h4 .headerlink,.rst-content h4 a .headerlink,a .rst-content h5 .headerlink,.rst-content h5 a .headerlink,a .rst-content h6 .headerlink,.rst-content h6 a .headerlink,a .rst-content dl dt .headerlink,.rst-content dl dt a .headerlink,a .rst-content p.caption .headerlink,.rst-content p.caption a .headerlink,a .rst-content table>caption .headerlink,.rst-content table>caption a .headerlink,a .rst-content .code-block-caption .headerlink,.rst-content .code-block-caption a .headerlink,a .rst-content tt.download span:first-child,.rst-content tt.download a span:first-child,a .rst-content code.download span:first-child,.rst-content code.download a span:first-child,a .icon{display:inline-block;text-decoration:inherit}.btn .fa,.btn .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .btn span.toctree-expand,.btn .wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.on a .btn span.toctree-expand,.btn .wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.current>a .btn span.toctree-expand,.btn .rst-content .admonition-title,.rst-content .btn .admonition-title,.btn .rst-content h1 .headerlink,.rst-content h1 .btn .headerlink,.btn .rst-content h2 .headerlink,.rst-content h2 .btn .headerlink,.btn .rst-content h3 .headerlink,.rst-content h3 .btn .headerlink,.btn .rst-content h4 .headerlink,.rst-content h4 .btn .headerlink,.btn .rst-content h5 .headerlink,.rst-content h5 .btn .headerlink,.btn .rst-content h6 .headerlink,.rst-content h6 .btn .headerlink,.btn .rst-content dl dt .headerlink,.rst-content dl dt .btn .headerlink,.btn .rst-content p.caption .headerlink,.rst-content p.caption .btn .headerlink,.btn .rst-content table>caption .headerlink,.rst-content table>caption .btn .headerlink,.btn .rst-content .code-block-caption .headerlink,.rst-content .code-block-caption .btn .headerlink,.btn .rst-content tt.download span:first-child,.rst-content tt.download .btn span:first-child,.btn .rst-content code.download span:first-child,.rst-content code.download .btn span:first-child,.btn .icon,.nav .fa,.nav .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .nav span.toctree-expand,.nav .wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.on a .nav span.toctree-expand,.nav .wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.current>a .nav span.toctree-expand,.nav .rst-content .admonition-title,.rst-content .nav .admonition-title,.nav .rst-content h1 .headerlink,.rst-content h1 .nav .headerlink,.nav .rst-content h2 .headerlink,.rst-content h2 .nav .headerlink,.nav .rst-content h3 .headerlink,.rst-content h3 .nav .headerlink,.nav .rst-content h4 .headerlink,.rst-content h4 .nav .headerlink,.nav .rst-content h5 .headerlink,.rst-content h5 .nav .headerlink,.nav .rst-content h6 .headerlink,.rst-content h6 .nav .headerlink,.nav .rst-content dl dt .headerlink,.rst-content dl dt .nav .headerlink,.nav .rst-content p.caption .headerlink,.rst-content p.caption .nav .headerlink,.nav .rst-content table>caption .headerlink,.rst-content table>caption .nav .headerlink,.nav .rst-content .code-block-caption .headerlink,.rst-content .code-block-caption .nav .headerlink,.nav .rst-content tt.download span:first-child,.rst-content tt.download .nav span:first-child,.nav .rst-content code.download span:first-child,.rst-content code.download .nav span:first-child,.nav .icon{display:inline}.btn .fa.fa-large,.btn .wy-menu-vertical li span.fa-large.toctree-expand,.wy-menu-vertical li .btn span.fa-large.toctree-expand,.btn .rst-content .fa-large.admonition-title,.rst-content .btn .fa-large.admonition-title,.btn .rst-content h1 .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.btn .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .btn .fa-large.headerlink,.btn .rst-content p.caption .fa-large.headerlink,.rst-content p.caption .btn .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.btn .rst-content .code-block-caption .fa-large.headerlink,.rst-content .code-block-caption .btn .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.rst-content tt.download .btn span.fa-large:first-child,.btn .rst-content code.download span.fa-large:first-child,.rst-content code.download .btn span.fa-large:first-child,.btn .fa-large.icon,.nav .fa.fa-large,.nav .wy-menu-vertical li span.fa-large.toctree-expand,.wy-menu-vertical li .nav span.fa-large.toctree-expand,.nav .rst-content .fa-large.admonition-title,.rst-content .nav .fa-large.admonition-title,.nav .rst-content h1 .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.nav .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.nav .rst-content p.caption .fa-large.headerlink,.rst-content p.caption .nav .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.nav .rst-content .code-block-caption .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.nav .rst-content code.download span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.nav .fa-large.icon{line-height:.9em}.btn .fa.fa-spin,.btn .wy-menu-vertical li span.fa-spin.toctree-expand,.wy-menu-vertical li .btn span.fa-spin.toctree-expand,.btn .rst-content .fa-spin.admonition-title,.rst-content .btn .fa-spin.admonition-title,.btn .rst-content h1 .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.btn .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .btn .fa-spin.headerlink,.btn .rst-content p.caption .fa-spin.headerlink,.rst-content p.caption .btn .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.btn .rst-content .code-block-caption .fa-spin.headerlink,.rst-content .code-block-caption .btn .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.rst-content tt.download .btn span.fa-spin:first-child,.btn .rst-content code.download span.fa-spin:first-child,.rst-content code.download .btn span.fa-spin:first-child,.btn .fa-spin.icon,.nav .fa.fa-spin,.nav .wy-menu-vertical li span.fa-spin.toctree-expand,.wy-menu-vertical li .nav span.fa-spin.toctree-expand,.nav .rst-content .fa-spin.admonition-title,.rst-content .nav .fa-spin.admonition-title,.nav .rst-content h1 .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.nav .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.nav .rst-content p.caption .fa-spin.headerlink,.rst-content p.caption .nav .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.nav .rst-content .code-block-caption .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.nav .rst-content code.download span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.nav .fa-spin.icon{display:inline-block}.btn.fa:before,.wy-menu-vertical li span.btn.toctree-expand:before,.rst-content .btn.admonition-title:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content dl dt .btn.headerlink:before,.rst-content p.caption .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.rst-content code.download span.btn:first-child:before,.btn.icon:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.wy-menu-vertical li span.btn.toctree-expand:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content p.caption .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.rst-content code.download span.btn:first-child:hover:before,.btn.icon:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li .btn-mini span.toctree-expand:before,.btn-mini .rst-content .admonition-title:before,.rst-content .btn-mini .admonition-title:before,.btn-mini .rst-content h1 .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.btn-mini .rst-content dl dt .headerlink:before,.rst-content dl dt .btn-mini .headerlink:before,.btn-mini .rst-content p.caption .headerlink:before,.rst-content p.caption .btn-mini .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.rst-content tt.download .btn-mini span:first-child:before,.btn-mini .rst-content code.download span:first-child:before,.rst-content code.download .btn-mini span:first-child:before,.btn-mini .icon:before{font-size:14px;vertical-align:-15%}.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo,.rst-content .admonition{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.wy-alert-title,.rst-content .admonition-title{color:#fff;font-weight:bold;display:block;color:#fff;background:#6ab0de;margin:-12px;padding:6px 12px;margin-bottom:12px}.wy-alert.wy-alert-danger,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.admonition{background:#fdf3f2}.wy-alert.wy-alert-danger .wy-alert-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .danger .wy-alert-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .danger .admonition-title,.rst-content .error .admonition-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition .admonition-title{background:#f29f97}.wy-alert.wy-alert-warning,.rst-content .wy-alert-warning.note,.rst-content .attention,.rst-content .caution,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.tip,.rst-content .warning,.rst-content .wy-alert-warning.seealso,.rst-content .admonition-todo,.rst-content .wy-alert-warning.admonition{background:#ffedcc}.wy-alert.wy-alert-warning .wy-alert-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .attention .wy-alert-title,.rst-content .caution .wy-alert-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .attention .admonition-title,.rst-content .caution .admonition-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .warning .admonition-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .admonition-todo .admonition-title,.rst-content .wy-alert-warning.admonition .admonition-title{background:#f0b37e}.wy-alert.wy-alert-info,.rst-content .note,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.rst-content .seealso,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.admonition{background:#e7f2fa}.wy-alert.wy-alert-info .wy-alert-title,.rst-content .note .wy-alert-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.rst-content .note .admonition-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .seealso .admonition-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition .admonition-title{background:#6ab0de}.wy-alert.wy-alert-success,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.warning,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.admonition{background:#dbfaf4}.wy-alert.wy-alert-success .wy-alert-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .hint .wy-alert-title,.rst-content .important .wy-alert-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .hint .admonition-title,.rst-content .important .admonition-title,.rst-content .tip .admonition-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition .admonition-title{background:#1abc9c}.wy-alert.wy-alert-neutral,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.admonition{background:#f3f6f6}.wy-alert.wy-alert-neutral .wy-alert-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition .admonition-title{color:#404040;background:#e1e4e5}.wy-alert.wy-alert-neutral a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a{color:#2980B9}.wy-alert p:last-child,.rst-content .note p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.rst-content .seealso p:last-child,.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0px;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,0.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27AE60}.wy-tray-container li.wy-tray-item-info{background:#2980B9}.wy-tray-container li.wy-tray-item-warning{background:#E67E22}.wy-tray-container li.wy-tray-item-danger{background:#E74C3C}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width: 768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px 12px;color:#fff;border:1px solid rgba(0,0,0,0.1);background-color:#27AE60;text-decoration:none;font-weight:normal;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:0px 1px 2px -1px rgba(255,255,255,0.5) inset,0px -2px 0px 0px rgba(0,0,0,0.1) inset;outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:0px -1px 0px 0px rgba(0,0,0,0.05) inset,0px 2px 0px 0px rgba(0,0,0,0.1) inset;padding:8px 12px 6px 12px}.btn:visited{color:#fff}.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn-disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn-disabled:hover,.btn-disabled:focus,.btn-disabled:active{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980B9 !important}.btn-info:hover{background-color:#2e8ece !important}.btn-neutral{background-color:#f3f6f6 !important;color:#404040 !important}.btn-neutral:hover{background-color:#e5ebeb !important;color:#404040}.btn-neutral:visited{color:#404040 !important}.btn-success{background-color:#27AE60 !important}.btn-success:hover{background-color:#295 !important}.btn-danger{background-color:#E74C3C !important}.btn-danger:hover{background-color:#ea6153 !important}.btn-warning{background-color:#E67E22 !important}.btn-warning:hover{background-color:#e98b39 !important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f !important}.btn-link{background-color:transparent !important;color:#2980B9;box-shadow:none;border-color:transparent !important}.btn-link:hover{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:active{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:visited{color:#9B59B6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:before,.wy-btn-group:after{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:solid 1px #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,0.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980B9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:solid 1px #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type="search"]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980B9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned input,.wy-form-aligned textarea,.wy-form-aligned select,.wy-form-aligned .wy-help-inline,.wy-form-aligned label{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{border:0;margin:0;padding:0}legend{display:block;width:100%;border:0;padding:0;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label{display:block;margin:0 0 .3125em 0;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;*zoom:1;max-width:68em;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#E74C3C}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full input[type="text"],.wy-control-group .wy-form-full input[type="password"],.wy-control-group .wy-form-full input[type="email"],.wy-control-group .wy-form-full input[type="url"],.wy-control-group .wy-form-full input[type="date"],.wy-control-group .wy-form-full input[type="month"],.wy-control-group .wy-form-full input[type="time"],.wy-control-group .wy-form-full input[type="datetime"],.wy-control-group .wy-form-full input[type="datetime-local"],.wy-control-group .wy-form-full input[type="week"],.wy-control-group .wy-form-full input[type="number"],.wy-control-group .wy-form-full input[type="search"],.wy-control-group .wy-form-full input[type="tel"],.wy-control-group .wy-form-full input[type="color"],.wy-control-group .wy-form-halves input[type="text"],.wy-control-group .wy-form-halves input[type="password"],.wy-control-group .wy-form-halves input[type="email"],.wy-control-group .wy-form-halves input[type="url"],.wy-control-group .wy-form-halves input[type="date"],.wy-control-group .wy-form-halves input[type="month"],.wy-control-group .wy-form-halves input[type="time"],.wy-control-group .wy-form-halves input[type="datetime"],.wy-control-group .wy-form-halves input[type="datetime-local"],.wy-control-group .wy-form-halves input[type="week"],.wy-control-group .wy-form-halves input[type="number"],.wy-control-group .wy-form-halves input[type="search"],.wy-control-group .wy-form-halves input[type="tel"],.wy-control-group .wy-form-halves input[type="color"],.wy-control-group .wy-form-thirds input[type="text"],.wy-control-group .wy-form-thirds input[type="password"],.wy-control-group .wy-form-thirds input[type="email"],.wy-control-group .wy-form-thirds input[type="url"],.wy-control-group .wy-form-thirds input[type="date"],.wy-control-group .wy-form-thirds input[type="month"],.wy-control-group .wy-form-thirds input[type="time"],.wy-control-group .wy-form-thirds input[type="datetime"],.wy-control-group .wy-form-thirds input[type="datetime-local"],.wy-control-group .wy-form-thirds input[type="week"],.wy-control-group .wy-form-thirds input[type="number"],.wy-control-group .wy-form-thirds input[type="search"],.wy-control-group .wy-form-thirds input[type="tel"],.wy-control-group .wy-form-thirds input[type="color"]{width:100%}.wy-control-group .wy-form-full{float:left;display:block;margin-right:2.3576515979%;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.3576515979%;width:48.821174201%}.wy-control-group .wy-form-halves:last-child{margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n+1){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.3576515979%;width:31.7615656014%}.wy-control-group .wy-form-thirds:last-child{margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control{margin:6px 0 0 0;font-size:90%}.wy-control-no-input{display:inline-block;margin:6px 0 0 0;font-size:90%}.wy-control-group.fluid-input input[type="text"],.wy-control-group.fluid-input input[type="password"],.wy-control-group.fluid-input input[type="email"],.wy-control-group.fluid-input input[type="url"],.wy-control-group.fluid-input input[type="date"],.wy-control-group.fluid-input input[type="month"],.wy-control-group.fluid-input input[type="time"],.wy-control-group.fluid-input input[type="datetime"],.wy-control-group.fluid-input input[type="datetime-local"],.wy-control-group.fluid-input input[type="week"],.wy-control-group.fluid-input input[type="number"],.wy-control-group.fluid-input input[type="search"],.wy-control-group.fluid-input input[type="tel"],.wy-control-group.fluid-input input[type="color"]{width:100%}.wy-form-message-inline{display:inline-block;padding-left:.3em;color:#666;vertical-align:middle;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;*overflow:visible}input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type="datetime-local"]{padding:.34375em .625em}input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}input[type="text"]:focus,input[type="password"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus{outline:0;outline:thin dotted \9;border-color:#333}input.no-focus:focus{border-color:#ccc !important}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:1px auto #129FEA}input[type="text"][disabled],input[type="password"][disabled],input[type="email"][disabled],input[type="url"][disabled],input[type="date"][disabled],input[type="month"][disabled],input[type="time"][disabled],input[type="datetime"][disabled],input[type="datetime-local"][disabled],input[type="week"][disabled],input[type="number"][disabled],input[type="search"][disabled],input[type="tel"][disabled],input[type="color"][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#E74C3C;border:1px solid #E74C3C}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#E74C3C}input[type="file"]:focus:invalid:focus,input[type="radio"]:focus:invalid:focus,input[type="checkbox"]:focus:invalid:focus{outline-color:#E74C3C}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type="radio"][disabled],input[type="checkbox"][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:solid 1px #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{position:absolute;content:"";display:block;left:0;top:0;width:36px;height:12px;border-radius:4px;background:#ccc;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{position:absolute;content:"";display:block;width:18px;height:18px;border-radius:4px;background:#999;left:-3px;top:-3px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27AE60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#E74C3C}.wy-control-group.wy-control-group-error input[type="text"],.wy-control-group.wy-control-group-error input[type="password"],.wy-control-group.wy-control-group-error input[type="email"],.wy-control-group.wy-control-group-error input[type="url"],.wy-control-group.wy-control-group-error input[type="date"],.wy-control-group.wy-control-group-error input[type="month"],.wy-control-group.wy-control-group-error input[type="time"],.wy-control-group.wy-control-group-error input[type="datetime"],.wy-control-group.wy-control-group-error input[type="datetime-local"],.wy-control-group.wy-control-group-error input[type="week"],.wy-control-group.wy-control-group-error input[type="number"],.wy-control-group.wy-control-group-error input[type="search"],.wy-control-group.wy-control-group-error input[type="tel"],.wy-control-group.wy-control-group-error input[type="color"]{border:solid 1px #E74C3C}.wy-control-group.wy-control-group-error textarea{border:solid 1px #E74C3C}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27AE60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#E74C3C}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#E67E22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980B9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width: 480px){.wy-form button[type="submit"]{margin:.7em 0 0}.wy-form input[type="text"],.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:.3em;display:block}.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0 0}.wy-form .wy-help-inline,.wy-form-message-inline,.wy-form-message{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width: 768px){.tablet-hide{display:none}}@media screen and (max-width: 480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.wy-table,.rst-content table.docutils,.rst-content table.field-list{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.wy-table caption,.rst-content table.docutils caption,.rst-content table.field-list caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td,.wy-table th,.rst-content table.docutils th,.rst-content table.field-list th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.wy-table td:first-child,.rst-content table.docutils td:first-child,.rst-content table.field-list td:first-child,.wy-table th:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list th:first-child{border-left-width:0}.wy-table thead,.rst-content table.docutils thead,.rst-content table.field-list thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.wy-table thead th,.rst-content table.docutils thead th,.rst-content table.field-list thead th{font-weight:bold;border-bottom:solid 2px #e1e4e5}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td{background-color:transparent;vertical-align:middle}.wy-table td p,.rst-content table.docutils td p,.rst-content table.field-list td p{line-height:18px}.wy-table td p:last-child,.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child{margin-bottom:0}.wy-table .wy-table-cell-min,.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min{width:1%;padding-right:0}.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:gray;font-size:90%}.wy-table-tertiary{color:gray;font-size:80%}.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td,.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td{background-color:#f3f6f6}.wy-table-backed{background-color:#f3f6f6}.wy-table-bordered-all,.rst-content table.docutils{border:1px solid #e1e4e5}.wy-table-bordered-all td,.rst-content table.docutils td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.wy-table-bordered-all tbody>tr:last-child td,.rst-content table.docutils tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px 0;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0 !important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980B9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9B59B6}html{height:100%;overflow-x:hidden}body{font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;font-weight:normal;color:#404040;min-height:100%;overflow-x:hidden;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#E67E22 !important}a.wy-text-warning:hover{color:#eb9950 !important}.wy-text-info{color:#2980B9 !important}a.wy-text-info:hover{color:#409ad5 !important}.wy-text-success{color:#27AE60 !important}a.wy-text-success:hover{color:#36d278 !important}.wy-text-danger{color:#E74C3C !important}a.wy-text-danger:hover{color:#ed7669 !important}.wy-text-neutral{color:#404040 !important}a.wy-text-neutral:hover{color:#595959 !important}h1,h2,.rst-content .toctree-wrapper p.caption,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif}p{line-height:24px;margin:0;font-size:16px;margin-bottom:24px}h1{font-size:175%}h2,.rst-content .toctree-wrapper p.caption{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}code,.rst-content tt,.rst-content code{white-space:nowrap;max-width:100%;background:#fff;border:solid 1px #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;color:#E74C3C;overflow-x:auto}code.code-large,.rst-content tt.code-large{font-size:90%}.wy-plain-list-disc,.rst-content .section ul,.rst-content .toctree-wrapper ul,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.wy-plain-list-disc li,.rst-content .section ul li,.rst-content .toctree-wrapper ul li,article ul li{list-style:disc;margin-left:24px}.wy-plain-list-disc li p:last-child,.rst-content .section ul li p:last-child,.rst-content .toctree-wrapper ul li p:last-child,article ul li p:last-child{margin-bottom:0}.wy-plain-list-disc li ul,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li ul,article ul li ul{margin-bottom:0}.wy-plain-list-disc li li,.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,article ul li li{list-style:circle}.wy-plain-list-disc li li li,.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,article ul li li li{list-style:square}.wy-plain-list-disc li ol li,.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,article ul li ol li{list-style:decimal}.wy-plain-list-decimal,.rst-content .section ol,.rst-content ol.arabic,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.wy-plain-list-decimal li,.rst-content .section ol li,.rst-content ol.arabic li,article ol li{list-style:decimal;margin-left:24px}.wy-plain-list-decimal li p:last-child,.rst-content .section ol li p:last-child,.rst-content ol.arabic li p:last-child,article ol li p:last-child{margin-bottom:0}.wy-plain-list-decimal li ul,.rst-content .section ol li ul,.rst-content ol.arabic li ul,article ol li ul{margin-bottom:0}.wy-plain-list-decimal li ul li,.rst-content .section ol li ul li,.rst-content ol.arabic li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:before,.wy-breadcrumbs:after{display:table;content:""}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs li{display:inline-block}.wy-breadcrumbs li.wy-breadcrumbs-aside{float:right}.wy-breadcrumbs li a{display:inline-block;padding:5px}.wy-breadcrumbs li a:first-child{padding-left:0}.wy-breadcrumbs li code,.wy-breadcrumbs li .rst-content tt,.rst-content .wy-breadcrumbs li tt{padding:5px;border:none;background:none}.wy-breadcrumbs li code.literal,.wy-breadcrumbs li .rst-content tt.literal,.rst-content .wy-breadcrumbs li tt.literal{color:#404040}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width: 480px){.wy-breadcrumbs-extra{display:none}.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:before,.wy-menu-horiz:after{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz ul,.wy-menu-horiz li{display:inline-block}.wy-menu-horiz li:hover{background:rgba(255,255,255,0.1)}.wy-menu-horiz li.divide-left{border-left:solid 1px #404040}.wy-menu-horiz li.divide-right{border-right:solid 1px #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#3a7ca8;height:32px;display:inline-block;line-height:32px;padding:0 1.618em;margin:12px 0 0 0;display:block;font-weight:bold;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:solid 1px #404040}.wy-menu-vertical li.divide-bottom{border-bottom:solid 1px #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:gray;border-right:solid 1px #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.wy-menu-vertical li code,.wy-menu-vertical li .rst-content tt,.rst-content .wy-menu-vertical li tt{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li span.toctree-expand{display:block;float:left;margin-left:-1.2em;font-size:.8em;line-height:1.6em;color:#4d4d4d}.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a{color:#404040;padding:.4045em 1.618em;font-weight:bold;position:relative;background:#fcfcfc;border:none;padding-left:1.618em -4px}.wy-menu-vertical li.on a:hover,.wy-menu-vertical li.current>a:hover{background:#fcfcfc}.wy-menu-vertical li.on a:hover span.toctree-expand,.wy-menu-vertical li.current>a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand{display:block;font-size:.8em;line-height:1.6em;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:solid 1px #c9c9c9;border-top:solid 1px #c9c9c9}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a{color:#404040}.wy-menu-vertical li.toctree-l1.current li.toctree-l2>ul,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>ul{display:none}.wy-menu-vertical li.toctree-l1.current li.toctree-l2.current>ul,.wy-menu-vertical li.toctree-l2.current li.toctree-l3.current>ul{display:block}.wy-menu-vertical li.toctree-l2.current>a{background:#c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{display:block;background:#c9c9c9;padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l2 a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.toctree-l2 span.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3{font-size:.9em}.wy-menu-vertical li.toctree-l3.current>a{background:#bdbdbd;padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{display:block;background:#bdbdbd;padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l3 a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.toctree-l3 span.toctree-expand{color:#969696}.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:normal}.wy-menu-vertical a{display:inline-block;line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover span.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980B9;cursor:pointer;color:#fff}.wy-menu-vertical a:active span.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980B9;text-align:center;padding:.809em;display:block;color:#fcfcfc;margin-bottom:.809em}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em auto;height:45px;width:45px;background-color:#2980B9;padding:5px;border-radius:100%}.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a{color:#fcfcfc;font-size:100%;font-weight:bold;display:inline-block;padding:4px 6px;margin-bottom:.809em}.wy-side-nav-search>a:hover,.wy-side-nav-search .wy-dropdown>a:hover{background:rgba(255,255,255,0.1)}.wy-side-nav-search>a img.logo,.wy-side-nav-search .wy-dropdown>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search>a.icon img.logo,.wy-side-nav-search .wy-dropdown>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.version{margin-top:-.4045em;margin-bottom:.809em;font-weight:normal;color:rgba(255,255,255,0.3)}.wy-nav .wy-menu-vertical header{color:#2980B9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980B9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980B9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:before,.wy-nav-top:after{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:bold}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980B9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,0.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:gray}footer p{margin-bottom:12px}footer span.commit code,footer span.commit .rst-content tt,.rst-content footer span.commit tt{padding:0px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:1em;background:none;border:none;color:gray}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:before,.rst-footer-buttons:after{width:100%}.rst-footer-buttons:before,.rst-footer-buttons:after{display:table;content:""}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:before,.rst-breadcrumbs-buttons:after{display:table;content:""}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:solid 1px #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:solid 1px #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:gray;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width: 768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-side-scroll{width:auto}.wy-side-nav-search{width:auto}.wy-menu.wy-menu-vertical{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width: 1100px){.wy-nav-content-wrap{background:rgba(0,0,0,0.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,footer,.wy-nav-side{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version span.toctree-expand,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content p.caption .headerlink,.rst-content p.caption .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .icon{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}.rst-content img{max-width:100%;height:auto}.rst-content div.figure{margin-bottom:24px}.rst-content div.figure p.caption{font-style:italic}.rst-content div.figure p:last-child.caption{margin-bottom:0px}.rst-content div.figure.align-center{text-align:center}.rst-content .section>img,.rst-content .section>a>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:"";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px 12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;display:block;overflow:auto}.rst-content pre.literal-block,.rst-content div[class^='highlight']{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px 0}.rst-content pre.literal-block div[class^='highlight'],.rst-content div[class^='highlight'] div[class^='highlight']{padding:0px;border:none;margin:0}.rst-content div[class^='highlight'] td.code{width:100%}.rst-content .linenodiv pre{border-right:solid 1px #e6e9ea;margin:0;padding:12px 12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^='highlight'] pre{white-space:pre;margin:0;padding:12px 12px;display:block;overflow:auto}.rst-content div[class^='highlight'] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content pre.literal-block,.rst-content div[class^='highlight'] pre,.rst-content .linenodiv pre{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px;line-height:1.4}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^='highlight'],.rst-content div[class^='highlight'] pre{white-space:pre-wrap}}.rst-content .note .last,.rst-content .attention .last,.rst-content .caution .last,.rst-content .danger .last,.rst-content .error .last,.rst-content .hint .last,.rst-content .important .last,.rst-content .tip .last,.rst-content .warning .last,.rst-content .seealso .last,.rst-content .admonition-todo .last,.rst-content .admonition .last{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,0.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent !important;border-color:rgba(0,0,0,0.1) !important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha li{list-style:upper-alpha}.rst-content .section ol p,.rst-content .section ul p{margin-bottom:12px}.rst-content .section ol p:last-child,.rst-content .section ul p:last-child{margin-bottom:24px}.rst-content .line-block{margin-left:0px;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0px}.rst-content .topic-title{font-weight:bold;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0px 0px 24px 24px}.rst-content .align-left{float:left;margin:0px 24px 24px 0px}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content .toctree-wrapper p.caption .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink,.rst-content table>caption .headerlink,.rst-content .code-block-caption .headerlink{visibility:hidden;font-size:14px}.rst-content h1 .headerlink:after,.rst-content h2 .headerlink:after,.rst-content .toctree-wrapper p.caption .headerlink:after,.rst-content h3 .headerlink:after,.rst-content h4 .headerlink:after,.rst-content h5 .headerlink:after,.rst-content h6 .headerlink:after,.rst-content dl dt .headerlink:after,.rst-content p.caption .headerlink:after,.rst-content table>caption .headerlink:after,.rst-content .code-block-caption .headerlink:after{content:"";font-family:FontAwesome}.rst-content h1:hover .headerlink:after,.rst-content h2:hover .headerlink:after,.rst-content .toctree-wrapper p.caption:hover .headerlink:after,.rst-content h3:hover .headerlink:after,.rst-content h4:hover .headerlink:after,.rst-content h5:hover .headerlink:after,.rst-content h6:hover .headerlink:after,.rst-content dl dt:hover .headerlink:after,.rst-content p.caption:hover .headerlink:after,.rst-content table>caption:hover .headerlink:after,.rst-content .code-block-caption:hover .headerlink:after{visibility:visible}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:solid 1px #e1e4e5}.rst-content .sidebar p,.rst-content .sidebar ul,.rst-content .sidebar dl{font-size:90%}.rst-content .sidebar .last{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif;font-weight:bold;background:#e1e4e5;padding:6px 12px;margin:-24px;margin-bottom:24px;font-size:100%}.rst-content .highlighted{background:#F1C40F;display:inline-block;font-weight:bold;padding:0 6px}.rst-content .footnote-reference,.rst-content .citation-reference{vertical-align:baseline;position:relative;top:-0.4em;line-height:0;font-size:90%}.rst-content table.docutils.citation,.rst-content table.docutils.footnote{background:none;border:none;color:gray}.rst-content table.docutils.citation td,.rst-content table.docutils.citation tr,.rst-content table.docutils.footnote td,.rst-content table.docutils.footnote tr{border:none;background-color:transparent !important;white-space:normal}.rst-content table.docutils.citation td.label,.rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}.rst-content table.docutils.citation tt,.rst-content table.docutils.citation code,.rst-content table.docutils.footnote tt,.rst-content table.docutils.footnote code{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}.rst-content table.docutils td .last,.rst-content table.docutils td .last :last-child{margin-bottom:0}.rst-content table.field-list{border:none}.rst-content table.field-list td{border:none}.rst-content table.field-list td p{font-size:inherit;line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content tt,.rst-content tt,.rst-content code{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;padding:2px 5px}.rst-content tt big,.rst-content tt em,.rst-content tt big,.rst-content code big,.rst-content tt em,.rst-content code em{font-size:100% !important;line-height:normal}.rst-content tt.literal,.rst-content tt.literal,.rst-content code.literal{color:#E74C3C}.rst-content tt.xref,a .rst-content tt,.rst-content tt.xref,.rst-content code.xref,a .rst-content tt,a .rst-content code{font-weight:bold;color:#404040}.rst-content pre,.rst-content kbd,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace}.rst-content a tt,.rst-content a tt,.rst-content a code{color:#2980B9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:bold;margin-bottom:12px}.rst-content dl p,.rst-content dl table,.rst-content dl ul,.rst-content dl ol{margin-bottom:12px !important}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}.rst-content dl:not(.docutils){margin-bottom:24px}.rst-content dl:not(.docutils) dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980B9;border-top:solid 3px #6ab0de;padding:6px;position:relative}.rst-content dl:not(.docutils) dt:before{color:#6ab0de}.rst-content dl:not(.docutils) dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dl dt{margin-bottom:6px;border:none;border-left:solid 3px #ccc;background:#f0f0f0;color:#555}.rst-content dl:not(.docutils) dl dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dt:first-child{margin-top:0}.rst-content dl:not(.docutils) tt,.rst-content dl:not(.docutils) tt,.rst-content dl:not(.docutils) code{font-weight:bold}.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) tt.descclassname,.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) code.descname,.rst-content dl:not(.docutils) tt.descclassname,.rst-content dl:not(.docutils) code.descclassname{background-color:transparent;border:none;padding:0;font-size:100% !important}.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) code.descname{font-weight:bold}.rst-content dl:not(.docutils) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:bold}.rst-content dl:not(.docutils) .property{display:inline-block;padding-right:8px}.rst-content .viewcode-link,.rst-content .viewcode-back{display:inline-block;color:#27AE60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:bold}.rst-content tt.download,.rst-content code.download{background:inherit;padding:inherit;font-weight:normal;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content tt.download span:first-child,.rst-content code.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before{margin-right:4px}.rst-content .guilabel{border:1px solid #7fbbe3;background:#e7f2fa;font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .versionmodified{font-style:italic}@media screen and (max-width: 480px){.rst-content .sidebar{width:100%}}span[id*='MathJax-Span']{color:#404040}.math{text-align:center}@font-face{font-family:"Lato";src:url("../fonts/Lato/lato-regular.eot");src:url("../fonts/Lato/lato-regular.eot?#iefix") format("embedded-opentype"),url("../fonts/Lato/lato-regular.woff2") format("woff2"),url("../fonts/Lato/lato-regular.woff") format("woff"),url("../fonts/Lato/lato-regular.ttf") format("truetype");font-weight:400;font-style:normal}@font-face{font-family:"Lato";src:url("../fonts/Lato/lato-bold.eot");src:url("../fonts/Lato/lato-bold.eot?#iefix") format("embedded-opentype"),url("../fonts/Lato/lato-bold.woff2") format("woff2"),url("../fonts/Lato/lato-bold.woff") format("woff"),url("../fonts/Lato/lato-bold.ttf") format("truetype");font-weight:700;font-style:normal}@font-face{font-family:"Lato";src:url("../fonts/Lato/lato-bolditalic.eot");src:url("../fonts/Lato/lato-bolditalic.eot?#iefix") format("embedded-opentype"),url("../fonts/Lato/lato-bolditalic.woff2") format("woff2"),url("../fonts/Lato/lato-bolditalic.woff") format("woff"),url("../fonts/Lato/lato-bolditalic.ttf") format("truetype");font-weight:700;font-style:italic}@font-face{font-family:"Lato";src:url("../fonts/Lato/lato-italic.eot");src:url("../fonts/Lato/lato-italic.eot?#iefix") format("embedded-opentype"),url("../fonts/Lato/lato-italic.woff2") format("woff2"),url("../fonts/Lato/lato-italic.woff") format("woff"),url("../fonts/Lato/lato-italic.ttf") format("truetype");font-weight:400;font-style:italic}@font-face{font-family:"Roboto Slab";font-style:normal;font-weight:400;src:url("../fonts/RobotoSlab/roboto-slab.eot");src:url("../fonts/RobotoSlab/roboto-slab-v7-regular.eot?#iefix") format("embedded-opentype"),url("../fonts/RobotoSlab/roboto-slab-v7-regular.woff2") format("woff2"),url("../fonts/RobotoSlab/roboto-slab-v7-regular.woff") format("woff"),url("../fonts/RobotoSlab/roboto-slab-v7-regular.ttf") format("truetype")}@font-face{font-family:"Roboto Slab";font-style:normal;font-weight:700;src:url("../fonts/RobotoSlab/roboto-slab-v7-bold.eot");src:url("../fonts/RobotoSlab/roboto-slab-v7-bold.eot?#iefix") format("embedded-opentype"),url("../fonts/RobotoSlab/roboto-slab-v7-bold.woff2") format("woff2"),url("../fonts/RobotoSlab/roboto-slab-v7-bold.woff") format("woff"),url("../fonts/RobotoSlab/roboto-slab-v7-bold.ttf") format("truetype")} diff --git a/docs/build/html/_static/doctools.js b/docs/build/html/_static/doctools.js deleted file mode 100644 index daccd209..00000000 --- a/docs/build/html/_static/doctools.js +++ /dev/null @@ -1,315 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for all documentation. - * - * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s === 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node, addItems) { - if (node.nodeType === 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && - !jQuery(node.parentNode).hasClass(className) && - !jQuery(node.parentNode).hasClass("nohighlight")) { - var span; - var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); - if (isInSVG) { - span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - } else { - span = document.createElement("span"); - span.className = className; - } - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - if (isInSVG) { - var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); - var bbox = node.parentElement.getBBox(); - rect.x.baseVal.value = bbox.x; - rect.y.baseVal.value = bbox.y; - rect.width.baseVal.value = bbox.width; - rect.height.baseVal.value = bbox.height; - rect.setAttribute('class', className); - addItems.push({ - "parent": node.parentNode, - "target": rect}); - } - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this, addItems); - }); - } - } - var addItems = []; - var result = this.each(function() { - highlight(this, addItems); - }); - for (var i = 0; i < addItems.length; ++i) { - jQuery(addItems[i].parent).before(addItems[i].target); - } - return result; -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { - this.initOnKeyListeners(); - } - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated === 'undefined') - return string; - return (typeof translated === 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated === 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash && $.browser.mozilla) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - if (!body.length) { - body = $('body'); - } - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('#searchbox')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) === 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this === '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - }, - - initOnKeyListeners: function() { - $(document).keydown(function(event) { - var activeElementType = document.activeElement.tagName; - // don't navigate when in search box or textarea - if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' - && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) { - switch (event.keyCode) { - case 37: // left - var prevHref = $('link[rel="prev"]').prop('href'); - if (prevHref) { - window.location.href = prevHref; - return false; - } - case 39: // right - var nextHref = $('link[rel="next"]').prop('href'); - if (nextHref) { - window.location.href = nextHref; - return false; - } - } - } - }); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -}); diff --git a/docs/build/html/_static/documentation_options.js b/docs/build/html/_static/documentation_options.js deleted file mode 100644 index 285a1ecc..00000000 --- a/docs/build/html/_static/documentation_options.js +++ /dev/null @@ -1,12 +0,0 @@ -var DOCUMENTATION_OPTIONS = { - URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '1.0.6', - LANGUAGE: 'en', - COLLAPSE_INDEX: false, - BUILDER: 'html', - FILE_SUFFIX: '.html', - LINK_SUFFIX: '.html', - HAS_SOURCE: true, - SOURCELINK_SUFFIX: '.txt', - NAVIGATION_WITH_KEYS: false -}; \ No newline at end of file diff --git a/docs/build/html/_static/file.png b/docs/build/html/_static/file.png deleted file mode 100644 index a858a410..00000000 Binary files a/docs/build/html/_static/file.png and /dev/null differ diff --git a/docs/build/html/_static/fonts/Inconsolata-Bold.ttf b/docs/build/html/_static/fonts/Inconsolata-Bold.ttf deleted file mode 100644 index 809c1f58..00000000 Binary files a/docs/build/html/_static/fonts/Inconsolata-Bold.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Inconsolata-Regular.ttf b/docs/build/html/_static/fonts/Inconsolata-Regular.ttf deleted file mode 100644 index fc981ce7..00000000 Binary files a/docs/build/html/_static/fonts/Inconsolata-Regular.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Inconsolata.ttf b/docs/build/html/_static/fonts/Inconsolata.ttf deleted file mode 100644 index 4b8a36d2..00000000 Binary files a/docs/build/html/_static/fonts/Inconsolata.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato-Bold.ttf b/docs/build/html/_static/fonts/Lato-Bold.ttf deleted file mode 100644 index 1d23c706..00000000 Binary files a/docs/build/html/_static/fonts/Lato-Bold.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato-Regular.ttf b/docs/build/html/_static/fonts/Lato-Regular.ttf deleted file mode 100644 index 0f3d0f83..00000000 Binary files a/docs/build/html/_static/fonts/Lato-Regular.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-bold.eot b/docs/build/html/_static/fonts/Lato/lato-bold.eot deleted file mode 100644 index 3361183a..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-bold.eot and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-bold.ttf b/docs/build/html/_static/fonts/Lato/lato-bold.ttf deleted file mode 100644 index 29f691d5..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-bold.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-bold.woff b/docs/build/html/_static/fonts/Lato/lato-bold.woff deleted file mode 100644 index c6dff51f..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-bold.woff and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-bold.woff2 b/docs/build/html/_static/fonts/Lato/lato-bold.woff2 deleted file mode 100644 index bb195043..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-bold.woff2 and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-bolditalic.eot b/docs/build/html/_static/fonts/Lato/lato-bolditalic.eot deleted file mode 100644 index 3d415493..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-bolditalic.eot and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf b/docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf deleted file mode 100644 index f402040b..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff b/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff deleted file mode 100644 index 88ad05b9..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff2 b/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff2 deleted file mode 100644 index c4e3d804..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff2 and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-italic.eot b/docs/build/html/_static/fonts/Lato/lato-italic.eot deleted file mode 100644 index 3f826421..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-italic.eot and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-italic.ttf b/docs/build/html/_static/fonts/Lato/lato-italic.ttf deleted file mode 100644 index b4bfc9b2..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-italic.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-italic.woff b/docs/build/html/_static/fonts/Lato/lato-italic.woff deleted file mode 100644 index 76114bc0..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-italic.woff and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-italic.woff2 b/docs/build/html/_static/fonts/Lato/lato-italic.woff2 deleted file mode 100644 index 3404f37e..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-italic.woff2 and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-regular.eot b/docs/build/html/_static/fonts/Lato/lato-regular.eot deleted file mode 100644 index 11e3f2a5..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-regular.eot and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-regular.ttf b/docs/build/html/_static/fonts/Lato/lato-regular.ttf deleted file mode 100644 index 74decd9e..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-regular.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-regular.woff b/docs/build/html/_static/fonts/Lato/lato-regular.woff deleted file mode 100644 index ae1307ff..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-regular.woff and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-regular.woff2 b/docs/build/html/_static/fonts/Lato/lato-regular.woff2 deleted file mode 100644 index 3bf98433..00000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-regular.woff2 and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab-Bold.ttf b/docs/build/html/_static/fonts/RobotoSlab-Bold.ttf deleted file mode 100644 index df5d1df2..00000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab-Bold.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab-Regular.ttf b/docs/build/html/_static/fonts/RobotoSlab-Regular.ttf deleted file mode 100644 index eb52a790..00000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab-Regular.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot deleted file mode 100644 index 79dc8efe..00000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf deleted file mode 100644 index df5d1df2..00000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff deleted file mode 100644 index 6cb60000..00000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 deleted file mode 100644 index 7059e231..00000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot deleted file mode 100644 index 2f7ca78a..00000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf deleted file mode 100644 index eb52a790..00000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff deleted file mode 100644 index f815f63f..00000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 deleted file mode 100644 index f2c76e5b..00000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 and /dev/null differ diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.eot b/docs/build/html/_static/fonts/fontawesome-webfont.eot deleted file mode 100644 index e9f60ca9..00000000 Binary files a/docs/build/html/_static/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.svg b/docs/build/html/_static/fonts/fontawesome-webfont.svg deleted file mode 100644 index 855c845e..00000000 --- a/docs/build/html/_static/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,2671 +0,0 @@ - - - - -Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 - By ,,, -Copyright Dave Gandy 2016. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.ttf b/docs/build/html/_static/fonts/fontawesome-webfont.ttf deleted file mode 100644 index 35acda2f..00000000 Binary files a/docs/build/html/_static/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.woff b/docs/build/html/_static/fonts/fontawesome-webfont.woff deleted file mode 100644 index 400014a4..00000000 Binary files a/docs/build/html/_static/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.woff2 b/docs/build/html/_static/fonts/fontawesome-webfont.woff2 deleted file mode 100644 index 4d13fc60..00000000 Binary files a/docs/build/html/_static/fonts/fontawesome-webfont.woff2 and /dev/null differ diff --git a/docs/build/html/_static/jquery-3.2.1.js b/docs/build/html/_static/jquery-3.2.1.js deleted file mode 100644 index d2d8ca47..00000000 --- a/docs/build/html/_static/jquery-3.2.1.js +++ /dev/null @@ -1,10253 +0,0 @@ -/*! - * jQuery JavaScript Library v3.2.1 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2017-03-20T18:59Z - */ -( function( global, factory ) { - - "use strict"; - - if ( typeof module === "object" && typeof module.exports === "object" ) { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 -// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode -// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common -// enough that all such attempts are guarded in a try block. -"use strict"; - -var arr = []; - -var document = window.document; - -var getProto = Object.getPrototypeOf; - -var slice = arr.slice; - -var concat = arr.concat; - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var fnToString = hasOwn.toString; - -var ObjectFunctionString = fnToString.call( Object ); - -var support = {}; - - - - function DOMEval( code, doc ) { - doc = doc || document; - - var script = doc.createElement( "script" ); - - script.text = code; - doc.head.appendChild( script ).parentNode.removeChild( script ); - } -/* global Symbol */ -// Defining this global in .eslintrc.json would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - -var - version = "3.2.1", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }, - - // Support: Android <=4.0 only - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }; - -jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - - // Return all the elements in a clean array - if ( num == null ) { - return slice.call( this ); - } - - // Return just the one element from the set - return num < 0 ? this[ num + this.length ] : this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = Array.isArray( copy ) ) ) ) { - - if ( copyIsArray ) { - copyIsArray = false; - clone = src && Array.isArray( src ) ? src : []; - - } else { - clone = src && jQuery.isPlainObject( src ) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isFunction: function( obj ) { - return jQuery.type( obj ) === "function"; - }, - - isWindow: function( obj ) { - return obj != null && obj === obj.window; - }, - - isNumeric: function( obj ) { - - // As of jQuery 3.0, isNumeric is limited to - // strings and numbers (primitives or objects) - // that can be coerced to finite numbers (gh-2662) - var type = jQuery.type( obj ); - return ( type === "number" || type === "string" ) && - - // parseFloat NaNs numeric-cast false positives ("") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - !isNaN( obj - parseFloat( obj ) ); - }, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - - /* eslint-disable no-unused-vars */ - // See https://github.com/eslint/eslint/issues/6125 - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; - }, - - // Evaluates a script in a global context - globalEval: function( code ) { - DOMEval( code ); - }, - - // Convert dashed to camelCase; used by the css and data modules - // Support: IE <=9 - 11, Edge 12 - 13 - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // Support: Android <=4.0 only - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var tmp, args, proxy; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: Date.now, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; -} - -// Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), -function( i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -} ); - -function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = jQuery.type( obj ); - - if ( type === "function" || jQuery.isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.3.3 - * https://sizzlejs.com/ - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2016-08-08 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf as it's faster than native - // https://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + identifier + ")" ), - "CLASS": new RegExp( "^\\.(" + identifier + ")" ), - "TAG": new RegExp( "^(" + identifier + "|[*])" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - disabledAncestor = addCombinator( - function( elem ) { - return elem.disabled === true && ("form" in elem || "label" in elem); - }, - { dir: "parentNode", next: "legend" } - ); - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { - - // ID selector - if ( (m = match[1]) ) { - - // Document context - if ( nodeType === 9 ) { - if ( (elem = context.getElementById( m )) ) { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && (elem = newContext.getElementById( m )) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( (m = match[3]) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !compilerCache[ selector + " " ] && - (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - - if ( nodeType !== 1 ) { - newContext = context; - newSelector = selector; - - // qSA looks outside Element context, which is not what we want - // Thanks to Andrew Dupont for this workaround technique - // Support: IE <=8 - // Exclude object elements - } else if ( context.nodeName.toLowerCase() !== "object" ) { - - // Capture the context ID, setting it first if necessary - if ( (nid = context.getAttribute( "id" )) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", (nid = expando) ); - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[i] = "#" + nid + " " + toSelector( groups[i] ); - } - newSelector = groups.join( "," ); - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ -function assert( fn ) { - var el = document.createElement("fieldset"); - - try { - return !!fn( el ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - // release memory in IE - el = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = arr.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - a.sourceIndex - b.sourceIndex; - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ -function createDisabledPseudo( disabled ) { - - // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Only certain elements can match :enabled or :disabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled - if ( "form" in elem ) { - - // Check for inherited disabledness on relevant non-disabled elements: - // * listed form-associated elements in a disabled fieldset - // https://html.spec.whatwg.org/multipage/forms.html#category-listed - // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled - // * option elements in a disabled optgroup - // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled - // All such elements have a "form" property. - if ( elem.parentNode && elem.disabled === false ) { - - // Option elements defer to a parent optgroup if present - if ( "label" in elem ) { - if ( "label" in elem.parentNode ) { - return elem.parentNode.disabled === disabled; - } else { - return elem.disabled === disabled; - } - } - - // Support: IE 6 - 11 - // Use the isDisabled shortcut property to check for disabled fieldset ancestors - return elem.isDisabled === disabled || - - // Where there is no isDisabled, check manually - /* jshint -W018 */ - elem.isDisabled !== !disabled && - disabledAncestor( elem ) === disabled; - } - - return elem.disabled === disabled; - - // Try to winnow out elements that can't be disabled before trusting the disabled property. - // Some victims get caught in our net (label, legend, menu, track), but it shouldn't - // even exist on them, let alone have a boolean value. - } else if ( "label" in elem ) { - return elem.disabled === disabled; - } - - // Remaining elements are neither :enabled nor :disabled - return false; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, subWindow, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - - // Support: IE 9-11, Edge - // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - if ( preferredDoc !== document && - (subWindow = document.defaultView) && subWindow.top !== subWindow ) { - - // Support: IE 11, Edge - if ( subWindow.addEventListener ) { - subWindow.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( subWindow.attachEvent ) { - subWindow.attachEvent( "onunload", unloadHandler ); - } - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert(function( el ) { - el.className = "i"; - return !el.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( el ) { - el.appendChild( document.createComment("") ); - return !el.getElementsByTagName("*").length; - }); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( document.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( el ) { - docElem.appendChild( el ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - }); - - // ID filter and find - if ( support.getById ) { - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var elem = context.getElementById( id ); - return elem ? [ elem ] : []; - } - }; - } else { - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - - // Support: IE 6 - 7 only - // getElementById is not reliable as a find shortcut - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var node, i, elems, - elem = context.getElementById( id ); - - if ( elem ) { - - // Verify the id attribute - node = elem.getAttributeNode("id"); - if ( node && node.value === id ) { - return [ elem ]; - } - - // Fall back on getElementsByName - elems = context.getElementsByName( id ); - i = 0; - while ( (elem = elems[i++]) ) { - node = elem.getAttributeNode("id"); - if ( node && node.value === id ) { - return [ elem ]; - } - } - } - - return []; - } - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See https://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( el ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // https://bugs.jquery.com/ticket/12359 - docElem.appendChild( el ).innerHTML = "" + - ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll("[msallowcapture^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !el.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push("~="); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !el.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push(".#.+[+~]"); - } - }); - - assert(function( el ) { - el.innerHTML = "" + - ""; - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement("input"); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( el.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( el.querySelectorAll(":enabled").length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE9-11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll(":disabled").length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( el ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( el, "*" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( el, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully self-exclusive - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { - return -1; - } - if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - return a === document ? -1 : - b === document ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - !compilerCache[ expr + " " ] && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch (e) {} - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null; -}; - -Sizzle.escape = function( sel ) { - return (sel + "").replace( rcssescape, fcssescape ); -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[6] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, uniqueCache, outerCache, node, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType, - diff = false; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) { - - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - - // Seek `elem` from a previously-cached index - - // ...in a gzip-friendly way - node = parent; - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex && cache[ 2 ]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - } else { - // Use previously-cached element index if available - if ( useCache ) { - // ...in a gzip-friendly way - node = elem; - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex; - } - - // xml :nth-child(...) - // or :nth-last-child(...) or :nth(-last)?-of-type(...) - if ( diff === false ) { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) && - ++diff ) { - - // Cache the index of each encountered element - if ( useCache ) { - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - uniqueCache[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - // Don't keep the element (issue #299) - input[0] = null; - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": createDisabledPseudo( false ), - "disabled": createDisabledPseudo( true ), - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( (tokens = []) ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - skip = combinator.next, - key = skip || dir, - checkNonElements = base && key === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - return false; - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, uniqueCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); - - if ( skip && skip === elem.nodeName.toLowerCase() ) { - elem = elem[ dir ] || elem; - } else if ( (oldCache = uniqueCache[ key ]) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); - } else { - // Reuse newcache so results back-propagate to previous elements - uniqueCache[ key ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { - return true; - } - } - } - } - } - return false; - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - // Avoid hanging onto element (issue #299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), - len = elems.length; - - if ( outermost ) { - outermostContext = context === document || context || outermost; - } - - // Add elements passing elementMatchers directly to results - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - if ( !context && elem.ownerDocument !== document ) { - setDocument( elem ); - xml = !documentIsHTML; - } - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context || document, xml) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // `i` is now the count of elements visited above, and adding it to `matchedCount` - // makes the latter nonnegative. - matchedCount += i; - - // Apply set filters to unmatched elements - // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` - // equals `i`), unless we didn't visit _any_ elements in the above loop because we have - // no element matchers and no seed. - // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that - // case, which will result in a "00" `matchedCount` that differs from `i` but is also - // numerically zero. - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); - - results = results || []; - - // Try to minimize operations if there is only one selector in the list and no seed - // (the latter of which guarantees us context) - if ( match.length === 1 ) { - - // Reduce context if the leading compound selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - !context || rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome 14-35+ -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( el ) { - // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( el ) { - el.innerHTML = ""; - return el.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( el ) { - el.innerHTML = ""; - el.firstChild.setAttribute( "value", "" ); - return el.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( el ) { - return el.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - null; - } - }); -} - -return Sizzle; - -})( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; - -// Deprecated -jQuery.expr[ ":" ] = jQuery.expr.pseudos; -jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; -jQuery.escapeSelector = Sizzle.escape; - - - - -var dir = function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; -}; - - -var siblings = function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; -}; - - -var rneedsContext = jQuery.expr.match.needsContext; - - - -function nodeName( elem, name ) { - - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - -}; -var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); - - - -var risSimple = /^.[^:#\[\.,]*$/; - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) !== not; - } ); - } - - // Single element - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - } ); - } - - // Arraylike of elements (jQuery, arguments, Array) - if ( typeof qualifier !== "string" ) { - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not; - } ); - } - - // Simple selector that can be filtered directly, removing non-Elements - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - // Complex selector, compare the two sets, removing non-Elements - qualifier = jQuery.filter( qualifier, elements ); - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1; - } ); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - if ( elems.length === 1 && elem.nodeType === 1 ) { - return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; - } - - return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - } ) ); -}; - -jQuery.fn.extend( { - find: function( selector ) { - var i, ret, - len = this.length, - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - } ) ); - } - - ret = this.pushStack( [] ); - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - return len > 1 ? jQuery.uniqueSort( ret ) : ret; - }, - filter: function( selector ) { - return this.pushStack( winnow( this, selector || [], false ) ); - }, - not: function( selector ) { - return this.pushStack( winnow( this, selector || [], true ) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -} ); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - // Shortcut simple #id case for speed - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Method init() accepts an alternate rootjQuery - // so migrate can support jQuery.sub (gh-2101) - root = root || rootjQuery; - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[ 0 ] === "<" && - selector[ selector.length - 1 ] === ">" && - selector.length >= 3 ) { - - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && ( match[ 1 ] || !context ) ) { - - // HANDLE: $(html) -> $(array) - if ( match[ 1 ] ) { - context = context instanceof jQuery ? context[ 0 ] : context; - - // Option to run scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[ 1 ], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[ 2 ] ); - - if ( elem ) { - - // Inject the element directly into the jQuery object - this[ 0 ] = elem; - this.length = 1; - } - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || root ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return root.ready !== undefined ? - root.ready( selector ) : - - // Execute immediately if ready is not present - selector( jQuery ); - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - - // Methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend( { - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter( function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - targets = typeof selectors !== "string" && jQuery( selectors ); - - // Positional selectors never match, since there's no _selection_ context - if ( !rneedsContext.test( selectors ) ) { - for ( ; i < l; i++ ) { - for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - - // Always skip document fragments - if ( cur.nodeType < 11 && ( targets ? - targets.index( cur ) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector( cur, selectors ) ) ) { - - matched.push( cur ); - break; - } - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); - }, - - // Determine the position of an element within the set - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // Index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.uniqueSort( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - } -} ); - -function sibling( cur, dir ) { - while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} - return cur; -} - -jQuery.each( { - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return siblings( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return siblings( elem.firstChild ); - }, - contents: function( elem ) { - if ( nodeName( elem, "iframe" ) ) { - return elem.contentDocument; - } - - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } - - return jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.uniqueSort( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; -} ); -var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); - - - -// Convert String-formatted options into Object-formatted ones -function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { - object[ flag ] = true; - } ); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - createOptions( options ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - - // Last fire value for non-forgettable lists - memory, - - // Flag to know if list was already fired - fired, - - // Flag to prevent firing - locked, - - // Actual callback list - list = [], - - // Queue of execution data for repeatable lists - queue = [], - - // Index of currently firing callback (modified by add/remove as needed) - firingIndex = -1, - - // Fire callbacks - fire = function() { - - // Enforce single-firing - locked = locked || options.once; - - // Execute callbacks for all pending executions, - // respecting firingIndex overrides and runtime changes - fired = firing = true; - for ( ; queue.length; firingIndex = -1 ) { - memory = queue.shift(); - while ( ++firingIndex < list.length ) { - - // Run callback and check for early termination - if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && - options.stopOnFalse ) { - - // Jump to end and forget the data so .add doesn't re-fire - firingIndex = list.length; - memory = false; - } - } - } - - // Forget the data if we're done with it - if ( !options.memory ) { - memory = false; - } - - firing = false; - - // Clean up if we're done firing for good - if ( locked ) { - - // Keep an empty list if we have data for future add calls - if ( memory ) { - list = []; - - // Otherwise, this object is spent - } else { - list = ""; - } - } - }, - - // Actual Callbacks object - self = { - - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - - // If we have memory from a past run, we should fire after adding - if ( memory && !firing ) { - firingIndex = list.length - 1; - queue.push( memory ); - } - - ( function add( args ) { - jQuery.each( args, function( _, arg ) { - if ( jQuery.isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { - - // Inspect recursively - add( arg ); - } - } ); - } )( arguments ); - - if ( memory && !firing ) { - fire(); - } - } - return this; - }, - - // Remove a callback from the list - remove: function() { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - - // Handle firing indexes - if ( index <= firingIndex ) { - firingIndex--; - } - } - } ); - return this; - }, - - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? - jQuery.inArray( fn, list ) > -1 : - list.length > 0; - }, - - // Remove all callbacks from the list - empty: function() { - if ( list ) { - list = []; - } - return this; - }, - - // Disable .fire and .add - // Abort any current/pending executions - // Clear all callbacks and values - disable: function() { - locked = queue = []; - list = memory = ""; - return this; - }, - disabled: function() { - return !list; - }, - - // Disable .fire - // Also disable .add unless we have memory (since it would have no effect) - // Abort any pending executions - lock: function() { - locked = queue = []; - if ( !memory && !firing ) { - list = memory = ""; - } - return this; - }, - locked: function() { - return !!locked; - }, - - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( !locked ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - queue.push( args ); - if ( !firing ) { - fire(); - } - } - return this; - }, - - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -function Identity( v ) { - return v; -} -function Thrower( ex ) { - throw ex; -} - -function adoptValue( value, resolve, reject, noValue ) { - var method; - - try { - - // Check for promise aspect first to privilege synchronous behavior - if ( value && jQuery.isFunction( ( method = value.promise ) ) ) { - method.call( value ).done( resolve ).fail( reject ); - - // Other thenables - } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) { - method.call( value, resolve, reject ); - - // Other non-thenables - } else { - - // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: - // * false: [ value ].slice( 0 ) => resolve( value ) - // * true: [ value ].slice( 1 ) => resolve() - resolve.apply( undefined, [ value ].slice( noValue ) ); - } - - // For Promises/A+, convert exceptions into rejections - // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in - // Deferred#then to conditionally suppress rejection. - } catch ( value ) { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - reject.apply( undefined, [ value ] ); - } -} - -jQuery.extend( { - - Deferred: function( func ) { - var tuples = [ - - // action, add listener, callbacks, - // ... .then handlers, argument index, [final state] - [ "notify", "progress", jQuery.Callbacks( "memory" ), - jQuery.Callbacks( "memory" ), 2 ], - [ "resolve", "done", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 0, "resolved" ], - [ "reject", "fail", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 1, "rejected" ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - "catch": function( fn ) { - return promise.then( null, fn ); - }, - - // Keep pipe for back-compat - pipe: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - - return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - - // Map tuples (progress, done, fail) to arguments (done, fail, progress) - var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - - // deferred.progress(function() { bind to newDefer or newDefer.notify }) - // deferred.done(function() { bind to newDefer or newDefer.resolve }) - // deferred.fail(function() { bind to newDefer or newDefer.reject }) - deferred[ tuple[ 1 ] ]( function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - then: function( onFulfilled, onRejected, onProgress ) { - var maxDepth = 0; - function resolve( depth, deferred, handler, special ) { - return function() { - var that = this, - args = arguments, - mightThrow = function() { - var returned, then; - - // Support: Promises/A+ section 2.3.3.3.3 - // https://promisesaplus.com/#point-59 - // Ignore double-resolution attempts - if ( depth < maxDepth ) { - return; - } - - returned = handler.apply( that, args ); - - // Support: Promises/A+ section 2.3.1 - // https://promisesaplus.com/#point-48 - if ( returned === deferred.promise() ) { - throw new TypeError( "Thenable self-resolution" ); - } - - // Support: Promises/A+ sections 2.3.3.1, 3.5 - // https://promisesaplus.com/#point-54 - // https://promisesaplus.com/#point-75 - // Retrieve `then` only once - then = returned && - - // Support: Promises/A+ section 2.3.4 - // https://promisesaplus.com/#point-64 - // Only check objects and functions for thenability - ( typeof returned === "object" || - typeof returned === "function" ) && - returned.then; - - // Handle a returned thenable - if ( jQuery.isFunction( then ) ) { - - // Special processors (notify) just wait for resolution - if ( special ) { - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ) - ); - - // Normal processors (resolve) also hook into progress - } else { - - // ...and disregard older resolution values - maxDepth++; - - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ), - resolve( maxDepth, deferred, Identity, - deferred.notifyWith ) - ); - } - - // Handle all other returned values - } else { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Identity ) { - that = undefined; - args = [ returned ]; - } - - // Process the value(s) - // Default process is resolve - ( special || deferred.resolveWith )( that, args ); - } - }, - - // Only normal processors (resolve) catch and reject exceptions - process = special ? - mightThrow : - function() { - try { - mightThrow(); - } catch ( e ) { - - if ( jQuery.Deferred.exceptionHook ) { - jQuery.Deferred.exceptionHook( e, - process.stackTrace ); - } - - // Support: Promises/A+ section 2.3.3.3.4.1 - // https://promisesaplus.com/#point-61 - // Ignore post-resolution exceptions - if ( depth + 1 >= maxDepth ) { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Thrower ) { - that = undefined; - args = [ e ]; - } - - deferred.rejectWith( that, args ); - } - } - }; - - // Support: Promises/A+ section 2.3.3.3.1 - // https://promisesaplus.com/#point-57 - // Re-resolve promises immediately to dodge false rejection from - // subsequent errors - if ( depth ) { - process(); - } else { - - // Call an optional hook to record the stack, in case of exception - // since it's otherwise lost when execution goes async - if ( jQuery.Deferred.getStackHook ) { - process.stackTrace = jQuery.Deferred.getStackHook(); - } - window.setTimeout( process ); - } - }; - } - - return jQuery.Deferred( function( newDefer ) { - - // progress_handlers.add( ... ) - tuples[ 0 ][ 3 ].add( - resolve( - 0, - newDefer, - jQuery.isFunction( onProgress ) ? - onProgress : - Identity, - newDefer.notifyWith - ) - ); - - // fulfilled_handlers.add( ... ) - tuples[ 1 ][ 3 ].add( - resolve( - 0, - newDefer, - jQuery.isFunction( onFulfilled ) ? - onFulfilled : - Identity - ) - ); - - // rejected_handlers.add( ... ) - tuples[ 2 ][ 3 ].add( - resolve( - 0, - newDefer, - jQuery.isFunction( onRejected ) ? - onRejected : - Thrower - ) - ); - } ).promise(); - }, - - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 5 ]; - - // promise.progress = list.add - // promise.done = list.add - // promise.fail = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( - function() { - - // state = "resolved" (i.e., fulfilled) - // state = "rejected" - state = stateString; - }, - - // rejected_callbacks.disable - // fulfilled_callbacks.disable - tuples[ 3 - i ][ 2 ].disable, - - // progress_callbacks.lock - tuples[ 0 ][ 2 ].lock - ); - } - - // progress_handlers.fire - // fulfilled_handlers.fire - // rejected_handlers.fire - list.add( tuple[ 3 ].fire ); - - // deferred.notify = function() { deferred.notifyWith(...) } - // deferred.resolve = function() { deferred.resolveWith(...) } - // deferred.reject = function() { deferred.rejectWith(...) } - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); - return this; - }; - - // deferred.notifyWith = list.fireWith - // deferred.resolveWith = list.fireWith - // deferred.rejectWith = list.fireWith - deferred[ tuple[ 0 ] + "With" ] = list.fireWith; - } ); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( singleValue ) { - var - - // count of uncompleted subordinates - remaining = arguments.length, - - // count of unprocessed arguments - i = remaining, - - // subordinate fulfillment data - resolveContexts = Array( i ), - resolveValues = slice.call( arguments ), - - // the master Deferred - master = jQuery.Deferred(), - - // subordinate callback factory - updateFunc = function( i ) { - return function( value ) { - resolveContexts[ i ] = this; - resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( !( --remaining ) ) { - master.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, - !remaining ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( master.state() === "pending" || - jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return master.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); - } - - return master.promise(); - } -} ); - - -// These usually indicate a programmer mistake during development, -// warn about them ASAP rather than swallowing them by default. -var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - -jQuery.Deferred.exceptionHook = function( error, stack ) { - - // Support: IE 8 - 9 only - // Console exists when dev tools are open, which can happen at any time - if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); - } -}; - - - - -jQuery.readyException = function( error ) { - window.setTimeout( function() { - throw error; - } ); -}; - - - - -// The deferred used on DOM ready -var readyList = jQuery.Deferred(); - -jQuery.fn.ready = function( fn ) { - - readyList - .then( fn ) - - // Wrap jQuery.readyException in a function so that the lookup - // happens at the time of error handling instead of callback - // registration. - .catch( function( error ) { - jQuery.readyException( error ); - } ); - - return this; -}; - -jQuery.extend( { - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - } -} ); - -jQuery.ready.then = readyList.then; - -// The ready event handler and self cleanup method -function completed() { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - jQuery.ready(); -} - -// Catch cases where $(document).ready() is called -// after the browser event has already occurred. -// Support: IE <=9 - 10 only -// Older IE sometimes signals "interactive" too soon -if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - - // Handle it asynchronously to allow scripts the opportunity to delay ready - window.setTimeout( jQuery.ready ); - -} else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); -} - - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - access( elems, fn, i, key[ i ], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( - elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - if ( chainable ) { - return elems; - } - - // Gets - if ( bulk ) { - return fn.call( elems ); - } - - return len ? fn( elems[ 0 ], key ) : emptyGet; -}; -var acceptData = function( owner ) { - - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); -}; - - - - -function Data() { - this.expando = jQuery.expando + Data.uid++; -} - -Data.uid = 1; - -Data.prototype = { - - cache: function( owner ) { - - // Check if the owner object already has a cache - var value = owner[ this.expando ]; - - // If not, create one - if ( !value ) { - value = {}; - - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return an empty object. - if ( acceptData( owner ) ) { - - // If it is a node unlikely to be stringify-ed or looped over - // use plain assignment - if ( owner.nodeType ) { - owner[ this.expando ] = value; - - // Otherwise secure it in a non-enumerable property - // configurable must be true to allow the property to be - // deleted when data is removed - } else { - Object.defineProperty( owner, this.expando, { - value: value, - configurable: true - } ); - } - } - } - - return value; - }, - set: function( owner, data, value ) { - var prop, - cache = this.cache( owner ); - - // Handle: [ owner, key, value ] args - // Always use camelCase key (gh-2257) - if ( typeof data === "string" ) { - cache[ jQuery.camelCase( data ) ] = value; - - // Handle: [ owner, { properties } ] args - } else { - - // Copy the properties one-by-one to the cache object - for ( prop in data ) { - cache[ jQuery.camelCase( prop ) ] = data[ prop ]; - } - } - return cache; - }, - get: function( owner, key ) { - return key === undefined ? - this.cache( owner ) : - - // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ]; - }, - access: function( owner, key, value ) { - - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ( ( key && typeof key === "string" ) && value === undefined ) ) { - - return this.get( owner, key ); - } - - // When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, - cache = owner[ this.expando ]; - - if ( cache === undefined ) { - return; - } - - if ( key !== undefined ) { - - // Support array or space separated string of keys - if ( Array.isArray( key ) ) { - - // If key is an array of keys... - // We always set camelCase keys, so remove that. - key = key.map( jQuery.camelCase ); - } else { - key = jQuery.camelCase( key ); - - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - key = key in cache ? - [ key ] : - ( key.match( rnothtmlwhite ) || [] ); - } - - i = key.length; - - while ( i-- ) { - delete cache[ key[ i ] ]; - } - } - - // Remove the expando if there's no more data - if ( key === undefined || jQuery.isEmptyObject( cache ) ) { - - // Support: Chrome <=35 - 45 - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) - if ( owner.nodeType ) { - owner[ this.expando ] = undefined; - } else { - delete owner[ this.expando ]; - } - } - }, - hasData: function( owner ) { - var cache = owner[ this.expando ]; - return cache !== undefined && !jQuery.isEmptyObject( cache ); - } -}; -var dataPriv = new Data(); - -var dataUser = new Data(); - - - -// Implementation Summary -// -// 1. Enforce API surface and semantic compatibility with 1.9.x branch -// 2. Improve the module's maintainability by reducing the storage -// paths to a single mechanism. -// 3. Use the same single mechanism to support "private" and "user" data. -// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) -// 5. Avoid exposing implementation details on user objects (eg. expando properties) -// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /[A-Z]/g; - -function getData( data ) { - if ( data === "true" ) { - return true; - } - - if ( data === "false" ) { - return false; - } - - if ( data === "null" ) { - return null; - } - - // Only convert to a number if it doesn't change the string - if ( data === +data + "" ) { - return +data; - } - - if ( rbrace.test( data ) ) { - return JSON.parse( data ); - } - - return data; -} - -function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = getData( data ); - } catch ( e ) {} - - // Make sure we set the data so it isn't changed later - dataUser.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; -} - -jQuery.extend( { - hasData: function( elem ) { - return dataUser.hasData( elem ) || dataPriv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return dataUser.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - dataUser.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to dataPriv methods, these can be deprecated. - _data: function( elem, name, data ) { - return dataPriv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - dataPriv.remove( elem, name ); - } -} ); - -jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = dataUser.get( elem ); - - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE 11 only - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - dataPriv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - dataUser.set( this, key ); - } ); - } - - return access( this, function( value ) { - var data; - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - - // Attempt to get data from the cache - // The key will always be camelCased in Data - data = dataUser.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, key ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each( function() { - - // We always store the camelCased key - dataUser.set( this, key, value ); - } ); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each( function() { - dataUser.remove( this, key ); - } ); - } -} ); - - -jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = dataPriv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || Array.isArray( data ) ) { - queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // Clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // Not public - generate a queueHooks object, or return the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - dataPriv.remove( elem, [ type + "queue", key ] ); - } ) - } ); - } -} ); - -jQuery.fn.extend( { - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[ 0 ], type ); - } - - return data === undefined ? - this : - this.each( function() { - var queue = jQuery.queue( this, type, data ); - - // Ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - } ); - }, - dequeue: function( type ) { - return this.each( function() { - jQuery.dequeue( this, type ); - } ); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -} ); -var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; - -var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); - - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var isHiddenWithinTree = function( elem, el ) { - - // isHiddenWithinTree might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - - // Inline style trumps all - return elem.style.display === "none" || - elem.style.display === "" && - - // Otherwise, check computed style - // Support: Firefox <=43 - 45 - // Disconnected elements can have computed display: none, so first confirm that elem is - // in the document. - jQuery.contains( elem.ownerDocument, elem ) && - - jQuery.css( elem, "display" ) === "none"; - }; - -var swap = function( elem, options, callback, args ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.apply( elem, args || [] ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; -}; - - - - -function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, - scale = 1, - maxIterations = 20, - currentValue = tween ? - function() { - return tween.cur(); - } : - function() { - return jQuery.css( elem, prop, "" ); - }, - initial = currentValue(), - unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), - - // Starting value computation is required for potential unit mismatches - initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - do { - - // If previous iteration zeroed out, double until we get *something*. - // Use string for doubling so we don't accidentally see scale as unchanged below - scale = scale || ".5"; - - // Adjust and apply - initialInUnit = initialInUnit / scale; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Update scale, tolerating zero or NaN from tween.cur() - // Break the loop if scale is unchanged or perfect, or if we've just had enough. - } while ( - scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations - ); - } - - if ( valueParts ) { - initialInUnit = +initialInUnit || +initial || 0; - - // Apply relative offset (+=/-=) if specified - adjusted = valueParts[ 1 ] ? - initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : - +valueParts[ 2 ]; - if ( tween ) { - tween.unit = unit; - tween.start = initialInUnit; - tween.end = adjusted; - } - } - return adjusted; -} - - -var defaultDisplayMap = {}; - -function getDefaultDisplay( elem ) { - var temp, - doc = elem.ownerDocument, - nodeName = elem.nodeName, - display = defaultDisplayMap[ nodeName ]; - - if ( display ) { - return display; - } - - temp = doc.body.appendChild( doc.createElement( nodeName ) ); - display = jQuery.css( temp, "display" ); - - temp.parentNode.removeChild( temp ); - - if ( display === "none" ) { - display = "block"; - } - defaultDisplayMap[ nodeName ] = display; - - return display; -} - -function showHide( elements, show ) { - var display, elem, - values = [], - index = 0, - length = elements.length; - - // Determine new display value for elements that need to change - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - display = elem.style.display; - if ( show ) { - - // Since we force visibility upon cascade-hidden elements, an immediate (and slow) - // check is required in this first loop unless we have a nonempty display value (either - // inline or about-to-be-restored) - if ( display === "none" ) { - values[ index ] = dataPriv.get( elem, "display" ) || null; - if ( !values[ index ] ) { - elem.style.display = ""; - } - } - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { - values[ index ] = getDefaultDisplay( elem ); - } - } else { - if ( display !== "none" ) { - values[ index ] = "none"; - - // Remember what we're overwriting - dataPriv.set( elem, "display", display ); - } - } - } - - // Set the display of the elements in a second loop to avoid constant reflow - for ( index = 0; index < length; index++ ) { - if ( values[ index ] != null ) { - elements[ index ].style.display = values[ index ]; - } - } - - return elements; -} - -jQuery.fn.extend( { - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHiddenWithinTree( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); - } -} ); -var rcheckableType = ( /^(?:checkbox|radio)$/i ); - -var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); - -var rscriptType = ( /^$|\/(?:java|ecma)script/i ); - - - -// We have to close these tags to support XHTML (#13200) -var wrapMap = { - - // Support: IE <=9 only - option: [ 1, "" ], - - // XHTML parsers do not magically insert elements in the - // same way that tag soup parsers do. So we cannot shorten - // this by omitting or other required elements. - thead: [ 1, "", "
" ], - col: [ 2, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - _default: [ 0, "", "" ] -}; - -// Support: IE <=9 only -wrapMap.optgroup = wrapMap.option; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - - -function getAll( context, tag ) { - - // Support: IE <=9 - 11 only - // Use typeof to avoid zero-argument method invocation on host objects (#15151) - var ret; - - if ( typeof context.getElementsByTagName !== "undefined" ) { - ret = context.getElementsByTagName( tag || "*" ); - - } else if ( typeof context.querySelectorAll !== "undefined" ) { - ret = context.querySelectorAll( tag || "*" ); - - } else { - ret = []; - } - - if ( tag === undefined || tag && nodeName( context, tag ) ) { - return jQuery.merge( [ context ], ret ); - } - - return ret; -} - - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - dataPriv.set( - elems[ i ], - "globalEval", - !refElements || dataPriv.get( refElements[ i ], "globalEval" ) - ); - } -} - - -var rhtml = /<|&#?\w+;/; - -function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, contains, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( ( elem = nodes[ i++ ] ) ) { - - // Skip elements already in the context collection (trac-4087) - if ( selection && jQuery.inArray( elem, selection ) > -1 ) { - if ( ignored ) { - ignored.push( elem ); - } - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( ( elem = tmp[ j++ ] ) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; -} - - -( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; -} )(); -var documentElement = document.documentElement; - - - -var - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -// Support: IE <=9 only -// See #13393 for more info -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -function on( elem, types, selector, data, fn, one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - on( elem, type, selector, data, types[ type ], one ); - } - return elem; - } - - if ( data == null && fn == null ) { - - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return elem; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return elem.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - } ); -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.get( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Ensure that invalid selectors throw exceptions at attach time - // Evaluate against documentElement in case elem is a non-element node (e.g., document) - if ( selector ) { - jQuery.find.matchesSelector( documentElement, selector ); - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !( events = elemData.events ) ) { - events = elemData.events = {}; - } - if ( !( eventHandle = elemData.handle ) ) { - eventHandle = elemData.handle = function( e ) { - - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend( { - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join( "." ) - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !( handlers = events[ type ] ) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[ 2 ] && - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || - selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || - special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove data and the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - dataPriv.remove( elem, "handle events" ); - } - }, - - dispatch: function( nativeEvent ) { - - // Make a writable jQuery.Event from the native event object - var event = jQuery.event.fix( nativeEvent ); - - var i, j, ret, matched, handleObj, handlerQueue, - args = new Array( arguments.length ), - handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[ 0 ] = event; - - for ( i = 1; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } - - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( ( handleObj = matched.handlers[ j++ ] ) && - !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or 2) have namespace(s) - // a subset or equal to those in the bound event (both can have no namespace). - if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || - handleObj.handler ).apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( ( event.result = ret ) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, handleObj, sel, matchedHandlers, matchedSelectors, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - if ( delegateCount && - - // Support: IE <=9 - // Black-hole SVG instance trees (trac-13180) - cur.nodeType && - - // Support: Firefox <=42 - // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) - // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click - // Support: IE 11 only - // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) - !( event.type === "click" && event.button >= 1 ) ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { - matchedHandlers = []; - matchedSelectors = {}; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matchedSelectors[ sel ] === undefined ) { - matchedSelectors[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matchedSelectors[ sel ] ) { - matchedHandlers.push( handleObj ); - } - } - if ( matchedHandlers.length ) { - handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - cur = this; - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - addProp: function( name, hook ) { - Object.defineProperty( jQuery.Event.prototype, name, { - enumerable: true, - configurable: true, - - get: jQuery.isFunction( hook ) ? - function() { - if ( this.originalEvent ) { - return hook( this.originalEvent ); - } - } : - function() { - if ( this.originalEvent ) { - return this.originalEvent[ name ]; - } - }, - - set: function( value ) { - Object.defineProperty( this, name, { - enumerable: true, - configurable: true, - writable: true, - value: value - } ); - } - } ); - }, - - fix: function( originalEvent ) { - return originalEvent[ jQuery.expando ] ? - originalEvent : - new jQuery.Event( originalEvent ); - }, - - special: { - load: { - - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - this.focus(); - return false; - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - } -}; - -jQuery.removeEvent = function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle ); - } -}; - -jQuery.Event = function( src, props ) { - - // Allow instantiation without the 'new' keyword - if ( !( this instanceof jQuery.Event ) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - - // Support: Android <=2.3 only - src.returnValue === false ? - returnTrue : - returnFalse; - - // Create target properties - // Support: Safari <=6 - 7 only - // Target should not be a text node (#504, #13143) - this.target = ( src.target && src.target.nodeType === 3 ) ? - src.target.parentNode : - src.target; - - this.currentTarget = src.currentTarget; - this.relatedTarget = src.relatedTarget; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - constructor: jQuery.Event, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - isSimulated: false, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && !this.isSimulated ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Includes all common event props including KeyEvent and MouseEvent specific props -jQuery.each( { - altKey: true, - bubbles: true, - cancelable: true, - changedTouches: true, - ctrlKey: true, - detail: true, - eventPhase: true, - metaKey: true, - pageX: true, - pageY: true, - shiftKey: true, - view: true, - "char": true, - charCode: true, - key: true, - keyCode: true, - button: true, - buttons: true, - clientX: true, - clientY: true, - offsetX: true, - offsetY: true, - pointerId: true, - pointerType: true, - screenX: true, - screenY: true, - targetTouches: true, - toElement: true, - touches: true, - - which: function( event ) { - var button = event.button; - - // Add which for key events - if ( event.which == null && rkeyEvent.test( event.type ) ) { - return event.charCode != null ? event.charCode : event.keyCode; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { - if ( button & 1 ) { - return 1; - } - - if ( button & 2 ) { - return 3; - } - - if ( button & 4 ) { - return 2; - } - - return 0; - } - - return event.which; - } -}, jQuery.event.addProp ); - -// Create mouseenter/leave events using mouseover/out and event-time checks -// so that event delegation works in jQuery. -// Do the same for pointerenter/pointerleave and pointerover/pointerout -// -// Support: Safari 7 only -// Safari sends mouseenter too often; see: -// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 -// for the description of the bug (it existed in older Chrome versions as well). -jQuery.each( { - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mouseenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -} ); - -jQuery.fn.extend( { - - on: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn ); - }, - one: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? - handleObj.origType + "." + handleObj.namespace : - handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each( function() { - jQuery.event.remove( this, types, fn, selector ); - } ); - } -} ); - - -var - - /* eslint-disable max-len */ - - // See https://github.com/eslint/eslint/issues/3229 - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, - - /* eslint-enable */ - - // Support: IE <=10 - 11, Edge 12 - 13 - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /\s*$/g; - -// Prefer a tbody over its parent table for containing new rows -function manipulationTarget( elem, content ) { - if ( nodeName( elem, "table" ) && - nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - - return jQuery( ">tbody", elem )[ 0 ] || elem; - } - - return elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - - if ( match ) { - elem.type = match[ 1 ]; - } else { - elem.removeAttribute( "type" ); - } - - return elem; -} - -function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.access( src ); - pdataCur = dataPriv.set( dest, pdataOld ); - events = pdataOld.events; - - if ( events ) { - delete pdataCur.handle; - pdataCur.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( dataUser.hasData( src ) ) { - udataOld = dataUser.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - dataUser.set( dest, udataCur ); - } -} - -// Fix IE bugs, see support tests -function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -function domManip( collection, args, callback, ignored ) { - - // Flatten any nested arrays - args = concat.apply( [], args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = collection.length, - iNoClone = l - 1, - value = args[ 0 ], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return collection.each( function( index ) { - var self = collection.eq( index ); - if ( isFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - domManip( self, args, callback, ignored ); - } ); - } - - if ( l ) { - fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - // Require either new content or an interest in ignored elements to invoke the callback - if ( first || ignored ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item - // instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( collection[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !dataPriv.access( node, "globalEval" ) && - jQuery.contains( doc, node ) ) { - - if ( node.src ) { - - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - DOMEval( node.textContent.replace( rcleanScript, "" ), doc ); - } - } - } - } - } - } - - return collection; -} - -function remove( elem, selector, keepData ) { - var node, - nodes = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = nodes[ i ] ) != null; i++ ) { - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; -} - -jQuery.extend( { - htmlPrefilter: function( html ) { - return html.replace( rxhtmlTag, "<$1>" ); - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = jQuery.contains( elem.ownerDocument, elem ); - - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - cleanData: function( elems ) { - var data, elem, type, - special = jQuery.event.special, - i = 0; - - for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( acceptData( elem ) ) { - if ( ( data = elem[ dataPriv.expando ] ) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataPriv.expando ] = undefined; - } - if ( elem[ dataUser.expando ] ) { - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataUser.expando ] = undefined; - } - } - } - } -} ); - -jQuery.fn.extend( { - detach: function( selector ) { - return remove( this, selector, true ); - }, - - remove: function( selector ) { - return remove( this, selector ); - }, - - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each( function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - } ); - }, null, value, arguments.length ); - }, - - append: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - } ); - }, - - prepend: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - } ); - }, - - before: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - } ); - }, - - after: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - } ); - }, - - empty: function() { - var elem, - i = 0; - - for ( ; ( elem = this[ i ] ) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - } ); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch ( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var ignored = []; - - // Make the changes, replacing each non-ignored context element with the new content - return domManip( this, arguments, function( elem ) { - var parent = this.parentNode; - - if ( jQuery.inArray( this, ignored ) < 0 ) { - jQuery.cleanData( getAll( this ) ); - if ( parent ) { - parent.replaceChild( elem, this ); - } - } - - // Force callback invocation - }, ignored ); - } -} ); - -jQuery.each( { - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: Android <=4.0 only, PhantomJS 1 only - // .get() because push.apply(_, arraylike) throws on ancient WebKit - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -} ); -var rmargin = ( /^margin/ ); - -var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); - -var getStyles = function( elem ) { - - // Support: IE <=11 only, Firefox <=30 (#15098, #14150) - // IE throws on elements created in popups - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" - var view = elem.ownerDocument.defaultView; - - if ( !view || !view.opener ) { - view = window; - } - - return view.getComputedStyle( elem ); - }; - - - -( function() { - - // Executing both pixelPosition & boxSizingReliable tests require only one layout - // so they're executed at the same time to save the second computation. - function computeStyleTests() { - - // This is a singleton, we need to execute it only once - if ( !div ) { - return; - } - - div.style.cssText = - "box-sizing:border-box;" + - "position:relative;display:block;" + - "margin:auto;border:1px;padding:1px;" + - "top:1%;width:50%"; - div.innerHTML = ""; - documentElement.appendChild( container ); - - var divStyle = window.getComputedStyle( div ); - pixelPositionVal = divStyle.top !== "1%"; - - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 - reliableMarginLeftVal = divStyle.marginLeft === "2px"; - boxSizingReliableVal = divStyle.width === "4px"; - - // Support: Android 4.0 - 4.3 only - // Some styles come back with percentage values, even though they shouldn't - div.style.marginRight = "50%"; - pixelMarginRightVal = divStyle.marginRight === "4px"; - - documentElement.removeChild( container ); - - // Nullify the div so it wouldn't be stored in the memory and - // it will also be a sign that checks already performed - div = null; - } - - var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal, - container = document.createElement( "div" ), - div = document.createElement( "div" ); - - // Finish early in limited (non-browser) environments - if ( !div.style ) { - return; - } - - // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (#8908) - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + - "padding:0;margin-top:1px;position:absolute"; - container.appendChild( div ); - - jQuery.extend( support, { - pixelPosition: function() { - computeStyleTests(); - return pixelPositionVal; - }, - boxSizingReliable: function() { - computeStyleTests(); - return boxSizingReliableVal; - }, - pixelMarginRight: function() { - computeStyleTests(); - return pixelMarginRightVal; - }, - reliableMarginLeft: function() { - computeStyleTests(); - return reliableMarginLeftVal; - } - } ); -} )(); - - -function curCSS( elem, name, computed ) { - var width, minWidth, maxWidth, ret, - - // Support: Firefox 51+ - // Retrieving style before computed somehow - // fixes an issue with getting wrong values - // on detached elements - style = elem.style; - - computed = computed || getStyles( elem ); - - // getPropertyValue is needed for: - // .css('filter') (IE 9 only, #12537) - // .css('--customProperty) (#3144) - if ( computed ) { - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Android Browser returns percentage for some values, - // but width seems to be reliably pixels. - // This is against the CSSOM draft spec: - // https://drafts.csswg.org/cssom/#resolved-values - if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret !== undefined ? - - // Support: IE <=9 - 11 only - // IE returns zIndex value as an integer. - ret + "" : - ret; -} - - -function addGetHookIf( conditionFn, hookFn ) { - - // Define the hook, we'll check on the first run if it's really needed. - return { - get: function() { - if ( conditionFn() ) { - - // Hook not needed (or it's not possible to use it due - // to missing dependency), remove it. - delete this.get; - return; - } - - // Hook needed; redefine it so that the support test is not executed again. - return ( this.get = hookFn ).apply( this, arguments ); - } - }; -} - - -var - - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rcustomProp = /^--/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }, - - cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style; - -// Return a css property mapped to a potentially vendor prefixed property -function vendorPropName( name ) { - - // Shortcut for names that are not vendor prefixed - if ( name in emptyStyle ) { - return name; - } - - // Check for vendor prefixed names - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in emptyStyle ) { - return name; - } - } -} - -// Return a property mapped along what jQuery.cssProps suggests or to -// a vendor prefixed property. -function finalPropName( name ) { - var ret = jQuery.cssProps[ name ]; - if ( !ret ) { - ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name; - } - return ret; -} - -function setPositiveNumber( elem, value, subtract ) { - - // Any relative (+/-) values have already been - // normalized at this point - var matches = rcssNum.exec( value ); - return matches ? - - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : - value; -} - -function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { - var i, - val = 0; - - // If we already have the right measurement, avoid augmentation - if ( extra === ( isBorderBox ? "border" : "content" ) ) { - i = 4; - - // Otherwise initialize for horizontal or vertical properties - } else { - i = name === "width" ? 1 : 0; - } - - for ( ; i < 4; i += 2 ) { - - // Both box models exclude margin, so add it if we want it - if ( extra === "margin" ) { - val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); - } - - if ( isBorderBox ) { - - // border-box includes padding, so remove it if we want content - if ( extra === "content" ) { - val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // At this point, extra isn't border nor margin, so remove border - if ( extra !== "margin" ) { - val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } else { - - // At this point, extra isn't content, so add padding - val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // At this point, extra isn't content nor padding, so add border - if ( extra !== "padding" ) { - val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - return val; -} - -function getWidthOrHeight( elem, name, extra ) { - - // Start with computed style - var valueIsBorderBox, - styles = getStyles( elem ), - val = curCSS( elem, name, styles ), - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // Computed unit is not pixels. Stop here and return. - if ( rnumnonpx.test( val ) ) { - return val; - } - - // Check for style in case a browser which returns unreliable values - // for getComputedStyle silently falls back to the reliable elem.style - valueIsBorderBox = isBorderBox && - ( support.boxSizingReliable() || val === elem.style[ name ] ); - - // Fall back to offsetWidth/Height when value is "auto" - // This happens for inline elements with no explicit setting (gh-3571) - if ( val === "auto" ) { - val = elem[ "offset" + name[ 0 ].toUpperCase() + name.slice( 1 ) ]; - } - - // Normalize "", auto, and prepare for extra - val = parseFloat( val ) || 0; - - // Use the active box-sizing model to add/subtract irrelevant styles - return ( val + - augmentWidthOrHeight( - elem, - name, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles - ) - ) + "px"; -} - -jQuery.extend( { - - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "animationIterationCount": true, - "columnCount": true, - "fillOpacity": true, - "flexGrow": true, - "flexShrink": true, - "fontWeight": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: { - "float": "cssFloat" - }, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = jQuery.camelCase( name ), - isCustomProp = rcustomProp.test( name ), - style = elem.style; - - // Make sure that we're working with the right name. We don't - // want to query the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Gets hook for the prefixed version, then unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // Convert "+=" or "-=" to relative numbers (#7345) - if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { - value = adjustCSS( elem, name, ret ); - - // Fixes bug #9237 - type = "number"; - } - - // Make sure that null and NaN values aren't set (#7116) - if ( value == null || value !== value ) { - return; - } - - // If a number was passed in, add the unit (except for certain CSS properties) - if ( type === "number" ) { - value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); - } - - // background-* props affect original clone's values - if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !( "set" in hooks ) || - ( value = hooks.set( elem, value, extra ) ) !== undefined ) { - - if ( isCustomProp ) { - style.setProperty( name, value ); - } else { - style[ name ] = value; - } - } - - } else { - - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && - ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { - - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = jQuery.camelCase( name ), - isCustomProp = rcustomProp.test( name ); - - // Make sure that we're working with the right name. We don't - // want to modify the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Try prefixed name followed by the unprefixed name - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - // Convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Make numeric if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || isFinite( num ) ? num || 0 : val; - } - - return val; - } -} ); - -jQuery.each( [ "height", "width" ], function( i, name ) { - jQuery.cssHooks[ name ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - - // Certain elements can have dimension info if we invisibly show them - // but it must have a current display style that would benefit - return rdisplayswap.test( jQuery.css( elem, "display" ) ) && - - // Support: Safari 8+ - // Table columns in Safari have non-zero offsetWidth & zero - // getBoundingClientRect().width unless display is changed. - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, name, extra ); - } ) : - getWidthOrHeight( elem, name, extra ); - } - }, - - set: function( elem, value, extra ) { - var matches, - styles = extra && getStyles( elem ), - subtract = extra && augmentWidthOrHeight( - elem, - name, - extra, - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - styles - ); - - // Convert to pixels if value adjustment is needed - if ( subtract && ( matches = rcssNum.exec( value ) ) && - ( matches[ 3 ] || "px" ) !== "px" ) { - - elem.style[ name ] = value; - value = jQuery.css( elem, name ); - } - - return setPositiveNumber( elem, value, subtract ); - } - }; -} ); - -jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, - function( elem, computed ) { - if ( computed ) { - return ( parseFloat( curCSS( elem, "marginLeft" ) ) || - elem.getBoundingClientRect().left - - swap( elem, { marginLeft: 0 }, function() { - return elem.getBoundingClientRect().left; - } ) - ) + "px"; - } - } -); - -// These hooks are used by animate to expand properties -jQuery.each( { - margin: "", - padding: "", - border: "Width" -}, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i = 0, - expanded = {}, - - // Assumes a single number if not a string - parts = typeof value === "string" ? value.split( " " ) : [ value ]; - - for ( ; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( !rmargin.test( prefix ) ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } -} ); - -jQuery.fn.extend( { - css: function( name, value ) { - return access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( Array.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - } -} ); - - -function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); -} -jQuery.Tween = Tween; - -Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || jQuery.easing._default; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } -}; - -Tween.prototype.init.prototype = Tween.prototype; - -Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - // Use a property on the element directly when it is not a DOM element, - // or when there is no matching style property that exists. - if ( tween.elem.nodeType !== 1 || - tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { - return tween.elem[ tween.prop ]; - } - - // Passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails. - // Simple values such as "10px" are parsed to Float; - // complex values such as "rotate(1rad)" are returned as-is. - result = jQuery.css( tween.elem, tween.prop, "" ); - - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - - // Use step hook for back compat. - // Use cssHook if its there. - // Use .style if available and use plain properties where available. - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && - ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || - jQuery.cssHooks[ tween.prop ] ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } -}; - -// Support: IE <=9 only -// Panic based approach to setting things on disconnected nodes -Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } -}; - -jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p * Math.PI ) / 2; - }, - _default: "swing" -}; - -jQuery.fx = Tween.prototype.init; - -// Back compat <1.8 extension point -jQuery.fx.step = {}; - - - - -var - fxNow, inProgress, - rfxtypes = /^(?:toggle|show|hide)$/, - rrun = /queueHooks$/; - -function schedule() { - if ( inProgress ) { - if ( document.hidden === false && window.requestAnimationFrame ) { - window.requestAnimationFrame( schedule ); - } else { - window.setTimeout( schedule, jQuery.fx.interval ); - } - - jQuery.fx.tick(); - } -} - -// Animations created synchronously will run synchronously -function createFxNow() { - window.setTimeout( function() { - fxNow = undefined; - } ); - return ( fxNow = jQuery.now() ); -} - -// Generate parameters to create a standard animation -function genFx( type, includeWidth ) { - var which, - i = 0, - attrs = { height: type }; - - // If we include width, step value is 1 to do all cssExpand values, - // otherwise step value is 2 to skip over Left and Right - includeWidth = includeWidth ? 1 : 0; - for ( ; i < 4; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; -} - -function createTween( value, prop, animation ) { - var tween, - collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { - - // We're done with this property - return tween; - } - } -} - -function defaultPrefilter( elem, props, opts ) { - var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, - isBox = "width" in props || "height" in props, - anim = this, - orig = {}, - style = elem.style, - hidden = elem.nodeType && isHiddenWithinTree( elem ), - dataShow = dataPriv.get( elem, "fxshow" ); - - // Queue-skipping animations hijack the fx hooks - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always( function() { - - // Ensure the complete handler is called before this completes - anim.always( function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - } ); - } ); - } - - // Detect show/hide animations - for ( prop in props ) { - value = props[ prop ]; - if ( rfxtypes.test( value ) ) { - delete props[ prop ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - - // Pretend to be hidden if this is a "show" and - // there is still data from a stopped show/hide - if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { - hidden = true; - - // Ignore all other no-op show/hide data - } else { - continue; - } - } - orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - } - } - - // Bail out if this is a no-op like .hide().hide() - propTween = !jQuery.isEmptyObject( props ); - if ( !propTween && jQuery.isEmptyObject( orig ) ) { - return; - } - - // Restrict "overflow" and "display" styles during box animations - if ( isBox && elem.nodeType === 1 ) { - - // Support: IE <=9 - 11, Edge 12 - 13 - // Record all 3 overflow attributes because IE does not infer the shorthand - // from identically-valued overflowX and overflowY - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Identify a display type, preferring old show/hide data over the CSS cascade - restoreDisplay = dataShow && dataShow.display; - if ( restoreDisplay == null ) { - restoreDisplay = dataPriv.get( elem, "display" ); - } - display = jQuery.css( elem, "display" ); - if ( display === "none" ) { - if ( restoreDisplay ) { - display = restoreDisplay; - } else { - - // Get nonempty value(s) by temporarily forcing visibility - showHide( [ elem ], true ); - restoreDisplay = elem.style.display || restoreDisplay; - display = jQuery.css( elem, "display" ); - showHide( [ elem ] ); - } - } - - // Animate inline elements as inline-block - if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { - if ( jQuery.css( elem, "float" ) === "none" ) { - - // Restore the original display value at the end of pure show/hide animations - if ( !propTween ) { - anim.done( function() { - style.display = restoreDisplay; - } ); - if ( restoreDisplay == null ) { - display = style.display; - restoreDisplay = display === "none" ? "" : display; - } - } - style.display = "inline-block"; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - anim.always( function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - } ); - } - - // Implement show/hide animations - propTween = false; - for ( prop in orig ) { - - // General show/hide setup for this element animation - if ( !propTween ) { - if ( dataShow ) { - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - } else { - dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); - } - - // Store hidden/visible for toggle so `.stop().toggle()` "reverses" - if ( toggle ) { - dataShow.hidden = !hidden; - } - - // Show elements before animating them - if ( hidden ) { - showHide( [ elem ], true ); - } - - /* eslint-disable no-loop-func */ - - anim.done( function() { - - /* eslint-enable no-loop-func */ - - // The final step of a "hide" animation is actually hiding the element - if ( !hidden ) { - showHide( [ elem ] ); - } - dataPriv.remove( elem, "fxshow" ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - } ); - } - - // Per-property setup - propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = propTween.start; - if ( hidden ) { - propTween.end = propTween.start; - propTween.start = 0; - } - } - } -} - -function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = jQuery.camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( Array.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // Not quite $.extend, this won't overwrite existing keys. - // Reusing 'index' because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } -} - -function Animation( elem, properties, options ) { - var result, - stopped, - index = 0, - length = Animation.prefilters.length, - deferred = jQuery.Deferred().always( function() { - - // Don't match elem in the :animated selector - delete tick.elem; - } ), - tick = function() { - if ( stopped ) { - return false; - } - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - - // Support: Android 2.3 only - // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ] ); - - // If there's more to do, yield - if ( percent < 1 && length ) { - return remaining; - } - - // If this was an empty animation, synthesize a final progress notification - if ( !length ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - } - - // Resolve the animation and report its conclusion - deferred.resolveWith( elem, [ animation ] ); - return false; - }, - animation = deferred.promise( { - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { - specialEasing: {}, - easing: jQuery.easing._default - }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - - // If we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - if ( stopped ) { - return this; - } - stopped = true; - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // Resolve when we played the last frame; otherwise, reject - if ( gotoEnd ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - } ), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length; index++ ) { - result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - if ( jQuery.isFunction( result.stop ) ) { - jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = - jQuery.proxy( result.stop, result ); - } - return result; - } - } - - jQuery.map( props, createTween, animation ); - - if ( jQuery.isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - // Attach callbacks from options - animation - .progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); - - jQuery.fx.timer( - jQuery.extend( tick, { - elem: elem, - anim: animation, - queue: animation.opts.queue - } ) - ); - - return animation; -} - -jQuery.Animation = jQuery.extend( Animation, { - - tweeners: { - "*": [ function( prop, value ) { - var tween = this.createTween( prop, value ); - adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); - return tween; - } ] - }, - - tweener: function( props, callback ) { - if ( jQuery.isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.match( rnothtmlwhite ); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length; index++ ) { - prop = props[ index ]; - Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; - Animation.tweeners[ prop ].unshift( callback ); - } - }, - - prefilters: [ defaultPrefilter ], - - prefilter: function( callback, prepend ) { - if ( prepend ) { - Animation.prefilters.unshift( callback ); - } else { - Animation.prefilters.push( callback ); - } - } -} ); - -jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - jQuery.isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing - }; - - // Go to the end state if fx are off - if ( jQuery.fx.off ) { - opt.duration = 0; - - } else { - if ( typeof opt.duration !== "number" ) { - if ( opt.duration in jQuery.fx.speeds ) { - opt.duration = jQuery.fx.speeds[ opt.duration ]; - - } else { - opt.duration = jQuery.fx.speeds._default; - } - } - } - - // Normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( jQuery.isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; -}; - -jQuery.fn.extend( { - fadeTo: function( speed, to, easing, callback ) { - - // Show any hidden elements after setting opacity to 0 - return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() - - // Animate to the value specified - .end().animate( { opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations, or finishing resolves immediately - if ( empty || dataPriv.get( this, "finish" ) ) { - anim.stop( true ); - } - }; - doAnimation.finish = doAnimation; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue && type !== false ) { - this.queue( type || "fx", [] ); - } - - return this.each( function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = dataPriv.get( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && - ( type == null || timers[ index ].queue === type ) ) { - - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // Start the next in the queue if the last step wasn't forced. - // Timers currently will call their complete callbacks, which - // will dequeue but only if they were gotoEnd. - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - } ); - }, - finish: function( type ) { - if ( type !== false ) { - type = type || "fx"; - } - return this.each( function() { - var index, - data = dataPriv.get( this ), - queue = data[ type + "queue" ], - hooks = data[ type + "queueHooks" ], - timers = jQuery.timers, - length = queue ? queue.length : 0; - - // Enable finishing flag on private data - data.finish = true; - - // Empty the queue first - jQuery.queue( this, type, [] ); - - if ( hooks && hooks.stop ) { - hooks.stop.call( this, true ); - } - - // Look for any active animations, and finish them - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && timers[ index ].queue === type ) { - timers[ index ].anim.stop( true ); - timers.splice( index, 1 ); - } - } - - // Look for any animations in the old queue and finish them - for ( index = 0; index < length; index++ ) { - if ( queue[ index ] && queue[ index ].finish ) { - queue[ index ].finish.call( this ); - } - } - - // Turn off finishing flag - delete data.finish; - } ); - } -} ); - -jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; -} ); - -// Generate shortcuts for custom animations -jQuery.each( { - slideDown: genFx( "show" ), - slideUp: genFx( "hide" ), - slideToggle: genFx( "toggle" ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } -}, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; -} ); - -jQuery.timers = []; -jQuery.fx.tick = function() { - var timer, - i = 0, - timers = jQuery.timers; - - fxNow = jQuery.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - - // Run the timer and safely remove it when done (allowing for external removal) - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; -}; - -jQuery.fx.timer = function( timer ) { - jQuery.timers.push( timer ); - jQuery.fx.start(); -}; - -jQuery.fx.interval = 13; -jQuery.fx.start = function() { - if ( inProgress ) { - return; - } - - inProgress = true; - schedule(); -}; - -jQuery.fx.stop = function() { - inProgress = null; -}; - -jQuery.fx.speeds = { - slow: 600, - fast: 200, - - // Default speed - _default: 400 -}; - - -// Based off of the plugin by Clint Helfers, with permission. -// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ -jQuery.fn.delay = function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = window.setTimeout( next, time ); - hooks.stop = function() { - window.clearTimeout( timeout ); - }; - } ); -}; - - -( function() { - var input = document.createElement( "input" ), - select = document.createElement( "select" ), - opt = select.appendChild( document.createElement( "option" ) ); - - input.type = "checkbox"; - - // Support: Android <=4.3 only - // Default value for a checkbox should be "on" - support.checkOn = input.value !== ""; - - // Support: IE <=11 only - // Must access selectedIndex to make default options select - support.optSelected = opt.selected; - - // Support: IE <=11 only - // An input loses its value after becoming a radio - input = document.createElement( "input" ); - input.value = "t"; - input.type = "radio"; - support.radioValue = input.value === "t"; -} )(); - - -var boolHook, - attrHandle = jQuery.expr.attrHandle; - -jQuery.fn.extend( { - attr: function( name, value ) { - return access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each( function() { - jQuery.removeAttr( this, name ); - } ); - } -} ); - -jQuery.extend( { - attr: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set attributes on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - // Attribute hooks are determined by the lowercase version - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - hooks = jQuery.attrHooks[ name.toLowerCase() ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); - } - - if ( value !== undefined ) { - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - } - - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - elem.setAttribute( name, value + "" ); - return value; - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? undefined : ret; - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !support.radioValue && value === "radio" && - nodeName( elem, "input" ) ) { - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - removeAttr: function( elem, value ) { - var name, - i = 0, - - // Attribute names can contain non-HTML whitespace characters - // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 - attrNames = value && value.match( rnothtmlwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( ( name = attrNames[ i++ ] ) ) { - elem.removeAttribute( name ); - } - } - } -} ); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - elem.setAttribute( name, name ); - } - return name; - } -}; - -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { - var getter = attrHandle[ name ] || jQuery.find.attr; - - attrHandle[ name ] = function( elem, name, isXML ) { - var ret, handle, - lowercaseName = name.toLowerCase(); - - if ( !isXML ) { - - // Avoid an infinite loop by temporarily removing this function from the getter - handle = attrHandle[ lowercaseName ]; - attrHandle[ lowercaseName ] = ret; - ret = getter( elem, name, isXML ) != null ? - lowercaseName : - null; - attrHandle[ lowercaseName ] = handle; - } - return ret; - }; -} ); - - - - -var rfocusable = /^(?:input|select|textarea|button)$/i, - rclickable = /^(?:a|area)$/i; - -jQuery.fn.extend( { - prop: function( name, value ) { - return access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - return this.each( function() { - delete this[ jQuery.propFix[ name ] || name ]; - } ); - } -} ); - -jQuery.extend( { - prop: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set properties on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - return ( elem[ name ] = value ); - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - return elem[ name ]; - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - - // Support: IE <=9 - 11 only - // elem.tabIndex doesn't always return the - // correct value when it hasn't been explicitly set - // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - if ( tabindex ) { - return parseInt( tabindex, 10 ); - } - - if ( - rfocusable.test( elem.nodeName ) || - rclickable.test( elem.nodeName ) && - elem.href - ) { - return 0; - } - - return -1; - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - } -} ); - -// Support: IE <=11 only -// Accessing the selectedIndex property -// forces the browser to respect setting selected -// on the option -// The getter ensures a default option is selected -// when in an optgroup -// eslint rule "no-unused-expressions" is disabled for this code -// since it considers such accessions noop -if ( !support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent && parent.parentNode ) { - parent.parentNode.selectedIndex; - } - return null; - }, - set: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }; -} - -jQuery.each( [ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -} ); - - - - - // Strip and collapse whitespace according to HTML spec - // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace - function stripAndCollapse( value ) { - var tokens = value.match( rnothtmlwhite ) || []; - return tokens.join( " " ); - } - - -function getClass( elem ) { - return elem.getAttribute && elem.getAttribute( "class" ) || ""; -} - -jQuery.fn.extend( { - addClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( jQuery.isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( typeof value === "string" && value ) { - classes = value.match( rnothtmlwhite ) || []; - - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( jQuery.isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( !arguments.length ) { - return this.attr( "class", "" ); - } - - if ( typeof value === "string" && value ) { - classes = value.match( rnothtmlwhite ) || []; - - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) > -1 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value; - - if ( typeof stateVal === "boolean" && type === "string" ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( jQuery.isFunction( value ) ) { - return this.each( function( i ) { - jQuery( this ).toggleClass( - value.call( this, i, getClass( this ), stateVal ), - stateVal - ); - } ); - } - - return this.each( function() { - var className, i, self, classNames; - - if ( type === "string" ) { - - // Toggle individual class names - i = 0; - self = jQuery( this ); - classNames = value.match( rnothtmlwhite ) || []; - - while ( ( className = classNames[ i++ ] ) ) { - - // Check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( value === undefined || type === "boolean" ) { - className = getClass( this ); - if ( className ) { - - // Store className if set - dataPriv.set( this, "__className__", className ); - } - - // If the element has a class name or if we're passed `false`, - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" - ); - } - } - } ); - }, - - hasClass: function( selector ) { - var className, elem, - i = 0; - - className = " " + selector + " "; - while ( ( elem = this[ i++ ] ) ) { - if ( elem.nodeType === 1 && - ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { - return true; - } - } - - return false; - } -} ); - - - - -var rreturn = /\r/g; - -jQuery.fn.extend( { - val: function( value ) { - var hooks, ret, isFunction, - elem = this[ 0 ]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || - jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && - "get" in hooks && - ( ret = hooks.get( elem, "value" ) ) !== undefined - ) { - return ret; - } - - ret = elem.value; - - // Handle most common string cases - if ( typeof ret === "string" ) { - return ret.replace( rreturn, "" ); - } - - // Handle cases where value is null/undef or number - return ret == null ? "" : ret; - } - - return; - } - - isFunction = jQuery.isFunction( value ); - - return this.each( function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - - } else if ( typeof val === "number" ) { - val += ""; - - } else if ( Array.isArray( val ) ) { - val = jQuery.map( val, function( value ) { - return value == null ? "" : value + ""; - } ); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - } ); - } -} ); - -jQuery.extend( { - valHooks: { - option: { - get: function( elem ) { - - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - - // Support: IE <=10 - 11 only - // option.text throws exceptions (#14686, #14858) - // Strip and collapse whitespace - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace - stripAndCollapse( jQuery.text( elem ) ); - } - }, - select: { - get: function( elem ) { - var value, option, i, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one", - values = one ? null : [], - max = one ? index + 1 : options.length; - - if ( index < 0 ) { - i = max; - - } else { - i = one ? index : 0; - } - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Support: IE <=9 only - // IE8-9 doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - - // Don't return options that are disabled or in a disabled optgroup - !option.disabled && - ( !option.parentNode.disabled || - !nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - - /* eslint-disable no-cond-assign */ - - if ( option.selected = - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 - ) { - optionSet = true; - } - - /* eslint-enable no-cond-assign */ - } - - // Force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - } -} ); - -// Radios and checkboxes getter/setter -jQuery.each( [ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( Array.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); - } - } - }; - if ( !support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - return elem.getAttribute( "value" ) === null ? "on" : elem.value; - }; - } -} ); - - - - -// Return jQuery for attributes-only inclusion - - -var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/; - -jQuery.extend( jQuery.event, { - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "." ) > -1 ) { - - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split( "." ); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf( ":" ) < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join( "." ); - event.rnamespace = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === ( elem.ownerDocument || document ) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && - dataPriv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( ( !special._default || - special._default.apply( eventPath.pop(), data ) === false ) && - acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - // Piggyback on a donor event to simulate a different one - // Used only for `focus(in | out)` events - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - } - ); - - jQuery.event.trigger( e, null, elem ); - } - -} ); - -jQuery.fn.extend( { - - trigger: function( type, data ) { - return this.each( function() { - jQuery.event.trigger( type, data, this ); - } ); - }, - triggerHandler: function( type, data ) { - var elem = this[ 0 ]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -} ); - - -jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup contextmenu" ).split( " " ), - function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - return arguments.length > 0 ? - this.on( name, null, data, fn ) : - this.trigger( name ); - }; -} ); - -jQuery.fn.extend( { - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -} ); - - - - -support.focusin = "onfocusin" in window; - - -// Support: Firefox <=44 -// Firefox doesn't have focus(in | out) events -// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 -// -// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 -// focus(in | out) events fire after focus & blur events, -// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order -// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 -if ( !support.focusin ) { - jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = dataPriv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = dataPriv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - dataPriv.remove( doc, fix ); - - } else { - dataPriv.access( doc, fix, attaches ); - } - } - }; - } ); -} -var location = window.location; - -var nonce = jQuery.now(); - -var rquery = ( /\?/ ); - - - -// Cross-browser xml parsing -jQuery.parseXML = function( data ) { - var xml; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) { - xml = undefined; - } - - if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; -}; - - -var - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, - rsubmittable = /^(?:input|select|textarea|keygen)/i; - -function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( Array.isArray( obj ) ) { - - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - - // Item is non-scalar (array or object), encode its numeric index. - buildParams( - prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", - v, - traditional, - add - ); - } - } ); - - } else if ( !traditional && jQuery.type( obj ) === "object" ) { - - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - - // Serialize scalar item. - add( prefix, obj ); - } -} - -// Serialize an array of form elements or a set of -// key/values into a query string -jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, valueOrFunction ) { - - // If value is a function, invoke it and use its return value - var value = jQuery.isFunction( valueOrFunction ) ? - valueOrFunction() : - valueOrFunction; - - s[ s.length ] = encodeURIComponent( key ) + "=" + - encodeURIComponent( value == null ? "" : value ); - }; - - // If an array was passed in, assume that it is an array of form elements. - if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - } ); - - } else { - - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ); -}; - -jQuery.fn.extend( { - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map( function() { - - // Can add propHook for "elements" to filter or add form elements - var elements = jQuery.prop( this, "elements" ); - return elements ? jQuery.makeArray( elements ) : this; - } ) - .filter( function() { - var type = this.type; - - // Use .is( ":disabled" ) so that fieldset[disabled] works - return this.name && !jQuery( this ).is( ":disabled" ) && - rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && - ( this.checked || !rcheckableType.test( type ) ); - } ) - .map( function( i, elem ) { - var val = jQuery( this ).val(); - - if ( val == null ) { - return null; - } - - if ( Array.isArray( val ) ) { - return jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ); - } - - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ).get(); - } -} ); - - -var - r20 = /%20/g, - rhash = /#.*$/, - rantiCache = /([?&])_=[^&]*/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, - - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = "*/".concat( "*" ), - - // Anchor tag for parsing the document origin - originAnchor = document.createElement( "a" ); - originAnchor.href = location.href; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport -function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, - i = 0, - dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; - - if ( jQuery.isFunction( func ) ) { - - // For each dataType in the dataTypeExpression - while ( ( dataType = dataTypes[ i++ ] ) ) { - - // Prepend if requested - if ( dataType[ 0 ] === "+" ) { - dataType = dataType.slice( 1 ) || "*"; - ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); - - // Otherwise append - } else { - ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); - } - } - } - }; -} - -// Base inspection function for prefilters and transports -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { - - var inspected = {}, - seekingTransport = ( structure === transports ); - - function inspect( dataType ) { - var selected; - inspected[ dataType ] = true; - jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { - var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); - if ( typeof dataTypeOrTransport === "string" && - !seekingTransport && !inspected[ dataTypeOrTransport ] ) { - - options.dataTypes.unshift( dataTypeOrTransport ); - inspect( dataTypeOrTransport ); - return false; - } else if ( seekingTransport ) { - return !( selected = dataTypeOrTransport ); - } - } ); - return selected; - } - - return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); -} - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes #9887 -function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } - - return target; -} - -/* Handles responses to an ajax request: - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ -function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes; - - // Remove auto dataType and get content-type in the process - while ( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } -} - -/* Chain conversions given the request and the original response - * Also sets the responseXXX fields on the jqXHR instance - */ -function ajaxConvert( s, response, jqXHR, isSuccess ) { - var conv2, current, conv, tmp, prev, - converters = {}, - - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(); - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - current = dataTypes.shift(); - - // Convert to each sequential dataType - while ( current ) { - - if ( s.responseFields[ current ] ) { - jqXHR[ s.responseFields[ current ] ] = response; - } - - // Apply the dataFilter if provided - if ( !prev && isSuccess && s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - prev = current; - current = dataTypes.shift(); - - if ( current ) { - - // There's only work to do if current dataType is non-auto - if ( current === "*" ) { - - current = prev; - - // Convert response if prev dataType is non-auto and differs from current - } else if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split( " " ); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.unshift( tmp[ 1 ] ); - } - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s.throws ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { - state: "parsererror", - error: conv ? e : "No conversion from " + prev + " to " + current - }; - } - } - } - } - } - } - - return { state: "success", data: response }; -} - -jQuery.extend( { - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {}, - - ajaxSettings: { - url: location.href, - type: "GET", - isLocal: rlocalProtocol.test( location.protocol ), - global: true, - processData: true, - async: true, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - "*": allTypes, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - - // Data converters - // Keys separate source (or catchall "*") and destination types with a single space - converters: { - - // Convert anything to text - "* text": String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": JSON.parse, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - url: true, - context: true - } - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - return settings ? - - // Building a settings object - ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : - - // Extending ajaxSettings - ajaxExtend( jQuery.ajaxSettings, target ); - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var transport, - - // URL without anti-cache param - cacheURL, - - // Response headers - responseHeadersString, - responseHeaders, - - // timeout handle - timeoutTimer, - - // Url cleanup var - urlAnchor, - - // Request state (becomes false upon send and true upon completion) - completed, - - // To know if global events are to be dispatched - fireGlobals, - - // Loop variable - i, - - // uncached part of the url - uncached, - - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - - // Callbacks context - callbackContext = s.context || s, - - // Context for global events is callbackContext if it is a DOM node or jQuery collection - globalEventContext = s.context && - ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, - - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - - // Status-dependent callbacks - statusCode = s.statusCode || {}, - - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - - // Default abort message - strAbort = "canceled", - - // Fake xhr - jqXHR = { - readyState: 0, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( completed ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; - } - } - match = responseHeaders[ key.toLowerCase() ]; - } - return match == null ? null : match; - }, - - // Raw string - getAllResponseHeaders: function() { - return completed ? responseHeadersString : null; - }, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( completed == null ) { - name = requestHeadersNames[ name.toLowerCase() ] = - requestHeadersNames[ name.toLowerCase() ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( completed == null ) { - s.mimeType = type; - } - return this; - }, - - // Status-dependent callbacks - statusCode: function( map ) { - var code; - if ( map ) { - if ( completed ) { - - // Execute the appropriate callbacks - jqXHR.always( map[ jqXHR.status ] ); - } else { - - // Lazy-add the new callbacks in a way that preserves old ones - for ( code in map ) { - statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; - } - } - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - var finalText = statusText || strAbort; - if ( transport ) { - transport.abort( finalText ); - } - done( 0, finalText ); - return this; - } - }; - - // Attach deferreds - deferred.promise( jqXHR ); - - // Add protocol if not provided (prefilters might expect it) - // Handle falsy url in the settings object (#10093: consistency with old signature) - // We also use the url parameter if available - s.url = ( ( url || s.url || location.href ) + "" ) - .replace( rprotocol, location.protocol + "//" ); - - // Alias method option to type as per ticket #12004 - s.type = options.method || options.type || s.method || s.type; - - // Extract dataTypes list - s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; - - // A cross-domain request is in order when the origin doesn't match the current origin. - if ( s.crossDomain == null ) { - urlAnchor = document.createElement( "a" ); - - // Support: IE <=8 - 11, Edge 12 - 13 - // IE throws exception on accessing the href property if url is malformed, - // e.g. http://example.com:80x/ - try { - urlAnchor.href = s.url; - - // Support: IE <=8 - 11 only - // Anchor's host property isn't correctly set when s.url is relative - urlAnchor.href = urlAnchor.href; - s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== - urlAnchor.protocol + "//" + urlAnchor.host; - } catch ( e ) { - - // If there is an error parsing the URL, assume it is crossDomain, - // it can be rejected by the transport if it is invalid - s.crossDomain = true; - } - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( completed ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) - fireGlobals = jQuery.event && s.global; - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Save the URL in case we're toying with the If-Modified-Since - // and/or If-None-Match header later on - // Remove hash to simplify url manipulation - cacheURL = s.url.replace( rhash, "" ); - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // Remember the hash so we can put it back - uncached = s.url.slice( cacheURL.length ); - - // If data is available, append data to url - if ( s.data ) { - cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; - - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Add or update anti-cache param if needed - if ( s.cache === false ) { - cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; - } - - // Put hash and anti-cache on the URL that will be requested (gh-1732) - s.url = cacheURL + uncached; - - // Change '%20' to '+' if this is encoded form body content (gh-2658) - } else if ( s.data && s.processData && - ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { - s.data = s.data.replace( r20, "+" ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - if ( jQuery.lastModified[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); - } - if ( jQuery.etag[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? - s.accepts[ s.dataTypes[ 0 ] ] + - ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && - ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { - - // Abort if not done already and return - return jqXHR.abort(); - } - - // Aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - - // If request was aborted inside ajaxSend, stop there - if ( completed ) { - return jqXHR; - } - - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = window.setTimeout( function() { - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - completed = false; - transport.send( requestHeaders, done ); - } catch ( e ) { - - // Rethrow post-completion exceptions - if ( completed ) { - throw e; - } - - // Propagate others as results - done( -1, e ); - } - } - - // Callback for when everything is done - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Ignore repeat invocations - if ( completed ) { - return; - } - - completed = true; - - // Clear timeout if it exists - if ( timeoutTimer ) { - window.clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Determine if successful - isSuccess = status >= 200 && status < 300 || status === 304; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // Convert no matter what (that way responseXXX fields are always set) - response = ajaxConvert( s, response, jqXHR, isSuccess ); - - // If successful, handle type chaining - if ( isSuccess ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - modified = jqXHR.getResponseHeader( "Last-Modified" ); - if ( modified ) { - jQuery.lastModified[ cacheURL ] = modified; - } - modified = jqXHR.getResponseHeader( "etag" ); - if ( modified ) { - jQuery.etag[ cacheURL ] = modified; - } - } - - // if no content - if ( status === 204 || s.type === "HEAD" ) { - statusText = "nocontent"; - - // if not modified - } else if ( status === 304 ) { - statusText = "notmodified"; - - // If we have data, let's convert it - } else { - statusText = response.state; - success = response.data; - error = response.error; - isSuccess = !error; - } - } else { - - // Extract error from statusText and normalize for non-aborts - error = statusText; - if ( status || !statusText ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - return jqXHR; - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - } -} ); - -jQuery.each( [ "get", "post" ], function( i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - - // Shift arguments if data argument was omitted - if ( jQuery.isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - // The url can be an options object (which then must have .url) - return jQuery.ajax( jQuery.extend( { - url: url, - type: method, - dataType: type, - data: data, - success: callback - }, jQuery.isPlainObject( url ) && url ) ); - }; -} ); - - -jQuery._evalUrl = function( url ) { - return jQuery.ajax( { - url: url, - - // Make this explicit, since user can override this through ajaxSetup (#11264) - type: "GET", - dataType: "script", - cache: true, - async: false, - global: false, - "throws": true - } ); -}; - - -jQuery.fn.extend( { - wrapAll: function( html ) { - var wrap; - - if ( this[ 0 ] ) { - if ( jQuery.isFunction( html ) ) { - html = html.call( this[ 0 ] ); - } - - // The elements to wrap the target around - wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); - - if ( this[ 0 ].parentNode ) { - wrap.insertBefore( this[ 0 ] ); - } - - wrap.map( function() { - var elem = this; - - while ( elem.firstElementChild ) { - elem = elem.firstElementChild; - } - - return elem; - } ).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each( function( i ) { - jQuery( this ).wrapInner( html.call( this, i ) ); - } ); - } - - return this.each( function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - } ); - }, - - wrap: function( html ) { - var isFunction = jQuery.isFunction( html ); - - return this.each( function( i ) { - jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); - } ); - }, - - unwrap: function( selector ) { - this.parent( selector ).not( "body" ).each( function() { - jQuery( this ).replaceWith( this.childNodes ); - } ); - return this; - } -} ); - - -jQuery.expr.pseudos.hidden = function( elem ) { - return !jQuery.expr.pseudos.visible( elem ); -}; -jQuery.expr.pseudos.visible = function( elem ) { - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); -}; - - - - -jQuery.ajaxSettings.xhr = function() { - try { - return new window.XMLHttpRequest(); - } catch ( e ) {} -}; - -var xhrSuccessStatus = { - - // File protocol always yields status code 0, assume 200 - 0: 200, - - // Support: IE <=9 only - // #1450: sometimes IE returns 1223 when it should be 204 - 1223: 204 - }, - xhrSupported = jQuery.ajaxSettings.xhr(); - -support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); -support.ajax = xhrSupported = !!xhrSupported; - -jQuery.ajaxTransport( function( options ) { - var callback, errorCallback; - - // Cross domain only allowed if supported through XMLHttpRequest - if ( support.cors || xhrSupported && !options.crossDomain ) { - return { - send: function( headers, complete ) { - var i, - xhr = options.xhr(); - - xhr.open( - options.type, - options.url, - options.async, - options.username, - options.password - ); - - // Apply custom fields if provided - if ( options.xhrFields ) { - for ( i in options.xhrFields ) { - xhr[ i ] = options.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( options.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( options.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Set headers - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - - // Callback - callback = function( type ) { - return function() { - if ( callback ) { - callback = errorCallback = xhr.onload = - xhr.onerror = xhr.onabort = xhr.onreadystatechange = null; - - if ( type === "abort" ) { - xhr.abort(); - } else if ( type === "error" ) { - - // Support: IE <=9 only - // On a manual native abort, IE9 throws - // errors on any property access that is not readyState - if ( typeof xhr.status !== "number" ) { - complete( 0, "error" ); - } else { - complete( - - // File: protocol always yields status 0; see #8605, #14207 - xhr.status, - xhr.statusText - ); - } - } else { - complete( - xhrSuccessStatus[ xhr.status ] || xhr.status, - xhr.statusText, - - // Support: IE <=9 only - // IE9 has no XHR2 but throws on binary (trac-11426) - // For XHR2 non-text, let the caller handle it (gh-2498) - ( xhr.responseType || "text" ) !== "text" || - typeof xhr.responseText !== "string" ? - { binary: xhr.response } : - { text: xhr.responseText }, - xhr.getAllResponseHeaders() - ); - } - } - }; - }; - - // Listen to events - xhr.onload = callback(); - errorCallback = xhr.onerror = callback( "error" ); - - // Support: IE 9 only - // Use onreadystatechange to replace onabort - // to handle uncaught aborts - if ( xhr.onabort !== undefined ) { - xhr.onabort = errorCallback; - } else { - xhr.onreadystatechange = function() { - - // Check readyState before timeout as it changes - if ( xhr.readyState === 4 ) { - - // Allow onerror to be called first, - // but that will not handle a native abort - // Also, save errorCallback to a variable - // as xhr.onerror cannot be accessed - window.setTimeout( function() { - if ( callback ) { - errorCallback(); - } - } ); - } - }; - } - - // Create the abort callback - callback = callback( "abort" ); - - try { - - // Do send the request (this may raise an exception) - xhr.send( options.hasContent && options.data || null ); - } catch ( e ) { - - // #14683: Only rethrow if this hasn't been notified as an error yet - if ( callback ) { - throw e; - } - } - }, - - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } -} ); - - - - -// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) -jQuery.ajaxPrefilter( function( s ) { - if ( s.crossDomain ) { - s.contents.script = false; - } -} ); - -// Install script dataType -jQuery.ajaxSetup( { - accepts: { - script: "text/javascript, application/javascript, " + - "application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } -} ); - -// Handle cache's special case and crossDomain -jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - } -} ); - -// Bind script tag hack transport -jQuery.ajaxTransport( "script", function( s ) { - - // This transport only deals with cross domain requests - if ( s.crossDomain ) { - var script, callback; - return { - send: function( _, complete ) { - script = jQuery( " - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- -
    - -
  • Docs »
  • - -
  • Index
  • - - -
  • - - - -
  • - -
- - -
-
-
-
- - -

Index

- -
- A - | B - | C - | D - | E - | F - | G - | H - | I - | L - | M - | N - | O - | P - | R - | S - | T - | Z - -
-

A

- - - -
- -

B

- - - -
- -

C

- - - -
- -

D

- - - -
- -

E

- - - -
- -

F

- - - -
- -

G

- - - -
- -

H

- - - -
- -

I

- - - -
- -

L

- - -
- -

M

- - - -
- -

N

- - -
- -

O

- - -
- -

P

- - - -
- -

R

- - - -
- -

S

- - - -
- -

T

- - - -
- -

Z

- - - -
- - - -
- -
-
- - -
- -
-

- © Copyright 2020, Robbie van Leeuwen - -

-
- Built with Sphinx using a theme provided by Read the Docs. - -
- -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/index.html b/docs/build/html/index.html deleted file mode 100644 index e5a7b70e..00000000 --- a/docs/build/html/index.html +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - - - - - - Documentation — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- - - - -
-
-
-
- - sectionproperties -
-

Documentation

-

sectionproperties is a python package for the analysis of arbitrary cross-sections using the -finite element method written by Robbie van Leeuwen. sectionproperties can be used to determine -section properties to be used in structural design and visualise cross-sectional stresses resulting -from combinations of applied forces and bending moments.

-

A list of the current features of the package and implementation goals for future releases -can be found in the README file on github.

- -

Here’s a quick example that harnesses some of the power of sectionproperties and shows its simplicity:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-# create geometry of the cross-section
-geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
-
-# generate a finite element mesh
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-
-# create a CrossSection object for analysis
-section = CrossSection(geometry, mesh)
-
-# calculate various cross-section properties
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-
-# print some of the calculated section properties
-print(section.get_area())  # cross-section area
->>>3231.80
-print(section.get_ic())  # second moments of area about the centroidal axis
->>>(23544664.29, 3063383.07, 0.00)
-print(section.get_j())  # torsion constant
->>>62907.79
-print(section.get_As())  # shear areas in the x & y directions
->>>(1842.17, 1120.18)
-
-
-
-

Support

-

Contact me on my email robbie.vanleeuwen@gmail.com or raise an issue on the github issue -tracker using one of the issue templates. -If you have a request for a feature to be added to the sectionproperties package, -please don’t hesitate to get in touch

-
-
-

License

-

The project is licensed under the MIT license.

-
-
- - -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv deleted file mode 100644 index 1c4cd5dc..00000000 Binary files a/docs/build/html/objects.inv and /dev/null differ diff --git a/docs/build/html/rst/analysis.html b/docs/build/html/rst/analysis.html deleted file mode 100644 index da2ab898..00000000 --- a/docs/build/html/rst/analysis.html +++ /dev/null @@ -1,632 +0,0 @@ - - - - - - - - - - - Running an Analysis — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- - - - -
-
-
-
- -
-

Running an Analysis

-

The first step in running a cross-section analysis is the creation of a -CrossSection object. This class -stores the structural geometry and finite element mesh and provides methods to -perform various types of cross-section analyses.

-
-
-class sectionproperties.analysis.cross_section.CrossSection(geometry, mesh, materials=None, time_info=False)[source]
-

Bases: object

-

Class for structural cross-sections.

-

Stores the finite element geometry, mesh and material information and provides methods to -compute the cross-section properties. The element type used in this program is the six-noded -quadratic triangular element.

-

The constructor extracts information from the provided mesh object and creates and stores the -corresponding Tri6 finite element objects.

-
-
Parameters
-
    -
  • geometry (Geometry) – Cross-section geometry object used to generate the mesh

  • -
  • mesh (meshpy.triangle.MeshInfo) – Mesh object returned by meshpy

  • -
  • materials (list[Material]) – A list of material properties corresponding to various regions in the -geometry and mesh. Note that if materials are specified, the number of material objects -ust equal the number of regions in the geometry. If no materials are specified, only a -purely geometric analysis can take place, and all regions will be assigned a default -material with an elastic modulus and yield strength equal to 1, and a Poisson’s ratio -equal to 0.

  • -
  • time_info (bool) – If set to True, a detailed description of the computation and the time -cost is printed to the terminal.

  • -
-
-
-

The following example creates a CrossSection -object of a 100D x 50W rectangle using a mesh size of 5:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.RectangularSection(d=100, b=50)
-mesh = geometry.create_mesh(mesh_sizes=[5])
-section = CrossSection(geometry, mesh)
-
-
-

The following example creates a 100D x 50W rectangle, with the top half of the section -comprised of timber and the bottom half steel. The timber section is meshed with a maximum area -of 10 and the steel section mesh with a maximum area of 5:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.pre.pre import Material
-from sectionproperties.analysis.cross_section import CrossSection
-
-geom_steel = sections.RectangularSection(d=50, b=50)
-geom_timber = sections.RectangularSection(d=50, b=50, shift=[0, 50])
-geometry = sections.MergedSection([geom_steel, geom_timber])
-geometry.clean_geometry()
-
-mesh = geometry.create_mesh(mesh_sizes=[5, 10])
-
-steel = Material(name='Steel', elastic_modulus=200e3, poissons_ratio=0.3,
-    yield_strength=250, color='grey'
-)
-timber = Material(name='Timber', elastic_modulus=8e3, poissons_ratio=0.35,
-    yield_strength=20, color='burlywood'
-)
-
-section = CrossSection(geometry, mesh, [steel, timber])
-section.plot_mesh(materials=True, alpha=0.5)
-
-
-
-
Variables
-
    -
  • elements (list[Tri6]) – List of finite element objects describing the cross-section mesh

  • -
  • num_nodes (int) – Number of nodes in the finite element mesh

  • -
  • geometry (Geometry) – Cross-section geometry object used to generate the mesh

  • -
  • mesh (meshpy.triangle.MeshInfo) – Mesh object returned by meshpy

  • -
  • mesh_nodes (numpy.ndarray) – Array of node coordinates from the mesh

  • -
  • mesh_elements (numpy.ndarray) – Array of connectivities from the mesh

  • -
  • mesh_attributes (numpy.ndarray) – Array of attributes from the mesh

  • -
  • materials – List of materials

  • -
  • material_groups – List of objects containing the elements in each defined material

  • -
  • section_props (SectionProperties) – Class to store calculated section properties

  • -
-
-
Raises
-

AssertionError – If the number of materials does not equal the number of regions

-
-
-
- -
-

Checking the Mesh Quality

-

Before carrying out a cross-section analysis it is a good idea to check the quality -of the finite element mesh. Some useful methods are provided to display mesh statistics -and to plot the finite element mesh:

-
-
-CrossSection.display_mesh_info()[source]
-

Prints mesh statistics (number of nodes, elements and regions) to the command window.

-

The following example displays the mesh statistics for a Tee section merged from two -rectangles:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-rec1 = sections.RectangularSection(d=100, b=25, shift=[-12.5, 0])
-rec2 = sections.RectangularSection(d=25, b=100, shift=[-50, 100])
-geometry = sections.MergedSection([rec1, rec2])
-mesh = geometry.create_mesh(mesh_sizes=[5, 2.5])
-section = CrossSection(geometry, mesh)
-section.display_mesh_info()
-
->>>Mesh Statistics:
->>>--4920 nodes
->>>--2365 elements
->>>--2 regions
-
-
-
- -
-
-CrossSection.plot_mesh(ax=None, pause=True, alpha=1, materials=False, mask=None)[source]
-

Plots the finite element mesh. If no axes object is supplied a new figure and axis is -created.

-
-
Parameters
-
    -
  • ax (matplotlib.axes.Axes) – Axes object on which the mesh is plotted

  • -
  • pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

  • -
  • alpha (float) – Transparency of the mesh outlines: \(0 \leq \alpha \leq 1\)

  • -
  • materials (bool) – If set to true and material properties have been provided to the -CrossSection object, shades the -elements with the specified material colours

  • -
  • mask (list[bool]) – Mask array, of length num_nodes, to mask out triangles

  • -
-
-
-

The following example plots the mesh generated for the second example -listed under the CrossSection object -definition:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.pre.pre import Material
-from sectionproperties.analysis.cross_section import CrossSection
-
-geom_steel = sections.RectangularSection(d=50, b=50)
-geom_timber = sections.RectangularSection(d=50, b=50, shift=[50, 0])
-geometry = sections.MergedSection([geom_steel, geom_timber])
-geometry.clean_geometry()
-
-mesh = geometry.create_mesh(mesh_sizes=[5, 10])
-
-steel = Material(
-    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=250,
-    color='grey'
-)
-timber = Material(
-    name='Timber', elastic_modulus=8e3, poissons_ratio=0.35, yield_strength=20,
-    color='burlywood'
-)
-
-section = CrossSection(geometry, mesh, [steel, timber])
-section.plot_mesh(materials=True, alpha=0.5)
-
-
-
-../_images/composite_mesh.png -

Finite element mesh generated by the above example.

-
-
- -
-
-

Geometric Analysis

-

A geometric analysis calculates the area properties of the cross-section.

-
-
-CrossSection.calculate_geometric_properties(time_info=False)[source]
-

Calculates the geometric properties of the cross-section and stores them in the -SectionProperties object contained in -the section_props class variable.

-
-
Parameters
-

time_info (bool) – If set to True, a detailed description of the computation and the -time cost is printed to the terminal.

-
-
-

The following geometric section properties are calculated:

-
    -
  • Cross-sectional area

  • -
  • Cross-sectional perimeter

  • -
  • Modulus weighted area (axial rigidity)

  • -
  • First moments of area

  • -
  • Second moments of area about the global axis

  • -
  • Second moments of area about the centroidal axis

  • -
  • Elastic centroid

  • -
  • Centroidal section moduli

  • -
  • Radii of gyration

  • -
  • Principal axis properties

  • -
-

If materials are specified for the cross-section, the moments of area and section moduli -are elastic modulus weighted.

-

The following example demonstrates the use of this method:

-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-
-
-
- -
-
-

Plastic Analysis

-

A plastic analysis calculates the plastic properties of the cross-section.

-
-

Note

-

A geometric analysis must be performed on the CrossSection object before -a plastic analysis is carried out.

-
-
-
-CrossSection.calculate_plastic_properties(time_info=False, verbose=False, debug=False)[source]
-

Calculates the plastic properties of the cross-section and stores the, in the -SectionProperties object contained in -the section_props class variable.

-
-
Parameters
-
    -
  • time_info (bool) – If set to True, a detailed description of the computation and the -time cost is printed to the terminal.

  • -
  • verbose (bool) – If set to True, the number of iterations required for each plastic -axis is printed to the terminal.

  • -
  • debug (bool) – If set to True, the geometry is plotted each time a new mesh is -generated by the plastic centroid algorithm.

  • -
-
-
-

The following warping section properties are calculated:

-
    -
  • Plastic centroid for bending about the centroidal and principal axes

  • -
  • Plastic section moduli for bending about the centroidal and principal axes

  • -
  • Shape factors for bending about the centroidal and principal axes

  • -
-

If materials are specified for the cross-section, the plastic section moduli are displayed -as plastic moments (i.e \(M_p = f_y S\)) and the shape factors are not calculated.

-

Note that the geometric properties must be calculated before the plastic properties are -calculated:

-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-
-
-
-
Raises
-

RuntimeError – If the geometric properties have not been calculated prior to calling -this method

-
-
-
- -
-
-

Warping Analysis

-

A warping analysis calculates the torsion and shear properties of the cross-section.

-
-

Note

-

A geometric analysis must be performed on the CrossSection object before -a warping analysis is carried out.

-
-
-
-CrossSection.calculate_warping_properties(time_info=False, solver_type='direct')[source]
-

Calculates all the warping properties of the cross-section and stores them in the -SectionProperties object contained in -the section_props class variable.

-
-
Parameters
-
    -
  • time_info (bool) – If set to True, a detailed description of the computation and the -time cost is printed to the terminal.

  • -
  • solver_type (string) – Solver used for solving systems of linear equations, either -using the ‘direct’ method or ‘cgs’ iterative method

  • -
-
-
-

The following warping section properties are calculated:

-
    -
  • Torsion constant

  • -
  • Shear centre

  • -
  • Shear area

  • -
  • Warping constant

  • -
  • Monosymmetry constant

  • -
-

If materials are specified, the values calculated for the torsion constant, warping -constant and shear area are elastic modulus weighted.

-

Note that the geometric properties must be calculated first for the calculation of the -warping properties to be correct:

-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-
-
-
-
Raises
-

RuntimeError – If the geometric properties have not been -calculated prior to calling this method

-
-
-
- -
-
-

Stress Analysis

-

A stress analysis calculates the cross-section stresses arising from a set of forces -and moments. Executing this method returns a StressResult -object which stores the cross-section stresses and provides stress plotting functions.

-
-

Note

-

A geometric and warping analysis must be performed on the CrossSection -object before a stress analysis is carried out.

-
-
-
-CrossSection.calculate_stress(N=0, Vx=0, Vy=0, Mxx=0, Myy=0, M11=0, M22=0, Mzz=0, time_info=False)[source]
-

Calculates the cross-section stress resulting from design actions and returns a -StressPost object allowing -post-processing of the stress results.

-
-
Parameters
-
    -
  • N (float) – Axial force

  • -
  • Vx (float) – Shear force acting in the x-direction

  • -
  • Vy (float) – Shear force acting in the y-direction

  • -
  • Mxx (float) – Bending moment about the centroidal xx-axis

  • -
  • Myy (float) – Bending moment about the centroidal yy-axis

  • -
  • M11 (float) – Bending moment about the centroidal 11-axis

  • -
  • M22 (float) – Bending moment about the centroidal 22-axis

  • -
  • Mzz (float) – Torsion moment about the centroidal zz-axis

  • -
  • time_info (bool) – If set to True, a detailed description of the computation and the -time cost is printed to the terminal.

  • -
-
-
Returns
-

Object for post-processing cross-section stresses

-
-
Return type
-

StressPost

-
-
-

Note that a geometric and warping analysis must be performed before a stress analysis is -carried out:

-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(N=1e3, Vy=3e3, Mxx=1e6)
-
-
-
-
Raises
-

RuntimeError – If a geometric and warping analysis have not been performed prior to -calling this method

-
-
-
- -
-
-

Calculating Frame Properties

-

Calculates the cross-section properties required for a 2D or 3D frame analysis.

-
-

Note

-

This method is significantly faster than performing a geometric and -a warping analysis and has no prerequisites.

-
-
-
-CrossSection.calculate_frame_properties(time_info=False, solver_type='direct')[source]
-

Calculates and returns the properties required for a frame analysis. The properties are -also stored in the SectionProperties -object contained in the section_props class variable.

-
-
Parameters
-
    -
  • time_info (bool) – If set to True, a detailed description of the computation and the -time cost is printed to the terminal.

  • -
  • solver_type (string) – Solver used for solving systems of linear equations, either -using the ‘direct’ method or ‘cgs’ iterative method

  • -
-
-
Returns
-

Cross-section properties to be used for a frame analysis (area, ixx, iyy, ixy, j, -phi)

-
-
Return type
-

tuple(float, float, float, float, float, float)

-
-
-

The following section properties are calculated:

-
    -
  • Cross-sectional area (area)

  • -
  • Second moments of area about the centroidal axis (ixx, iyy, ixy)

  • -
  • Torsion constant (j)

  • -
  • Principal axis angle (phi)

  • -
-

If materials are specified for the cross-section, the area, second moments of area and -torsion constant are elastic moulus weighted.

-

The following example demonstrates the use of this method:

-
section = CrossSection(geometry, mesh)
-(area, ixx, iyy, ixy, j, phi) = section.calculate_frame_properties()
-
-
-
- -
-
- - -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/rst/api.html b/docs/build/html/rst/api.html deleted file mode 100644 index 63c382de..00000000 --- a/docs/build/html/rst/api.html +++ /dev/null @@ -1,6431 +0,0 @@ - - - - - - - - - - - Python API Documentation — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- - - - -
-
-
-
- -
-

Python API Documentation

-
-

Pre-Processor Package

-
-

sections Module

-
-

Geometry Class

-
-
-class sectionproperties.pre.sections.Geometry(control_points, shift)[source]
-

Parent class for a cross-section geometry input.

-

Provides an interface for the user to specify the geometry defining a cross-section. A method -is provided for generating a triangular mesh, for translating the cross-section by (x, y) and -for plotting the geometry.

-
-
Variables
-
    -
  • points (list[list[float, float]]) – List of points (x, y) defining the vertices of the cross-section

  • -
  • facets (list[list[int, int]]) – List of point index pairs (p1, p2) defining the edges of the cross-section

  • -
  • holes (list[list[float, float]]) – List of points (x, y) defining the locations of holes within the cross-section. -If there are no holes, provide an empty list [].

  • -
  • control_points (list[list[float, float]]) – A list of points (x, y) that define different regions of the -cross-section. A control point is an arbitrary point within a region enclosed by facets.

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
  • perimeter (list[int]) – List of facet indices defining the perimeter of the cross-section

  • -
-
-
-
-
-add_control_point(control_point)[source]
-

Adds a control point to the geometry and returns the added control -point id.

-
-
Parameters
-

hole (list[float, float]) – Location of the control point

-
-
Returns
-

Control point id

-
-
Return type
-

int

-
-
-
- -
-
-add_facet(facet)[source]
-

Adds a facet to the geometry and returns the added facet id.

-
-
Parameters
-

facet (list[float, float]) – Point indices of the facet

-
-
Returns
-

Facet id

-
-
Return type
-

int

-
-
-
- -
-
-add_hole(hole)[source]
-

Adds a hole location to the geometry and returns the added hole id.

-
-
Parameters
-

hole (list[float, float]) – Location of the hole

-
-
Returns
-

Hole id

-
-
Return type
-

int

-
-
-
- -
-
-add_point(point)[source]
-

Adds a point to the geometry and returns the added point id.

-
-
Parameters
-

point (list[float, float]) – Location of the point

-
-
Returns
-

Point id

-
-
Return type
-

int

-
-
-
- -
-
-calculate_extents()[source]
-

Calculates the minimum and maximum x and y-values amongst the list of points.

-
-
Returns
-

Minimum and maximum x and y-values (x_min, x_max, y_min, y_max)

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
- -
-
-calculate_facet_length(facet)[source]
-

Calculates the length of the facet.

-
-
Parameters
-

facet – Point index pair (p1, p2) defining a facet

-
-
Returns
-

Facet length

-
-
Return type
-

float

-
-
-
- -
-
-calculate_perimeter()[source]
-

Calculates the perimeter of the cross-section by summing the length of all facets in the -perimeter class variable.

-
-
Returns
-

Cross-section perimeter, returns 0 if there is no perimeter defined

-
-
Return type
-

float

-
-
-
- -
-
-clean_geometry(verbose=False)[source]
-

Peforms a full clean on the geometry.

-
-
Parameters
-

verbose (bool) – If set to true, information related to the geometry cleaning process -is printed to the terminal.

-
-
-
-

Note

-

Cleaning the geometry is always recommended when creating a merged section, -which may result in overlapping or intersecting facets, or duplicate nodes.

-
-
- -
-
-create_mesh(mesh_sizes)[source]
-

Creates a quadratic triangular mesh from the Geometry object.

-
-
Parameters
-

mesh_sizes – A list of maximum element areas corresponding to each region within the -cross-section geometry.

-
-
Returns
-

Object containing generated mesh data

-
-
Return type
-

meshpy.triangle.MeshInfo

-
-
Raises
-

AssertionError – If the number of mesh sizes does not match the number of regions

-
-
-

The following example creates a circular cross-section with a diameter of 50 with 64 -points, and generates a mesh with a maximum triangular area of 2.5:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.CircularSection(d=50, n=64)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-
-
-
-../_images/circle_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-draw_radius(pt, r, theta, n, anti=True)[source]
-

Adds a quarter radius of points to the points list - centered at point pt, with radius -r, starting at angle theta, with n points. If r = 0, adds pt only.

-
-
Parameters
-
    -
  • pt (list[float, float]) – Centre of radius (x,y)

  • -
  • r (float) – Radius

  • -
  • theta (float) – Initial angle

  • -
  • n (int) – Number of points

  • -
  • anti (bool) – Anticlockwise rotation?

  • -
-
-
-
- -
-
-mirror_section(axis='x', mirror_point=None)[source]
-

Mirrors the geometry about a point on either the x or y-axis. If no point is provided, -mirrors the geometry about the first control point in the list of control points of the -Geometry object.

-
-
Parameters
-
    -
  • axis (string) – Axis about which to mirror the geometry, ‘x’ or ‘y’

  • -
  • mirror_point (list[float, float]) – Point about which to mirror the geometry (x, y)

  • -
-
-
-

The following example mirrors a 200PFC section about the y-axis and the point (0, 0):

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.PfcSection(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8)
-geometry.mirror_section(axis='y', mirror_point=[0, 0])
-
-
-
- -
-
-plot_geometry(ax=None, pause=True, labels=False, perimeter=False)[source]
-

Plots the geometry defined by the input section. If no axes object is supplied a new -figure and axis is created.

-
-
Parameters
-
    -
  • ax (matplotlib.axes.Axes) – Axes object on which the mesh is plotted

  • -
  • pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

  • -
  • labels (bool) – If set to true, node and facet labels are displayed

  • -
  • perimeter (bool) – If set to true, boldens the perimeter of the cross-section

  • -
-
-
-

The following example creates a CHS discretised with 64 points, with a diameter of 48 and -thickness of 3.2, and plots the geometry:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.Chs(d=48, t=3.2, n=64)
-geometry.plot_geometry()
-
-
-
-../_images/chs_geometry.png -

Geometry generated by the above example.

-
-
- -
-
-rotate_section(angle, rot_point=None)[source]
-

Rotates the geometry and specified angle about a point. If the rotation point is not -provided, rotates the section about the first control point in the list of control points -of the Geometry object.

-
-
Parameters
-
    -
  • angle (float) – Angle (degrees) by which to rotate the section. A positive angle leads -to a counter-clockwise rotation.

  • -
  • rot_point (list[float, float]) – Point (x, y) about which to rotate the section

  • -
-
-
-

The following example rotates a 200UB25 section clockwise by 30 degrees:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
-geometry.rotate_section(angle=-30)
-
-
-
- -
-
-shift_section()[source]
-

Shifts the cross-section parameters by the class variable vector shift.

-
- -
- -
-
-

CustomSection Class

-
-
-class sectionproperties.pre.sections.CustomSection(points, facets, holes, control_points, shift=[0, 0], perimeter=[])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a cross-section from a list of points, facets, holes and a user specified control -point.

-
-
Parameters
-
    -
  • points (list[list[float, float]]) – List of points (x, y) defining the vertices of the cross-section

  • -
  • facets (list[list[int, int]]) – List of point index pairs (p1, p2) defining the edges of the cross-section

  • -
  • holes (list[list[float, float]]) – List of points (x, y) defining the locations of holes within the cross-section. -If there are no holes, provide an empty list [].

  • -
  • control_points (list[list[float, float]]) – A list of points (x, y) that define different regions of the -cross-section. A control point is an arbitrary point within a region enclosed by facets.

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
  • perimeter – List of facet indices defining the perimeter of the cross-section

  • -
-
-
-

The following example creates a hollow trapezium with a base width of 100, top width of 50, -height of 50 and a wall thickness of 10. A mesh is generated with a maximum triangular area of -2.0:

-
import sectionproperties.pre.sections as sections
-
-points = [[0, 0], [100, 0], [75, 50], [25, 50], [15, 10], [85, 10], [70, 40], [30, 40]]
-facets = [[0, 1], [1, 2], [2, 3], [3, 0], [4, 5], [5, 6], [6, 7], [7, 4]]
-holes = [[50, 25]]
-control_points = [[5, 5]]
-perimeter = [0, 1, 2, 3]
-
-geometry = sections.CustomSection(
-    points, facets, holes, control_points, perimeter=perimeter
-)
-mesh = geometry.create_mesh(mesh_sizes=[2.0])
-
-
-
-../_images/custom_geometry.png -

Custom section geometry.

-
-
-../_images/custom_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-

RectangularSection Class

-
-
-class sectionproperties.pre.sections.RectangularSection(d, b, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a rectangular section with the bottom left corner at the origin (0, 0), with -depth d and width b.

-
-
Parameters
-
    -
  • d (float) – Depth (y) of the rectangle

  • -
  • b (float) – Width (x) of the rectangle

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a rectangular cross-section with a depth of 100 and width of 50, -and generates a mesh with a maximum triangular area of 5:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.RectangularSection(d=100, b=50)
-mesh = geometry.create_mesh(mesh_sizes=[5])
-
-
-
-../_images/rectangle_geometry.png -

Rectangular section geometry.

-
-
-../_images/rectangle_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-

CircularSection Class

-
-
-class sectionproperties.pre.sections.CircularSection(d, n, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a solid circle centered at the origin (0, 0) with diameter d and using n -points to construct the circle.

-
-
Parameters
-
    -
  • d (float) – Diameter of the circle

  • -
  • n (int) – Number of points discretising the circle

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a circular cross-section with a diameter of 50 with 64 points, -and generates a mesh with a maximum triangular area of 2.5:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.CircularSection(d=50, n=64)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-
-
-
-../_images/circle_geometry.png -

Circular section geometry.

-
-
-../_images/circle_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-

Chs Class

-
-
-class sectionproperties.pre.sections.Chs(d, t, n, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a circular hollow section centered at the origin (0, 0), with diameter d and -thickness t, using n points to construct the inner and outer circles.

-
-
Parameters
-
    -
  • d (float) – Outer diameter of the CHS

  • -
  • t (float) – Thickness of the CHS

  • -
  • n (int) – Number of points discretising the inner and outer circles

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a CHS discretised with 64 points, with a diameter of 48 and -thickness of 3.2, and generates a mesh with a maximum triangular area of 1.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.Chs(d=48, t=3.2, n=64)
-mesh = geometry.create_mesh(mesh_sizes=[1.0])
-
-
-
-../_images/chs_geometry.png -

CHS geometry.

-
-
-../_images/chs_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-

EllipticalSection Class

-
-
-class sectionproperties.pre.sections.EllipticalSection(d_y, d_x, n, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a solid ellipse centered at the origin (0, 0) with vertical diameter d_y and -horizontal diameter d_x, using n points to construct the ellipse.

-
-
Parameters
-
    -
  • d_y (float) – Diameter of the ellipse in the y-dimension

  • -
  • d_x (float) – Diameter of the ellipse in the x-dimension

  • -
  • n (int) – Number of points discretising the ellipse

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates an elliptical cross-section with a vertical diameter of 25 and -horizontal diameter of 50, with 40 points, and generates a mesh with a maximum triangular area -of 1.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.EllipticalSection(d_y=25, d_x=50, n=40)
-mesh = geometry.create_mesh(mesh_sizes=[1.0])
-
-
-
-../_images/ellipse_geometry.png -

Elliptical section geometry.

-
-
-../_images/ellipse_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-

Ehs Class

-
-
-class sectionproperties.pre.sections.Ehs(d_y, d_x, t, n, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs an elliptical hollow section centered at the origin (0, 0), with outer vertical -diameter d_y, outer horizontal diameter d_x, and thickness t, using n points to -construct the inner and outer ellipses.

-
-
Parameters
-
    -
  • d_y (float) – Diameter of the ellipse in the y-dimension

  • -
  • d_x (float) – Diameter of the ellipse in the x-dimension

  • -
  • t (float) – Thickness of the EHS

  • -
  • n (int) – Number of points discretising the inner and outer ellipses

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a EHS discretised with 30 points, with a outer vertical diameter -of 25, outer horizontal diameter of 50, and thickness of 2.0, and generates a mesh with a -maximum triangular area of 0.5:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.Ehs(d_y=25, d_x=50, t=2.0, n=64)
-mesh = geometry.create_mesh(mesh_sizes=[0.5])
-
-
-
-../_images/ehs_geometry.png -

EHS geometry.

-
-
-../_images/ehs_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-

Rhs Class

-
-
-class sectionproperties.pre.sections.Rhs(d, b, t, r_out, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a rectangular hollow section centered at (b/2, d/2), with depth d, width b, -thickness t and outer radius r_out, using n_r points to construct the inner and outer -radii. If the outer radius is less than the thickness of the RHS, the inner radius is set to -zero.

-
-
Parameters
-
    -
  • d (float) – Depth of the RHS

  • -
  • b (float) – Width of the RHS

  • -
  • t (float) – Thickness of the RHS

  • -
  • r_out (float) – Outer radius of the RHS

  • -
  • n_r (int) – Number of points discretising the inner and outer radii

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates an RHS with a depth of 100, a width of 50, a thickness of 6 and -an outer radius of 9, using 8 points to discretise the inner and outer radii. A mesh is -generated with a maximum triangular area of 2.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.Rhs(d=100, b=50, t=6, r_out=9, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.0])
-
-
-
-../_images/rhs_geometry.png -

RHS geometry.

-
-
-../_images/rhs_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-

ISection Class

-
-
-
-class sectionproperties.pre.sections.ISection(d, b, t_f, t_w, r, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs an I-section centered at (b/2, d/2), with depth d, width b, flange -thickness t_f, web thickness t_w, and root radius r, using n_r points to construct the -root radius.

-
-
Parameters
-
    -
  • d (float) – Depth of the I-section

  • -
  • b (float) – Width of the I-section

  • -
  • t_f (float) – Flange thickness of the I-section

  • -
  • t_w (float) – Web thickness of the I-section

  • -
  • r (float) – Root radius of the I-section

  • -
  • n_r (int) – Number of points discretising the root radius

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates an I-section with a depth of 203, a width of 133, a flange -thickness of 7.8, a web thickness of 5.8 and a root radius of 8.9, using 16 points to -discretise the root radius. A mesh is generated with a maximum triangular area of 3.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=16)
-mesh = geometry.create_mesh(mesh_sizes=[3.0])
-
-
-
-../_images/isection_geometry.png -

I-section geometry.

-
-
-../_images/isection_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

MonoISection Class

-
-
-
-class sectionproperties.pre.sections.MonoISection(d, b_t, b_b, t_fb, t_ft, t_w, r, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a monosymmetric I-section centered at (max(b_t, b_b)/2, d/2), with depth d, -top flange width b_t, bottom flange width b_b, top flange thickness t_ft, top flange -thickness t_fb, web thickness t_w, and root radius r, using n_r points to construct the -root radius.

-
-
Parameters
-
    -
  • d (float) – Depth of the I-section

  • -
  • b_t (float) – Top flange width

  • -
  • b_b (float) – Bottom flange width

  • -
  • t_ft (float) – Top flange thickness of the I-section

  • -
  • t_fb (float) – Bottom flange thickness of the I-section

  • -
  • t_w (float) – Web thickness of the I-section

  • -
  • r (float) – Root radius of the I-section

  • -
  • n_r (int) – Number of points discretising the root radius

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a monosymmetric I-section with a depth of 200, a top flange width -of 50, a top flange thickness of 12, a bottom flange width of 130, a bottom flange thickness of -8, a web thickness of 6 and a root radius of 8, using 16 points to discretise the root radius. -A mesh is generated with a maximum triangular area of 3.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.MonoISection(
-    d=200, b_t=50, b_b=130, t_ft=12, t_fb=8, t_w=6, r=8, n_r=16
-)
-mesh = geometry.create_mesh(mesh_sizes=[3.0])
-
-
-
-../_images/monoisection_geometry.png -

I-section geometry.

-
-
-../_images/monoisection_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

TaperedFlangeISection Class

-
-
-
-class sectionproperties.pre.sections.TaperedFlangeISection(d, b, t_f, t_w, r_r, r_f, alpha, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a Tapered Flange I-section centered at (b/2, d/2), with depth d, width b, -mid-flange thickness t_f, web thickness t_w, root radius r_r, flange radius r_f and -flange angle alpha, using n_r points to construct the radii.

-
-
Parameters
-
    -
  • d (float) – Depth of the Tapered Flange I-section

  • -
  • b (float) – Width of the Tapered Flange I-section

  • -
  • t_f (float) – Mid-flange thickness of the Tapered Flange I-section (measured at the point -equidistant from the face of the web to the edge of the flange)

  • -
  • t_w (float) – Web thickness of the Tapered Flange I-section

  • -
  • r_r (float) – Root radius of the Tapered Flange I-section

  • -
  • r_f (float) – Flange radius of the Tapered Flange I-section

  • -
  • alpha (float) – Flange angle of the Tapered Flange I-section (degrees)

  • -
  • n_r (int) – Number of points discretising the radii

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a Tapered Flange I-section with a depth of 588, a width of 191, a -mid-flange thickness of 27.2, a web thickness of 15.2, a root radius of 17.8, a flange radius -of 8.9 and a flange angle of 8°, using 16 points to discretise the radii. A mesh is generated -with a maximum triangular area of 20.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.TaperedFlangeISection(
-    d=588, b=191, t_f=27.2, t_w=15.2, r_r=17.8, r_f=8.9, alpha=8, n_r=16
-)
-mesh = geometry.create_mesh(mesh_sizes=[20.0])
-
-
-
-../_images/taperedisection_geometry.png -

I-section geometry.

-
-
-../_images/taperedisection_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

PfcSection Class

-
-
-
-class sectionproperties.pre.sections.PfcSection(d, b, t_f, t_w, r, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a PFC section with the bottom left corner at the origin (0, 0), with depth d, -width b, flange thickness t_f, web thickness t_w and root radius r, using n_r points -to construct the root radius.

-
-
Parameters
-
    -
  • d (float) – Depth of the PFC section

  • -
  • b (float) – Width of the PFC section

  • -
  • t_f (float) – Flange thickness of the PFC section

  • -
  • t_w (float) – Web thickness of the PFC section

  • -
  • r (float) – Root radius of the PFC section

  • -
  • n_r (int) – Number of points discretising the root radius

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a PFC section with a depth of 250, a width of 90, a flange -thickness of 15, a web thickness of 8 and a root radius of 12, using 8 points to discretise the -root radius. A mesh is generated with a maximum triangular area of 5.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.PfcSection(d=250, b=90, t_f=15, t_w=8, r=12, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[5.0])
-
-
-
-../_images/pfc_geometry.png -

PFC geometry.

-
-
-../_images/pfc_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

TaperedFlangeChannel Class

-
-
-
-class sectionproperties.pre.sections.TaperedFlangeChannel(d, b, t_f, t_w, r_r, r_f, alpha, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a Tapered Flange Channel section with the bottom left corner at the origin -(0, 0), with depth d, width b, mid-flange thickness t_f, web thickness t_w, root -radius r_r, flange radius r_f and flange angle alpha, using n_r points to construct the -radii.

-
-
Parameters
-
    -
  • d (float) – Depth of the Tapered Flange Channel section

  • -
  • b (float) – Width of the Tapered Flange Channel section

  • -
  • t_f (float) – Mid-flange thickness of the Tapered Flange Channel section (measured at the -point equidistant from the face of the web to the edge of the flange)

  • -
  • t_w (float) – Web thickness of the Tapered Flange Channel section

  • -
  • r_r (float) – Root radius of the Tapered Flange Channel section

  • -
  • r_f (float) – Flange radius of the Tapered Flange Channel section

  • -
  • alpha (float) – Flange angle of the Tapered Flange Channel section (degrees)

  • -
  • n_r (int) – Number of points discretising the radii

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a Tapered Flange Channel section with a depth of 10, a width of -3.5, a mid-flange thickness of 0.575, a web thickness of 0.475, a root radius of 0.575, a -flange radius of 0.4 and a flange angle of 8°, using 16 points to discretise the radii. A mesh -is generated with a maximum triangular area of 0.02:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.TaperedFlangeChannel(
-    d=10, b=3.5, t_f=0.575, t_w=0.475, r_r=0.575, r_f=0.4, alpha=8, n_r=16
-)
-mesh = geometry.create_mesh(mesh_sizes=[0.02])
-
-
-
-../_images/taperedchannel_geometry.png -

I-section geometry.

-
-
-../_images/taperedchannel_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

TeeSection Class

-
-
-
-class sectionproperties.pre.sections.TeeSection(d, b, t_f, t_w, r, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a Tee section with the top left corner at (0, d), with depth d, width b, -flange thickness t_f, web thickness t_w and root radius r, using n_r points to -construct the root radius.

-
-
Parameters
-
    -
  • d (float) – Depth of the Tee section

  • -
  • b (float) – Width of the Tee section

  • -
  • t_f (float) – Flange thickness of the Tee section

  • -
  • t_w (float) – Web thickness of the Tee section

  • -
  • r (float) – Root radius of the Tee section

  • -
  • n_r (int) – Number of points discretising the root radius

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a Tee section with a depth of 200, a width of 100, a flange -thickness of 12, a web thickness of 6 and a root radius of 8, using 8 points to discretise the -root radius. A mesh is generated with a maximum triangular area of 3.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.TeeSection(d=200, b=100, t_f=12, t_w=6, r=8, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[3.0])
-
-
-
-../_images/tee_geometry.png -

Tee section geometry.

-
-
-../_images/tee_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

AngleSection Class

-
-
-
-class sectionproperties.pre.sections.AngleSection(d, b, t, r_r, r_t, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs an angle section with the bottom left corner at the origin (0, 0), with depth -d, width b, thickness t, root radius r_r and toe radius r_t, using n_r points to -construct the radii.

-
-
Parameters
-
    -
  • d (float) – Depth of the angle section

  • -
  • b (float) – Width of the angle section

  • -
  • t (float) – Thickness of the angle section

  • -
  • r_r (float) – Root radius of the angle section

  • -
  • r_t (float) – Toe radius of the angle section

  • -
  • n_r (int) – Number of points discretising the radii

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates an angle section with a depth of 150, a width of 100, a thickness -of 8, a root radius of 12 and a toe radius of 5, using 16 points to discretise the radii. A -mesh is generated with a maximum triangular area of 2.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.AngleSection(d=150, b=100, t=8, r_r=12, r_t=5, n_r=16)
-mesh = geometry.create_mesh(mesh_sizes=[2.0])
-
-
-
-../_images/angle_geometry.png -

Angle section geometry.

-
-
-../_images/angle_mesh.png -
-
- -
-
-
-

CeeSection Class

-
-
-
-class sectionproperties.pre.sections.CeeSection(d, b, l, t, r_out, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a Cee section with the bottom left corner at the origin (0, 0), with depth d, -width b, lip l, thickness t and outer radius r_out, using n_r points to construct the -radius. If the outer radius is less than the thickness of the Cee Section, the inner radius is -set to zero.

-
-
Parameters
-
    -
  • d (float) – Depth of the Cee section

  • -
  • b (float) – Width of the Cee section

  • -
  • l (float) – Lip of the Cee section

  • -
  • t (float) – Thickness of the Cee section

  • -
  • r_out (float) – Outer radius of the Cee section

  • -
  • n_r (int) – Number of points discretising the outer radius

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
Raises
-

Exception – Lip length must be greater than the outer radius

-
-
-

The following example creates a Cee section with a depth of 125, a width of 50, a lip of 30, a -thickness of 1.5 and an outer radius of 6, using 8 points to discretise the radius. A mesh is -generated with a maximum triangular area of 0.25:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.CeeSection(d=125, b=50, l=30, t=1.5, r_out=6, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[0.25])
-
-
-
-../_images/cee_geometry.png -

Cee section geometry.

-
-
-../_images/cee_mesh.png -
-
- -
-
-
-

ZedSection Class

-
-
-
-class sectionproperties.pre.sections.ZedSection(d, b_l, b_r, l, t, r_out, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a Zed section with the bottom left corner at the origin (0, 0), with depth d, -left flange width b_l, right flange width b_r, lip l, thickness t and outer radius -r_out, using n_r points to construct the radius. If the outer radius is less than the -thickness of the Zed Section, the inner radius is set to zero.

-
-
Parameters
-
    -
  • d (float) – Depth of the Zed section

  • -
  • b_l (float) – Left flange width of the Zed section

  • -
  • b_r (float) – Right flange width of the Zed section

  • -
  • l (float) – Lip of the Zed section

  • -
  • t (float) – Thickness of the Zed section

  • -
  • r_out (float) – Outer radius of the Zed section

  • -
  • n_r (int) – Number of points discretising the outer radius

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
Raises
-

Exception – Lip length must be greater than the outer radius

-
-
-

The following example creates a Zed section with a depth of 100, a left flange width of 40, a -right flange width of 50, a lip of 20, a thickness of 1.2 and an outer radius of 5, using 8 -points to discretise the radius. A mesh is generated with a maximum triangular area of 0.15:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.ZedSection(d=100, b_l=40, b_r=50, l=20, t=1.2, r_out=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[0.15])
-
-
-
-../_images/zed_geometry.png -

Zed section geometry.

-
-
-../_images/zed_mesh.png -
-
- -
-
-
-

CruciformSection Class

-
-
-
-class sectionproperties.pre.sections.CruciformSection(d, b, t, r, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a cruciform section centered at the origin (0, 0), with depth d, width b, -thickness t and root radius r, using n_r points to construct the root radius.

-
-
Parameters
-
    -
  • d (float) – Depth of the cruciform section

  • -
  • b (float) – Width of the cruciform section

  • -
  • t (float) – Thickness of the cruciform section

  • -
  • r (float) – Root radius of the cruciform section

  • -
  • n_r (int) – Number of points discretising the root radius

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a cruciform section with a depth of 250, a width of 175, a -thickness of 12 and a root radius of 16, using 16 points to discretise the radius. A mesh is -generated with a maximum triangular area of 5.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.CruciformSection(d=250, b=175, t=12, r=16, n_r=16)
-mesh = geometry.create_mesh(mesh_sizes=[5.0])
-
-
-
-../_images/cruciform_geometry.png -

Cruciform section geometry.

-
-
-../_images/cruciform_mesh.png -
-
- -
-
-
-

PolygonSection Class

-
-
-
-class sectionproperties.pre.sections.PolygonSection(d, t, n_sides, r_in=0, n_r=1, rot=0, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a regular hollow polygon section centered at (0, 0), with a pitch circle -diameter of bounding polygon d, thickness t, number of sides n_sides and an optional -inner radius r_in, using n_r points to construct the inner and outer radii (if radii is -specified).

-
-
Parameters
-
    -
  • d (float) – Pitch circle diameter of the outer bounding polygon (i.e. diameter of circle -that passes through all vertices of the outer polygon)

  • -
  • t (float) – Thickness of the polygon section wall

  • -
  • r_in (float) – Inner radius of the polygon corners. By default, if not specified, a polygon -with no corner radii is generated.

  • -
  • n_r (int) – Number of points discretising the inner and outer radii, ignored if no inner -radii is specified

  • -
  • rot – Initial counterclockwise rotation in degrees. By default bottom face is aligned -with x axis.

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
Raises
-

Exception – Number of sides in polygon must be greater than or equal to 3

-
-
-

The following example creates an Octagonal section (8 sides) with a diameter of 200, a -thickness of 6 and an inner radius of 20, using 12 points to discretise the inner and outer -radii. A mesh is generated with a maximum triangular area of 5:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.PolygonSection(d=200, t=6, n_sides=8, r_in=20, n_r=12)
-mesh = geometry.create_mesh(mesh_sizes=[5])
-
-
-
-../_images/polygon_geometry.png -

Octagonal section geometry.

-
-
-../_images/polygon_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

BoxGirderSection Class

-
-
-
-class sectionproperties.pre.sections.BoxGirderSection(d, b_t, b_b, t_ft, t_fb, t_w, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a Box Girder section centered at at (max(b_t, b_b)/2, d/2), with depth d, top -width b_t, bottom width b_b, top flange thickness t_ft, bottom flange thickness t_fb -and web thickness t_w.

-
-
Parameters
-
    -
  • d (float) – Depth of the Box Girder section

  • -
  • b_t (float) – Top width of the Box Girder section

  • -
  • b_b (float) – Bottom width of the Box Girder section

  • -
  • t_ft (float) – Top lange thickness of the Box Girder section

  • -
  • t_fb (float) – Bottom flange thickness of the Box Girder section

  • -
  • t_w (float) – Web thickness of the Box Girder section

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a Box Gider section with a depth of 1200, a top width of 1200, a -bottom width of 400, a top flange thickness of 16, a bottom flange thickness of 12 and a web -thickness of 8. A mesh is generated with a maximum triangular area of 5.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.BoxGirderSection(d=1200, b_t=1200, b_b=400, t_ft=100, t_fb=80, t_w=50)
-mesh = geometry.create_mesh(mesh_sizes=[200.0])
-
-
-
-../_images/box_girder_geometry.png -

Box Girder geometry.

-
-
-../_images/box_girder_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

MergedSection Class

-
-
-
-class sectionproperties.pre.sections.MergedSection(sections)[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Merges a number of section geometries into one geometry. Note that for the meshing algorithm -to work, there needs to be connectivity between all regions of the provided geometries. -Overlapping of geometries is permitted.

-
-
Parameters
-

sections (list[Geometry]) – A list of geometry objects to merge into one -Geometry object

-
-
-

The following example creates a combined cross-section with a 150x100x6 RHS placed on its side -on top of a 200UB25.4. A mesh is generated with a maximum triangle size of 5.0 for the -I-section and 2.5 for the RHS:

-
import sectionproperties.pre.sections as sections
-
-isection = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
-box = sections.Rhs(d=100, b=150, t=6, r_out=15, n_r=8, shift=[-8.5, 203])
-
-geometry = sections.MergedSection([isection, box])
-geometry.clean_geometry()
-mesh = geometry.create_mesh(mesh_sizes=[5.0, 2.5])
-
-
-
-../_images/merged_geometry.png -

Merged section geometry.

-
-
-../_images/merged_mesh.png -
-
- -
-
-
-
-

pre Module

-
-

Material Class

-
-
-
-class sectionproperties.pre.pre.Material(name, elastic_modulus, poissons_ratio, yield_strength, color='w')[source]
-

Bases: object

-

Class for structural materials.

-

Provides a way of storing material properties related to a specific material. The color can be -a multitude of different formats, refer to https://matplotlib.org/api/colors_api.html and -https://matplotlib.org/examples/color/named_colors.html for more information.

-
-
Parameters
-
    -
  • name (string) – Material name

  • -
  • elastic_modulus (float) – Material modulus of elasticity

  • -
  • poissons_ratio (float) – Material Poisson’s ratio

  • -
  • yield_strength (float) – Material yield strength

  • -
  • color (matplotlib.colors) – Material color for rendering

  • -
-
-
Variables
-
    -
  • name (string) – Material name

  • -
  • elastic_modulus (float) – Material modulus of elasticity

  • -
  • poissons_ratio (float) – Material Poisson’s ratio

  • -
  • shear_modulus (float) – Material shear modulus, derived from the elastic modulus and -Poisson’s ratio assuming an isotropic material

  • -
  • yield_strength (float) – Material yield strength

  • -
  • color (matplotlib.colors) – Material color for rendering

  • -
-
-
-

The following example creates materials for concrete, steel and timber:

-
from sectionproperties.pre.pre import Material
-
-concrete = Material(
-    name='Concrete', elastic_modulus=30.1e3, poissons_ratio=0.2, yield_strength=32,
-        color='lightgrey'
-)
-steel = Material(
-    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500,
-        color='grey'
-)
-timber = Material(
-    name='Timber', elastic_modulus=8e3, poissons_ratio=0.35, yield_strength=20,
-        color='burlywood'
-)
-
-
-
- -
-
-
-

GeometryCleaner Class

-
-
-
-class sectionproperties.pre.pre.GeometryCleaner(geometry, verbose)[source]
-

Bases: object

-

Class for cleaning Geometry objects.

-
-
Parameters
-
    -
  • geometry (Geometry) – Geometry object to clean

  • -
  • verbose (bool) – If set to true, information related to the geometry cleaning process is -printed to the terminal.

  • -
-
-
-

Provides methods to clean various aspects of the geometry including:

-
    -
  • Zipping nodes - Find nodes that are close together (relative and absolute tolerance) and -deletes one of the nodes and rejoins the facets to the remaining node.

  • -
  • Removing zero length facets - Removes facets that start and end at the same point.

  • -
  • Remove duplicate facets - Removes facets that have the same starting and ending point as an -existing facet.

  • -
  • Removing overlapping facets - Searches for facets that overlap each other, given a tolerance -angle, and reconstructs a unique set of facets along the overlapping region.

  • -
  • Remove unused points - Removes points that are not connected to any facets.

  • -
  • Intersect facets - Searches for intersections between two facets and adds the intersection -point to the points list and splits the intersected facets.

  • -
-

Note that a geometry cleaning method is provided to all -Geometry objects.

-
-
Variables
-
    -
  • geometry (Geometry) – Geometry object to clean

  • -
  • verbose (bool) – If set to true, information related to the geometry cleaning process is -printed to the terminal.

  • -
-
-
-

The following example creates a back-to-back 200PFC geometry, rotates the geometry by 30 -degrees, and cleans the geometry before meshing:

-
import sectionproperties.pre.sections as sections
-
-pfc_right = sections.PfcSection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
-pfc_left = sections.PfcSection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
-pfc_left.mirror_section(axis='y', mirror_point=[0, 0])
-geometry = sections.MergedSection([pfc_left, pfc_right])
-geometry.rotate_section(angle=30)
-geometry.clean_geometry(verbose=True)
-mesh = geometry.create_mesh(mesh_sizes=[5, 5])
-
-
-
-

Warning

-

If the geometry were not cleaned in the previous example, the meshing algorithm -would crash (most likely return a segment error). Cleaning the geometry is always recommended -when creating a merged section, which may result in overlapping or intersecting facets, or -duplicate nodes.

-
-
-
-clean_geometry()[source]
-

Performs a full geometry clean on the geometry object.

-
- -
-
-intersect_facets()[source]
-

Searches through all facet combinations and finds facets that intersect each other. The -intersection point is added and the facets rebuilt.

-
- -
-
-is_duplicate_facet(fct1, fct2)[source]
-

Checks to see if to facets are duplicates.

-
-
Parameters
-
    -
  • fct1 (list[int, int]) – First facet to compare

  • -
  • fct2 (list[int, int]) – Second facet to compare

  • -
-
-
Returns
-

Whether or not the facets are identical

-
-
Return type
-

bool

-
-
-
- -
-
-is_intersect(p, q, r, s)[source]
-

Determines if the line segment p->p+r intersects q->q+s. Implements Gareth Rees’s -answer: https://stackoverflow.com/questions/563198.

-
-
Parameters
-
    -
  • p (numpy.ndarray [float, float]) – Starting point of the first line segment

  • -
  • q (numpy.ndarray [float, float]) – Starting point of the second line segment

  • -
  • r (numpy.ndarray [float, float]) – Vector of the first line segment

  • -
  • s (numpy.ndarray [float, float]) – Vector of the second line segment

  • -
-
-
Returns
-

The intersection point of the line segments. If there is no intersection, returns -None.

-
-
Return type
-

numpy.ndarray [float, float]

-
-
-
- -
-
-is_overlap(p, q, r, s, fct1, fct2)[source]
-

Determines if the line segment p->p+r overlaps q->q+s. Implements Gareth Rees’s answer: -https://stackoverflow.com/questions/563198.

-
-
Parameters
-
    -
  • p (numpy.ndarray [float, float]) – Starting point of the first line segment

  • -
  • q (numpy.ndarray [float, float]) – Starting point of the second line segment

  • -
  • r (numpy.ndarray [float, float]) – Vector of the first line segment

  • -
  • s (numpy.ndarray [float, float]) – Vector of the second line segment

  • -
  • fct1 – sadkjas;dkas;dj

  • -
-
-
Returns
-

A list containing the points required for facet rebuilding. If there is no -rebuild to be done, returns None.

-
-
Return type
-

list[list[float, float]]

-
-
-
- -
-
-remove_duplicate_facets()[source]
-

Searches through all facets and removes facets that are duplicates, independent of the -point order.

-
- -
-
-remove_overlapping_facets()[source]
-

Searches through all facet combinations and fixes facets that overlap within a -tolerance.

-
- -
-
-remove_point_id(point_id)[source]
-

Removes point point_id from the points list and renumbers the references to points after -point_id in the facet list.

-
-
Parameters
-

point_id (int) – Index of point to be removed

-
-
-
- -
-
-remove_unused_points()[source]
-

Searches through all facets and removes points that are not connected to any facets.

-
- -
-
-remove_zero_length_facets()[source]
-

Searches through all facets and removes those that have the same starting and ending -point.

-
- -
-
-replace_point_id(id_old, id_new)[source]
-

Searches all facets and replaces references to point id_old with id_new.

-
-
Parameters
-
    -
  • id_old (int) – Point index to be replaced

  • -
  • id_new (int) – Point index to replace point id_old

  • -
-
-
-
- -
-
-zip_points(atol=1e-08, rtol=1e-05)[source]
-

Zips points that are close to each other. Searches through the point list and merges two -points if there are deemed to be sufficiently close. The average value of the coordinates -is used for the new point. One of the points is deleted from the point list and the facet -list is updated to remove references to the old points and renumber the remaining point -indices in the facet list.

-
-
Parameters
-
    -
  • atol (float) – Absolute tolerance for point zipping

  • -
  • rtol (float) – Relative tolerance (to geometry extents) for point zipping

  • -
-
-
-
- -
- -
-
-
-

pre Functions

-
-
-sectionproperties.pre.pre.create_mesh(points, facets, holes, control_points, mesh_sizes)[source]
-

Creates a quadratic triangular mesh using the meshpy module, which utilises the code -‘Triangle’, by Jonathan Shewchuk.

-
-
Parameters
-
    -
  • points (list[list[int, int]]) – List of points (x, y) defining the vertices of the cross-section

  • -
  • facets – List of point index pairs (p1, p2) defining the edges of the cross-section

  • -
  • holes (list[list[float, float]]) – List of points (x, y) defining the locations of holes within the cross-section. -If there are no holes, provide an empty list [].

  • -
  • control_points (list[list[float, float]]) – A list of points (x, y) that define different regions of the -cross-section. A control point is an arbitrary point within a region enclosed by facets.

  • -
  • mesh_sizes (list[float]) – List of maximum element areas for each region defined by a control point

  • -
-
-
Returns
-

Object containing generated mesh data

-
-
Return type
-

meshpy.triangle.MeshInfo

-
-
-
- -
-
-
-

offset Module

-
-
-sectionproperties.pre.offset.offset_perimeter(geometry, offset, side='left', plot_offset=False)[source]
-

Offsets the perimeter of a geometry of a Geometry -object by a certain distance. Note that the perimeter facet list must be entered in a -consecutive order.

-
-
Parameters
-
    -
  • geometry (Geometry) – Cross-section geometry object

  • -
  • offset (float) – Offset distance for the perimeter

  • -
  • side (string) – Side of the perimeter offset, either ‘left’ or ‘right’. E.g. ‘left’ for a -counter-clockwise offsets the perimeter inwards.

  • -
  • plot_offset (bool) – If set to True, generates a plot comparing the old and new geometry

  • -
-
-
-

The following example ‘corrodes’ a 200UB25 I-section by 1.5 mm and compares a few of the -section properties:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.pre.offset import offset_perimeter
-from sectionproperties.analysis.cross_section import CrossSection
-
-# calculate original section properties
-original_geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=16)
-original_mesh = original_geometry.create_mesh(mesh_sizes=[3.0])
-original_section = CrossSection(original_geometry, original_mesh)
-original_section.calculate_geometric_properties()
-original_area = original_section.get_area()
-(original_ixx, _, _) = original_section.get_ic()
-
-# calculate corroded section properties
-corroded_geometry = offset_perimeter(original_geometry, 1.5, plot_offset=True)
-corroded_mesh = corroded_geometry.create_mesh(mesh_sizes=[3.0])
-corroded_section = CrossSection(corroded_geometry, corroded_mesh)
-corroded_section.calculate_geometric_properties()
-corroded_area = corroded_section.get_area()
-(corroded_ixx, _, _) = corroded_section.get_ic()
-
-# compare section properties
-print("Area reduction = {0:.2f}%".format(
-    100 * (original_area - corroded_area) / original_area))
-print("Ixx reduction = {0:.2f}%".format(
-    100 *(original_ixx - corroded_ixx) / original_ixx))
-
-
-

The following plot is generated by the above example:

-
-../_images/offset_example.png -

200UB25 with 1.5 mm corrosion.

-
-

The following is printed to the terminal:

-
Area reduction = 41.97%
-Ixx reduction = 39.20%
-
-
-
- -
-
-

nastran_sections Module

-

This module contains cross-sections as defined by Nastran and Nastran-based programs, -such as MYSTRAN and ASTROS.

-
-

BARSection Class

-
-
-class sectionproperties.pre.nastran_sections.BARSection(DIM1, DIM2, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a BAR section with the center at the origin (0, 0), with two parameters -defining dimensions. See Nastran documentation 1 2 3 4 5 for definition of -parameters. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Width (x) of bar

  • -
  • DIM2 (float) – Depth (y) of bar

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a BAR cross-section with a depth of 1.5 and width of 2.0, and -generates a mesh with a maximum triangular area of 0.001:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.BARSection(DIM1=2.0, DIM2=1.5)
-mesh = geometry.create_mesh(mesh_sizes=[0.001])
-
-
-
-../_images/bar_geometry.png -

BAR section geometry.

-
-
-../_images/bar_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

BOXSection Class

-
-
-class sectionproperties.pre.nastran_sections.BOXSection(DIM1, DIM2, DIM3, DIM4, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a BOX section with the center at the origin (0, 0), with four parameters -defining dimensions. See Nastran documentation 1 2 3 4 5 for definition of -parameters. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Width (x) of box

  • -
  • DIM2 (float) – Depth (y) of box

  • -
  • DIM3 (float) – Thickness of box in y direction

  • -
  • DIM4 (float) – Thickness of box in x direction

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a BOX cross-section with a depth of 3.0 and width of 4.0, and -generates a mesh with a maximum triangular area of 0.001:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.BOXSection(DIM1=4.0, DIM2=3.0, DIM3=0.375, DIM4=0.5)
-mesh = geometry.create_mesh(mesh_sizes=[0.001])
-
-
-
-../_images/box_geometry.png -

BOX section geometry.

-
-
-../_images/box_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

BOX1Section Class

-
-
-class sectionproperties.pre.nastran_sections.BOX1Section(DIM1, DIM2, DIM3, DIM4, DIM5, DIM6, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a BOX1 section with the center at the origin (0, 0), with six parameters -defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by -JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Width (x) of box

  • -
  • DIM2 (float) – Depth (y) of box

  • -
  • DIM3 (float) – Thickness of top wall

  • -
  • DIM4 (float) – Thickness of bottom wall

  • -
  • DIM5 (float) – Thickness of left wall

  • -
  • DIM6 (float) – Thickness of right wall

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a BOX1 cross-section with a depth of 3.0 and width of 4.0, and -generates a mesh with a maximum triangular area of 0.007:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.BOX1Section(
-    DIM1=4.0, DIM2=3.0, DIM3=0.375, DIM4=0.5, DIM5=0.25, DIM6=0.75
-)
-mesh = geometry.create_mesh(mesh_sizes=[0.007])
-
-
-
-../_images/box1_geometry.png -

BOX1 section geometry.

-
-
-../_images/box1_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

CHANSection Class

-
-
-class sectionproperties.pre.nastran_sections.CHANSection(DIM1, DIM2, DIM3, DIM4, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a CHAN (C-Channel) section with the web’s middle center at the origin (0, 0), -with four parameters defining dimensions. See Nastran documentation 1 2 3 4 for -more details. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Width (x) of the CHAN-section

  • -
  • DIM2 (float) – Depth (y) of the CHAN-section

  • -
  • DIM3 (float) – Thickness of web (vertical portion)

  • -
  • DIM4 (float) – Thickness of flanges (top/bottom portion)

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a CHAN cross-section with a depth of 4.0 and width of 2.0, and -generates a mesh with a maximum triangular area of 0.008:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.CHANSection(DIM1=2.0, DIM2=4.0, DIM3=0.25, DIM4=0.5)
-mesh = geometry.create_mesh(mesh_sizes=[0.008])
-
-
-
-../_images/chan_geometry.png -

CHAN section geometry.

-
-
-../_images/chan_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

CHAN1Section Class

-
-
-class sectionproperties.pre.nastran_sections.CHAN1Section(DIM1, DIM2, DIM3, DIM4, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a CHAN1 (C-Channel) section with the web’s middle center at the origin (0, 0), -with four parameters defining dimensions. See Nastran documentation 1 2 3 4 for -more details. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Width (x) of channels

  • -
  • DIM2 (float) – Thicknesss (x) of web

  • -
  • DIM3 (float) – Spacing between channels (length of web)

  • -
  • DIM4 (float) – Depth (y) of CHAN1-section

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a CHAN1 cross-section with a depth of 4.0 and width of 1.75, and -generates a mesh with a maximum triangular area of 0.01:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.CHAN1Section(DIM1=0.75, DIM2=1.0, DIM3=3.5, DIM4=4.0)
-mesh = geometry.create_mesh(mesh_sizes=[0.01])
-
-
-
-../_images/chan1_geometry.png -

CHAN1 section geometry.

-
-
-../_images/chan1_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

CHAN2Section Class

-
-
-class sectionproperties.pre.nastran_sections.CHAN2Section(DIM1, DIM2, DIM3, DIM4, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a CHAN2 (C-Channel) section with the bottom web’s middle center at the origin -(0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 3 -4 for more details. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Thickness of channels

  • -
  • DIM2 (float) – Thickness of web

  • -
  • DIM3 (float) – Depth (y) of CHAN2-section

  • -
  • DIM4 (float) – Width (x) of CHAN2-section

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a CHAN2 cross-section with a depth of 2.0 and width of 4.0, and -generates a mesh with a maximum triangular area of 0.01:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.CHAN2Section(DIM1=0.375, DIM2=0.5, DIM3=2.0, DIM4=4.0)
-mesh = geometry.create_mesh(mesh_sizes=[0.01])
-
-
-
-../_images/chan2_geometry.png -

CHAN2 section geometry.

-
-
-../_images/chan2_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

CROSSSection Class

-
-
-class sectionproperties.pre.nastran_sections.CROSSSection(DIM1, DIM2, DIM3, DIM4, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs Nastran’s cruciform/cross section with the intersection’s middle center at the -origin (0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 -3 4 for more details. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Twice the width of horizontal member protruding from the vertical center -member

  • -
  • DIM2 (float) – Thickness of the vertical member

  • -
  • DIM3 (float) – Depth (y) of the CROSS-section

  • -
  • DIM4 (float) – Thickness of the horizontal members

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a rectangular cross-section with a depth of 3.0 and width of -1.875, and generates a mesh with a maximum triangular area of 0.008:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.CROSSSection(DIM1=1.5, DIM2=0.375, DIM3=3.0, DIM4=0.25)
-mesh = geometry.create_mesh(mesh_sizes=[0.008])
-
-
-
-../_images/cross_geometry.png -

Cruciform/cross section geometry.

-
-
-../_images/cross_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

DBOXSection Class

-
-
-class sectionproperties.pre.nastran_sections.DBOXSection(DIM1, DIM2, DIM3, DIM4, DIM5, DIM6, DIM7, DIM8, DIM9, DIM10, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a DBOX section with the center at the origin (0, 0), with ten parameters -defining dimensions. See MSC Nastran documentation 1 for more details. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Width (x) of the DBOX-section

  • -
  • DIM2 (float) – Depth (y) of the DBOX-section

  • -
  • DIM3 (float) – Width (x) of left-side box

  • -
  • DIM4 (float) – Thickness of left wall

  • -
  • DIM5 (float) – Thickness of center wall

  • -
  • DIM6 (float) – Thickness of right wall

  • -
  • DIM7 (float) – Thickness of top left wall

  • -
  • DIM8 (float) – Thickness of bottom left wall

  • -
  • DIM9 (float) – Thickness of top right wall

  • -
  • DIM10 (float) – Thickness of bottom right wall

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a DBOX cross-section with a depth of 3.0 and width of 8.0, and -generates a mesh with a maximum triangular area of 0.01:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.DBOXSection(
-    DIM1=8.0, DIM2=3.0, DIM3=3.0, DIM4=0.5, DIM5=0.625, DIM6=0.75, DIM7=0.375, DIM8=0.25,
-    DIM9=0.5, DIM10=0.375
-)
-mesh = geometry.create_mesh(mesh_sizes=[0.01])
-
-
-
-../_images/dbox_geometry.png -

DBOX section geometry.

-
-
-../_images/dbox_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

FCROSSSection Class

-
-
-class sectionproperties.pre.nastran_sections.FCROSSSection(DIM1, DIM2, DIM3, DIM4, DIM5, DIM6, DIM7, DIM8, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a flanged cruciform/cross section with the intersection’s middle center at the -origin (0, 0), with eight parameters defining dimensions. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Depth (y) of flanged cruciform

  • -
  • DIM2 (float) – Width (x) of flanged cruciform

  • -
  • DIM3 (float) – Thickness of vertical web

  • -
  • DIM4 (float) – Thickness of horizontal web

  • -
  • DIM5 (float) – Length of flange attached to vertical web

  • -
  • DIM6 (float) – Thickness of flange attached to vertical web

  • -
  • DIM7 (float) – Length of flange attached to horizontal web

  • -
  • DIM8 (float) – Thickness of flange attached to horizontal web

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example demonstrates the creation of a flanged cross section:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.FCROSSSection(
-    DIM1=9.0, DIM2=6.0, DIM3=0.75, DIM4=0.625, DIM5=2.1, DIM6=0.375, DIM7=4.5, DIM8=0.564
-)
-mesh = geometry.create_mesh(mesh_sizes=[0.03])
-
-
-
-../_images/fcross_geometry.png -

Flanged Cruciform/cross section geometry.

-
-
-../_images/fcross_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

GBOXSection Class

-
-
-class sectionproperties.pre.nastran_sections.GBOXSection(DIM1, DIM2, DIM3, DIM4, DIM5, DIM6, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a GBOX section with the center at the origin (0, 0), with six parameters -defining dimensions. See ASTROS documentation 5 for more details. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Width (x) of the GBOX-section

  • -
  • DIM2 (float) – Depth (y) of the GBOX-section

  • -
  • DIM3 (float) – Thickness of top flange

  • -
  • DIM4 (float) – Thickness of bottom flange

  • -
  • DIM5 (float) – Thickness of webs

  • -
  • DIM6 (float) – Spacing between webs

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a GBOX cross-section with a depth of 2.5 and width of 6.0, and -generates a mesh with a maximum triangular area of 0.01:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.GBOXSection(
-    DIM1=6.0, DIM2=2.5, DIM3=0.375, DIM4=0.25, DIM5=0.625, DIM6=1.0
-)
-mesh = geometry.create_mesh(mesh_sizes=[0.01])
-
-
-
-../_images/gbox_geometry.png -

GBOX section geometry.

-
-
-../_images/gbox_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

HSection Class

-
-
-class sectionproperties.pre.nastran_sections.HSection(DIM1, DIM2, DIM3, DIM4, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a H section with the middle web’s middle center at the origin (0, 0), with four -parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. -Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Spacing between vertical flanges (length of web)

  • -
  • DIM2 (float) – Twice the thickness of the vertical flanges

  • -
  • DIM3 (float) – Depth (y) of the H-section

  • -
  • DIM4 (float) – Thickness of the middle web

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a H cross-section with a depth of 3.5 and width of 2.75, and -generates a mesh with a maximum triangular area of 0.005:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.HSection(DIM1=2.0, DIM2=0.75, DIM3=3.5, DIM4=0.25)
-mesh = geometry.create_mesh(mesh_sizes=[0.005])
-
-
-
-../_images/h_geometry.png -

H section geometry.

-
-
-../_images/h_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

HATSection Class

-
-
-class sectionproperties.pre.nastran_sections.HATSection(DIM1, DIM2, DIM3, DIM4, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a Hat section with the top most section’s middle center at the origin (0, 0), -with four parameters defining dimensions. See Nastran documentation 1 2 3 4 for -more details. Note that HAT in ASTROS is actually HAT1 in this code. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Depth (y) of HAT-section

  • -
  • DIM2 (float) – Thickness of HAT-section

  • -
  • DIM3 (float) – Width (x) of top most section

  • -
  • DIM4 (float) – Width (x) of bottom sections

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a HAT cross-section with a depth of 1.25 and width of 2.5, and -generates a mesh with a maximum triangular area of 0.001:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.HATSection(DIM1=1.25, DIM2=0.25, DIM3=1.5, DIM4=0.5)
-mesh = geometry.create_mesh(mesh_sizes=[0.001])
-
-
-
-../_images/hat_geometry.png -

HAT section geometry.

-
-
-../_images/hat_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the origin by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

HAT1Section Class

-
-
-class sectionproperties.pre.nastran_sections.HAT1Section(DIM1, DIM2, DIM3, DIM4, DIM5, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a HAT1 section with the bottom plate’s bottom center at the origin (0, 0), -with five parameters defining dimensions. See Nastran documentation 1 2 3 5 for -definition of parameters. Note that in ASTROS, HAT1 is called HAT. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Width(x) of the HAT1-section

  • -
  • DIM2 (float) – Depth (y) of the HAT1-section

  • -
  • DIM3 (float) – Width (x) of hat’s top flange

  • -
  • DIM4 (float) – Thickness of hat stiffener

  • -
  • DIM5 (float) – Thicknesss of bottom plate

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a HAT1 cross-section with a depth of 2.0 and width of 4.0, and -generates a mesh with a maximum triangular area of 0.005:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.HAT1Section(DIM1=4.0, DIM2=2.0, DIM3=1.5, DIM4=0.1875, DIM5=0.375)
-mesh = geometry.create_mesh(mesh_sizes=[0.005])
-
-
-
-../_images/hat1_geometry.png -

HAT1 section geometry.

-
-
-../_images/hat1_mesh.png -

Mesh generated from the above geometry.

-
-
-
-create_mesh(mesh_sizes)[source]
-

Creates a quadratic triangular mesh from the Geometry object. This is overloaded here to -allow specifying only one mesh_size which is used for both regions in the Hat1 section.

-
-
Parameters
-

mesh_sizes – A list of maximum element areas corresponding to each region within the -cross-section geometry.

-
-
Returns
-

Object containing generated mesh data

-
-
Return type
-

meshpy.triangle.MeshInfo

-
-
Raises
-

AssertionError – If the number of mesh sizes does not match the number of regions

-
-
-
- -
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the origin by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

HEXASection Class

-
-
-class sectionproperties.pre.nastran_sections.HEXASection(DIM1, DIM2, DIM3, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a HEXA (hexagon) section with the center at the origin (0, 0), with three -parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. -Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Spacing between bottom right point and right most point

  • -
  • DIM2 (float) – Width (x) of hexagon

  • -
  • DIM3 (float) – Depth (y) of hexagon

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a rectangular cross-section with a depth of 1.5 and width of 2.0, -and generates a mesh with a maximum triangular area of 0.005:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.HEXASection(DIM1=0.5, DIM2=2.0, DIM3=1.5)
-mesh = geometry.create_mesh(mesh_sizes=[0.005])
-
-
-
-../_images/hexa_geometry.png -

HEXA section geometry.

-
-
-../_images/hexa_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

NISection Class

-
-
-class sectionproperties.pre.nastran_sections.NISection(DIM1, DIM2, DIM3, DIM4, DIM5, DIM6, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs Nastran’s I section with the bottom flange’s middle center at the origin -(0, 0), with six parameters defining dimensions. See Nastran documentation 1 2 3 -4 for definition of parameters. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Depth(y) of the I-section

  • -
  • DIM2 (float) – Width (x) of bottom flange

  • -
  • DIM3 (float) – Width (x) of top flange

  • -
  • DIM4 (float) – Thickness of web

  • -
  • DIM5 (float) – Thickness of bottom web

  • -
  • DIM6 (float) – Thickness of top web

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a Nastran I cross-section with a depth of 5.0, and generates a -mesh with a maximum triangular area of 0.008:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.NISection(
-    DIM1=5.0, DIM2=2.0, DIM3=3.0, DIM4=0.25, DIM5=0.375, DIM6=0.5
-)
-mesh = geometry.create_mesh(mesh_sizes=[0.008])
-
-
-
-../_images/ni_geometry.png -

Nastran’s I section geometry.

-
-
-../_images/ni_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

I1Section Class

-
-
-class sectionproperties.pre.nastran_sections.I1Section(DIM1, DIM2, DIM3, DIM4, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a I1 section with the web’s middle center at the origin (0, 0), with four -parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. -Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Twice distance from web end to flange end

  • -
  • DIM2 (float) – Thickness of web

  • -
  • DIM3 (float) – Length of web (spacing between flanges)

  • -
  • DIM4 (float) – Depth (y) of the I1-section

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a I1 cross-section with a depth of -5.0 and width of 1.75, and generates a mesh with a maximum triangular area of -0.02:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.I1Section(DIM1=1.0, DIM2=0.75, DIM3=4.0, DIM4=5.0)
-mesh = geometry.create_mesh(mesh_sizes=[0.02])
-
-
-
-../_images/i1_geometry.png -

I1 section geometry.

-
-
-../_images/i1_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

LSection Class

-
-
-class sectionproperties.pre.nastran_sections.LSection(DIM1, DIM2, DIM3, DIM4, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a L section with the intersection’s center at the origin (0, 0), with four -parameters defining dimensions. See Nastran documentation 1 2 3 for more details. -Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Width (x) of the L-section

  • -
  • DIM2 (float) – Depth (y) of the L-section

  • -
  • DIM3 (float) – Thickness of flange (horizontal portion)

  • -
  • DIM4 (float) – Thickness of web (vertical portion)

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a L cross-section with a depth of 6.0 and width of 3.0, and -generates a mesh with a maximum triangular area of 0.01:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.LSection(DIM1=3.0, DIM2=6.0, DIM3=0.375, DIM4=0.625)
-mesh = geometry.create_mesh(mesh_sizes=[0.01])
-
-
-
-../_images/l_geometry.png -

L section geometry.

-
-
-../_images/l_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

RODSection Class

-
-
-class sectionproperties.pre.nastran_sections.RODSection(DIM1, n, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a circular rod section with the center at the origin (0, 0), with one parameter -defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by -JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Radius of the circular rod section

  • -
  • n (int) – Number of points discretising the circle

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a circular rod with a radius of 3.0 and 50 points discretizing -the boundary, and generates a mesh with a maximum triangular area of 0.01:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.RODSection(DIM1=3.0, n=50)
-mesh = geometry.create_mesh(mesh_sizes=[0.01])
-
-
-
-../_images/rod_geometry.png -

Rod section geometry.

-
-
-../_images/rod_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-
    -
  • DIM1 (float) – Radius of the circular rod section

  • -
  • shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

  • -
-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

TSection Class

-
-
-class sectionproperties.pre.nastran_sections.TSection(DIM1, DIM2, DIM3, DIM4, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a T section with the top flange’s middle center at the origin (0, 0), with four -parameters defining dimensions. See Nastran documentation 1 2 3 4 5 for more -details. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Width (x) of top flange

  • -
  • DIM2 (float) – Depth (y) of the T-section

  • -
  • DIM3 (float) – Thickness of top flange

  • -
  • DIM4 (float) – Thickness of web

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a T cross-section with a depth of 4.0 and width of 3.0, and -generates a mesh with a maximum triangular area of 0.001:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.TSection(DIM1=3.0, DIM2=4.0, DIM3=0.375, DIM4=0.25)
-mesh = geometry.create_mesh(mesh_sizes=[0.001])
-
-
-
-../_images/t_geometry.png -

T section geometry.

-
-
-../_images/t_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin -of the cross-section. The shift parameter can be used to make the coordinates -relative to the centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

T1Section Class

-
-
-class sectionproperties.pre.nastran_sections.T1Section(DIM1, DIM2, DIM3, DIM4, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a T1 section with the right flange’s middle center at the origin (0, 0), with -four parameters defining dimensions. See Nastran documentation 1 2 3 4 for more -details. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Depth (y) of T1-section

  • -
  • DIM2 (float) – Length (x) of web

  • -
  • DIM3 (float) – Thickness of right flange

  • -
  • DIM4 (float) – Thickness of web

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a T1 cross-section with a depth of 3.0 and width of 3.875, and -generates a mesh with a maximum triangular area of 0.001:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.T1Section(DIM1=3.0, DIM2=3.5, DIM3=0.375, DIM4=0.25)
-mesh = geometry.create_mesh(mesh_sizes=[0.001])
-
-
-
-../_images/t1_geometry.png -

T1 section geometry.

-
-
-../_images/t1_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

T2Section Class

-
-
-class sectionproperties.pre.nastran_sections.T2Section(DIM1, DIM2, DIM3, DIM4, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a T2 section with the bottom flange’s middle center at the origin (0, 0), with -four parameters defining dimensions. See Nastran documentation 1 2 3 4 for more -details. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Width (x) of T2-section

  • -
  • DIM2 (float) – Depth (y) of T2-section

  • -
  • DIM3 (float) – Thickness of bottom flange

  • -
  • DIM4 (float) – Thickness of web

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a T2 cross-section with a depth of 4.0 and width of 3.0, and -generates a mesh with a maximum triangular area of 0.005:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.T2Section(DIM1=3.0, DIM2=4.0, DIM3=0.375, DIM4=0.5)
-mesh = geometry.create_mesh(mesh_sizes=[0.005])
-
-
-
-../_images/t2_geometry.png -

T2 section geometry.

-
-
-../_images/t2_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

TUBESection Class

-
-
-class sectionproperties.pre.nastran_sections.TUBESection(DIM1, DIM2, n, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a circular tube section with the center at the origin (0, 0), with two -parameters defining dimensions. See Nastran documentation 1 2 3 4 for more -details. Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Outer radius of the circular tube section

  • -
  • DIM2 (float) – Inner radius of the circular tube section

  • -
  • n (int) – Number of points discretising the circle

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a circular tube cross-section with an outer radius of 3.0 and an -inner radius of 2.5, and generates a mesh with 37 points discretizing the boundaries and a -maximum triangular area of 0.01:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.TUBESection(DIM1=3.0, DIM2=2.5, n=37)
-mesh = geometry.create_mesh(mesh_sizes=[0.01])
-
-
-
-../_images/tube_geometry.png -

TUBE section geometry.

-
-
-../_images/tube_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

TUBE2Section Class

-
-
-class sectionproperties.pre.nastran_sections.TUBE2Section(DIM1, DIM2, n, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a circular TUBE2 section with the center at the origin (0, 0), with two -parameters defining dimensions. See MSC Nastran documentation 1 for more details. Added by -JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Outer radius of the circular tube section

  • -
  • DIM2 (float) – Thickness of wall

  • -
  • n (int) – Number of points discretising the circle

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a ciruclar TUBE2 cross-section with an outer radius of 3.0 and a -wall thickness of 0.5, and generates a mesh with 37 point discritizing the boundary and a -maximum triangular area of 0.01:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.TUBE2Section(DIM1=3.0, DIM2=0.5, n=37)
-mesh = geometry.create_mesh(mesh_sizes=[0.01])
-
-
-
-../_images/tube2_geometry.png -

TUBE2 section geometry.

-
-
-../_images/tube2_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

ZSection Class

-
-
-class sectionproperties.pre.nastran_sections.ZSection(DIM1, DIM2, DIM3, DIM4, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a Z section with the web’s middle center at the origin (0, 0), with four -parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. -Added by JohnDN90.

-
-
Parameters
-
    -
  • DIM1 (float) – Width (x) of horizontal members

  • -
  • DIM2 (float) – Thickness of web

  • -
  • DIM3 (float) – Spacing between horizontal members (length of web)

  • -
  • DIM4 (float) – Depth (y) of Z-section

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a rectangular cross-section with a depth of 4.0 and width of -2.75, and generates a mesh with a maximum triangular area of 0.005:

-
import sectionproperties.pre.nastran_sections as nsections
-
-geometry = nsections.ZSection(DIM1=1.125, DIM2=0.5, DIM3=3.5, DIM4=4.0)
-mesh = geometry.create_mesh(mesh_sizes=[0.005])
-
-
-
-../_images/z_geometry.png -

Z section geometry.

-
-
-../_images/z_mesh.png -

Mesh generated from the above geometry.

-
-
-
-getStressPoints(shift=0.0, 0.0)[source]
-

Returns the coordinates of the stress evaluation points relative to the origin of the -cross-section. The shift parameter can be used to make the coordinates relative to the -centroid or the shear center.

-
-
Parameters
-

shift (tuple(float, float)) – Vector that shifts the cross-section by (x, y)

-
-
Returns
-

Stress evaluation points relative to shifted origin - C, D, E, F

-
-
-
- -
- -
-
-

References

-
-
1(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22)
-

MSC Nastran Quick Reference Guide 2012, -PBEAML - Simple Beam Cross-Section Property, pp. 2890-2894 -https://simcompanion.mscsoftware.com/infocenter/index?page=content&id=DOC10351

-
-
2(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
-

Siemens NX Nastran 12 Quick Reference Guide, -PBEAML, pp. 16-59 - 16-62 -https://docs.plm.automation.siemens.com/data_services/resources/nxnastran/12/help/tdoc/en_US/pdf/QRG.pdf

-
-
3(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
-

AutoDesk Nastran Online Documentation, Nastran Reference Guide, -Section 4 - Bulk Data, PBEAML -http://help.autodesk.com/view/NSTRN/2018/ENU/?guid=GUID-B7044BA7-3C26-49DA-9EE7-DA7505FD4B2C

-
-
4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18)
-

Users Reference Manual for the MYSTRAN General Purpose Finite Element Structural Analysis Computer Program, -Jan. 2019, Section 6.4.1.53 - PBARL, pp. 154-156 -https://www.mystran.com/Executable/MYSTRAN-Users-Manual.pdf

-
-
5(1,2,3,4,5)
-

Astros Enhancements - Volume III - Astros Theoretical Manual, -Section 5.1.3.2, pp. 56 -https://apps.dtic.mil/dtic/tr/fulltext/u2/a308134.pdf

-
-
-
-
-
-
-

Analysis Package

-
-

cross_section Module

-
-

CrossSection Class

-
-
-
-class sectionproperties.analysis.cross_section.CrossSection(geometry, mesh, materials=None, time_info=False)[source]
-

Bases: object

-

Class for structural cross-sections.

-

Stores the finite element geometry, mesh and material information and provides methods to -compute the cross-section properties. The element type used in this program is the six-noded -quadratic triangular element.

-

The constructor extracts information from the provided mesh object and creates and stores the -corresponding Tri6 finite element objects.

-
-
Parameters
-
    -
  • geometry (Geometry) – Cross-section geometry object used to generate the mesh

  • -
  • mesh (meshpy.triangle.MeshInfo) – Mesh object returned by meshpy

  • -
  • materials (list[Material]) – A list of material properties corresponding to various regions in the -geometry and mesh. Note that if materials are specified, the number of material objects -ust equal the number of regions in the geometry. If no materials are specified, only a -purely geometric analysis can take place, and all regions will be assigned a default -material with an elastic modulus and yield strength equal to 1, and a Poisson’s ratio -equal to 0.

  • -
  • time_info (bool) – If set to True, a detailed description of the computation and the time -cost is printed to the terminal.

  • -
-
-
-

The following example creates a CrossSection -object of a 100D x 50W rectangle using a mesh size of 5:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.RectangularSection(d=100, b=50)
-mesh = geometry.create_mesh(mesh_sizes=[5])
-section = CrossSection(geometry, mesh)
-
-
-

The following example creates a 100D x 50W rectangle, with the top half of the section -comprised of timber and the bottom half steel. The timber section is meshed with a maximum area -of 10 and the steel section mesh with a maximum area of 5:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.pre.pre import Material
-from sectionproperties.analysis.cross_section import CrossSection
-
-geom_steel = sections.RectangularSection(d=50, b=50)
-geom_timber = sections.RectangularSection(d=50, b=50, shift=[0, 50])
-geometry = sections.MergedSection([geom_steel, geom_timber])
-geometry.clean_geometry()
-
-mesh = geometry.create_mesh(mesh_sizes=[5, 10])
-
-steel = Material(name='Steel', elastic_modulus=200e3, poissons_ratio=0.3,
-    yield_strength=250, color='grey'
-)
-timber = Material(name='Timber', elastic_modulus=8e3, poissons_ratio=0.35,
-    yield_strength=20, color='burlywood'
-)
-
-section = CrossSection(geometry, mesh, [steel, timber])
-section.plot_mesh(materials=True, alpha=0.5)
-
-
-
-
Variables
-
    -
  • elements (list[Tri6]) – List of finite element objects describing the cross-section mesh

  • -
  • num_nodes (int) – Number of nodes in the finite element mesh

  • -
  • geometry (Geometry) – Cross-section geometry object used to generate the mesh

  • -
  • mesh (meshpy.triangle.MeshInfo) – Mesh object returned by meshpy

  • -
  • mesh_nodes (numpy.ndarray) – Array of node coordinates from the mesh

  • -
  • mesh_elements (numpy.ndarray) – Array of connectivities from the mesh

  • -
  • mesh_attributes (numpy.ndarray) – Array of attributes from the mesh

  • -
  • materials – List of materials

  • -
  • material_groups – List of objects containing the elements in each defined material

  • -
  • section_props (SectionProperties) – Class to store calculated section properties

  • -
-
-
Raises
-

AssertionError – If the number of materials does not equal the number of regions

-
-
-
-
-assemble_torsion(lg=True)[source]
-

Assembles stiffness matrices to be used for the computation of warping properties and -the torsion load vector (f_torsion). Both a regular (k) and Lagrangian multiplier (k_lg) -stiffness matrix are returned. The stiffness matrices are assembled using the sparse COO -format and returned in the sparse CSC format.

-
-
Parameters
-

lg (bool) – Whether or not to calculate the Lagrangian multiplier stiffness matrix

-
-
Returns
-

Regular stiffness matrix, Lagrangian multiplier stiffness matrix and torsion load -vector (k, k_lg, f_torsion)

-
-
Return type
-

tuple(scipy.sparse.csc_matrix, scipy.sparse.csc_matrix, -numpy.ndarray)

-
-
-
- -
-
-calculate_frame_properties(time_info=False, solver_type='direct')[source]
-

Calculates and returns the properties required for a frame analysis. The properties are -also stored in the SectionProperties -object contained in the section_props class variable.

-
-
Parameters
-
    -
  • time_info (bool) – If set to True, a detailed description of the computation and the -time cost is printed to the terminal.

  • -
  • solver_type (string) – Solver used for solving systems of linear equations, either -using the ‘direct’ method or ‘cgs’ iterative method

  • -
-
-
Returns
-

Cross-section properties to be used for a frame analysis (area, ixx, iyy, ixy, j, -phi)

-
-
Return type
-

tuple(float, float, float, float, float, float)

-
-
-

The following section properties are calculated:

-
    -
  • Cross-sectional area (area)

  • -
  • Second moments of area about the centroidal axis (ixx, iyy, ixy)

  • -
  • Torsion constant (j)

  • -
  • Principal axis angle (phi)

  • -
-

If materials are specified for the cross-section, the area, second moments of area and -torsion constant are elastic moulus weighted.

-

The following example demonstrates the use of this method:

-
section = CrossSection(geometry, mesh)
-(area, ixx, iyy, ixy, j, phi) = section.calculate_frame_properties()
-
-
-
- -
-
-calculate_geometric_properties(time_info=False)[source]
-

Calculates the geometric properties of the cross-section and stores them in the -SectionProperties object contained in -the section_props class variable.

-
-
Parameters
-

time_info (bool) – If set to True, a detailed description of the computation and the -time cost is printed to the terminal.

-
-
-

The following geometric section properties are calculated:

-
    -
  • Cross-sectional area

  • -
  • Cross-sectional perimeter

  • -
  • Modulus weighted area (axial rigidity)

  • -
  • First moments of area

  • -
  • Second moments of area about the global axis

  • -
  • Second moments of area about the centroidal axis

  • -
  • Elastic centroid

  • -
  • Centroidal section moduli

  • -
  • Radii of gyration

  • -
  • Principal axis properties

  • -
-

If materials are specified for the cross-section, the moments of area and section moduli -are elastic modulus weighted.

-

The following example demonstrates the use of this method:

-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-
-
-
- -
-
-calculate_plastic_properties(time_info=False, verbose=False, debug=False)[source]
-

Calculates the plastic properties of the cross-section and stores the, in the -SectionProperties object contained in -the section_props class variable.

-
-
Parameters
-
    -
  • time_info (bool) – If set to True, a detailed description of the computation and the -time cost is printed to the terminal.

  • -
  • verbose (bool) – If set to True, the number of iterations required for each plastic -axis is printed to the terminal.

  • -
  • debug (bool) – If set to True, the geometry is plotted each time a new mesh is -generated by the plastic centroid algorithm.

  • -
-
-
-

The following warping section properties are calculated:

-
    -
  • Plastic centroid for bending about the centroidal and principal axes

  • -
  • Plastic section moduli for bending about the centroidal and principal axes

  • -
  • Shape factors for bending about the centroidal and principal axes

  • -
-

If materials are specified for the cross-section, the plastic section moduli are displayed -as plastic moments (i.e \(M_p = f_y S\)) and the shape factors are not calculated.

-

Note that the geometric properties must be calculated before the plastic properties are -calculated:

-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-
-
-
-
Raises
-

RuntimeError – If the geometric properties have not been calculated prior to calling -this method

-
-
-
- -
-
-calculate_stress(N=0, Vx=0, Vy=0, Mxx=0, Myy=0, M11=0, M22=0, Mzz=0, time_info=False)[source]
-

Calculates the cross-section stress resulting from design actions and returns a -StressPost object allowing -post-processing of the stress results.

-
-
Parameters
-
    -
  • N (float) – Axial force

  • -
  • Vx (float) – Shear force acting in the x-direction

  • -
  • Vy (float) – Shear force acting in the y-direction

  • -
  • Mxx (float) – Bending moment about the centroidal xx-axis

  • -
  • Myy (float) – Bending moment about the centroidal yy-axis

  • -
  • M11 (float) – Bending moment about the centroidal 11-axis

  • -
  • M22 (float) – Bending moment about the centroidal 22-axis

  • -
  • Mzz (float) – Torsion moment about the centroidal zz-axis

  • -
  • time_info (bool) – If set to True, a detailed description of the computation and the -time cost is printed to the terminal.

  • -
-
-
Returns
-

Object for post-processing cross-section stresses

-
-
Return type
-

StressPost

-
-
-

Note that a geometric and warping analysis must be performed before a stress analysis is -carried out:

-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(N=1e3, Vy=3e3, Mxx=1e6)
-
-
-
-
Raises
-

RuntimeError – If a geometric and warping analysis have not been performed prior to -calling this method

-
-
-
- -
-
-calculate_warping_properties(time_info=False, solver_type='direct')[source]
-

Calculates all the warping properties of the cross-section and stores them in the -SectionProperties object contained in -the section_props class variable.

-
-
Parameters
-
    -
  • time_info (bool) – If set to True, a detailed description of the computation and the -time cost is printed to the terminal.

  • -
  • solver_type (string) – Solver used for solving systems of linear equations, either -using the ‘direct’ method or ‘cgs’ iterative method

  • -
-
-
-

The following warping section properties are calculated:

-
    -
  • Torsion constant

  • -
  • Shear centre

  • -
  • Shear area

  • -
  • Warping constant

  • -
  • Monosymmetry constant

  • -
-

If materials are specified, the values calculated for the torsion constant, warping -constant and shear area are elastic modulus weighted.

-

Note that the geometric properties must be calculated first for the calculation of the -warping properties to be correct:

-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-
-
-
-
Raises
-

RuntimeError – If the geometric properties have not been -calculated prior to calling this method

-
-
-
- -
-
-display_mesh_info()[source]
-

Prints mesh statistics (number of nodes, elements and regions) to the command window.

-

The following example displays the mesh statistics for a Tee section merged from two -rectangles:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-rec1 = sections.RectangularSection(d=100, b=25, shift=[-12.5, 0])
-rec2 = sections.RectangularSection(d=25, b=100, shift=[-50, 100])
-geometry = sections.MergedSection([rec1, rec2])
-mesh = geometry.create_mesh(mesh_sizes=[5, 2.5])
-section = CrossSection(geometry, mesh)
-section.display_mesh_info()
-
->>>Mesh Statistics:
->>>--4920 nodes
->>>--2365 elements
->>>--2 regions
-
-
-
- -
-
-display_results(fmt='8.6e')[source]
-

Prints the results that have been calculated to the terminal.

-
-
Parameters
-

fmt (string) – Number formatting string

-
-
-

The following example displays the geometric section properties for a 100D x 50W rectangle -with three digits after the decimal point:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.RectangularSection(d=100, b=50)
-mesh = geometry.create_mesh(mesh_sizes=[5])
-
-section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-
-section.display_results(fmt='.3f')
-
-
-
- -
-
-get_As()[source]
-
-
Returns
-

Shear area for loading about the centroidal axis (A_sx, A_sy)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-(A_sx, A_sy) = section.get_As()
-
-
-
- -
-
-get_As_p()[source]
-
-
Returns
-

Shear area for loading about the principal bending axis (A_s11, A_s22)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-(A_s11, A_s22) = section.get_As_p()
-
-
-
- -
-
-get_area()[source]
-
-
Returns
-

Cross-section area

-
-
Return type
-

float

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-area = section.get_area()
-
-
-
- -
-
-get_beta()[source]
-
-
Returns
-

Monosymmetry constant for bending about both global axes (beta_x_plus, -beta_x_minus, beta_y_plus, beta_y_minus). The plus value relates to the top flange -in compression and the minus value relates to the bottom flange in compression.

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-(beta_x_plus, beta_x_minus, beta_y_plus, beta_y_minus) = section.get_beta()
-
-
-
- -
-
-get_beta_p()[source]
-
-
Returns
-

Monosymmetry constant for bending about both principal axes (beta_11_plus, -beta_11_minus, beta_22_plus, beta_22_minus). The plus value relates to the top -flange in compression and the minus value relates to the bottom flange in -compression.

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-(beta_11_plus, beta_11_minus, beta_22_plus, beta_22_minus) = section.get_beta_p()
-
-
-
- -
-
-get_c()[source]
-
-
Returns
-

Elastic centroid (cx, cy)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(cx, cy) = section.get_c()
-
-
-
- -
-
-get_ea()[source]
-
-
Returns
-

Modulus weighted area (axial rigidity)

-
-
Return type
-

float

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-ea = section.get_ea()
-
-
-
- -
-
-get_gamma()[source]
-
-
Returns
-

Warping constant

-
-
Return type
-

float

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-gamma = section.get_gamma()
-
-
-
- -
-
-get_ic()[source]
-
-
Returns
-

Second moments of area centroidal axis (ixx_c, iyy_c, ixy_c)

-
-
Return type
-

tuple(float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(ixx_c, iyy_c, ixy_c) = section.get_ic()
-
-
-
- -
-
-get_ig()[source]
-
-
Returns
-

Second moments of area about the global axis (ixx_g, iyy_g, ixy_g)

-
-
Return type
-

tuple(float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(ixx_g, iyy_g, ixy_g) = section.get_ig()
-
-
-
- -
-
-get_ip()[source]
-
-
Returns
-

Second moments of area about the principal axis (i11_c, i22_c)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(i11_c, i22_c) = section.get_ip()
-
-
-
- -
-
-get_j()[source]
-
-
Returns
-

St. Venant torsion constant

-
-
Return type
-

float

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-j = section.get_j()
-
-
-
- -
-
-get_pc()[source]
-
-
Returns
-

Centroidal axis plastic centroid (x_pc, y_pc)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-(x_pc, y_pc) = section.get_pc()
-
-
-
- -
-
-get_pc_p()[source]
-
-
Returns
-

Principal bending axis plastic centroid (x11_pc, y22_pc)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-(x11_pc, y22_pc) = section.get_pc_p()
-
-
-
- -
-
-get_perimeter()[source]
-
-
Returns
-

Cross-section perimeter

-
-
Return type
-

float

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-perimeter = section.get_perimeter()
-
-
-
- -
-
-get_phi()[source]
-
-
Returns
-

Principal bending axis angle

-
-
Return type
-

float

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-phi = section.get_phi()
-
-
-
- -
-
-get_q()[source]
-
-
Returns
-

First moments of area about the global axis (qx, qy)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(qx, qy) = section.get_q()
-
-
-
- -
-
-get_rc()[source]
-
-
Returns
-

Radii of gyration about the centroidal axis (rx, ry)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(rx, ry) = section.get_rc()
-
-
-
- -
-
-get_rp()[source]
-
-
Returns
-

Radii of gyration about the principal axis (r11, r22)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(r11, r22) = section.get_rp()
-
-
-
- -
-
-get_s()[source]
-
-
Returns
-

Plastic section moduli about the centroidal axis (sxx, syy)

-
-
Return type
-

tuple(float, float)

-
-
-

If material properties have been specified, returns the plastic moment \(M_p = f_y S\).

-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-(sxx, syy) = section.get_s()
-
-
-
- -
-
-get_sc()[source]
-
-
Returns
-

Centroidal axis shear centre (elasticity approach) (x_se, y_se)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-(x_se, y_se) = section.get_sc()
-
-
-
- -
-
-get_sc_p()[source]
-
-
Returns
-

Principal axis shear centre (elasticity approach) (x11_se, y22_se)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-(x11_se, y22_se) = section.get_sc_p()
-
-
-
- -
-
-get_sc_t()[source]
-
-
Returns
-

Centroidal axis shear centre (Trefftz’s approach) (x_st, y_st)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-(x_st, y_st) = section.get_sc_t()
-
-
-
- -
-
-get_sf()[source]
-
-
Returns
-

Centroidal axis shape factors with respect to the top and bottom fibres -(sf_xx_plus, sf_xx_minus, sf_yy_plus, sf_yy_minus)

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-(sf_xx_plus, sf_xx_minus, sf_yy_plus, sf_yy_minus) = section.get_sf()
-
-
-
- -
-
-get_sf_p()[source]
-
-
Returns
-

Principal bending axis shape factors with respect to the top and bottom fibres -(sf_11_plus, sf_11_minus, sf_22_plus, sf_22_minus)

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-(sf_11_plus, sf_11_minus, sf_22_plus, sf_22_minus) = section.get_sf_p()
-
-
-
- -
-
-get_sp()[source]
-
-
Returns
-

Plastic section moduli about the principal bending axis (s11, s22)

-
-
Return type
-

tuple(float, float)

-
-
-

If material properties have been specified, returns the plastic moment -\(M_p = f_y S\).

-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-(s11, s22) = section.get_sp()
-
-
-
- -
-
-get_z()[source]
-
-
Returns
-

Elastic section moduli about the centroidal axis with respect to the top and -bottom fibres (zxx_plus, zxx_minus, zyy_plus, zyy_minus)

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(zxx_plus, zxx_minus, zyy_plus, zyy_minus) = section.get_z()
-
-
-
- -
-
-get_zp()[source]
-
-
Returns
-

Elastic section moduli about the principal axis with respect to the top and bottom -fibres (z11_plus, z11_minus, z22_plus, z22_minus)

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(z11_plus, z11_minus, z22_plus, z22_minus) = section.get_zp()
-
-
-
- -
-
-plot_centroids(pause=True)[source]
-

Plots the elastic centroid, the shear centre, the plastic centroids and the principal -axis, if they have been calculated, on top of the finite element mesh.

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example analyses a 200 PFC section and displays a plot of -the centroids:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.PfcSection(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-
-section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-section.calculate_plastic_properties()
-
-section.plot_centroids()
-
-
-
-../_images/pfc_centroids.png -

Plot of the centroids generated by the above example.

-
-

The following example analyses a 150x90x12 UA section and displays a plot of the -centroids:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-
-section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-section.calculate_plastic_properties()
-
-section.plot_centroids()
-
-
-
-../_images/angle_centroids.png -

Plot of the centroids generated by the above example.

-
-
- -
-
-plot_mesh(ax=None, pause=True, alpha=1, materials=False, mask=None)[source]
-

Plots the finite element mesh. If no axes object is supplied a new figure and axis is -created.

-
-
Parameters
-
    -
  • ax (matplotlib.axes.Axes) – Axes object on which the mesh is plotted

  • -
  • pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

  • -
  • alpha (float) – Transparency of the mesh outlines: \(0 \leq \alpha \leq 1\)

  • -
  • materials (bool) – If set to true and material properties have been provided to the -CrossSection object, shades the -elements with the specified material colours

  • -
  • mask (list[bool]) – Mask array, of length num_nodes, to mask out triangles

  • -
-
-
-

The following example plots the mesh generated for the second example -listed under the CrossSection object -definition:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.pre.pre import Material
-from sectionproperties.analysis.cross_section import CrossSection
-
-geom_steel = sections.RectangularSection(d=50, b=50)
-geom_timber = sections.RectangularSection(d=50, b=50, shift=[50, 0])
-geometry = sections.MergedSection([geom_steel, geom_timber])
-geometry.clean_geometry()
-
-mesh = geometry.create_mesh(mesh_sizes=[5, 10])
-
-steel = Material(
-    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=250,
-    color='grey'
-)
-timber = Material(
-    name='Timber', elastic_modulus=8e3, poissons_ratio=0.35, yield_strength=20,
-    color='burlywood'
-)
-
-section = CrossSection(geometry, mesh, [steel, timber])
-section.plot_mesh(materials=True, alpha=0.5)
-
-
-
-../_images/composite_mesh.png -

Finite element mesh generated by the above example.

-
-
- -
- -
-
-
-

PlasticSection Class

-
-
-
-class sectionproperties.analysis.cross_section.PlasticSection(geometry, materials, debug)[source]
-

Bases: object

-

Class for the plastic analysis of cross-sections.

-

Stores the finite element geometry and material information and provides methods to compute the -plastic section properties.

-
-
Parameters
-
    -
  • geometry (Geometry) – Cross-section geometry object

  • -
  • materials (list[Material]) – A list of material properties corresponding to various regions in the -geometry and mesh.

  • -
  • debug (bool) – If set to True, the geometry is plotted each time a new mesh is generated by -the plastic centroid algorithm.

  • -
-
-
Variables
-
    -
  • geometry (Geometry) – Deep copy of the cross-section geometry object provided to the constructor

  • -
  • materials (list[Material]) – A list of material properties corresponding to various regions in the geometry -and mesh.

  • -
  • debug (bool) – If set to True, the geometry is plotted each time a new mesh is generated by -the plastic centroid algorithm.

  • -
  • mesh (meshpy.triangle.MeshInfo) – Mesh object returned by meshpy

  • -
  • mesh_nodes (numpy.ndarray) – Array of node coordinates from the mesh

  • -
  • mesh_elements (numpy.ndarray) – Array of connectivities from the mesh

  • -
  • elements (list[Tri6]) – List of finite element objects describing the cross-section mesh

  • -
  • f_top (float) – Current force in the top region

  • -
  • c_top – Centroid of the force in the top region (c_top_x, c_top_y)

  • -
  • c_bot – Centroid of the force in the bottom region (c_bot_x, c_bot_y)

  • -
-
-
-
-
-add_line(geometry, line)[source]
-

Adds a line a geometry object. Finds the intersection points of the line with the -current facets and splits the existing facets to accomodate the new line.

-
-
Parameters
-
    -
  • geometry (Geometry) – Cross-section geometry object used to generate the mesh

  • -
  • line (list[numpy.ndarray, numpy.ndarray]) – A point p and a unit vector u defining a line to add to the mesh -(line: p -> p + u)

  • -
-
-
-
- -
-
-calculate_centroid(elements)[source]
-

Calculates the elastic centroid from a list of finite elements.

-
-
Parameters
-

elements (list[Tri6]) – A list of Tri6 finite elements.

-
-
Returns
-

A tuple containing the x and y location of the elastic centroid.

-
-
Return type
-

tuple(float, float)

-
-
-
- -
-
-calculate_extreme_fibres(angle)[source]
-

Calculates the locations of the extreme fibres along and perpendicular to the axis -specified by ‘angle’ using the elements stored in self.elements.

-
-
Parameters
-

angle (float) – Angle (in radians) along which to calculate the extreme fibre locations

-
-
Returns
-

The location of the extreme fibres parallel (u) and perpendicular (v) to the axis -(u_min, u_max, v_min, v_max)

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
- -
-
-calculate_plastic_force(elements, u, p)[source]
-

Sums the forces above and below the axis defined by unit vector u and point p. Also -returns the force centroid of the forces above and below the axis.

-
-
Parameters
-
    -
  • elements (list[Tri6]) – A list of Tri6 finite elements.

  • -
  • u (numpy.ndarray) – Unit vector defining the direction of the axis

  • -
  • p (numpy.ndarray) – Point on the axis

  • -
-
-
Returns
-

Force in the top and bottom areas (f_top, f_bot)

-
-
Return type
-

tuple(float, float)

-
-
-
- -
-
-calculate_plastic_properties(cross_section, verbose)[source]
-

Calculates the location of the plastic centroid with respect to the centroidal and -principal bending axes, the plastic section moduli and shape factors and stores the results -to the supplied CrossSection object.

-
-
Parameters
-
    -
  • cross_section (CrossSection) – Cross section object that uses the same geometry and materials -specified in the class constructor

  • -
  • verbose (bool) – If set to True, the number of iterations required for each plastic -axis is printed to the terminal.

  • -
-
-
-
- -
-
-check_convergence(root_result, axis)[source]
-

Checks that the function solver converged and if not, raises a helpful error.

-
-
Parameters
-
    -
  • root_result (scipy.optimize.RootResults) – Result object from the root finder

  • -
  • axis (string) – Axis being considered by the function sovler

  • -
-
-
Raises
-

RuntimeError – If the function solver did not converge

-
-
-
- -
-
-create_plastic_mesh(new_line=None)[source]
-

Generates a triangular mesh of a deep copy of the geometry stored in self.geometry. -Optionally, a line can be added to the copied geometry, which is defined by a point p and -a unit vector u.

-
-
Parameters
-
    -
  • new_line (list[numpy.ndarray, numpy.ndarray]) – A point p and a unit vector u defining a line to add to the mesh -(new_line: p -> p + u) [p, u]

  • -
  • mesh (meshpy.triangle.MeshInfo) – Mesh object returned by meshpy

  • -
-
-
-
- -
-
-evaluate_force_eq(d, u, u_p, verbose)[source]
-

Given a distance d from the centroid to an axis (defined by unit vector u), creates -a mesh including the new and axis and calculates the force equilibrium. The resultant -force, as a ratio of the total force, is returned.

-
-
Parameters
-
    -
  • d (float) – Distance from the centroid to current axis

  • -
  • u (numpy.ndarray) – Unit vector defining the direction of the axis

  • -
  • u_p (numpy.ndarray) – Unit vector perpendicular to the direction of the axis

  • -
  • verbose (bool) – If set to True, the number of iterations required for each plastic -axis is printed to the terminal.

  • -
-
-
Returns
-

The force equilibrium norm

-
-
Return type
-

float

-
-
-
- -
-
-get_elements(mesh)[source]
-

Extracts finite elements from the provided mesh and returns Tri6 finite elements with -their associated material properties.

-
-
Parameters
-

mesh (meshpy.triangle.MeshInfo) – Mesh object returned by meshpy

-
-
Returns
-

A tuple containing an array of the nodes locations, element indicies and a list of -the finite elements.

-
-
Return type
-

tuple(numpy.ndarray, numpy.ndarray, -list[Tri6])

-
-
-
- -
-
-pc_algorithm(u, dlim, axis, verbose)[source]
-

An algorithm used for solving for the location of the plastic centroid. The algorithm -searches for the location of the axis, defined by unit vector u and within the section -depth, that satisfies force equilibrium.

-
-
Parameters
-
    -
  • u (numpy.ndarray) – Unit vector defining the direction of the axis

  • -
  • dlim (list[float, float]) – List [dmax, dmin] containing the distances from the centroid to the extreme -fibres perpendicular to the axis

  • -
  • axis (int) – The current axis direction: 1 (e.g. x or 11) or 2 (e.g. y or 22)

  • -
  • verbose (bool) – If set to True, the number of iterations required for each plastic -axis is printed to the terminal.

  • -
-
-
Returns
-

The distance to the plastic centroid axis d, the result object r, the force in -the top of the section f_top and the location of the centroids of the top and bottom -areas c_top and c_bottom

-
-
Return type
-

tuple(float, scipy.optimize.RootResults, float, list[float, float], -list[float, float])

-
-
-
- -
-
-plot_mesh(nodes, elements, element_list, materials)[source]
-

Watered down implementation of the CrossSection method to plot the finite element mesh, -showing material properties.

-
- -
-
-point_within_element(pt)[source]
-

Determines whether a point lies within an element in the mesh stored in -self.mesh_elements.

-
-
Parameters
-

pt (numpy.ndarray) – Point to check

-
-
Returns
-

Whether the point lies within an element

-
-
Return type
-

bool

-
-
-
- -
-
-print_verbose(d, root_result, axis)[source]
-

Prints information related to the function solver convergence to the terminal.

-
-
Parameters
-
    -
  • d (float) – Location of the plastic centroid axis

  • -
  • root_result (scipy.optimize.RootResults) – Result object from the root finder

  • -
  • axis (string) – Axis being considered by the function sovler

  • -
-
-
-
- -
-
-rebuild_parent_facet(geometry, fct_idx, pt_idx)[source]
-

Splits and rebuilds a facet at a given point.

-
-
Parameters
-
    -
  • geometry (Geometry) – Cross-section geometry object used to generate the mesh

  • -
  • fct_idx (int) – Index of the facet to be split

  • -
  • pt_idx (int) – Index of the point to insert into the facet

  • -
-
-
-
- -
- -
-
-
-

StressPost Class

-
-
-class sectionproperties.analysis.cross_section.StressPost(cross_section)[source]
-

Bases: object

-

Class for post-processing finite element stress results.

-

A StressPost object is created when a stress analysis is carried out and is returned as an -object to allow post-processing of the results. The StressPost object creates a deep copy of -the MaterialGroups within the cross-section to allow the calculation of stresses for each -material. Methods for post-processing the calculated stresses are provided.

-
-
Parameters
-

cross_section (CrossSection) – Cross section object for stress calculation

-
-
Variables
-
    -
  • cross_section (CrossSection) – Cross section object for stress calculation

  • -
  • material_groups (list[MaterialGroup]) – A deep copy of the cross_section material groups to allow a new stress -analysis

  • -
-
-
-
-
-get_stress()[source]
-

Returns the stresses within each material belonging to the current -StressPost object.

-
-
Returns
-

A list of dictionaries containing the cross-section stresses for each material.

-
-
Return type
-

list[dict]

-
-
-

A dictionary is returned for each material in the cross-section, containing the following -keys and values:

-
    -
  • ‘Material’: Material name

  • -
  • ‘sig_zz_n’: Normal stress \(\sigma_{zz,N}\) resulting from the axial load \(N\)

  • -
  • ‘sig_zz_mxx’: Normal stress \(\sigma_{zz,Mxx}\) resulting from the bending moment -\(M_{xx}\)

  • -
  • ‘sig_zz_myy’: Normal stress \(\sigma_{zz,Myy}\) resulting from the bending moment -\(M_{yy}\)

  • -
  • ‘sig_zz_m11’: Normal stress \(\sigma_{zz,M11}\) resulting from the bending moment -\(M_{11}\)

  • -
  • ‘sig_zz_m22’: Normal stress \(\sigma_{zz,M22}\) resulting from the bending moment -\(M_{22}\)

  • -
  • ‘sig_zz_m’: Normal stress \(\sigma_{zz,\Sigma M}\) resulting from all bending -moments

  • -
  • ‘sig_zx_mzz’: x-component of the shear stress \(\sigma_{zx,Mzz}\) resulting from -the torsion moment

  • -
  • ‘sig_zy_mzz’: y-component of the shear stress \(\sigma_{zy,Mzz}\) resulting from -the torsion moment

  • -
  • ‘sig_zxy_mzz’: Resultant shear stress \(\sigma_{zxy,Mzz}\) resulting from the -torsion moment

  • -
  • ‘sig_zx_vx’: x-component of the shear stress \(\sigma_{zx,Vx}\) resulting from -the shear force \(V_{x}\)

  • -
  • ‘sig_zy_vx’: y-component of the shear stress \(\sigma_{zy,Vx}\) resulting from -the shear force \(V_{x}\)

  • -
  • ‘sig_zxy_vx’: Resultant shear stress \(\sigma_{zxy,Vx}\) resulting from the shear -force \(V_{x}\)

  • -
  • ‘sig_zx_vy’: x-component of the shear stress \(\sigma_{zx,Vy}\) resulting from -the shear force \(V_{y}\)

  • -
  • ‘sig_zy_vy’: y-component of the shear stress \(\sigma_{zy,Vy}\) resulting from -the shear force \(V_{y}\)

  • -
  • ‘sig_zxy_vy’: Resultant shear stress \(\sigma_{zxy,Vy}\) resulting from the shear -force \(V_{y}\)

  • -
  • ‘sig_zx_v’: x-component of the shear stress \(\sigma_{zx,\Sigma V}\) resulting -from all shear forces

  • -
  • ‘sig_zy_v’: y-component of the shear stress \(\sigma_{zy,\Sigma V}\) resulting -from all shear forces

  • -
  • ‘sig_zxy_v’: Resultant shear stress \(\sigma_{zxy,\Sigma V}\) resulting from all -shear forces

  • -
  • ‘sig_zz’: Combined normal stress \(\sigma_{zz}\) resulting from all actions

  • -
  • ‘sig_zx’: x-component of the shear stress \(\sigma_{zx}\) resulting from all -actions

  • -
  • ‘sig_zy’: y-component of the shear stress \(\sigma_{zy}\) resulting from all -actions

  • -
  • ‘sig_zxy’: Resultant shear stress \(\sigma_{zxy}\) resulting from all actions

  • -
  • ‘sig_vm’: von Mises stress \(\sigma_{vM}\) resulting from all actions

  • -
-

The following example returns the normal stress within a 150x90x12 UA section resulting -from an axial force of 10 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(N=10e3)
-
-stresses = stress_post.get_stress()
-print('Material: {0}'.format(stresses[0]['Material']))
-print('Axial Stresses: {0}'.format(stresses[0]['sig_zz_n']))
-
-$ Material: default
-$ Axial Stresses: [3.6402569 3.6402569 3.6402569 ... 3.6402569 3.6402569 3.6402569]
-
-
-
- -
-
-plot_stress_contour(sigs, title, pause)[source]
-

Plots filled stress contours over the finite element mesh.

-
-
Parameters
-
    -
  • sigs (list[numpy.ndarray]) – List of nodal stress values for each material

  • -
  • title (string) – Plot title

  • -
  • pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

  • -
-
-
-
- -
-
-plot_stress_m11_zz(pause=True)[source]
-

Produces a contour plot of the normal stress \(\sigma_{zz,M11}\) resulting from the -bending moment \(M_{11}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the normal stress within a 150x90x12 UA section resulting from -a bending moment about the 11-axis of 5 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(M11=5e6)
-
-stress_post.plot_stress_m11_zz()
-
-
-
-../_images/stress_m11_zz.png -

Contour plot of the bending stress.

-
-
- -
-
-plot_stress_m22_zz(pause=True)[source]
-

Produces a contour plot of the normal stress \(\sigma_{zz,M22}\) resulting from the -bending moment \(M_{22}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the normal stress within a 150x90x12 UA section resulting from -a bending moment about the 22-axis of 2 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(M22=5e6)
-
-stress_post.plot_stress_m22_zz()
-
-
-
-../_images/stress_m22_zz.png -

Contour plot of the bending stress.

-
-
- -
-
-plot_stress_m_zz(pause=True)[source]
-

Produces a contour plot of the normal stress \(\sigma_{zz,\Sigma M}\) resulting from -all bending moments \(M_{xx} + M_{yy} + M_{11} + M_{22}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the normal stress within a 150x90x12 UA section resulting from -a bending moment about the x-axis of 5 kN.m, a bending moment about the y-axis of 2 kN.m -and a bending moment of 3 kN.m about the 11-axis:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mxx=5e6, Myy=2e6, M11=3e6)
-
-stress_post.plot_stress_m_zz()
-
-
-
-../_images/stress_m_zz.png -

Contour plot of the bending stress.

-
-
- -
-
-plot_stress_mxx_zz(pause=True)[source]
-

Produces a contour plot of the normal stress \(\sigma_{zz,Mxx}\) resulting from the -bending moment \(M_{xx}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the normal stress within a 150x90x12 UA section resulting from -a bending moment about the x-axis of 5 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mxx=5e6)
-
-stress_post.plot_stress_mxx_zz()
-
-
-
-../_images/stress_mxx_zz.png -

Contour plot of the bending stress.

-
-
- -
-
-plot_stress_myy_zz(pause=True)[source]
-

Produces a contour plot of the normal stress \(\sigma_{zz,Myy}\) resulting from the -bending moment \(M_{yy}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the normal stress within a 150x90x12 UA section resulting from -a bending moment about the y-axis of 2 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Myy=2e6)
-
-stress_post.plot_stress_myy_zz()
-
-
-
-../_images/stress_myy_zz.png -

Contour plot of the bending stress.

-
-
- -
-
-plot_stress_mzz_zx(pause=True)[source]
-

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx,Mzz}\) -resulting from the torsion moment \(M_{zz}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the x-component of the shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6)
-
-stress_post.plot_stress_mzz_zx()
-
-
-
-../_images/stress_mzz_zx.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_mzz_zxy(pause=True)[source]
-

Produces a contour plot of the resultant shear stress \(\sigma_{zxy,Mzz}\) resulting -from the torsion moment \(M_{zz}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots a contour of the resultant shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6)
-
-stress_post.plot_stress_mzz_zxy()
-
-
-
-../_images/stress_mzz_zxy.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_mzz_zy(pause=True)[source]
-

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy,Mzz}\) -resulting from the torsion moment \(M_{zz}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the y-component of the shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6)
-
-stress_post.plot_stress_mzz_zy()
-
-
-
-../_images/stress_mzz_zy.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_n_zz(pause=True)[source]
-

Produces a contour plot of the normal stress \(\sigma_{zz,N}\) resulting from the -axial load \(N\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the normal stress within a 150x90x12 UA section resulting from -an axial force of 10 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(N=10e3)
-
-stress_post.plot_stress_n_zz()
-
-
-
-../_images/stress_n_zz.png -

Contour plot of the axial stress.

-
-
- -
-
-plot_stress_v_zx(pause=True)[source]
-

Produces a contour plot of the x-component of the shear stress -\(\sigma_{zx,\Sigma V}\) resulting from the sum of the applied shear forces -\(V_{x} + V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the x-component of the shear stress within a 150x90x12 UA -section resulting from a shear force of 15 kN in the x-direction and 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)
-
-stress_post.plot_stress_v_zx()
-
-
-
-../_images/stress_v_zx.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_v_zxy(pause=True)[source]
-

Produces a contour plot of the resultant shear stress -\(\sigma_{zxy,\Sigma V}\) resulting from the sum of the applied shear forces -\(V_{x} + V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots a contour of the resultant shear stress within a 150x90x12 UA -section resulting from a shear force of 15 kN in the x-direction and 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)
-
-stress_post.plot_stress_v_zxy()
-
-
-
-../_images/stress_v_zxy.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_v_zy(pause=True)[source]
-

Produces a contour plot of the y-component of the shear stress -\(\sigma_{zy,\Sigma V}\) resulting from the sum of the applied shear forces -\(V_{x} + V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the y-component of the shear stress within a 150x90x12 UA -section resulting from a shear force of 15 kN in the x-direction and 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)
-
-stress_post.plot_stress_v_zy()
-
-
-
-../_images/stress_v_zy.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_vector(sigxs, sigys, title, pause)[source]
-

Plots stress vectors over the finite element mesh.

-
-
Parameters
-
    -
  • sigxs (list[numpy.ndarray]) – List of x-components of the nodal stress values for each material

  • -
  • sigys (list[numpy.ndarray]) – List of y-components of the nodal stress values for each material

  • -
  • title (string) – Plot title

  • -
  • pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

  • -
-
-
-
- -
-
-plot_stress_vm(pause=True)[source]
-

Produces a contour plot of the von Mises stress \(\sigma_{vM}\) resulting from all -actions.

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots a contour of the von Mises stress within a 150x90x12 UA section -resulting from the following actions:

-
    -
  • \(N = 50\) kN

  • -
  • \(M_{xx} = -5\) kN.m

  • -
  • \(M_{22} = 2.5\) kN.m

  • -
  • \(M_{zz} = 1.5\) kN.m

  • -
  • \(V_{x} = 10\) kN

  • -
  • \(V_{y} = 5\) kN

  • -
-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(
-    N=50e3, Mxx=-5e6, M22=2.5e6, Mzz=0.5e6, Vx=10e3, Vy=5e3
-)
-
-stress_post.plot_stress_vm()
-
-
-
-../_images/stress_vm.png -

Contour plot of the von Mises stress.

-
-
- -
-
-plot_stress_vx_zx(pause=True)[source]
-

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx,Vx}\) -resulting from the shear force \(V_{x}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the x-component of the shear stress within a 150x90x12 UA -section resulting from a shear force in the x-direction of 15 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3)
-
-stress_post.plot_stress_vx_zx()
-
-
-
-../_images/stress_vx_zx.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_vx_zxy(pause=True)[source]
-

Produces a contour plot of the resultant shear stress \(\sigma_{zxy,Vx}\) resulting -from the shear force \(V_{x}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots a contour of the resultant shear stress within a 150x90x12 UA -section resulting from a shear force in the x-direction of 15 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3)
-
-stress_post.plot_stress_vx_zxy()
-
-
-
-../_images/stress_vx_zxy.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_vx_zy(pause=True)[source]
-

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy,Vx}\) -resulting from the shear force \(V_{x}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the y-component of the shear stress within a 150x90x12 UA -section resulting from a shear force in the x-direction of 15 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3)
-
-stress_post.plot_stress_vx_zy()
-
-
-
-../_images/stress_vx_zy.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_vy_zx(pause=True)[source]
-

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx,Vy}\) -resulting from the shear force \(V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the x-component of the shear stress within a 150x90x12 UA -section resulting from a shear force in the y-direction of 30 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vy=30e3)
-
-stress_post.plot_stress_vy_zx()
-
-
-
-../_images/stress_vy_zx.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_vy_zxy(pause=True)[source]
-

Produces a contour plot of the resultant shear stress \(\sigma_{zxy,Vy}\) resulting -from the shear force \(V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots a contour of the resultant shear stress within a 150x90x12 UA -section resulting from a shear force in the y-direction of 30 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vy=30e3)
-
-stress_post.plot_stress_vy_zxy()
-
-
-
-../_images/stress_vy_zxy.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_vy_zy(pause=True)[source]
-

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy,Vy}\) -resulting from the shear force \(V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the y-component of the shear stress within a 150x90x12 UA -section resulting from a shear force in the y-direction of 30 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vy=30e3)
-
-stress_post.plot_stress_vy_zy()
-
-
-
-../_images/stress_vy_zy.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_zx(pause=True)[source]
-

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx}\) -resulting from all actions.

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the x-component of the shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)
-
-stress_post.plot_stress_zx()
-
-
-
-../_images/stress_zx.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_zxy(pause=True)[source]
-

Produces a contour plot of the resultant shear stress \(\sigma_{zxy}\) resulting -from all actions.

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots a contour of the resultant shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)
-
-stress_post.plot_stress_zxy()
-
-
-
-../_images/stress_zxy.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_zy(pause=True)[source]
-

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy}\) -resulting from all actions.

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the y-component of the shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)
-
-stress_post.plot_stress_zy()
-
-
-
-../_images/stress_zy.png -

Contour plot of the shear stress.

-
-
- -
-
-plot_stress_zz(pause=True)[source]
-

Produces a contour plot of the combined normal stress \(\sigma_{zz}\) resulting from -all actions.

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the normal stress within a 150x90x12 UA section resulting from -an axial force of 100 kN, a bending moment about the x-axis of 5 kN.m and a bending moment -about the y-axis of 2 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(N=100e3, Mxx=5e6, Myy=2e6)
-
-stress_post.plot_stress_zz()
-
-
-
-../_images/stress_zz.png -

Contour plot of the normal stress.

-
-
- -
-
-plot_vector_mzz_zxy(pause=True)[source]
-

Produces a vector plot of the resultant shear stress \(\sigma_{zxy,Mzz}\) resulting -from the torsion moment \(M_{zz}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example generates a vector plot of the shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6)
-
-stress_post.plot_vector_mzz_zxy()
-
-
-
-../_images/vector_mzz_zxy.png -

Vector plot of the shear stress.

-
-
- -
-
-plot_vector_v_zxy(pause=True)[source]
-

Produces a vector plot of the resultant shear stress -\(\sigma_{zxy,\Sigma V}\) resulting from the sum of the applied shear forces -\(V_{x} + V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example generates a vector plot of the shear stress within a 150x90x12 UA -section resulting from a shear force of 15 kN in the x-direction and 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)
-
-stress_post.plot_vector_v_zxy()
-
-
-
-../_images/vector_v_zxy.png -

Vector plot of the shear stress.

-
-
- -
-
-plot_vector_vx_zxy(pause=True)[source]
-

Produces a vector plot of the resultant shear stress \(\sigma_{zxy,Vx}\) resulting -from the shear force \(V_{x}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example generates a vector plot of the shear stress within a 150x90x12 UA -section resulting from a shear force in the x-direction of 15 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3)
-
-stress_post.plot_vector_vx_zxy()
-
-
-
-../_images/vector_vx_zxy.png -

Vector plot of the shear stress.

-
-
- -
-
-plot_vector_vy_zxy(pause=True)[source]
-

Produces a vector plot of the resultant shear stress \(\sigma_{zxy,Vy}\) resulting -from the shear force \(V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example generates a vector plot of the shear stress within a 150x90x12 UA -section resulting from a shear force in the y-direction of 30 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vy=30e3)
-
-stress_post.plot_vector_vy_zxy()
-
-
-
-../_images/vector_vy_zxy.png -

Vector plot of the shear stress.

-
-
- -
-
-plot_vector_zxy(pause=True)[source]
-

Produces a vector plot of the resultant shear stress \(\sigma_{zxy}\) resulting -from all actions.

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example generates a vector plot of the shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)
-
-stress_post.plot_vector_zxy()
-
-
-
-../_images/vector_zxy.png -

Vector plot of the shear stress.

-
-
- -
- -
-
-

MaterialGroup Class

-
-
-
-class sectionproperties.analysis.cross_section.MaterialGroup(material, num_nodes)[source]
-

Bases: object

-

Class for storing elements of different materials.

-

A MaterialGroup object contains the finite element objects for a specified material. The -stress_result variable provides storage for stresses related each material.

-
-
Parameters
-
    -
  • material (Material) – Material object for the current MaterialGroup

  • -
  • num_nods (int) – Number of nodes for the entire cross-section

  • -
-
-
Variables
-
    -
  • material (Material) – Material object for the current MaterialGroup

  • -
  • stress_result (StressResult) – A StressResult object for saving the stresses of the current material

  • -
  • elements (list[Tri6]) – A list of finite element objects that are of the current material type

  • -
  • el_ids (list[int]) – A list of the element IDs of the elements that are of the current material type

  • -
-
-
-
-
-add_element(element)[source]
-

Adds an element and its element ID to the MaterialGroup.

-
-
Parameters
-

element (Tri6) – Element to add to the MaterialGroup

-
-
-
- -
- -
-
-
-

StressResult Class

-
-
-class sectionproperties.analysis.cross_section.StressResult(num_nodes)[source]
-

Bases: object

-

Class for storing a stress result.

-

Provides variables to store the results from a cross-section stress analysis. Also provides a -method to calculate combined stresses.

-
-
Parameters
-

num_nodes (int) – Number of nodes in the finite element mesh

-
-
Variables
-
    -
  • sig_zz_n (numpy.ndarray) – Normal stress (\(\sigma_{zz,N}\)) resulting from an axial force

  • -
  • sig_zz_mxx (numpy.ndarray) – Normal stress (\(\sigma_{zz,Mxx}\)) resulting from a bending moment about -the xx-axis

  • -
  • sig_zz_myy (numpy.ndarray) – Normal stress (\(\sigma_{zz,Myy}\)) resulting from a bending moment about -the yy-axis

  • -
  • sig_zz_m11 (numpy.ndarray) – Normal stress (\(\sigma_{zz,M11}\)) resulting from a bending moment about -the 11-axis

  • -
  • sig_zz_m22 (numpy.ndarray) – Normal stress (\(\sigma_{zz,M22}\)) resulting from a bending moment about -the 22-axis

  • -
  • sig_zx_mzz (numpy.ndarray) – Shear stress (\(\sigma_{zx,Mzz}\)) resulting from a torsion moment about -the zz-axis

  • -
  • sig_zy_mzz (numpy.ndarray) – Shear stress (\(\sigma_{zy,Mzz}\)) resulting from a torsion moment about -the zz-axis

  • -
  • sig_zx_vx (numpy.ndarray) – Shear stress (\(\sigma_{zx,Vx}\)) resulting from a shear force in the -x-direction

  • -
  • sig_zy_vx (numpy.ndarray) – Shear stress (\(\sigma_{zy,Vx}\)) resulting from a shear force in the -x-direction

  • -
  • sig_zx_vy (numpy.ndarray) – Shear stress (\(\sigma_{zx,Vy}\)) resulting from a shear force in the -y-direction

  • -
  • sig_zy_vy (numpy.ndarray) – Shear stress (\(\sigma_{zy,Vy}\)) resulting from a shear force in the -y-direction

  • -
  • sig_zz_m (numpy.ndarray) – Normal stress (\(\sigma_{zz,\Sigma M}\)) resulting from all bending moments

  • -
  • sig_zxy_mzz (numpy.ndarray) – Resultant shear stress (\(\sigma_{zxy,Mzz}\)) resulting from a torsion -moment in the zz-direction

  • -
  • sig_zxy_vx (numpy.ndarray) – Resultant shear stress (\(\sigma_{zxy,Vx}\)) resulting from a a shear -force in the x-direction

  • -
  • sig_zxy_vy (numpy.ndarray) – Resultant shear stress (\(\sigma_{zxy,Vy}\)) resulting from a a shear -force in the y-direction

  • -
  • sig_zx_v (numpy.ndarray) – Shear stress (\(\sigma_{zx,\Sigma V}\)) resulting from all shear forces

  • -
  • sig_zy_v (numpy.ndarray) – Shear stress (\(\sigma_{zy,\Sigma V}\)) resulting from all shear forces

  • -
  • sig_zxy_v (numpy.ndarray) – Resultant shear stress (\(\sigma_{zxy,\Sigma V}\)) resulting from all -shear forces

  • -
  • sig_zz (numpy.ndarray) – Combined normal force (\(\sigma_{zz}\)) resulting from all actions

  • -
  • sig_zx (numpy.ndarray) – Combined shear stress (\(\sigma_{zx}\)) resulting from all actions

  • -
  • sig_zy (numpy.ndarray) – Combined shear stress (\(\sigma_{zy}\)) resulting from all actions

  • -
  • sig_zxy (numpy.ndarray) – Combined resultant shear stress (\(\sigma_{zxy}\)) resulting from all -actions

  • -
  • sig_vm (numpy.ndarray) – von Mises stress (\(\sigma_{VM}\)) resulting from all actions

  • -
-
-
-
-
-calculate_combined_stresses()[source]
-

Calculates the combined cross-section stresses.

-
- -
- -
-
-

SectionProperties Class

-
-
-class sectionproperties.analysis.cross_section.SectionProperties[source]
-

Bases: object

-

Class for storing section properties.

-

Stores calculated section properties. Also provides methods to calculate section properties -entirely derived from other section properties.

-
-
Variables
-
    -
  • area (float) – Cross-sectional area

  • -
  • perimeter (float) – Cross-sectional perimeter

  • -
  • ea (float) – Modulus weighted area (axial rigidity)

  • -
  • ga (float) – Modulus weighted product of shear modulus and area

  • -
  • nu_eff (float) – Effective Poisson’s ratio

  • -
  • qx (float) – First moment of area about the x-axis

  • -
  • qy (float) – First moment of area about the y-axis

  • -
  • ixx_g (float) – Second moment of area about the global x-axis

  • -
  • iyy_g (float) – Second moment of area about the global y-axis

  • -
  • ixy_g (float) – Second moment of area about the global xy-axis

  • -
  • cx (float) – X coordinate of the elastic centroid

  • -
  • cy (float) – Y coordinate of the elastic centroid

  • -
  • ixx_c (float) – Second moment of area about the centroidal x-axis

  • -
  • iyy_c (float) – Second moment of area about the centroidal y-axis

  • -
  • ixy_c (float) – Second moment of area about the centroidal xy-axis

  • -
  • zxx_plus (float) – Section modulus about the centroidal x-axis for stresses at the positive -extreme value of y

  • -
  • zxx_minus (float) – Section modulus about the centroidal x-axis for stresses at the negative -extreme value of y

  • -
  • zyy_plus (float) – Section modulus about the centroidal y-axis for stresses at the positive -extreme value of x

  • -
  • zyy_minus (float) – Section modulus about the centroidal y-axis for stresses at the negative -extreme value of x

  • -
  • rx_c (float) – Radius of gyration about the centroidal x-axis.

  • -
  • ry_c (float) – Radius of gyration about the centroidal y-axis.

  • -
  • i11_c (float) – Second moment of area about the centroidal 11-axis

  • -
  • i22_c (float) – Second moment of area about the centroidal 22-axis

  • -
  • phi (float) – Principal axis angle

  • -
  • z11_plus (float) – Section modulus about the principal 11-axis for stresses at the positive -extreme value of the 22-axis

  • -
  • z11_minus (float) – Section modulus about the principal 11-axis for stresses at the negative -extreme value of the 22-axis

  • -
  • z22_plus (float) – Section modulus about the principal 22-axis for stresses at the positive -extreme value of the 11-axis

  • -
  • z22_minus (float) – Section modulus about the principal 22-axis for stresses at the negative -extreme value of the 11-axis

  • -
  • r11_c (float) – Radius of gyration about the principal 11-axis.

  • -
  • r22_c (float) – Radius of gyration about the principal 22-axis.

  • -
  • j (float) – Torsion constant

  • -
  • omega (numpy.ndarray) – Warping function

  • -
  • psi_shear (numpy.ndarray) – Psi shear function

  • -
  • phi_shear (numpy.ndarray) – Phi shear function

  • -
  • Delta_s (float) – Shear factor

  • -
  • x_se (float) – X coordinate of the shear centre (elasticity approach)

  • -
  • y_se (float) – Y coordinate of the shear centre (elasticity approach)

  • -
  • x11_se (float) – 11 coordinate of the shear centre (elasticity approach)

  • -
  • y22_se (float) – 22 coordinate of the shear centre (elasticity approach)

  • -
  • x_st (float) – X coordinate of the shear centre (Trefftz’s approach)

  • -
  • y_st (float) – Y coordinate of the shear centre (Trefftz’s approach)

  • -
  • gamma (float) – Warping constant

  • -
  • A_sx (float) – Shear area about the x-axis

  • -
  • A_sy (float) – Shear area about the y-axis

  • -
  • A_sxy (float) – Shear area about the xy-axis

  • -
  • A_s11 (float) – Shear area about the 11 bending axis

  • -
  • A_s22 (float) – Shear area about the 22 bending axis

  • -
  • beta_x_plus (float) – Monosymmetry constant for bending about the x-axis with the top flange -in compression

  • -
  • beta_x_minus (float) – Monosymmetry constant for bending about the x-axis with the bottom -flange in compression

  • -
  • beta_y_plus (float) – Monosymmetry constant for bending about the y-axis with the top flange -in compression

  • -
  • beta_y_minus (float) – Monosymmetry constant for bending about the y-axis with the bottom -flange in compression

  • -
  • beta_11_plus (float) – Monosymmetry constant for bending about the 11-axis with the top -flange in compression

  • -
  • beta_11_minus (float) – Monosymmetry constant for bending about the 11-axis with the bottom -flange in compression

  • -
  • beta_22_plus (float) – Monosymmetry constant for bending about the 22-axis with the top -flange in compression

  • -
  • beta_22_minus (float) – Monosymmetry constant for bending about the 22-axis with the bottom -flange in compression

  • -
  • x_pc (float) – X coordinate of the global plastic centroid

  • -
  • y_pc (float) – Y coordinate of the global plastic centroid

  • -
  • x11_pc (float) – 11 coordinate of the principal plastic centroid

  • -
  • y22_pc (float) – 22 coordinate of the principal plastic centroid

  • -
  • sxx (float) – Plastic section modulus about the centroidal x-axis

  • -
  • syy (float) – Plastic section modulus about the centroidal y-axis

  • -
  • sf_xx_plus (float) – Shape factor for bending about the x-axis with respect to the top fibre

  • -
  • sf_xx_minus (float) – Shape factor for bending about the x-axis with respect to the bottom -fibre

  • -
  • sf_yy_plus (float) – Shape factor for bending about the y-axis with respect to the top fibre

  • -
  • sf_yy_minus (float) – Shape factor for bending about the y-axis with respect to the bottom -fibre

  • -
  • s11 (float) – Plastic section modulus about the 11-axis

  • -
  • s22 (float) – Plastic section modulus about the 22-axis

  • -
  • sf_11_plus (float) – Shape factor for bending about the 11-axis with respect to the top -fibre

  • -
  • sf_11_minus (float) – Shape factor for bending about the 11-axis with respect to the bottom -fibre

  • -
  • sf_22_plus (float) – Shape factor for bending about the 22-axis with respect to the top -fibre

  • -
  • sf_22_minus (float) – Shape factor for bending about the 22-axis with respect to the bottom -fibre

  • -
-
-
-
-
-calculate_centroidal_properties(mesh)[source]
-

Calculates the geometric section properties about the centroidal and principal axes -based on the results about the global axis.

-
- -
-
-calculate_elastic_centroid()[source]
-

Calculates the elastic centroid based on the cross-section area and first moments of -area.

-
- -
- -
-
-
-

fea Module

-
-

Tri6 Class

-
-
-class sectionproperties.analysis.fea.Tri6(el_id, coords, node_ids, material)[source]
-

Bases: object

-

Class for a six noded quadratic triangular element.

-

Provides methods for the calculation of section properties based on the finite element method.

-
-
Parameters
-
    -
  • el_id (int) – Unique element id

  • -
  • coords (numpy.ndarray) – A 2 x 6 array of the coordinates of the tri-6 nodes. The first three columns -relate to the vertices of the triangle and the last three columns correspond to the -mid-nodes.

  • -
  • node_ids (list[int]) – A list of the global node ids for the current element

  • -
  • material (Material) – Material object for the current finite element.

  • -
-
-
Variables
-
    -
  • el_id (int) – Unique element id

  • -
  • coords (numpy.ndarray) – A 2 x 6 array of the coordinates of the tri-6 nodes. The first three columns -relate to the vertices of the triangle and the last three columns correspond to the -mid-nodes.

  • -
  • node_ids (list[int]) – A list of the global node ids for the current element

  • -
  • material (Material) – Material of the current finite element.

  • -
-
-
-
-
-element_stress(N, Mxx, Myy, M11, M22, Mzz, Vx, Vy, ea, cx, cy, ixx, iyy, ixy, i11, i22, phi, j, nu, omega, psi_shear, phi_shear, Delta_s)[source]
-

Calculates the stress within an element resulting from a specified loading. Also returns -the shape function weights.

-
-
Parameters
-
    -
  • N (float) – Axial force

  • -
  • Mxx (float) – Bending moment about the centroidal xx-axis

  • -
  • Myy (float) – Bending moment about the centroidal yy-axis

  • -
  • M11 (float) – Bending moment about the centroidal 11-axis

  • -
  • M22 (float) – Bending moment about the centroidal 22-axis

  • -
  • Mzz (float) – Torsion moment about the centroidal zz-axis

  • -
  • Vx (float) – Shear force acting in the x-direction

  • -
  • Vy (float) – Shear force acting in the y-direction

  • -
  • ea (float) – Modulus weighted area

  • -
  • cx (float) – x position of the elastic centroid

  • -
  • cy (float) – y position of the elastic centroid

  • -
  • ixx (float) – Second moment of area about the centroidal x-axis

  • -
  • iyy (float) – Second moment of area about the centroidal y-axis

  • -
  • ixy (float) – Second moment of area about the centroidal xy-axis

  • -
  • i11 (float) – Second moment of area about the principal 11-axis

  • -
  • i22 (float) – Second moment of area about the principal 22-axis

  • -
  • phi (float) – Principal bending axis angle

  • -
  • j (float) – St. Venant torsion constant

  • -
  • nu (float) – Effective Poisson’s ratio for the cross-section

  • -
  • omega (numpy.ndarray) – Values of the warping function at the element nodes

  • -
  • psi_shear (numpy.ndarray) – Values of the psi shear function at the element nodes

  • -
  • phi_shear (numpy.ndarray) – Values of the phi shear function at the element nodes

  • -
  • Delta_s (float) – Cross-section shear factor

  • -
-
-
Returns
-

Tuple containing element stresses and integration weights -(\(\sigma_{zz,n}\), \(\sigma_{zz,mxx}\), -\(\sigma_{zz,myy}\), \(\sigma_{zz,m11}\), -\(\sigma_{zz,m22}\), \(\sigma_{zx,mzz}\), -\(\sigma_{zy,mzz}\), \(\sigma_{zx,vx}\), -\(\sigma_{zy,vx}\), \(\sigma_{zx,vy}\), -\(\sigma_{zy,vy}\), \(w_i\))

-
-
Return type
-

tuple(numpy.ndarray, numpy.ndarray, …)

-
-
-
- -
-
-geometric_properties()[source]
-

Calculates the geometric properties for the current finite element.

-
-
Returns
-

Tuple containing the geometric properties and the elastic and shear moduli of the -element: (area, qx, qy, ixx, iyy, ixy, e, g)

-
-
Return type
-

tuple(float)

-
-
-
- -
-
-monosymmetry_integrals(phi)[source]
-

Calculates the integrals used to evaluate the monosymmetry constant about both global -axes and both prinicipal axes.

-
-
Parameters
-

phi (float) – Principal bending axis angle

-
-
Returns
-

Integrals used to evaluate the monosymmetry constants (int_x, int_y, int_11, -int_22)

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
- -
-
-plastic_properties(u, p)[source]
-

Calculates total force resisted by the element when subjected to a stress equal to the -yield strength. Also returns the modulus weighted area and first moments of area, and -determines whether or not the element is above or below the line defined by the unit -vector u and point p.

-
-
Parameters
-
    -
  • u (numpy.ndarray) – Unit vector in the direction of the line

  • -
  • p (numpy.ndarray) – Point on the line

  • -
-
-
Returns
-

Element force (force), modulus weighted area properties (ea, e.qx, e.qy) and -whether or not the element is above the line

-
-
Return type
-

tuple(float, float, float, float, bool)

-
-
-
- -
-
-point_within_element(pt)[source]
-

Determines whether a point lies within the current element.

-
-
Parameters
-

pt (list[float, float]) – Point to check (x, y)

-
-
Returns
-

Whether the point lies within an element

-
-
Return type
-

bool

-
-
-
- -
-
-shear_coefficients(ixx, iyy, ixy, psi_shear, phi_shear, nu)[source]
-

Calculates the variables used to determine the shear deformation coefficients.

-
-
Parameters
-
    -
  • ixx (float) – Second moment of area about the centroidal x-axis

  • -
  • iyy (float) – Second moment of area about the centroidal y-axis

  • -
  • ixy (float) – Second moment of area about the centroidal xy-axis

  • -
  • psi_shear (numpy.ndarray) – Values of the psi shear function at the element nodes

  • -
  • phi_shear (numpy.ndarray) – Values of the phi shear function at the element nodes

  • -
  • nu (float) – Effective Poisson’s ratio for the cross-section

  • -
-
-
Returns
-

Shear deformation variables (kappa_x, kappa_y, kappa_xy)

-
-
Return type
-

tuple(float, float, float)

-
-
-
- -
-
-shear_load_vectors(ixx, iyy, ixy, nu)[source]
-

Calculates the element shear load vectors used to evaluate the shear functions.

-
-
Parameters
-
    -
  • ixx (float) – Second moment of area about the centroidal x-axis

  • -
  • iyy (float) – Second moment of area about the centroidal y-axis

  • -
  • ixy (float) – Second moment of area about the centroidal xy-axis

  • -
  • nu (float) – Effective Poisson’s ratio for the cross-section

  • -
-
-
Returns
-

Element shear load vector psi (f_psi) and phi (f_phi)

-
-
Return type
-

tuple(numpy.ndarray, numpy.ndarray)

-
-
-
- -
-
-shear_warping_integrals(ixx, iyy, ixy, omega)[source]
-

Calculates the element shear centre and warping integrals required for shear analysis of -the cross-section.

-
-
Parameters
-
    -
  • ixx (float) – Second moment of area about the centroidal x-axis

  • -
  • iyy (float) – Second moment of area about the centroidal y-axis

  • -
  • ixy (float) – Second moment of area about the centroidal xy-axis

  • -
  • omega (numpy.ndarray) – Values of the warping function at the element nodes

  • -
-
-
Returns
-

Shear centre integrals about the x and y-axes (sc_xint, sc_yint), warping -integrals (q_omega, i_omega, i_xomega, i_yomega)

-
-
Return type
-

tuple(float, float, float, float, float, float)

-
-
-
- -
-
-torsion_properties()[source]
-

Calculates the element stiffness matrix used for warping analysis and the torsion load -vector.

-
-
Returns
-

Element stiffness matrix (k_el) and element torsion load vector (f_el)

-
-
Return type
-

tuple(numpy.ndarray, numpy.ndarray)

-
-
-
- -
- -
-
-

fea Functions

-
-
-sectionproperties.analysis.fea.gauss_points(n)[source]
-

Returns the Gaussian weights and locations for n point Gaussian integration of a quadratic -triangular element.

-
-
Parameters
-

n (int) – Number of Gauss points (1, 3 or 6)

-
-
Returns
-

An n x 4 matrix consisting of the integration weight and the eta, xi and zeta -locations for n Gauss points

-
-
Return type
-

numpy.ndarray

-
-
-
- -
-
-sectionproperties.analysis.fea.shape_function(coords, gauss_point)[source]
-

Computes shape functions, shape function derivatives and the determinant of the Jacobian -matrix for a tri 6 element at a given Gauss point.

-
-
Parameters
-
    -
  • coords (numpy.ndarray) – Global coordinates of the quadratic triangle vertices [2 x 6]

  • -
  • gauss_point (numpy.ndarray) – Gaussian weight and isoparametric location of the Gauss point

  • -
-
-
Returns
-

The value of the shape functions N(i) at the given Gauss point [1 x 6], the -derivative of the shape functions in the j-th global direction B(i,j) [2 x 6] and the -determinant of the Jacobian matrix j

-
-
Return type
-

tuple(numpy.ndarray, numpy.ndarray, float)

-
-
-
- -
-
-sectionproperties.analysis.fea.extrapolate_to_nodes(w)[source]
-

Extrapolates results at six Gauss points to the six noes of a quadratic triangular element.

-
-
Parameters
-

w (numpy.ndarray) – Result at the six Gauss points [1 x 6]

-
-
Returns
-

Extrapolated nodal values at the six nodes [1 x 6]

-
-
Return type
-

numpy.ndarray

-
-
-
- -
-
-sectionproperties.analysis.fea.principal_coordinate(phi, x, y)[source]
-

Determines the coordinates of the cartesian point (x, y) in the -principal axis system given an axis rotation angle phi.

-
-
Parameters
-
    -
  • phi (float) – Prinicpal bending axis angle (degrees)

  • -
  • x (float) – x coordinate in the global axis

  • -
  • y (float) – y coordinate in the global axis

  • -
-
-
Returns
-

Principal axis coordinates (x1, y2)

-
-
Return type
-

tuple(float, float)

-
-
-
- -
-
-sectionproperties.analysis.fea.global_coordinate(phi, x11, y22)[source]
-

Determines the global coordinates of the principal axis point (x1, y2) given principal -axis rotation angle phi.

-
-
Parameters
-
    -
  • phi (float) – Prinicpal bending axis angle (degrees)

  • -
  • x11 (float) – 11 coordinate in the principal axis

  • -
  • y22 (float) – 22 coordinate in the principal axis

  • -
-
-
Returns
-

Global axis coordinates (x, y)

-
-
Return type
-

tuple(float, float)

-
-
-
- -
-
-sectionproperties.analysis.fea.point_above_line(u, px, py, x, y)[source]
-

Determines whether a point (x, y) is a above or below the line defined by the parallel -unit vector u and the point (px, py).

-
-
Parameters
-
    -
  • u (numpy.ndarray) – Unit vector parallel to the line [1 x 2]

  • -
  • px (float) – x coordinate of a point on the line

  • -
  • py (float) – y coordinate of a point on the line

  • -
  • x (float) – x coordinate of the point to be tested

  • -
  • y (float) – y coordinate of the point to be tested

  • -
-
-
Returns
-

This method returns True if the point is above the line or False if the point is -below the line

-
-
Return type
-

bool

-
-
-
- -
-
-
-

solver Module

-
-

solver Functions

-
-
-sectionproperties.analysis.solver.solve_cgs(k, f, m=None, tol=1e-05)[source]
-

Solves a linear system of equations (Ku = f) using the CGS iterative method.

-
-
Parameters
-
    -
  • k (scipy.sparse.csc_matrix) – N x N matrix of the linear system

  • -
  • f (numpy.ndarray) – N x 1 right hand side of the linear system

  • -
  • tol (float) – Tolerance for the solver to acheieve. The algorithm terminates when either -the relative or the absolute residual is below tol.

  • -
  • m (scipy.linalg.LinearOperator) – Preconditioner for the linear matrix approximating the inverse of k

  • -
-
-
Returns
-

The solution vector to the linear system of equations

-
-
Return type
-

numpy.ndarray

-
-
Raises
-

RuntimeError – If the CGS iterative method does not converge

-
-
-
- -
-
-sectionproperties.analysis.solver.solve_cgs_lagrange(k_lg, f, tol=1e-05, m=None)[source]
-

Solves a linear system of equations (Ku = f) using the CGS iterative method and the -Lagrangian multiplier method.

-
-
Parameters
-
    -
  • k (scipy.sparse.csc_matrix) – (N+1) x (N+1) Lagrangian multiplier matrix of the linear system

  • -
  • f (numpy.ndarray) – N x 1 right hand side of the linear system

  • -
  • tol (float) – Tolerance for the solver to acheieve. The algorithm terminates when either -the relative or the absolute residual is below tol.

  • -
  • m (scipy.linalg.LinearOperator) – Preconditioner for the linear matrix approximating the inverse of k

  • -
-
-
Returns
-

The solution vector to the linear system of equations

-
-
Return type
-

numpy.ndarray

-
-
Raises
-

RuntimeError – If the CGS iterative method does not converge or the error from the -Lagrangian multiplier method exceeds the tolerance

-
-
-
- -
-
-sectionproperties.analysis.solver.solve_direct(k, f)[source]
-

Solves a linear system of equations (Ku = f) using the direct solver method.

-
-
Parameters
-
    -
  • k (scipy.sparse.csc_matrix) – N x N matrix of the linear system

  • -
  • f (numpy.ndarray) – N x 1 right hand side of the linear system

  • -
-
-
Returns
-

The solution vector to the linear system of equations

-
-
Return type
-

numpy.ndarray

-
-
-
- -
-
-sectionproperties.analysis.solver.solve_direct_lagrange(k_lg, f)[source]
-

Solves a linear system of equations (Ku = f) using the direct solver method and the -Lagrangian multiplier method.

-
-
Parameters
-
    -
  • k (scipy.sparse.csc_matrix) – (N+1) x (N+1) Lagrangian multiplier matrix of the linear system

  • -
  • f (numpy.ndarray) – N x 1 right hand side of the linear system

  • -
-
-
Returns
-

The solution vector to the linear system of equations

-
-
Return type
-

numpy.ndarray

-
-
Raises
-

RuntimeError – If the Lagrangian multiplier method exceeds a tolerance of 1e-5

-
-
-
- -
-
-sectionproperties.analysis.solver.function_timer(text, function, *args)[source]
-

Displays the message text and returns the time taken for a function, with arguments -args, to execute. The value returned by the timed function is also returned.

-
-
Parameters
-
    -
  • text (string) – Message to display

  • -
  • function (function) – Function to time and execute

  • -
  • args – Function arguments

  • -
-
-
Returns
-

Value returned from the function

-
-
-
- -
-
-
-
-

Post-Processor Package

-
-

post Module

-
-

post Functions

-
-
-sectionproperties.post.post.setup_plot(ax, pause)[source]
-

Executes code required to set up a matplotlib figure.

-
-
Parameters
-
    -
  • ax (matplotlib.axes.Axes) – Axes object on which to plot

  • -
  • pause (bool) – If set to true, the figure pauses the script until the window is closed. If -set to false, the script continues immediately after the window is rendered.

  • -
-
-
-
- -
-
-sectionproperties.post.post.finish_plot(ax, pause, title='')[source]
-

Executes code required to finish a matplotlib figure.

-
-
Parameters
-
    -
  • ax (matplotlib.axes.Axes) – Axes object on which to plot

  • -
  • pause (bool) – If set to true, the figure pauses the script until the window is closed. If -set to false, the script continues immediately after the window is rendered.

  • -
  • title (string) – Plot title

  • -
-
-
-
- -
-
-sectionproperties.post.post.draw_principal_axis(ax, phi, cx, cy)[source]
-

Draws the principal axis on a plot.

-
-
Parameters
-
    -
  • ax (matplotlib.axes.Axes) – Axes object on which to plot

  • -
  • phi (float) – Principal axis angle in radians

  • -
  • cx (float) – x-location of the centroid

  • -
  • cy (float) – y-location of the centroid

  • -
-
-
-
- -
-
-sectionproperties.post.post.print_results(cross_section, fmt)[source]
-

Prints the results that have been calculated to the terminal.

-
-
Parameters
-
    -
  • cross_section (CrossSection) – Structural cross-section object

  • -
  • fmt (string) – Number format

  • -
-
-
-
- -
-
-
-
- - -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/rst/examples.html b/docs/build/html/rst/examples.html deleted file mode 100644 index 2da583be..00000000 --- a/docs/build/html/rst/examples.html +++ /dev/null @@ -1,1275 +0,0 @@ - - - - - - - - - - - Examples — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- - - - -
-
-
-
- -
-

Examples

-

The following examples are located in the sectionproperties.examples -package.

-
-

Simple Example

-

The following example calculates the geometric, warping and plastic properties -of a 50 mm diameter circle. The circle is discretised with 64 points and a mesh -size of 2.5 mm2.

-

The geometry and mesh are plotted, and the mesh information printed to the terminal -before the analysis is carried out. Detailed time information is printed to the -terminal during the cross-section analysis stage. Once the analysis is complete, -the cross-section properties are printed to the terminal. The centroidal -axis second moments of area and torsion constant are saved to variables and it -is shown that, for a circle, the torsion constant is equal to the sum of the -second moments of area:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-# create a 50 diameter circle discretised by 64 points
-geometry = sections.CircularSection(d=50, n=64)
-geometry.plot_geometry()  # plot the geometry
-
-# create a mesh with a mesh size of 2.5
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-
-section = CrossSection(geometry, mesh)  # create a CrossSection object
-section.display_mesh_info()  # display the mesh information
-section.plot_mesh()  # plot the generated mesh
-
-# perform a geometric, warping and plastic analysis, displaying the time info
-section.calculate_geometric_properties(time_info=True)
-section.calculate_warping_properties(time_info=True)
-section.calculate_plastic_properties(time_info=True)
-
-# print the results to the terminal
-section.display_results()
-
-# get the second moments of area and the torsion constant
-(ixx_c, iyy_c, ixy_c) = section.get_ic()
-j = section.get_j()
-
-# print the sum of the second moments of area and the torsion constant
-print("Ixx + Iyy = {0:.3f}".format(ixx_c + iyy_c))
-print("J = {0:.3f}".format(j))
-
-
-

The following plots are generated by the above example:

-
-../_images/circle_geometry.png -

Circular section geometry.

-
-
-../_images/circle_mesh.png -

Mesh generated from the above geometry.

-
-

The following is printed to the terminal:

-
Mesh Statistics:
---2562 nodes
---1247 elements
---1 region
-
---Calculating geometric section properties...
-----completed in 0.765906 seconds---
-
---Assembing 2562x2562 stiffness matrix and load vector...
-----completed in 1.107300 seconds---
---Solving for the warping function using the direct solver...
-----completed in 0.023138 seconds---
---Computing the torsion constant...
-----completed in 0.000254 seconds---
---Assembling shear function load vectors...
-----completed in 1.150968 seconds---
---Solving for the shear functions using the direct solver...
-----completed in 0.136840 seconds---
---Assembling shear centre and warping moment integrals...
-----completed in 0.688029 seconds---
---Calculating shear centres...
-----completed in 0.000054 seconds---
---Assembling shear deformation coefficients...
-----completed in 1.184013 seconds---
---Assembling monosymmetry integrals...
-----completed in 0.784923 seconds---
-
---Calculating plastic properties...
-----completed in 0.669841 seconds---
-
-Section Properties:
-A      = 1.960343e+03
-Qx     = 1.900702e-13
-Qy     = 3.451461e-12
-cx     = 1.760642e-15
-cy     = 9.695762e-17
-Ixx_g  = 3.058119e+05
-Iyy_g  = 3.058119e+05
-Ixy_g  = -2.785328e-12
-Ixx_c  = 3.058119e+05
-Iyy_c  = 3.058119e+05
-Ixy_c  = -2.785328e-12
-Zxx+   = 1.223248e+04
-Zxx-   = 1.223248e+04
-Zyy+   = 1.223248e+04
-Zyy-   = 1.223248e+04
-rx     = 1.248996e+01
-ry     = 1.248996e+01
-phi    = 0.000000e+00
-I11_c  = 3.058119e+05
-I22_c  = 3.058119e+05
-Z11+   = 1.223248e+04
-Z11-   = 1.223248e+04
-Z22+   = 1.223248e+04
-Z22-   = 1.223248e+04
-r11    = 1.248996e+01
-r22    = 1.248996e+01
-J      = 6.116232e+05
-Iw     = 4.700106e-02
-x_se   = -8.788834e-06
-y_se   = -2.644033e-06
-x_st   = -8.788834e-06
-y_st   = -2.644033e-06
-x1_se  = -8.788834e-06
-y2_se  = -2.644033e-06
-A_sx   = 1.680296e+03
-A_sy   = 1.680296e+03
-A_s11  = 1.680296e+03
-A_s22  = 1.680296e+03
-betax+ = -5.288066e-06
-betax- = 5.288066e-06
-betay+ = -1.757767e-05
-betay- = 1.757767e-05
-beta11+= -5.288066e-06
-beta11-= 5.288066e-06
-beta22+= -1.757767e-05
-beta22-= 1.757767e-05
-x_pc   = 5.313355e-15
-y_pc   = 3.649671e-15
-Sxx    = 2.078317e+04
-Syy    = 2.078317e+04
-SF_xx+ = 1.699016e+00
-SF_xx- = 1.699016e+00
-SF_yy+ = 1.699016e+00
-SF_yy- = 1.699016e+00
-x11_pc = 5.313355e-15
-y22_pc = 3.649671e-15
-S11    = 2.078317e+04
-S22    = 2.078317e+04
-SF_11+ = 1.699016e+00
-SF_11- = 1.699016e+00
-SF_22+ = 1.699016e+00
-SF_22- = 1.699016e+00
-
-Ixx + Iyy = 611623.837
-J = 611623.214
-
-
-
-
-

Creating a Nastran Section

-

The following example demonstrates how to create a cross-section defined in -a Nastran-based finite element analysis program. The following creates a -HAT1 cross-section and calculates the geometric, warping and plastic properties. -The HAT1 cross-section is meshed with a maximum elemental area of 0.005.

-

The geometry and mesh are plotted, and the mesh information printed to the terminal -before the analysis is carried out. Detailed time information is printed to the -terminal during the cross-section analysis stage. Once the analysis is complete, -the cross-section properties are printed to the terminal. The centroidal -axis second moments of area and torsion constant are saved to variables and it -is shown that, for non-circular sections, the torsion constant is not equal to the -sum of the second moments of area:

-
import sectionproperties.pre.nastran_sections as nsections
-from sectionproperties.analysis.cross_section import CrossSection
-
-# create a HAT1 section
-geometry = nsections.HAT1Section(DIM1=4.0, DIM2=2.0, DIM3=1.5, DIM4=0.1875, DIM5=0.375)
-geometry.plot_geometry()  # plot the geometry
-
-# create a mesh with a maximum elemental area of 0.005
-mesh = geometry.create_mesh(mesh_sizes=[0.005])
-
-section = CrossSection(geometry, mesh)  # create a CrossSection object
-section.display_mesh_info()  # display the mesh information
-section.plot_mesh()  # plot the generated mesh`
-
-# perform a geometric, warping and plastic anaylsis, displaying the time info
-section.calculate_geometric_properties(time_info=True)
-section.calculate_warping_properties(time_info=True)
-section.calculate_plastic_properties(time_info=True)
-
-# print the results to the terminal
-section.display_results()
-
-# get the second moments of area and the torsion constant
-(ixx_c, iyy_c, ixy_c) = section.get_ic()
-j = section.get_j()
-
-# print the sum of the second moments of area and the torsion constant
-print("Ixx + Iyy = {0:.3f}".format(ixx_c + iyy_c))
-print("J = {0:.3f}".format(j))
-
-
-

The following plots are generated by the above example:

-
-../_images/hat1_geometry.png -

Circular section geometry.

-
-
-../_images/hat1_mesh.png -

Mesh generated from the above geometry.

-
-

The following is printed to the terminal:

-
Mesh Statistics:
---2038 nodes
---926 elements
---2 regions
-
---Calculating geometric section properties...
-----completed in 0.367074 seconds---
-
---Assembing 2038x2038 stiffness matrix and load vector...
-----completed in 0.515934 seconds---
---Solving for the warping function using the direct solver...
-----completed in 0.005604 seconds---
---Computing the torsion constant...
-----completed in 0.000104 seconds---
---Assembling shear function load vectors...
-----completed in 0.525532 seconds---
---Solving for the shear functions using the direct solver...
-----completed in 0.064247 seconds---
---Assembling shear centre and warping moment integrals...
-----completed in 0.331969 seconds---
---Calculating shear centres...
-----completed in 0.000043 seconds---
---Assembling shear deformation coefficients...
-----completed in 0.511631 seconds---
---Assembling monosymmetry integrals...
-----completed in 0.389498 seconds---
-
---Calculating plastic properties...
-----completed in 0.131321 seconds---
-
-Section Properties:
-A    = 2.789062e+00
-Qx   = 1.626709e+00
-Qy   = -1.424642e-16
-cx   = -5.107959e-17
-cy   = 5.832458e-01
-Ixx_g        = 1.935211e+00
-Iyy_g        = 3.233734e+00
-Ixy_g        = -1.801944e-16
-Ixx_c        = 9.864400e-01
-Iyy_c        = 3.233734e+00
-Ixy_c        = -9.710278e-17
-Zxx+         = 6.962676e-01
-Zxx-         = 1.691294e+00
-Zyy+         = 1.616867e+00
-Zyy-         = 1.616867e+00
-rx   = 5.947113e-01
-ry   = 1.076770e+00
-phi  = -9.000000e+01
-I11_c        = 3.233734e+00
-I22_c        = 9.864400e-01
-Z11+         = 1.616867e+00
-Z11-         = 1.616867e+00
-Z22+         = 1.691294e+00
-Z22-         = 6.962676e-01
-r11  = 1.076770e+00
-r22  = 5.947113e-01
-J    = 9.878443e-01
-Iw   = 1.160810e-01
-x_se         = 4.822719e-05
-y_se         = 4.674792e-01
-x_st         = 4.822719e-05
-y_st         = 4.674792e-01
-x1_se        = 1.157666e-01
-y2_se        = 4.822719e-05
-A_sx         = 1.648312e+00
-A_sy         = 6.979733e-01
-A_s11        = 6.979733e-01
-A_s22        = 1.648312e+00
-betax+       = -2.746928e-01
-betax-       = 2.746928e-01
-betay+       = 9.645438e-05
-betay-       = -9.645438e-05
-beta11+      = 9.645438e-05
-beta11-      = -9.645438e-05
-beta22+      = 2.746928e-01
-beta22-      = -2.746928e-01
-x_pc         = -5.107959e-17
-y_pc         = 3.486328e-01
-Sxx  = 1.140530e+00
-Syy  = 2.603760e+00
-SF_xx+       = 1.638062e+00
-SF_xx-       = 6.743533e-01
-SF_yy+       = 1.610373e+00
-SF_yy-       = 1.610373e+00
-x11_pc       = -3.671369e-17
-y22_pc       = 3.486328e-01
-S11  = 2.603760e+00
-S22  = 1.140530e+00
-SF_11+       = 1.610374e+00
-SF_11-       = 1.610374e+00
-SF_22+       = 6.743539e-01
-SF_22-       = 1.638064e+00
-
-Ixx + Iyy = 4.220
-J = 0.988
-
-
-
-
-

Creating Custom Geometry

-

The following example demonstrates how geometry objects can be created from a -list of points, facets, holes and control points. An straight angle section with -a plate at its base is created from a list of points and facets. The bottom plate -is assigned a separate control point meaning two discrete regions are created. -Creating separate regions allows the user to control the mesh size in each region -and assign material properties to different regions. The geometry is cleaned to -remove the overlapping facet at the junction of the angle and the plate. A -geometric, warping and plastic analysis is then carried out.

-

The geometry and mesh are plotted before the analysis is carried out. Once the -analysis is complete, a plot of the various calculated centroids is generated:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-# define parameters for the angle section
-a = 1
-b = 2
-t = 0.1
-
-# build the lists of points, facets, holes and control points
-points = [[-t/2, -2*a], [t/2, -2*a], [t/2, -t/2], [a, -t/2], [a, t/2],
-          [-t/2, t/2], [-b/2, -2*a], [b/2, -2*a], [b/2, -2*a-t],
-          [-b/2, -2*a-t]]
-facets = [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 0], [6, 7], [7, 8],
-          [8, 9], [9, 6]]
-holes = []
-control_points = [[0, 0], [0, -2*a-t/2]]
-
-# create the custom geometry object
-geometry = sections.CustomSection(points, facets, holes, control_points)
-geometry.clean_geometry()  # clean the geometry
-geometry.plot_geometry()  # plot the geometry
-
-# create the mesh - use a smaller refinement for the angle region
-mesh = geometry.create_mesh(mesh_sizes=[0.0005, 0.001])
-
-# create a CrossSection object
-section = CrossSection(geometry, mesh)
-section.plot_mesh()  # plot the generated mesh
-
-# perform a geometric, warping and plastic analysis
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-section.calculate_plastic_properties()
-
-# plot the centroids
-section.plot_centroids()
-
-
-

The following plots are generated by the above example:

-
-../_images/custom_geometry1.png -

Plot of the generated geometry object.

-
-
-../_images/custom_mesh1.png -

Mesh generated from the above geometry.

-
-
-../_images/custom_centroids.png -

Plot of the centroids and the principal axis.

-
-
-
-

Creating a Merged Section

-

The following example demonstrates how to merge multiple geometry objects into -a single geometry object. A 150x100x6 RHS is modelled with a solid 50x50 triangular -section on its top and a 100x100x6 EA section on its right side. The three geometry -objects are merged together using the MergedSection -class. The order of the geometry objects in the list that is passed into the constructor of the -MergedSection class is important, as this same -order relates to specifying mesh sizes and material properties.

-

Once the geometry has been merged, it is vital to clean the geometry to remove -any artefacts that may impede the meshing algorithm. A mesh is created with a mesh -size of 2.5 mm2 for the RHS (first in section_list), 5 mm2 for the triangle (second -in section_list) and 3 mm2 for the angle (last in section_list).

-

The geometry and mesh are plotted, and the mesh information printed to the terminal -before the analysis is carried out. Detailed time information is printed to the -terminal during the cross-section analysis stage. Once the analysis is complete, -the centroids are plotted:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-# create a 150x100x6 RHS
-rhs = sections.Rhs(d=150, b=100, t=6, r_out=15, n_r=8)
-
-# create a triangular section on top of the RHS
-points = [[0, 0], [50, 0], [25, 50]]
-facets = [[0, 1], [1, 2], [2, 0]]
-holes = []
-control_points = [[25, 25]]
-triangle = sections.CustomSection(points, facets, holes, control_points,
-                                  shift=[25, 150])
-
-# create a 100x100x6 EA on the right of the RHS
-angle = sections.AngleSection(d=100, b=100, t=6, r_r=8, r_t=5, n_r=8,
-                              shift=[100, 25])
-
-# create a list of the sections to be merged
-section_list = [rhs, triangle, angle]
-
-# merge the three sections into one geometry object
-geometry = sections.MergedSection(section_list)
-
-# clean the geometry - print cleaning information to the terminal
-geometry.clean_geometry(verbose=True)
-geometry.plot_geometry()  # plot the geometry
-
-# create a mesh - use a mesh size of 2.5 for the RHS, 5 for the triangle and
-# 3 for the angle
-mesh = geometry.create_mesh(mesh_sizes=[2.5, 5, 3])
-
-# create a CrossSection object
-section = CrossSection(geometry, mesh)
-section.display_mesh_info()  # display the mesh information
-section.plot_mesh()  # plot the generated mesh
-
-# perform a geometric, warping and plastic analysis, displaying the time info
-# and the iteration info for the plastic analysis
-section.calculate_geometric_properties(time_info=True)
-section.calculate_warping_properties(time_info=True)
-section.calculate_plastic_properties(time_info=True, verbose=True)
-
-# plot the centroids
-section.plot_centroids()
-
-
-

The following plots are generated by the above example:

-
-../_images/merged_geometry1.png -

Plot of the generated geometry object.

-
-
-../_images/merged_mesh1.png -

Mesh generated from the above geometry.

-
-
-../_images/merged_centroids.png -

Plot of the centroids and the principal axis.

-
-

The following is printed to the terminal:

-
Removed overlapping facets... Rebuilt with points: [30, 67, 93, 32]
-Removed overlapping facets... Rebuilt with points: [46, 65, 64, 48]
-Mesh Statistics:
---6053 nodes
---2755 elements
---3 regions
-
---Calculating geometric section properties...
-----completed in 1.730845 seconds---
-
---Assembing 6053x6053 stiffness matrix and load vector...
-----completed in 2.793801 seconds---
---Solving for the warping function using the direct solver...
-----completed in 0.021323 seconds---
---Computing the torsion constant...
-----completed in 0.000316 seconds---
---Assembling shear function load vectors...
-----completed in 2.552404 seconds---
---Solving for the shear functions using the direct solver...
-----completed in 0.604847 seconds---
---Assembling shear centre and warping moment integrals...
-----completed in 1.578075 seconds---
---Calculating shear centres...
-----completed in 0.000068 seconds---
---Assembling shear deformation coefficients...
-----completed in 2.438405 seconds---
-
---Calculating plastic properties...
----x-axis plastic centroid calculation converged at 1.66608e+00 in 7 iterations.
----y-axis plastic centroid calculation converged at -5.83761e+00 in 10 iterations.
----11-axis plastic centroid calculation converged at -1.43134e+00 in 7 iterations.
----22-axis plastic centroid calculation converged at -1.21319e+01 in 9 iterations.
-----completed in 2.710146 seconds---
-
-
-
-
-

Mirroring and Rotating Geometry

-

The following example demonstrates how geometry objects can be mirrored and -rotated. A 200PFC and 150PFC are placed back-to-back by using the -mirror_section() method and are -rotated counter-clockwise by 30 degrees by using the -rotate_section() method. The -geometry is cleaned to ensure there are no overlapping facets along the junction -between the two PFCs. A geometric, warping and plastic analysis is then carried out.

-

The geometry and mesh are plotted, and the mesh information printed to the terminal -before the analysis is carried out. Detailed time information is printed to the -terminal during the cross-section analysis stage and iteration information printed -for the plastic analysis. Once the analysis is complete, a plot of the various -calculated centroids is generated:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-# create a 200PFC and a 150PFC
-pfc1 = sections.PfcSection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
-pfc2 = sections.PfcSection(d=150, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8,
-                           shift=[0, 26.5])
-
-# mirror the 200 PFC about the y-axis
-pfc1.mirror_section(axis='y', mirror_point=[0, 0])
-
-# merge the pfc sections
-geometry = sections.MergedSection([pfc1, pfc2])
-
-# rotate the geometry counter-clockwise by 30 degrees
-geometry.rotate_section(angle=30)
-
-# clean the geometry - print cleaning information to the terminal
-geometry.clean_geometry(verbose=True)
-geometry.plot_geometry()  # plot the geometry
-
-# create a mesh - use a mesh size of 5 for the 200PFC and 4 for the 150PFC
-mesh = geometry.create_mesh(mesh_sizes=[5, 4])
-
-# create a CrossSection object
-section = CrossSection(geometry, mesh)
-section.display_mesh_info()  # display the mesh information
-section.plot_mesh()  # plot the generated mesh
-
-# perform a geometric, warping and plastic analysis, displaying the time info
-# and the iteration info for the plastic analysis
-section.calculate_geometric_properties(time_info=True)
-section.calculate_warping_properties(time_info=True)
-section.calculate_plastic_properties(time_info=True, verbose=True)
-
-# plot the centroids
-section.plot_centroids()
-
-
-

The following plots are generated by the above example:

-
-../_images/mirr_rot_geometry.png -

Plot of the generated geometry object.

-
-
-../_images/mirr_rot_mesh.png -

Mesh generated from the above geometry.

-
-
-../_images/mirr_rot_centroids.png -

Plot of the centroids and the principal axis.

-
-

The following is printed to the terminal:

-
Removed overlapping facets... Rebuilt with points: [21, 43, 22, 0]
-Mesh Statistics:
---4841 nodes
---2152 elements
---2 regions
-
---Calculating geometric section properties...
-----completed in 1.350236 seconds---
-
---Assembing 4841x4841 stiffness matrix and load vector...
-----completed in 2.002365 seconds---
---Solving for the warping function using the direct solver...
-----completed in 0.013307 seconds---
---Computing the torsion constant...
-----completed in 0.000222 seconds---
---Assembling shear function load vectors...
-----completed in 1.910170 seconds---
---Solving for the shear functions using the direct solver...
-----completed in 0.623121 seconds---
---Assembling shear centre and warping moment integrals...
-----completed in 1.163591 seconds---
---Calculating shear centres...
-----completed in 0.000059 seconds---
---Assembling shear deformation coefficients...
-----completed in 1.831169 seconds---
-
---Calculating plastic properties...
----x-axis plastic centroid calculation converged at 2.77651e+00 in 9 iterations.
----y-axis plastic centroid calculation converged at 3.02247e+00 in 5 iterations.
----11-axis plastic centroid calculation converged at -2.41585e-13 in 3 iterations.
----22-axis plastic centroid calculation converged at 6.10669e-01 in 5 iterations.
-----completed in 0.860817 seconds---
-
-
-
-
-

Performing a Stress Analysis

-

The following example demonstrates how a stress analysis can be performed on a -cross-section. A 150x100x6 RHS is modelled on its side with a maximum mesh area -of 2 mm2. The pre-requisite geometric and warping analyses are performed -before two separate stress analyses are undertaken. The first combines bending -and shear about the x-axis with a torsion moment and the second combines bending -and shear about the y-axis with a torsion moment.

-

After the analysis is performed, various plots of the stresses are generated:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-# create a 150x100x6 RHS on its side
-geometry = sections.Rhs(d=100, b=150, t=6, r_out=15, n_r=8)
-
-# create a mesh with a maximum area of 2
-mesh = geometry.create_mesh(mesh_sizes=[2])
-
-# create a CrossSection object
-section = CrossSection(geometry, mesh)
-
-# perform a geometry and warping analysis
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-
-# perform a stress analysis with Mx = 5 kN.m; Vx = 10 kN and Mzz = 3 kN.m
-case1 = section.calculate_stress(Mxx=5e6, Vx=10e3, Mzz=3e6)
-
-# perform a stress analysis with My = 15 kN.m; Vy = 30 kN and Mzz = 1.5 kN.m
-case2 = section.calculate_stress(Myy=15e6, Vy=30e3, Mzz=1.5e6)
-
-case1.plot_stress_m_zz(pause=False)  # plot the bending stress for case1
-case1.plot_vector_mzz_zxy(pause=False)  # plot the torsion vectors for case1
-case2.plot_stress_v_zxy(pause=False)  # plot the shear stress for case1
-case1.plot_stress_vm(pause=False)  # plot the von mises stress for case1
-case2.plot_stress_vm()  # plot the von mises stress for case2
-
-
-

The following plots are generated by the above example:

-
-../_images/stress_m.png -

Contour plot of the bending stress for case 1.

-
-
-../_images/stress_mzz.png -

Vector plot of the torsion stress for case 1.

-
-
-../_images/stress_v.png -

Contour plot of the shear stress for case 2.

-
-
-../_images/stress_vm1.png -

Contour plot of the von Mises stress for case 1.

-
-
-../_images/stress_vm2.png -

Contour plot of the von Mises stress for case 2.

-
-
-
-

Creating a Composite Cross-Section

-

The following example demonstrates how to create a composite cross-section by assigning -different material properties to various regions of the mesh. A steel 310UB40.4 is modelled -with a 50Dx600W timber panel placed on its top flange.

-

The geometry and mesh are plotted, and the mesh information printed to the terminal -before the analysis is carried out. All types of cross-section analyses are carried -out, with an axial force, bending moment and shear force applied during the stress -analysis. Once the analysis is complete, the cross-section properties are printed -to the terminal and a plot of the centroids and cross-section stresses generated:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.pre.pre import Material
-from sectionproperties.analysis.cross_section import CrossSection
-
-# create material properties
-steel = Material(name='Steel', elastic_modulus=200e3, poissons_ratio=0.3,
-                 yield_strength=500, color='grey')
-timber = Material(name='Timber', elastic_modulus=8e3, poissons_ratio=0.35,
-                  yield_strength=20, color='burlywood')
-
-# create 310UB40.4
-ub = sections.ISection(d=304, b=165, t_f=10.2, t_w=6.1, r=11.4, n_r=8)
-
-# create timber panel on top of the UB
-panel = sections.RectangularSection(d=50, b=600, shift=[-217.5, 304])
-
-# merge the two sections into one geometry object
-geometry = sections.MergedSection([ub, panel])
-geometry.clean_geometry()  # clean the geometry
-geometry.plot_geometry()  # plot the geometry
-
-# create a mesh - use a mesh size of 5 for the UB, 20 for the panel
-mesh = geometry.create_mesh(mesh_sizes=[5, 20])
-
-# create a CrossSection object - take care to list the materials in the same
-# order as entered into the MergedSection
-section = CrossSection(geometry, mesh, materials=[steel, timber])
-section.display_mesh_info()  # display the mesh information
-
-# plot the mesh with coloured materials and a line transparency of 0.5
-section.plot_mesh(materials=True, alpha=0.5)
-
-# perform a geometric, warping and plastic analysis
-section.calculate_geometric_properties(time_info=True)
-section.calculate_warping_properties(time_info=True)
-section.calculate_plastic_properties(time_info=True, verbose=True)
-
-# perform a stress analysis with N = 100 kN, Mxx = 120 kN.m and Vy = 75 kN
-stress_post = section.calculate_stress(N=-100e3, Mxx=-120e6, Vy=-75e3,
-                                       time_info=True)
-
-# print the results to the terminal
-section.display_results()
-
-# plot the centroids
-section.plot_centroids()
-
-stress_post.plot_stress_n_zz(pause=False)  # plot the axial stress
-stress_post.plot_stress_m_zz(pause=False)  # plot the bending stress
-stress_post.plot_stress_v_zxy()  # plot the shear stress
-
-
-

The following plots are generated by the above example:

-
-../_images/composite_geometry.png -

Plot of the generated geometry object.

-
-
-../_images/composite_mesh1.png -

Mesh generated from the above geometry.

-
-
-../_images/composite_centroids.png -

Plot of the centroids and the principal axis.

-
-
-../_images/composite_stress_n.png -

Contour plot of the axial stress.

-
-
-../_images/composite_stress_m.png -

Contour plot of the bending stress.

-
-
-../_images/composite_stress_v.png -

Contour plot of the shear stress.

-
-

The following is printed to the terminal:

-
Mesh Statistics:
---8972 nodes
---4189 elements
---2 regions
-
---Calculating geometric section properties...
-----completed in 2.619151 seconds---
-
---Assembing 8972x8972 stiffness matrix and load vector...
-----completed in 4.814592 seconds---
---Solving for the warping function using the direct solver...
-----completed in 0.032710 seconds---
---Computing the torsion constant...
-----completed in 0.000281 seconds---
---Assembling shear function load vectors...
-----completed in 3.648590 seconds---
---Solving for the shear functions using the direct solver...
-----completed in 0.073731 seconds---
---Assembling shear centre and warping moment integrals...
-----completed in 2.288843 seconds---
---Calculating shear centres...
-----completed in 0.000064 seconds---
---Assembling shear deformation coefficients...
-----completed in 3.597728 seconds---
---Assembling monosymmetry integrals...
-----completed in 2.519333 seconds---
-
---Calculating plastic properties...
-d = -185.13088495027134; f_norm = 1.0
-d = 168.86911504972866; f_norm = -1.0
-d = -8.130884950271337; f_norm = 0.1396051884674814
-d = 13.552166872240885; f_norm = 0.0983423820518053
-d = 60.60270845168385; f_norm = 0.008805290832496546
-d = 64.90008929872263; f_norm = 0.0006273832465500235
-d = 65.22746216923525; f_norm = 4.393296044849056e-06
-d = 65.22976962543858; f_norm = 2.2112746988930985e-09
-d = 65.2298027403234; f_norm = -6.080628821651535e-08
----x-axis plastic centroid calculation converged at 6.52298e+01 in 8 iterations.
-d = -300.0; f_norm = -1.0
-d = 300.0; f_norm = 1.0
-d = 0.0; f_norm = 2.1790636349700628e-16
-d = -5e-07; f_norm = -4.7730935851751974e-08
----y-axis plastic centroid calculation converged at 0.00000e+00 in 3 iterations.
-d = -185.13088495027134; f_norm = 1.0
-d = 168.86911504972866; f_norm = -1.0
-d = -8.130884950271337; f_norm = 0.1396051884674814
-d = 13.552166872240885; f_norm = 0.0983423820518053
-d = 60.60270845168385; f_norm = 0.008805290832496546
-d = 64.90008929872263; f_norm = 0.0006273832465500235
-d = 65.22746216923525; f_norm = 4.393296044849056e-06
-d = 65.22976962543858; f_norm = 2.2112746988930985e-09
-d = 65.2298027403234; f_norm = -6.080628821651535e-08
----11-axis plastic centroid calculation converged at 6.52298e+01 in 8 iterations.
-d = -300.0; f_norm = -1.0
-d = 300.0; f_norm = 1.0
-d = 0.0; f_norm = 2.1790636349700628e-16
-d = -5e-07; f_norm = -4.7730935851751974e-08
----22-axis plastic centroid calculation converged at 0.00000e+00 in 3 iterations.
-----completed in 0.794056 seconds---
-
---Calculating cross-section stresses...
-----completed in 4.240446 seconds---
-
-Section Properties:
-A      = 3.521094e+04
-E.A    = 1.282187e+09
-E.Qx   = 2.373725e+11
-E.Qy   = 1.057805e+11
-cx     = 8.250000e+01
-cy     = 1.851309e+02
-E.Ixx_g= 6.740447e+13
-E.Iyy_g= 1.745613e+13
-E.Ixy_g= 1.958323e+13
-E.Ixx_c= 2.345949e+13
-E.Iyy_c= 8.729240e+12
-E.Ixy_c= -7.421875e-02
-E.Zxx+ = 1.389212e+11
-E.Zxx- = 1.267184e+11
-E.Zyy+ = 2.909747e+10
-E.Zyy- = 2.909747e+10
-rx     = 1.352644e+02
-ry     = 8.251112e+01
-phi    = 0.000000e+00
-E.I11_c= 2.345949e+13
-E.I22_c= 8.729240e+12
-E.Z11+ = 1.389212e+11
-E.Z11- = 1.267184e+11
-E.Z22+ = 2.909747e+10
-E.Z22- = 2.909747e+10
-r11    = 1.352644e+02
-r22    = 8.251112e+01
-G.J    = 1.439379e+11
-G.Iw   = 2.554353e+16
-x_se   = 8.250071e+01
-y_se   = 2.863400e+02
-x_st   = 8.250070e+01
-y_st   = 2.857074e+02
-x1_se  = 7.063407e-04
-y2_se  = 1.012091e+02
-A_sx   = 1.104723e+04
-A_sy   = 1.021183e+04
-A_s11  = 1.104723e+04
-A_s22  = 1.021183e+04
-betax+ = 2.039413e+02
-betax- = -2.039413e+02
-betay+ = 1.412681e-03
-betay- = -1.412681e-03
-beta11+= 2.039413e+02
-beta11-= -2.039413e+02
-beta22+= 1.412681e-03
-beta22-= -1.412681e-03
-x_pc   = 8.250000e+01
-y_pc   = 2.503607e+02
-M_p,xx = 3.932542e+08
-M_p,yy = 1.610673e+08
-x11_pc = 8.250000e+01
-y22_pc = 2.503607e+02
-M_p,11 = 3.932542e+08
-M_p,22 = 1.610673e+08
-
-
-
-
-

Frame Analysis Example

-

The following example demonstrates how sectionproperties can be used to -calculate the cross-section properties required for a frame analysis. Using this -method is preferred over executing a geometric and warping analysis as only variables -required for a frame analysis are computed. In this example the torsion constant of -a rectangular section is calculated for a number of different mesh sizes and the -accuracy of the result compared with the time taken to obtain the solution:

-
import time
-import numpy as np
-import matplotlib.pyplot as plt
-import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-# create a rectangular section
-geometry = sections.RectangularSection(d=100, b=50)
-
-# create a list of mesh sizes to analyse
-mesh_sizes = [1.5, 2, 2.5, 3, 4, 5, 10, 15, 20, 25, 30, 40, 50, 75, 100]
-j_calc = []  # list to store torsion constants
-t_calc = []  # list to store computation times
-
-# loop through mesh sizes
-for mesh_size in mesh_sizes:
-    mesh = geometry.create_mesh(mesh_sizes=[mesh_size])  # create mesh
-    section = CrossSection(geometry, mesh)  # create a CrossSection object
-    start_time = time.time()  # start timing
-    # calculate the frame properties
-    (_, _, _, _, j, _) = section.calculate_frame_properties()
-    t = time.time() - start_time  # stop timing
-    t_calc.append(t)  # save the time
-    j_calc.append(j)  # save the torsion constant
-    # print the result
-    str = "Mesh Size: {0}; ".format(mesh_size)
-    str += "Solution Time {0:.5f} s; ".format(t)
-    str += "Torsion Constant: {0:.12e}".format(j)
-    print(str)
-
-correct_val = j_calc[0]  # assume the finest mesh gives the 'correct' value
-j_np = np.array(j_calc)  # convert results to a numpy array
-error_vals = (j_calc - correct_val) / j_calc * 100  # compute the error
-
-# produce a plot of the accuracy of the torsion constant with computation time
-plt.loglog(t_calc[1:], error_vals[1:], 'kx-')
-plt.xlabel("Solver Time [s]")
-plt.ylabel("Torsion Constant Error [%]")
-plt.show()
-
-
-
-../_images/frame_graph.png -

Plot of the torsion constant as a function of the solution time.

-
-
-
-

Advanced Examples

-

The following examples demonstrates how sectionproperties can be used for more academic purposes.

-
-

Torsion Constant of a Rectangle

-

In this example, the aspect ratio of a rectangular section is varied whilst keeping a constant -cross-sectional area and the torsion constant calculated. The variation of the torsion constant -with the aspect ratio is then plotted:

-
import numpy as np
-import matplotlib.pyplot as plt
-import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-# rectangle dimensions
-d_list = []
-b_list = np.linspace(0.2, 1, 20)
-j_list = []  # list holding torsion constant results
-
-# number of elements for each analysis
-n = 500
-
-# loop through all the widths
-for b in b_list:
-    # calculate d assuming area = 1
-    d = 1 / b
-    d_list.append(d)
-
-    # compute mesh size
-    ms = d * b / n
-
-    # perform a warping analysis on rectangle
-    geometry = sections.RectangularSection(d=d, b=b)
-    mesh = geometry.create_mesh(mesh_sizes=[ms])
-    section = CrossSection(geometry, mesh)
-    section.calculate_geometric_properties()
-    section.calculate_warping_properties()
-
-    # get the torsion constant
-    j = section.get_j()
-    print("d/b = {0:.3f}; J = {1:.5e}".format(d/b, j))
-    j_list.append(j)
-
-# plot the torsion constant as a function of the aspect ratio
-(fig, ax) = plt.subplots()
-ax.plot(np.array(d_list) / b_list, j_list, 'kx-')
-ax.set_xlabel("Aspect Ratio [d/b]")
-ax.set_ylabel("Torsion Constant [J]")
-ax.set_title("Rectangular Section Torsion Constant")
-plt.show()
-
-
-
-../_images/advanced1.png -

Plot of the torsion constant as a function of the aspect ratio.

-
-
-
-

Mesh Refinement

-

In this example the convergence of the torsion constant is investigated through an analysis of an -I-section. The mesh is refined both by modifying the mesh size and by specifying the number of -points making up the root radius. The figure below the example code shows that mesh refinement -adjacent to the root radius is a far more efficient method in obtaining fast convergence when -compared to reducing the mesh area size for the entire section:

-
import numpy as np
-import matplotlib.pyplot as plt
-import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-# define mesh sizes
-mesh_size_list = [50, 20, 10, 5, 3, 2, 1]
-nr_list = [4, 8, 12, 16, 20, 24, 32, 64]
-
-# initialise result lists
-mesh_results = []
-mesh_elements = []
-nr_results = []
-nr_elements = []
-
-# calculate reference solution
-geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=64)
-mesh = geometry.create_mesh(mesh_sizes=[0.5])  # create mesh
-section = CrossSection(geometry, mesh)  # create a CrossSection object
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-j_reference = section.get_j()  # get the torsion constant
-
-# run through mesh_sizes with n_r = 16
-for mesh_size in mesh_size_list:
-    geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=16)
-    mesh = geometry.create_mesh(mesh_sizes=[mesh_size])  # create mesh
-    section = CrossSection(geometry, mesh)  # create a CrossSection object
-    section.calculate_geometric_properties()
-    section.calculate_warping_properties()
-
-    mesh_elements.append(len(section.elements))
-    mesh_results.append(section.get_j())
-
-# run through n_r with mesh_size = 3
-for n_r in nr_list:
-    geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=n_r)
-    mesh = geometry.create_mesh(mesh_sizes=[3])  # create mesh
-    section = CrossSection(geometry, mesh)  # create a CrossSection object
-    section.calculate_geometric_properties()
-    section.calculate_warping_properties()
-
-    nr_elements.append(len(section.elements))
-    nr_results.append(section.get_j())
-
-# convert results to a numpy array
-mesh_results = np.array(mesh_results)
-nr_results = np.array(nr_results)
-
-# compute the error
-mesh_error_vals = (mesh_results - j_reference) / mesh_results * 100
-nr_error_vals = (nr_results - j_reference) / nr_results * 100
-
-# plot the results
-(fig, ax) = plt.subplots()
-ax.loglog(mesh_elements, mesh_error_vals, 'kx-', label='Mesh Size Refinement')
-ax.loglog(nr_elements, nr_error_vals, 'rx-', label='Root Radius Refinement')
-plt.xlabel("Number of Elements")
-plt.ylabel("Torsion Constant Error [%]")
-plt.legend(loc='center left', bbox_to_anchor=(1, 0.5))
-plt.tight_layout()
-plt.show()
-
-
-
-../_images/advanced2.png -

Plot of the torsion constant error as a function of number of elements used in the analysis for -both general mesh refinement and root radius refinement.

-
-
-
-
- - -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/rst/geom_mesh.html b/docs/build/html/rst/geom_mesh.html deleted file mode 100644 index 9a1b2864..00000000 --- a/docs/build/html/rst/geom_mesh.html +++ /dev/null @@ -1,1430 +0,0 @@ - - - - - - - - - - - Creating a Geometry, Mesh and Material Properties — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- -
    - -
  • Docs »
  • - -
  • Creating a Geometry, Mesh and Material Properties
  • - - -
  • - - - View page source - - -
  • - -
- - -
-
-
-
- -
-

Creating a Geometry, Mesh and Material Properties

-

Before performing a cross-section analysis, the geometry of the cross-section and a finite element -mesh must be created. Optionally, material properties can be applied to different regions of the -cross-section.

-
-

Cross-Section Geometry

-

The geometry of a cross-section defines its dimensions and shape and involves the creation of a -Geometry object. This geometry object stores all the -information needed to create a finite element mesh.

-
-
-class sectionproperties.pre.sections.Geometry(control_points, shift)[source]
-

Parent class for a cross-section geometry input.

-

Provides an interface for the user to specify the geometry defining a cross-section. A method -is provided for generating a triangular mesh, for translating the cross-section by (x, y) and -for plotting the geometry.

-
-
Variables
-
    -
  • points (list[list[float, float]]) – List of points (x, y) defining the vertices of the cross-section

  • -
  • facets (list[list[int, int]]) – List of point index pairs (p1, p2) defining the edges of the cross-section

  • -
  • holes (list[list[float, float]]) – List of points (x, y) defining the locations of holes within the cross-section. -If there are no holes, provide an empty list [].

  • -
  • control_points (list[list[float, float]]) – A list of points (x, y) that define different regions of the -cross-section. A control point is an arbitrary point within a region enclosed by facets.

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
  • perimeter (list[int]) – List of facet indices defining the perimeter of the cross-section

  • -
-
-
-
- -

Different regions of the geometry can be specified by defining a list of control_points, which -are located within unique enclosed areas of the geometry. Different regions can be used to specify -different mesh sizes and/or different material properties within the structural cross-section. See -the Examples for some example scripts in which different regions are specified through -a list of control points.

-
-
-

Creating Common Structural Geometries

-

In order to make your life easier, there are a number of built-in classes that generate typical -structural cross-sections that inherit from the Geometry -class. Note that these classes automatically assign a control_point to the geometry object.

-
-

Rectangular Section

-
-
-class sectionproperties.pre.sections.RectangularSection(d, b, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a rectangular section with the bottom left corner at the origin (0, 0), with -depth d and width b.

-
-
Parameters
-
    -
  • d (float) – Depth (y) of the rectangle

  • -
  • b (float) – Width (x) of the rectangle

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a rectangular cross-section with a depth of 100 and width of 50, -and generates a mesh with a maximum triangular area of 5:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.RectangularSection(d=100, b=50)
-mesh = geometry.create_mesh(mesh_sizes=[5])
-
-
-
-../_images/rectangle_geometry.png -

Rectangular section geometry.

-
-
-../_images/rectangle_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-

Circular Section

-
-
-class sectionproperties.pre.sections.CircularSection(d, n, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a solid circle centered at the origin (0, 0) with diameter d and using n -points to construct the circle.

-
-
Parameters
-
    -
  • d (float) – Diameter of the circle

  • -
  • n (int) – Number of points discretising the circle

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a circular cross-section with a diameter of 50 with 64 points, -and generates a mesh with a maximum triangular area of 2.5:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.CircularSection(d=50, n=64)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-
-
-
-../_images/circle_geometry.png -

Circular section geometry.

-
-
-../_images/circle_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-

Circular Hollow Section (CHS)

-
-
-class sectionproperties.pre.sections.Chs(d, t, n, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a circular hollow section centered at the origin (0, 0), with diameter d and -thickness t, using n points to construct the inner and outer circles.

-
-
Parameters
-
    -
  • d (float) – Outer diameter of the CHS

  • -
  • t (float) – Thickness of the CHS

  • -
  • n (int) – Number of points discretising the inner and outer circles

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a CHS discretised with 64 points, with a diameter of 48 and -thickness of 3.2, and generates a mesh with a maximum triangular area of 1.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.Chs(d=48, t=3.2, n=64)
-mesh = geometry.create_mesh(mesh_sizes=[1.0])
-
-
-
-../_images/chs_geometry.png -

CHS geometry.

-
-
-../_images/chs_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-

Elliptical Section

-
-
-class sectionproperties.pre.sections.EllipticalSection(d_y, d_x, n, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a solid ellipse centered at the origin (0, 0) with vertical diameter d_y and -horizontal diameter d_x, using n points to construct the ellipse.

-
-
Parameters
-
    -
  • d_y (float) – Diameter of the ellipse in the y-dimension

  • -
  • d_x (float) – Diameter of the ellipse in the x-dimension

  • -
  • n (int) – Number of points discretising the ellipse

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates an elliptical cross-section with a vertical diameter of 25 and -horizontal diameter of 50, with 40 points, and generates a mesh with a maximum triangular area -of 1.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.EllipticalSection(d_y=25, d_x=50, n=40)
-mesh = geometry.create_mesh(mesh_sizes=[1.0])
-
-
-
-../_images/ellipse_geometry.png -

Elliptical section geometry.

-
-
-../_images/ellipse_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-

Elliptical Hollow Section (EHS)

-
-
-class sectionproperties.pre.sections.Ehs(d_y, d_x, t, n, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs an elliptical hollow section centered at the origin (0, 0), with outer vertical -diameter d_y, outer horizontal diameter d_x, and thickness t, using n points to -construct the inner and outer ellipses.

-
-
Parameters
-
    -
  • d_y (float) – Diameter of the ellipse in the y-dimension

  • -
  • d_x (float) – Diameter of the ellipse in the x-dimension

  • -
  • t (float) – Thickness of the EHS

  • -
  • n (int) – Number of points discretising the inner and outer ellipses

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a EHS discretised with 30 points, with a outer vertical diameter -of 25, outer horizontal diameter of 50, and thickness of 2.0, and generates a mesh with a -maximum triangular area of 0.5:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.Ehs(d_y=25, d_x=50, t=2.0, n=64)
-mesh = geometry.create_mesh(mesh_sizes=[0.5])
-
-
-
-../_images/ehs_geometry.png -

EHS geometry.

-
-
-../_images/ehs_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-

Rectangular Hollow Section (RHS)

-
-
-class sectionproperties.pre.sections.Rhs(d, b, t, r_out, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a rectangular hollow section centered at (b/2, d/2), with depth d, width b, -thickness t and outer radius r_out, using n_r points to construct the inner and outer -radii. If the outer radius is less than the thickness of the RHS, the inner radius is set to -zero.

-
-
Parameters
-
    -
  • d (float) – Depth of the RHS

  • -
  • b (float) – Width of the RHS

  • -
  • t (float) – Thickness of the RHS

  • -
  • r_out (float) – Outer radius of the RHS

  • -
  • n_r (int) – Number of points discretising the inner and outer radii

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates an RHS with a depth of 100, a width of 50, a thickness of 6 and -an outer radius of 9, using 8 points to discretise the inner and outer radii. A mesh is -generated with a maximum triangular area of 2.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.Rhs(d=100, b=50, t=6, r_out=9, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.0])
-
-
-
-../_images/rhs_geometry.png -

RHS geometry.

-
-
-../_images/rhs_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-

I-Section

-
-
-
-class sectionproperties.pre.sections.ISection(d, b, t_f, t_w, r, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs an I-section centered at (b/2, d/2), with depth d, width b, flange -thickness t_f, web thickness t_w, and root radius r, using n_r points to construct the -root radius.

-
-
Parameters
-
    -
  • d (float) – Depth of the I-section

  • -
  • b (float) – Width of the I-section

  • -
  • t_f (float) – Flange thickness of the I-section

  • -
  • t_w (float) – Web thickness of the I-section

  • -
  • r (float) – Root radius of the I-section

  • -
  • n_r (int) – Number of points discretising the root radius

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates an I-section with a depth of 203, a width of 133, a flange -thickness of 7.8, a web thickness of 5.8 and a root radius of 8.9, using 16 points to -discretise the root radius. A mesh is generated with a maximum triangular area of 3.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=16)
-mesh = geometry.create_mesh(mesh_sizes=[3.0])
-
-
-
-../_images/isection_geometry.png -

I-section geometry.

-
-
-../_images/isection_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

Monosymmetric I-Section

-
-
-
-class sectionproperties.pre.sections.MonoISection(d, b_t, b_b, t_fb, t_ft, t_w, r, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a monosymmetric I-section centered at (max(b_t, b_b)/2, d/2), with depth d, -top flange width b_t, bottom flange width b_b, top flange thickness t_ft, top flange -thickness t_fb, web thickness t_w, and root radius r, using n_r points to construct the -root radius.

-
-
Parameters
-
    -
  • d (float) – Depth of the I-section

  • -
  • b_t (float) – Top flange width

  • -
  • b_b (float) – Bottom flange width

  • -
  • t_ft (float) – Top flange thickness of the I-section

  • -
  • t_fb (float) – Bottom flange thickness of the I-section

  • -
  • t_w (float) – Web thickness of the I-section

  • -
  • r (float) – Root radius of the I-section

  • -
  • n_r (int) – Number of points discretising the root radius

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a monosymmetric I-section with a depth of 200, a top flange width -of 50, a top flange thickness of 12, a bottom flange width of 130, a bottom flange thickness of -8, a web thickness of 6 and a root radius of 8, using 16 points to discretise the root radius. -A mesh is generated with a maximum triangular area of 3.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.MonoISection(
-    d=200, b_t=50, b_b=130, t_ft=12, t_fb=8, t_w=6, r=8, n_r=16
-)
-mesh = geometry.create_mesh(mesh_sizes=[3.0])
-
-
-
-../_images/monoisection_geometry.png -

I-section geometry.

-
-
-../_images/monoisection_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

Tapered Flange I-Section

-
-
-
-class sectionproperties.pre.sections.TaperedFlangeISection(d, b, t_f, t_w, r_r, r_f, alpha, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a Tapered Flange I-section centered at (b/2, d/2), with depth d, width b, -mid-flange thickness t_f, web thickness t_w, root radius r_r, flange radius r_f and -flange angle alpha, using n_r points to construct the radii.

-
-
Parameters
-
    -
  • d (float) – Depth of the Tapered Flange I-section

  • -
  • b (float) – Width of the Tapered Flange I-section

  • -
  • t_f (float) – Mid-flange thickness of the Tapered Flange I-section (measured at the point -equidistant from the face of the web to the edge of the flange)

  • -
  • t_w (float) – Web thickness of the Tapered Flange I-section

  • -
  • r_r (float) – Root radius of the Tapered Flange I-section

  • -
  • r_f (float) – Flange radius of the Tapered Flange I-section

  • -
  • alpha (float) – Flange angle of the Tapered Flange I-section (degrees)

  • -
  • n_r (int) – Number of points discretising the radii

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a Tapered Flange I-section with a depth of 588, a width of 191, a -mid-flange thickness of 27.2, a web thickness of 15.2, a root radius of 17.8, a flange radius -of 8.9 and a flange angle of 8°, using 16 points to discretise the radii. A mesh is generated -with a maximum triangular area of 20.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.TaperedFlangeISection(
-    d=588, b=191, t_f=27.2, t_w=15.2, r_r=17.8, r_f=8.9, alpha=8, n_r=16
-)
-mesh = geometry.create_mesh(mesh_sizes=[20.0])
-
-
-
-../_images/taperedisection_geometry.png -

I-section geometry.

-
-
-../_images/taperedisection_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

Parallel Flange Channel (PFC) Section

-
-
-
-class sectionproperties.pre.sections.PfcSection(d, b, t_f, t_w, r, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a PFC section with the bottom left corner at the origin (0, 0), with depth d, -width b, flange thickness t_f, web thickness t_w and root radius r, using n_r points -to construct the root radius.

-
-
Parameters
-
    -
  • d (float) – Depth of the PFC section

  • -
  • b (float) – Width of the PFC section

  • -
  • t_f (float) – Flange thickness of the PFC section

  • -
  • t_w (float) – Web thickness of the PFC section

  • -
  • r (float) – Root radius of the PFC section

  • -
  • n_r (int) – Number of points discretising the root radius

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a PFC section with a depth of 250, a width of 90, a flange -thickness of 15, a web thickness of 8 and a root radius of 12, using 8 points to discretise the -root radius. A mesh is generated with a maximum triangular area of 5.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.PfcSection(d=250, b=90, t_f=15, t_w=8, r=12, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[5.0])
-
-
-
-../_images/pfc_geometry.png -

PFC geometry.

-
-
-../_images/pfc_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

Tapered Flange Channel Section

-
-
-
-class sectionproperties.pre.sections.TaperedFlangeChannel(d, b, t_f, t_w, r_r, r_f, alpha, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a Tapered Flange Channel section with the bottom left corner at the origin -(0, 0), with depth d, width b, mid-flange thickness t_f, web thickness t_w, root -radius r_r, flange radius r_f and flange angle alpha, using n_r points to construct the -radii.

-
-
Parameters
-
    -
  • d (float) – Depth of the Tapered Flange Channel section

  • -
  • b (float) – Width of the Tapered Flange Channel section

  • -
  • t_f (float) – Mid-flange thickness of the Tapered Flange Channel section (measured at the -point equidistant from the face of the web to the edge of the flange)

  • -
  • t_w (float) – Web thickness of the Tapered Flange Channel section

  • -
  • r_r (float) – Root radius of the Tapered Flange Channel section

  • -
  • r_f (float) – Flange radius of the Tapered Flange Channel section

  • -
  • alpha (float) – Flange angle of the Tapered Flange Channel section (degrees)

  • -
  • n_r (int) – Number of points discretising the radii

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a Tapered Flange Channel section with a depth of 10, a width of -3.5, a mid-flange thickness of 0.575, a web thickness of 0.475, a root radius of 0.575, a -flange radius of 0.4 and a flange angle of 8°, using 16 points to discretise the radii. A mesh -is generated with a maximum triangular area of 0.02:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.TaperedFlangeChannel(
-    d=10, b=3.5, t_f=0.575, t_w=0.475, r_r=0.575, r_f=0.4, alpha=8, n_r=16
-)
-mesh = geometry.create_mesh(mesh_sizes=[0.02])
-
-
-
-../_images/taperedchannel_geometry.png -

I-section geometry.

-
-
-../_images/taperedchannel_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

Tee Section

-
-
-
-class sectionproperties.pre.sections.TeeSection(d, b, t_f, t_w, r, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a Tee section with the top left corner at (0, d), with depth d, width b, -flange thickness t_f, web thickness t_w and root radius r, using n_r points to -construct the root radius.

-
-
Parameters
-
    -
  • d (float) – Depth of the Tee section

  • -
  • b (float) – Width of the Tee section

  • -
  • t_f (float) – Flange thickness of the Tee section

  • -
  • t_w (float) – Web thickness of the Tee section

  • -
  • r (float) – Root radius of the Tee section

  • -
  • n_r (int) – Number of points discretising the root radius

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a Tee section with a depth of 200, a width of 100, a flange -thickness of 12, a web thickness of 6 and a root radius of 8, using 8 points to discretise the -root radius. A mesh is generated with a maximum triangular area of 3.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.TeeSection(d=200, b=100, t_f=12, t_w=6, r=8, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[3.0])
-
-
-
-../_images/tee_geometry.png -

Tee section geometry.

-
-
-../_images/tee_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

Angle Section

-
-
-
-class sectionproperties.pre.sections.AngleSection(d, b, t, r_r, r_t, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs an angle section with the bottom left corner at the origin (0, 0), with depth -d, width b, thickness t, root radius r_r and toe radius r_t, using n_r points to -construct the radii.

-
-
Parameters
-
    -
  • d (float) – Depth of the angle section

  • -
  • b (float) – Width of the angle section

  • -
  • t (float) – Thickness of the angle section

  • -
  • r_r (float) – Root radius of the angle section

  • -
  • r_t (float) – Toe radius of the angle section

  • -
  • n_r (int) – Number of points discretising the radii

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates an angle section with a depth of 150, a width of 100, a thickness -of 8, a root radius of 12 and a toe radius of 5, using 16 points to discretise the radii. A -mesh is generated with a maximum triangular area of 2.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.AngleSection(d=150, b=100, t=8, r_r=12, r_t=5, n_r=16)
-mesh = geometry.create_mesh(mesh_sizes=[2.0])
-
-
-
-../_images/angle_geometry.png -

Angle section geometry.

-
-
-../_images/angle_mesh.png -
-
- -
-
-
-

Cee Section

-
-
-
-class sectionproperties.pre.sections.CeeSection(d, b, l, t, r_out, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a Cee section with the bottom left corner at the origin (0, 0), with depth d, -width b, lip l, thickness t and outer radius r_out, using n_r points to construct the -radius. If the outer radius is less than the thickness of the Cee Section, the inner radius is -set to zero.

-
-
Parameters
-
    -
  • d (float) – Depth of the Cee section

  • -
  • b (float) – Width of the Cee section

  • -
  • l (float) – Lip of the Cee section

  • -
  • t (float) – Thickness of the Cee section

  • -
  • r_out (float) – Outer radius of the Cee section

  • -
  • n_r (int) – Number of points discretising the outer radius

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
Raises
-

Exception – Lip length must be greater than the outer radius

-
-
-

The following example creates a Cee section with a depth of 125, a width of 50, a lip of 30, a -thickness of 1.5 and an outer radius of 6, using 8 points to discretise the radius. A mesh is -generated with a maximum triangular area of 0.25:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.CeeSection(d=125, b=50, l=30, t=1.5, r_out=6, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[0.25])
-
-
-
-../_images/cee_geometry.png -

Cee section geometry.

-
-
-../_images/cee_mesh.png -
-
- -
-
-
-

Zed Section

-
-
-
-class sectionproperties.pre.sections.ZedSection(d, b_l, b_r, l, t, r_out, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a Zed section with the bottom left corner at the origin (0, 0), with depth d, -left flange width b_l, right flange width b_r, lip l, thickness t and outer radius -r_out, using n_r points to construct the radius. If the outer radius is less than the -thickness of the Zed Section, the inner radius is set to zero.

-
-
Parameters
-
    -
  • d (float) – Depth of the Zed section

  • -
  • b_l (float) – Left flange width of the Zed section

  • -
  • b_r (float) – Right flange width of the Zed section

  • -
  • l (float) – Lip of the Zed section

  • -
  • t (float) – Thickness of the Zed section

  • -
  • r_out (float) – Outer radius of the Zed section

  • -
  • n_r (int) – Number of points discretising the outer radius

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
Raises
-

Exception – Lip length must be greater than the outer radius

-
-
-

The following example creates a Zed section with a depth of 100, a left flange width of 40, a -right flange width of 50, a lip of 20, a thickness of 1.2 and an outer radius of 5, using 8 -points to discretise the radius. A mesh is generated with a maximum triangular area of 0.15:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.ZedSection(d=100, b_l=40, b_r=50, l=20, t=1.2, r_out=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[0.15])
-
-
-
-../_images/zed_geometry.png -

Zed section geometry.

-
-
-../_images/zed_mesh.png -
-
- -
-
-
-

Cruciform Section

-
-
-
-class sectionproperties.pre.sections.CruciformSection(d, b, t, r, n_r, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a cruciform section centered at the origin (0, 0), with depth d, width b, -thickness t and root radius r, using n_r points to construct the root radius.

-
-
Parameters
-
    -
  • d (float) – Depth of the cruciform section

  • -
  • b (float) – Width of the cruciform section

  • -
  • t (float) – Thickness of the cruciform section

  • -
  • r (float) – Root radius of the cruciform section

  • -
  • n_r (int) – Number of points discretising the root radius

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a cruciform section with a depth of 250, a width of 175, a -thickness of 12 and a root radius of 16, using 16 points to discretise the radius. A mesh is -generated with a maximum triangular area of 5.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.CruciformSection(d=250, b=175, t=12, r=16, n_r=16)
-mesh = geometry.create_mesh(mesh_sizes=[5.0])
-
-
-
-../_images/cruciform_geometry.png -

Cruciform section geometry.

-
-
-../_images/cruciform_mesh.png -
-
- -
-
-
-

Polygon Section

-
-
-
-class sectionproperties.pre.sections.PolygonSection(d, t, n_sides, r_in=0, n_r=1, rot=0, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a regular hollow polygon section centered at (0, 0), with a pitch circle -diameter of bounding polygon d, thickness t, number of sides n_sides and an optional -inner radius r_in, using n_r points to construct the inner and outer radii (if radii is -specified).

-
-
Parameters
-
    -
  • d (float) – Pitch circle diameter of the outer bounding polygon (i.e. diameter of circle -that passes through all vertices of the outer polygon)

  • -
  • t (float) – Thickness of the polygon section wall

  • -
  • r_in (float) – Inner radius of the polygon corners. By default, if not specified, a polygon -with no corner radii is generated.

  • -
  • n_r (int) – Number of points discretising the inner and outer radii, ignored if no inner -radii is specified

  • -
  • rot – Initial counterclockwise rotation in degrees. By default bottom face is aligned -with x axis.

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
Raises
-

Exception – Number of sides in polygon must be greater than or equal to 3

-
-
-

The following example creates an Octagonal section (8 sides) with a diameter of 200, a -thickness of 6 and an inner radius of 20, using 12 points to discretise the inner and outer -radii. A mesh is generated with a maximum triangular area of 5:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.PolygonSection(d=200, t=6, n_sides=8, r_in=20, n_r=12)
-mesh = geometry.create_mesh(mesh_sizes=[5])
-
-
-
-../_images/polygon_geometry.png -

Octagonal section geometry.

-
-
-../_images/polygon_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-

Box Girder Section

-
-
-
-class sectionproperties.pre.sections.BoxGirderSection(d, b_t, b_b, t_ft, t_fb, t_w, shift=[0, 0])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a Box Girder section centered at at (max(b_t, b_b)/2, d/2), with depth d, top -width b_t, bottom width b_b, top flange thickness t_ft, bottom flange thickness t_fb -and web thickness t_w.

-
-
Parameters
-
    -
  • d (float) – Depth of the Box Girder section

  • -
  • b_t (float) – Top width of the Box Girder section

  • -
  • b_b (float) – Bottom width of the Box Girder section

  • -
  • t_ft (float) – Top lange thickness of the Box Girder section

  • -
  • t_fb (float) – Bottom flange thickness of the Box Girder section

  • -
  • t_w (float) – Web thickness of the Box Girder section

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
-
-
-

The following example creates a Box Gider section with a depth of 1200, a top width of 1200, a -bottom width of 400, a top flange thickness of 16, a bottom flange thickness of 12 and a web -thickness of 8. A mesh is generated with a maximum triangular area of 5.0:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.BoxGirderSection(d=1200, b_t=1200, b_b=400, t_ft=100, t_fb=80, t_w=50)
-mesh = geometry.create_mesh(mesh_sizes=[200.0])
-
-
-
-../_images/box_girder_geometry.png -

Box Girder geometry.

-
-
-../_images/box_girder_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-
-
-
-

Arbitrary Cross-Section Geometries

-

If none of the above classes gives you what you need, you can create a -CustomSection geometry object, which is defined by a list -of points (nodes), facets (node connectivities) and hole locations:

-
-
-class sectionproperties.pre.sections.CustomSection(points, facets, holes, control_points, shift=[0, 0], perimeter=[])[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Constructs a cross-section from a list of points, facets, holes and a user specified control -point.

-
-
Parameters
-
    -
  • points (list[list[float, float]]) – List of points (x, y) defining the vertices of the cross-section

  • -
  • facets (list[list[int, int]]) – List of point index pairs (p1, p2) defining the edges of the cross-section

  • -
  • holes (list[list[float, float]]) – List of points (x, y) defining the locations of holes within the cross-section. -If there are no holes, provide an empty list [].

  • -
  • control_points (list[list[float, float]]) – A list of points (x, y) that define different regions of the -cross-section. A control point is an arbitrary point within a region enclosed by facets.

  • -
  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • -
  • perimeter – List of facet indices defining the perimeter of the cross-section

  • -
-
-
-

The following example creates a hollow trapezium with a base width of 100, top width of 50, -height of 50 and a wall thickness of 10. A mesh is generated with a maximum triangular area of -2.0:

-
import sectionproperties.pre.sections as sections
-
-points = [[0, 0], [100, 0], [75, 50], [25, 50], [15, 10], [85, 10], [70, 40], [30, 40]]
-facets = [[0, 1], [1, 2], [2, 3], [3, 0], [4, 5], [5, 6], [6, 7], [7, 4]]
-holes = [[50, 25]]
-control_points = [[5, 5]]
-perimeter = [0, 1, 2, 3]
-
-geometry = sections.CustomSection(
-    points, facets, holes, control_points, perimeter=perimeter
-)
-mesh = geometry.create_mesh(mesh_sizes=[2.0])
-
-
-
-../_images/custom_geometry.png -

Custom section geometry.

-
-
-../_images/custom_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-

Note

-

Ensure that the control_points you choose lie within the -CustomSection. If any of the control_points are -outside the region, on an edge or within a hole, the meshing algorithm will likely not treat -distinct areas within the CustomSection as a separate -regions and mesh refinements may not work as anticipated.

-
-
-

Note

-

In order to calculate the perimeter of the cross-section be sure to enter the facet -indices that correspond to the perimeter of your cross-section.

-
-
-
-

Merging Geometries

-

If you wish to merge multiple Geometry objects into a -single object, you can use the MergedSection class:

-
-
-class sectionproperties.pre.sections.MergedSection(sections)[source]
-

Bases: sectionproperties.pre.sections.Geometry

-

Merges a number of section geometries into one geometry. Note that for the meshing algorithm -to work, there needs to be connectivity between all regions of the provided geometries. -Overlapping of geometries is permitted.

-
-
Parameters
-

sections (list[Geometry]) – A list of geometry objects to merge into one -Geometry object

-
-
-

The following example creates a combined cross-section with a 150x100x6 RHS placed on its side -on top of a 200UB25.4. A mesh is generated with a maximum triangle size of 5.0 for the -I-section and 2.5 for the RHS:

-
import sectionproperties.pre.sections as sections
-
-isection = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
-box = sections.Rhs(d=100, b=150, t=6, r_out=15, n_r=8, shift=[-8.5, 203])
-
-geometry = sections.MergedSection([isection, box])
-geometry.clean_geometry()
-mesh = geometry.create_mesh(mesh_sizes=[5.0, 2.5])
-
-
-
-../_images/merged_geometry.png -

Merged section geometry.

-
-
-../_images/merged_mesh.png -
-
- -
-

Note

-

There must be connectivity between the Geometry -objects that you wish to merge. It is currently not possible to analyse a cross-section that is -composed of two or more unconnected domains.

-
-
-

Note

-

You may need to overwrite the perimeter facets list if predefined sections are used. -Enabling labels while plotting the geometry is an easy way to manually identify the facet indices -that make up the perimeter of the cross-section.

-
-
-
-

Cleaning the Geometry

-

When creating a merged section often there are overlapping facets or duplicate nodes. These -geometry artefacts can cause difficulty for the meshing algorithm. It is therefore recommended to -clean the geometry after merging sections which may result in overlapping or intersecting facets, -or duplicate nodes. Cleaning the geometry can be carried out by using the -clean_geometry() method:

-
-
-Geometry.clean_geometry(verbose=False)[source]
-

Peforms a full clean on the geometry.

-
-
Parameters
-

verbose (bool) – If set to true, information related to the geometry cleaning process -is printed to the terminal.

-
-
-
-

Note

-

Cleaning the geometry is always recommended when creating a merged section, -which may result in overlapping or intersecting facets, or duplicate nodes.

-
-
- -
-
-

Perimeter Offset

-

The perimeter of a cross-section geometry can be offset by using the -offset_perimeter() method:

-
-
-sectionproperties.pre.offset.offset_perimeter(geometry, offset, side='left', plot_offset=False)[source]
-

Offsets the perimeter of a geometry of a Geometry -object by a certain distance. Note that the perimeter facet list must be entered in a -consecutive order.

-
-
Parameters
-
    -
  • geometry (Geometry) – Cross-section geometry object

  • -
  • offset (float) – Offset distance for the perimeter

  • -
  • side (string) – Side of the perimeter offset, either ‘left’ or ‘right’. E.g. ‘left’ for a -counter-clockwise offsets the perimeter inwards.

  • -
  • plot_offset (bool) – If set to True, generates a plot comparing the old and new geometry

  • -
-
-
-

The following example ‘corrodes’ a 200UB25 I-section by 1.5 mm and compares a few of the -section properties:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.pre.offset import offset_perimeter
-from sectionproperties.analysis.cross_section import CrossSection
-
-# calculate original section properties
-original_geometry = sections.ISection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=16)
-original_mesh = original_geometry.create_mesh(mesh_sizes=[3.0])
-original_section = CrossSection(original_geometry, original_mesh)
-original_section.calculate_geometric_properties()
-original_area = original_section.get_area()
-(original_ixx, _, _) = original_section.get_ic()
-
-# calculate corroded section properties
-corroded_geometry = offset_perimeter(original_geometry, 1.5, plot_offset=True)
-corroded_mesh = corroded_geometry.create_mesh(mesh_sizes=[3.0])
-corroded_section = CrossSection(corroded_geometry, corroded_mesh)
-corroded_section.calculate_geometric_properties()
-corroded_area = corroded_section.get_area()
-(corroded_ixx, _, _) = corroded_section.get_ic()
-
-# compare section properties
-print("Area reduction = {0:.2f}%".format(
-    100 * (original_area - corroded_area) / original_area))
-print("Ixx reduction = {0:.2f}%".format(
-    100 *(original_ixx - corroded_ixx) / original_ixx))
-
-
-

The following plot is generated by the above example:

-
-../_images/offset_example.png -

200UB25 with 1.5 mm corrosion.

-
-

The following is printed to the terminal:

-
Area reduction = 41.97%
-Ixx reduction = 39.20%
-
-
-
- -
-

Note

-

All the built-in sections in the sections module are built using an anti-clockwise -facet direction. As a result, side=’left’ will reduce the cross-section, while side=’right’ will -increase the cross-section.

-
-
-

Note

-

The control_points may need to be manually re-assigned if reducing the cross-section -moves the control_point outside the geometry.

-
-
-

Warning

-

This feature is a beta addition and as a result may produce some errors if the -offsetting drastically changes the geometry.

-
-
-
-

Visualising the Geometry

-

Geometry objects can be visualised by using the -plot_geometry() method:

-
-
-Geometry.plot_geometry(ax=None, pause=True, labels=False, perimeter=False)[source]
-

Plots the geometry defined by the input section. If no axes object is supplied a new -figure and axis is created.

-
-
Parameters
-
    -
  • ax (matplotlib.axes.Axes) – Axes object on which the mesh is plotted

  • -
  • pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

  • -
  • labels (bool) – If set to true, node and facet labels are displayed

  • -
  • perimeter (bool) – If set to true, boldens the perimeter of the cross-section

  • -
-
-
-

The following example creates a CHS discretised with 64 points, with a diameter of 48 and -thickness of 3.2, and plots the geometry:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.Chs(d=48, t=3.2, n=64)
-geometry.plot_geometry()
-
-
-
-../_images/chs_geometry.png -

Geometry generated by the above example.

-
-
- -
-
-

Generating a Mesh

-

A finite element mesh is required to perform a cross-section analysis. A finite element mesh can -be created by using the create_mesh() method:

-
-
-Geometry.create_mesh(mesh_sizes)[source]
-

Creates a quadratic triangular mesh from the Geometry object.

-
-
Parameters
-

mesh_sizes – A list of maximum element areas corresponding to each region within the -cross-section geometry.

-
-
Returns
-

Object containing generated mesh data

-
-
Return type
-

meshpy.triangle.MeshInfo

-
-
Raises
-

AssertionError – If the number of mesh sizes does not match the number of regions

-
-
-

The following example creates a circular cross-section with a diameter of 50 with 64 -points, and generates a mesh with a maximum triangular area of 2.5:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.CircularSection(d=50, n=64)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-
-
-
-../_images/circle_mesh.png -

Mesh generated from the above geometry.

-
-
- -
-

Warning

-

The length of mesh_sizes must match the number of regions -in the geometry object.

-
-
-
-

Defining Material Properties

-

Composite cross-sections can be analysed by specifying different material properties for each -section of the mesh. Materials are defined in sectionproperties by creating a -Material object:

-
-
-class sectionproperties.pre.pre.Material(name, elastic_modulus, poissons_ratio, yield_strength, color='w')[source]
-

Bases: object

-

Class for structural materials.

-

Provides a way of storing material properties related to a specific material. The color can be -a multitude of different formats, refer to https://matplotlib.org/api/colors_api.html and -https://matplotlib.org/examples/color/named_colors.html for more information.

-
-
Parameters
-
    -
  • name (string) – Material name

  • -
  • elastic_modulus (float) – Material modulus of elasticity

  • -
  • poissons_ratio (float) – Material Poisson’s ratio

  • -
  • yield_strength (float) – Material yield strength

  • -
  • color (matplotlib.colors) – Material color for rendering

  • -
-
-
Variables
-
    -
  • name (string) – Material name

  • -
  • elastic_modulus (float) – Material modulus of elasticity

  • -
  • poissons_ratio (float) – Material Poisson’s ratio

  • -
  • shear_modulus (float) – Material shear modulus, derived from the elastic modulus and -Poisson’s ratio assuming an isotropic material

  • -
  • yield_strength (float) – Material yield strength

  • -
  • color (matplotlib.colors) – Material color for rendering

  • -
-
-
-

The following example creates materials for concrete, steel and timber:

-
from sectionproperties.pre.pre import Material
-
-concrete = Material(
-    name='Concrete', elastic_modulus=30.1e3, poissons_ratio=0.2, yield_strength=32,
-        color='lightgrey'
-)
-steel = Material(
-    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500,
-        color='grey'
-)
-timber = Material(
-    name='Timber', elastic_modulus=8e3, poissons_ratio=0.35, yield_strength=20,
-        color='burlywood'
-)
-
-
-
- -
-
- - -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/rst/installation.html b/docs/build/html/rst/installation.html deleted file mode 100644 index fa74e98d..00000000 --- a/docs/build/html/rst/installation.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - - - - - - Installation — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- - - - -
-
-
-
- -
-

Installation

-

These instructions will get you a copy of sectionproperties up and running on -your local machine. You will need a working copy of python>=3.5 on your machine.

-
-

Installing sectionproperties

-

sectionproperties uses meshpy to efficiently generate a conforming triangular -mesh in order to perform a finite element analysis of the structural cross-section. -The installation procedure for of meshpy depends on your local machine.

-
-

UNIX (MacOS/Linux)

-

sectionproperties and all of its dependencies can be installed through the -python package index:

-
$ pip install sectionproperties
-
-
-

If you have any issues installing meshpy, refer to the installation instructions -on its github page or its -documentation.

-
-
-

Windows

-

Install meshpy by downloading the appropriate installation wheel.

-

Navigate to the location of the downloaded wheel and install using pip:

-
$ cd Downloads
-$ pip install MeshPy‑2018.2.1‑cp36‑cp36m‑win_amd64.whl
-
-
-

Once meshpy has been installed, the rest of the sectionproperties package can -be installed using the python package index:

-
$ pip install sectionproperties
-
-
-
-
-
-

Testing the Installation

-

Python unittest modules are located in the sectionpropertes.tests package. -To see if your installation is working correctly, run this simple test:

-
$ python -m unittest sectionproperties.tests.test_rectangle
-
-
-
-
- - -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/rst/post.html b/docs/build/html/rst/post.html deleted file mode 100644 index f157a732..00000000 --- a/docs/build/html/rst/post.html +++ /dev/null @@ -1,2093 +0,0 @@ - - - - - - - - - - - Viewing the Results — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- - - - -
-
-
-
- -
-

Viewing the Results

-
-

Printing a List of the Section Properties

-

A list of section properties that have been calculated by various analyses can -be printed to the terminal using the display_results() -method that belongs to every -CrossSection object.

-
-
-CrossSection.display_results(fmt='8.6e')[source]
-

Prints the results that have been calculated to the terminal.

-
-
Parameters
-

fmt (string) – Number formatting string

-
-
-

The following example displays the geometric section properties for a 100D x 50W rectangle -with three digits after the decimal point:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.RectangularSection(d=100, b=50)
-mesh = geometry.create_mesh(mesh_sizes=[5])
-
-section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-
-section.display_results(fmt='.3f')
-
-
-
- -
-
-

Getting Specific Section Properties

-

Alternatively, there are a number of methods that can be called on the -CrossSection object to return -a specific section property:

-
-

Cross-Section Area

-
-
-CrossSection.get_area()[source]
-
-
Returns
-

Cross-section area

-
-
Return type
-

float

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-area = section.get_area()
-
-
-
- -
-
-

Cross-Section Perimeter

-
-
-CrossSection.get_perimeter()[source]
-
-
Returns
-

Cross-section perimeter

-
-
Return type
-

float

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-perimeter = section.get_perimeter()
-
-
-
- -
-
-

Axial Rigidity

-

If material properties have been specified, returns the axial rigidity of the -section.

-
-
-CrossSection.get_ea()[source]
-
-
Returns
-

Modulus weighted area (axial rigidity)

-
-
Return type
-

float

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-ea = section.get_ea()
-
-
-
- -
-
-

First Moments of Area

-
-
-CrossSection.get_q()[source]
-
-
Returns
-

First moments of area about the global axis (qx, qy)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(qx, qy) = section.get_q()
-
-
-
- -
-
-

Second Moments of Area

-
-
-CrossSection.get_ig()[source]
-
-
Returns
-

Second moments of area about the global axis (ixx_g, iyy_g, ixy_g)

-
-
Return type
-

tuple(float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(ixx_g, iyy_g, ixy_g) = section.get_ig()
-
-
-
- -
-
-CrossSection.get_ic()[source]
-
-
Returns
-

Second moments of area centroidal axis (ixx_c, iyy_c, ixy_c)

-
-
Return type
-

tuple(float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(ixx_c, iyy_c, ixy_c) = section.get_ic()
-
-
-
- -
-
-CrossSection.get_ip()[source]
-
-
Returns
-

Second moments of area about the principal axis (i11_c, i22_c)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(i11_c, i22_c) = section.get_ip()
-
-
-
- -
-
-

Elastic Centroid

-
-
-CrossSection.get_c()[source]
-
-
Returns
-

Elastic centroid (cx, cy)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(cx, cy) = section.get_c()
-
-
-
- -
-
-

Section Moduli

-
-
-CrossSection.get_z()[source]
-
-
Returns
-

Elastic section moduli about the centroidal axis with respect to the top and -bottom fibres (zxx_plus, zxx_minus, zyy_plus, zyy_minus)

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(zxx_plus, zxx_minus, zyy_plus, zyy_minus) = section.get_z()
-
-
-
- -
-
-CrossSection.get_zp()[source]
-
-
Returns
-

Elastic section moduli about the principal axis with respect to the top and bottom -fibres (z11_plus, z11_minus, z22_plus, z22_minus)

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(z11_plus, z11_minus, z22_plus, z22_minus) = section.get_zp()
-
-
-
- -
-
-

Radii of Gyration

-
-
-CrossSection.get_rc()[source]
-
-
Returns
-

Radii of gyration about the centroidal axis (rx, ry)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(rx, ry) = section.get_rc()
-
-
-
- -
-
-CrossSection.get_rp()[source]
-
-
Returns
-

Radii of gyration about the principal axis (r11, r22)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-(r11, r22) = section.get_rp()
-
-
-
- -
-
-

Principal Axis Angle

-
-
-CrossSection.get_phi()[source]
-
-
Returns
-

Principal bending axis angle

-
-
Return type
-

float

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-phi = section.get_phi()
-
-
-
- -
-
-

Torsion Constant

-
-
-CrossSection.get_j()[source]
-
-
Returns
-

St. Venant torsion constant

-
-
Return type
-

float

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-j = section.get_j()
-
-
-
- -
-
-

Shear Centre

-
-
-CrossSection.get_sc()[source]
-
-
Returns
-

Centroidal axis shear centre (elasticity approach) (x_se, y_se)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-(x_se, y_se) = section.get_sc()
-
-
-
- -
-
-CrossSection.get_sc_p()[source]
-
-
Returns
-

Principal axis shear centre (elasticity approach) (x11_se, y22_se)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-(x11_se, y22_se) = section.get_sc_p()
-
-
-
- -
-
-

Trefftz’s Shear Centre

-
-
-CrossSection.get_sc_t()[source]
-
-
Returns
-

Centroidal axis shear centre (Trefftz’s approach) (x_st, y_st)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-(x_st, y_st) = section.get_sc_t()
-
-
-
- -
-
-

Warping Constant

-
-
-CrossSection.get_gamma()[source]
-
-
Returns
-

Warping constant

-
-
Return type
-

float

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-gamma = section.get_gamma()
-
-
-
- -
-
-

Shear Area

-
-
-CrossSection.get_As()[source]
-
-
Returns
-

Shear area for loading about the centroidal axis (A_sx, A_sy)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-(A_sx, A_sy) = section.get_As()
-
-
-
- -
-
-CrossSection.get_As_p()[source]
-
-
Returns
-

Shear area for loading about the principal bending axis (A_s11, A_s22)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-(A_s11, A_s22) = section.get_As_p()
-
-
-
- -
-
-

Monosymmetry Constants

-
-
-CrossSection.get_beta()[source]
-
-
Returns
-

Monosymmetry constant for bending about both global axes (beta_x_plus, -beta_x_minus, beta_y_plus, beta_y_minus). The plus value relates to the top flange -in compression and the minus value relates to the bottom flange in compression.

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-(beta_x_plus, beta_x_minus, beta_y_plus, beta_y_minus) = section.get_beta()
-
-
-
- -
-
-CrossSection.get_beta_p()[source]
-
-
Returns
-

Monosymmetry constant for bending about both principal axes (beta_11_plus, -beta_11_minus, beta_22_plus, beta_22_minus). The plus value relates to the top -flange in compression and the minus value relates to the bottom flange in -compression.

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-(beta_11_plus, beta_11_minus, beta_22_plus, beta_22_minus) = section.get_beta_p()
-
-
-
- -
-
-

Plastic Centroid

-
-
-CrossSection.get_pc()[source]
-
-
Returns
-

Centroidal axis plastic centroid (x_pc, y_pc)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-(x_pc, y_pc) = section.get_pc()
-
-
-
- -
-
-CrossSection.get_pc_p()[source]
-
-
Returns
-

Principal bending axis plastic centroid (x11_pc, y22_pc)

-
-
Return type
-

tuple(float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-(x11_pc, y22_pc) = section.get_pc_p()
-
-
-
- -
-
-

Plastic Section Moduli

-
-
-CrossSection.get_s()[source]
-
-
Returns
-

Plastic section moduli about the centroidal axis (sxx, syy)

-
-
Return type
-

tuple(float, float)

-
-
-

If material properties have been specified, returns the plastic moment \(M_p = f_y S\).

-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-(sxx, syy) = section.get_s()
-
-
-
- -
-
-CrossSection.get_sp()[source]
-
-
Returns
-

Plastic section moduli about the principal bending axis (s11, s22)

-
-
Return type
-

tuple(float, float)

-
-
-

If material properties have been specified, returns the plastic moment -\(M_p = f_y S\).

-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-(s11, s22) = section.get_sp()
-
-
-
- -
-
-

Shape Factors

-
-
-CrossSection.get_sf()[source]
-
-
Returns
-

Centroidal axis shape factors with respect to the top and bottom fibres -(sf_xx_plus, sf_xx_minus, sf_yy_plus, sf_yy_minus)

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-(sf_xx_plus, sf_xx_minus, sf_yy_plus, sf_yy_minus) = section.get_sf()
-
-
-
- -
-
-CrossSection.get_sf_p()[source]
-
-
Returns
-

Principal bending axis shape factors with respect to the top and bottom fibres -(sf_11_plus, sf_11_minus, sf_22_plus, sf_22_minus)

-
-
Return type
-

tuple(float, float, float, float)

-
-
-
section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-(sf_11_plus, sf_11_minus, sf_22_plus, sf_22_minus) = section.get_sf_p()
-
-
-
- -
-
-
-

Section Property Centroids Plots

-

A plot of the centroids (elastic, plastic and shear centre) can be produced with -the finite element mesh in the background:

-
-
-CrossSection.plot_centroids(pause=True)[source]
-

Plots the elastic centroid, the shear centre, the plastic centroids and the principal -axis, if they have been calculated, on top of the finite element mesh.

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example analyses a 200 PFC section and displays a plot of -the centroids:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.PfcSection(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-
-section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-section.calculate_plastic_properties()
-
-section.plot_centroids()
-
-
-
-../_images/pfc_centroids.png -

Plot of the centroids generated by the above example.

-
-

The following example analyses a 150x90x12 UA section and displays a plot of the -centroids:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-
-section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-section.calculate_plastic_properties()
-
-section.plot_centroids()
-
-
-
-../_images/angle_centroids.png -

Plot of the centroids generated by the above example.

-
-
- -
-
-

Plotting Cross-Section Stresses

-

There are a number of methods that can be called from a StressResult -object to plot the various cross-section stresses. These methods take the following form:

-
-

StressResult.plot_(stress/vector)_(action)_(stresstype)

-
-

where:

-
    -
  • stress denotes a contour plot and vector denotes a vector plot.

  • -
  • action denotes the type of action causing the stress e.g. mxx for bending moment about the x-axis. Note that the action is omitted for stresses caused by the application of all actions.

  • -
  • stresstype denotes the type of stress that is being plotted e.g. zx for the x-component of shear stress.

  • -
-

The examples shown in the methods below are performed on a 150x90x12 UA -(unequal angle) section. The CrossSection -object is created below:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-
-
-

Primary Stress Plots

-
-

Axial Stress (\(\sigma_{zz,N}\))

-
-
-StressPost.plot_stress_n_zz(pause=True)[source]
-

Produces a contour plot of the normal stress \(\sigma_{zz,N}\) resulting from the -axial load \(N\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the normal stress within a 150x90x12 UA section resulting from -an axial force of 10 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(N=10e3)
-
-stress_post.plot_stress_n_zz()
-
-
-
-../_images/stress_n_zz.png -

Contour plot of the axial stress.

-
-
- -
-
-

Bending Stress (\(\sigma_{zz,Mxx}\))

-
-
-StressPost.plot_stress_mxx_zz(pause=True)[source]
-

Produces a contour plot of the normal stress \(\sigma_{zz,Mxx}\) resulting from the -bending moment \(M_{xx}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the normal stress within a 150x90x12 UA section resulting from -a bending moment about the x-axis of 5 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mxx=5e6)
-
-stress_post.plot_stress_mxx_zz()
-
-
-
-../_images/stress_mxx_zz.png -

Contour plot of the bending stress.

-
-
- -
-
-

Bending Stress (\(\sigma_{zz,Myy}\))

-
-
-StressPost.plot_stress_myy_zz(pause=True)[source]
-

Produces a contour plot of the normal stress \(\sigma_{zz,Myy}\) resulting from the -bending moment \(M_{yy}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the normal stress within a 150x90x12 UA section resulting from -a bending moment about the y-axis of 2 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Myy=2e6)
-
-stress_post.plot_stress_myy_zz()
-
-
-
-../_images/stress_myy_zz.png -

Contour plot of the bending stress.

-
-
- -
-
-

Bending Stress (\(\sigma_{zz,M11}\))

-
-
-StressPost.plot_stress_m11_zz(pause=True)[source]
-

Produces a contour plot of the normal stress \(\sigma_{zz,M11}\) resulting from the -bending moment \(M_{11}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the normal stress within a 150x90x12 UA section resulting from -a bending moment about the 11-axis of 5 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(M11=5e6)
-
-stress_post.plot_stress_m11_zz()
-
-
-
-../_images/stress_m11_zz.png -

Contour plot of the bending stress.

-
-
- -
-
-

Bending Stress (\(\sigma_{zz,M22}\))

-
-
-StressPost.plot_stress_m22_zz(pause=True)[source]
-

Produces a contour plot of the normal stress \(\sigma_{zz,M22}\) resulting from the -bending moment \(M_{22}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the normal stress within a 150x90x12 UA section resulting from -a bending moment about the 22-axis of 2 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(M22=5e6)
-
-stress_post.plot_stress_m22_zz()
-
-
-
-../_images/stress_m22_zz.png -

Contour plot of the bending stress.

-
-
- -
-
-

Bending Stress (\(\sigma_{zz,\Sigma M}\))

-
-
-StressPost.plot_stress_m_zz(pause=True)[source]
-

Produces a contour plot of the normal stress \(\sigma_{zz,\Sigma M}\) resulting from -all bending moments \(M_{xx} + M_{yy} + M_{11} + M_{22}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the normal stress within a 150x90x12 UA section resulting from -a bending moment about the x-axis of 5 kN.m, a bending moment about the y-axis of 2 kN.m -and a bending moment of 3 kN.m about the 11-axis:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mxx=5e6, Myy=2e6, M11=3e6)
-
-stress_post.plot_stress_m_zz()
-
-
-
-../_images/stress_m_zz.png -

Contour plot of the bending stress.

-
-
- -
-
-

Torsion Stress (\(\sigma_{zx,Mzz}\))

-
-
-StressPost.plot_stress_mzz_zx(pause=True)[source]
-

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx,Mzz}\) -resulting from the torsion moment \(M_{zz}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the x-component of the shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6)
-
-stress_post.plot_stress_mzz_zx()
-
-
-
-../_images/stress_mzz_zx.png -

Contour plot of the shear stress.

-
-
- -
-
-

Torsion Stress (\(\sigma_{zy,Mzz}\))

-
-
-StressPost.plot_stress_mzz_zy(pause=True)[source]
-

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy,Mzz}\) -resulting from the torsion moment \(M_{zz}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the y-component of the shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6)
-
-stress_post.plot_stress_mzz_zy()
-
-
-
-../_images/stress_mzz_zy.png -

Contour plot of the shear stress.

-
-
- -
-
-

Torsion Stress (\(\sigma_{zxy,Mzz}\))

-
-
-StressPost.plot_stress_mzz_zxy(pause=True)[source]
-

Produces a contour plot of the resultant shear stress \(\sigma_{zxy,Mzz}\) resulting -from the torsion moment \(M_{zz}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots a contour of the resultant shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6)
-
-stress_post.plot_stress_mzz_zxy()
-
-
-
-../_images/stress_mzz_zxy.png -

Contour plot of the shear stress.

-
-
- -
-
-StressPost.plot_vector_mzz_zxy(pause=True)[source]
-

Produces a vector plot of the resultant shear stress \(\sigma_{zxy,Mzz}\) resulting -from the torsion moment \(M_{zz}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example generates a vector plot of the shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6)
-
-stress_post.plot_vector_mzz_zxy()
-
-
-
-../_images/vector_mzz_zxy.png -

Vector plot of the shear stress.

-
-
- -
-
-

Shear Stress (\(\sigma_{zx,Vx}\))

-
-
-StressPost.plot_stress_vx_zx(pause=True)[source]
-

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx,Vx}\) -resulting from the shear force \(V_{x}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the x-component of the shear stress within a 150x90x12 UA -section resulting from a shear force in the x-direction of 15 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3)
-
-stress_post.plot_stress_vx_zx()
-
-
-
-../_images/stress_vx_zx.png -

Contour plot of the shear stress.

-
-
- -
-
-

Shear Stress (\(\sigma_{zy,Vx}\))

-
-
-StressPost.plot_stress_vx_zy(pause=True)[source]
-

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy,Vx}\) -resulting from the shear force \(V_{x}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the y-component of the shear stress within a 150x90x12 UA -section resulting from a shear force in the x-direction of 15 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3)
-
-stress_post.plot_stress_vx_zy()
-
-
-
-../_images/stress_vx_zy.png -

Contour plot of the shear stress.

-
-
- -
-
-

Shear Stress (\(\sigma_{zxy,Vx}\))

-
-
-StressPost.plot_stress_vx_zxy(pause=True)[source]
-

Produces a contour plot of the resultant shear stress \(\sigma_{zxy,Vx}\) resulting -from the shear force \(V_{x}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots a contour of the resultant shear stress within a 150x90x12 UA -section resulting from a shear force in the x-direction of 15 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3)
-
-stress_post.plot_stress_vx_zxy()
-
-
-
-../_images/stress_vx_zxy.png -

Contour plot of the shear stress.

-
-
- -
-
-StressPost.plot_vector_vx_zxy(pause=True)[source]
-

Produces a vector plot of the resultant shear stress \(\sigma_{zxy,Vx}\) resulting -from the shear force \(V_{x}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example generates a vector plot of the shear stress within a 150x90x12 UA -section resulting from a shear force in the x-direction of 15 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3)
-
-stress_post.plot_vector_vx_zxy()
-
-
-
-../_images/vector_vx_zxy.png -

Vector plot of the shear stress.

-
-
- -
-
-

Shear Stress (\(\sigma_{zx,Vy}\))

-
-
-StressPost.plot_stress_vy_zx(pause=True)[source]
-

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx,Vy}\) -resulting from the shear force \(V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the x-component of the shear stress within a 150x90x12 UA -section resulting from a shear force in the y-direction of 30 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vy=30e3)
-
-stress_post.plot_stress_vy_zx()
-
-
-
-../_images/stress_vy_zx.png -

Contour plot of the shear stress.

-
-
- -
-
-

Shear Stress (\(\sigma_{zy,Vy}\))

-
-
-StressPost.plot_stress_vy_zy(pause=True)[source]
-

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy,Vy}\) -resulting from the shear force \(V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the y-component of the shear stress within a 150x90x12 UA -section resulting from a shear force in the y-direction of 30 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vy=30e3)
-
-stress_post.plot_stress_vy_zy()
-
-
-
-../_images/stress_vy_zy.png -

Contour plot of the shear stress.

-
-
- -
-
-

Shear Stress (\(\sigma_{zxy,Vy}\))

-
-
-StressPost.plot_stress_vy_zxy(pause=True)[source]
-

Produces a contour plot of the resultant shear stress \(\sigma_{zxy,Vy}\) resulting -from the shear force \(V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots a contour of the resultant shear stress within a 150x90x12 UA -section resulting from a shear force in the y-direction of 30 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vy=30e3)
-
-stress_post.plot_stress_vy_zxy()
-
-
-
-../_images/stress_vy_zxy.png -

Contour plot of the shear stress.

-
-
- -
-
-StressPost.plot_vector_vy_zxy(pause=True)[source]
-

Produces a vector plot of the resultant shear stress \(\sigma_{zxy,Vy}\) resulting -from the shear force \(V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example generates a vector plot of the shear stress within a 150x90x12 UA -section resulting from a shear force in the y-direction of 30 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vy=30e3)
-
-stress_post.plot_vector_vy_zxy()
-
-
-
-../_images/vector_vy_zxy.png -

Vector plot of the shear stress.

-
-
- -
-
-

Shear Stress (\(\sigma_{zx,\Sigma V}\))

-
-
-StressPost.plot_stress_v_zx(pause=True)[source]
-

Produces a contour plot of the x-component of the shear stress -\(\sigma_{zx,\Sigma V}\) resulting from the sum of the applied shear forces -\(V_{x} + V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the x-component of the shear stress within a 150x90x12 UA -section resulting from a shear force of 15 kN in the x-direction and 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)
-
-stress_post.plot_stress_v_zx()
-
-
-
-../_images/stress_v_zx.png -

Contour plot of the shear stress.

-
-
- -
-
-

Shear Stress (\(\sigma_{zy,\Sigma V}\))

-
-
-StressPost.plot_stress_v_zy(pause=True)[source]
-

Produces a contour plot of the y-component of the shear stress -\(\sigma_{zy,\Sigma V}\) resulting from the sum of the applied shear forces -\(V_{x} + V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the y-component of the shear stress within a 150x90x12 UA -section resulting from a shear force of 15 kN in the x-direction and 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)
-
-stress_post.plot_stress_v_zy()
-
-
-
-../_images/stress_v_zy.png -

Contour plot of the shear stress.

-
-
- -
-
-

Shear Stress (\(\sigma_{zxy,\Sigma V}\))

-
-
-StressPost.plot_stress_v_zxy(pause=True)[source]
-

Produces a contour plot of the resultant shear stress -\(\sigma_{zxy,\Sigma V}\) resulting from the sum of the applied shear forces -\(V_{x} + V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots a contour of the resultant shear stress within a 150x90x12 UA -section resulting from a shear force of 15 kN in the x-direction and 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)
-
-stress_post.plot_stress_v_zxy()
-
-
-
-../_images/stress_v_zxy.png -

Contour plot of the shear stress.

-
-
- -
-
-StressPost.plot_vector_v_zxy(pause=True)[source]
-

Produces a vector plot of the resultant shear stress -\(\sigma_{zxy,\Sigma V}\) resulting from the sum of the applied shear forces -\(V_{x} + V_{y}\).

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example generates a vector plot of the shear stress within a 150x90x12 UA -section resulting from a shear force of 15 kN in the x-direction and 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)
-
-stress_post.plot_vector_v_zxy()
-
-
-
-../_images/vector_v_zxy.png -

Vector plot of the shear stress.

-
-
- -
-
-
-

Combined Stress Plots

-
-

Normal Stress (\(\sigma_{zz}\))

-
-
-StressPost.plot_stress_zz(pause=True)[source]
-

Produces a contour plot of the combined normal stress \(\sigma_{zz}\) resulting from -all actions.

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the normal stress within a 150x90x12 UA section resulting from -an axial force of 100 kN, a bending moment about the x-axis of 5 kN.m and a bending moment -about the y-axis of 2 kN.m:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(N=100e3, Mxx=5e6, Myy=2e6)
-
-stress_post.plot_stress_zz()
-
-
-
-../_images/stress_zz.png -

Contour plot of the normal stress.

-
-
- -
-
-

Shear Stress (\(\sigma_{zx}\))

-
-
-StressPost.plot_stress_zx(pause=True)[source]
-

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx}\) -resulting from all actions.

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the x-component of the shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)
-
-stress_post.plot_stress_zx()
-
-
-
-../_images/stress_zx.png -

Contour plot of the shear stress.

-
-
- -
-
-

Shear Stress (\(\sigma_{zy}\))

-
-
-StressPost.plot_stress_zy(pause=True)[source]
-

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy}\) -resulting from all actions.

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots the y-component of the shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)
-
-stress_post.plot_stress_zy()
-
-
-
-../_images/stress_zy.png -

Contour plot of the shear stress.

-
-
- -
-
-

Shear Stress (\(\sigma_{zxy}\))

-
-
-StressPost.plot_stress_zxy(pause=True)[source]
-

Produces a contour plot of the resultant shear stress \(\sigma_{zxy}\) resulting -from all actions.

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots a contour of the resultant shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)
-
-stress_post.plot_stress_zxy()
-
-
-
-../_images/stress_zxy.png -

Contour plot of the shear stress.

-
-
- -
-
-StressPost.plot_vector_zxy(pause=True)[source]
-

Produces a vector plot of the resultant shear stress \(\sigma_{zxy}\) resulting -from all actions.

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example generates a vector plot of the shear stress within a 150x90x12 UA -section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the -y-direction:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)
-
-stress_post.plot_vector_zxy()
-
-
-
-../_images/vector_zxy.png -

Vector plot of the shear stress.

-
-
- -
-
-

von Mises Stress (\(\sigma_{vM}\))

-
-
-StressPost.plot_stress_vm(pause=True)[source]
-

Produces a contour plot of the von Mises stress \(\sigma_{vM}\) resulting from all -actions.

-
-
Parameters
-

pause (bool) – If set to true, the figure pauses the script until the window is closed. -If set to false, the script continues immediately after the window is rendered.

-
-
-

The following example plots a contour of the von Mises stress within a 150x90x12 UA section -resulting from the following actions:

-
    -
  • \(N = 50\) kN

  • -
  • \(M_{xx} = -5\) kN.m

  • -
  • \(M_{22} = 2.5\) kN.m

  • -
  • \(M_{zz} = 1.5\) kN.m

  • -
  • \(V_{x} = 10\) kN

  • -
  • \(V_{y} = 5\) kN

  • -
-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(
-    N=50e3, Mxx=-5e6, M22=2.5e6, Mzz=0.5e6, Vx=10e3, Vy=5e3
-)
-
-stress_post.plot_stress_vm()
-
-
-
-../_images/stress_vm.png -

Contour plot of the von Mises stress.

-
-
- -
-
-
-
-

Retrieving Cross-Section Stress

-

All cross-section stresses can be recovered using the get_stress() -method that belongs to every -StressPost object:

-
-
-StressPost.get_stress()[source]
-

Returns the stresses within each material belonging to the current -StressPost object.

-
-
Returns
-

A list of dictionaries containing the cross-section stresses for each material.

-
-
Return type
-

list[dict]

-
-
-

A dictionary is returned for each material in the cross-section, containing the following -keys and values:

-
    -
  • ‘Material’: Material name

  • -
  • ‘sig_zz_n’: Normal stress \(\sigma_{zz,N}\) resulting from the axial load \(N\)

  • -
  • ‘sig_zz_mxx’: Normal stress \(\sigma_{zz,Mxx}\) resulting from the bending moment -\(M_{xx}\)

  • -
  • ‘sig_zz_myy’: Normal stress \(\sigma_{zz,Myy}\) resulting from the bending moment -\(M_{yy}\)

  • -
  • ‘sig_zz_m11’: Normal stress \(\sigma_{zz,M11}\) resulting from the bending moment -\(M_{11}\)

  • -
  • ‘sig_zz_m22’: Normal stress \(\sigma_{zz,M22}\) resulting from the bending moment -\(M_{22}\)

  • -
  • ‘sig_zz_m’: Normal stress \(\sigma_{zz,\Sigma M}\) resulting from all bending -moments

  • -
  • ‘sig_zx_mzz’: x-component of the shear stress \(\sigma_{zx,Mzz}\) resulting from -the torsion moment

  • -
  • ‘sig_zy_mzz’: y-component of the shear stress \(\sigma_{zy,Mzz}\) resulting from -the torsion moment

  • -
  • ‘sig_zxy_mzz’: Resultant shear stress \(\sigma_{zxy,Mzz}\) resulting from the -torsion moment

  • -
  • ‘sig_zx_vx’: x-component of the shear stress \(\sigma_{zx,Vx}\) resulting from -the shear force \(V_{x}\)

  • -
  • ‘sig_zy_vx’: y-component of the shear stress \(\sigma_{zy,Vx}\) resulting from -the shear force \(V_{x}\)

  • -
  • ‘sig_zxy_vx’: Resultant shear stress \(\sigma_{zxy,Vx}\) resulting from the shear -force \(V_{x}\)

  • -
  • ‘sig_zx_vy’: x-component of the shear stress \(\sigma_{zx,Vy}\) resulting from -the shear force \(V_{y}\)

  • -
  • ‘sig_zy_vy’: y-component of the shear stress \(\sigma_{zy,Vy}\) resulting from -the shear force \(V_{y}\)

  • -
  • ‘sig_zxy_vy’: Resultant shear stress \(\sigma_{zxy,Vy}\) resulting from the shear -force \(V_{y}\)

  • -
  • ‘sig_zx_v’: x-component of the shear stress \(\sigma_{zx,\Sigma V}\) resulting -from all shear forces

  • -
  • ‘sig_zy_v’: y-component of the shear stress \(\sigma_{zy,\Sigma V}\) resulting -from all shear forces

  • -
  • ‘sig_zxy_v’: Resultant shear stress \(\sigma_{zxy,\Sigma V}\) resulting from all -shear forces

  • -
  • ‘sig_zz’: Combined normal stress \(\sigma_{zz}\) resulting from all actions

  • -
  • ‘sig_zx’: x-component of the shear stress \(\sigma_{zx}\) resulting from all -actions

  • -
  • ‘sig_zy’: y-component of the shear stress \(\sigma_{zy}\) resulting from all -actions

  • -
  • ‘sig_zxy’: Resultant shear stress \(\sigma_{zxy}\) resulting from all actions

  • -
  • ‘sig_vm’: von Mises stress \(\sigma_{vM}\) resulting from all actions

  • -
-

The following example returns the normal stress within a 150x90x12 UA section resulting -from an axial force of 10 kN:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-section = CrossSection(geometry, mesh)
-
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-stress_post = section.calculate_stress(N=10e3)
-
-stresses = stress_post.get_stress()
-print('Material: {0}'.format(stresses[0]['Material']))
-print('Axial Stresses: {0}'.format(stresses[0]['sig_zz_n']))
-
-$ Material: default
-$ Axial Stresses: [3.6402569 3.6402569 3.6402569 ... 3.6402569 3.6402569 3.6402569]
-
-
-
- -
-
- - -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/rst/structure.html b/docs/build/html/rst/structure.html deleted file mode 100644 index 05692998..00000000 --- a/docs/build/html/rst/structure.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - - - - Structure of an Analysis — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- - - - -
-
-
-
- -
-

Structure of an Analysis

-

The process of performing a cross-section analysis with sectionproperties can -be broken down into three stages:

-
    -
  1. Pre-Processor: The input geometry and finite element mesh is created.

  2. -
  3. Solver: The cross-section properties are determined.

  4. -
  5. Post-Processor: The results are presented in a number of different formats.

  6. -
-
-

Creating a Geometry and Mesh

-

The dimensions and shape of the cross-section to be analysed define the geometry -of the cross-section. The sections Module provides a number of classes -to easily generate either commonly used structural sections or an arbitrary -cross-section, defined by a list of points, facets and holes. All of the classes -in the sections Module inherit from the -Geometry class.

-

The final stage in the pre-processor involves generating a finite element mesh of -the geometry that the solver can use to calculate the cross-section properties. -This can easily be performed using the create_mesh() -method that all Geometry objects have -access to.

-

The following example creates a geometry object with a circular cross-section. -The diameter of the circle is 50 and 64 points are used to discretise the circumference -of the circle. A finite element mesh is generated with a maximum triangular area -of 2.5:

-
import sectionproperties.pre.sections as sections
-
-geometry = sections.CircularSection(d=50, n=64)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-
-
-
-../_images/circle_mesh.png -

Finite element mesh generated by the above example.

-
-

If you are analysing a composite section, or would like to include material properties -in your model, material properties can be created using the Material -class. The following example creates a steel material object:

-
from sectionproperties.pre.pre import Material
-
-steel = Material(name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500,
-                 color='grey')
-
-
-

Refer to Creating a Geometry, Mesh and Material Properties for a more detailed explanation of the pre-processing -stage.

-
-
-

Running an Analysis

-

The solver operates on a CrossSection -object and can perform four different analysis types:

-
    -
  • Geometric Analysis: calculates area properties.

  • -
  • Plastic Analysis: calculates plastic properties.

  • -
  • Warping Analysis: calculates torsion and shear properties.

  • -
  • Stress Analysis: calculates cross-section stresses.

  • -
-

The geometric analysis can be performed individually. However in order to perform -a warping or plastic analysis, a geometric analysis must first be performed. Further, -in order to carry out a stress analysis, both a geometric and warping analysis must -have already been executed. The program will display a helpful error if you try -to run any of these analyses without first performing the prerequisite analyses.

-

The following example performs a geometric and warping analysis on the circular -cross-section defined in the previous section with steel used as the material -property:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-from sectionproperties.pre.pre import Material
-
-geometry = sections.CircularSection(d=50, n=64)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-steel = Material(name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500,
-                 color='grey')
-
-section = CrossSection(geometry, mesh, [steel])
-section.calculate_geometric_properties()
-section.calculate_warping_properties()
-
-
-

Refer to Running an Analysis for a more detailed explanation of the solver stage.

-
-
-

Viewing the Results

-

Once an analysis has been performed, a number of methods belonging to the -CrossSection object can be called -to present the cross-section results in a number of different formats. For example -the cross-section properties can be printed to the terminal, a plot of the centroids -displayed and the cross-section stresses visualised in a contour plot.

-

The following example analyses a 200 PFC section. The cross-section properties -are printed to the terminal and a plot of the centroids is displayed:

-
import sectionproperties.pre.sections as sections
-from sectionproperties.analysis.cross_section import CrossSection
-
-geometry = sections.PfcSection(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8)
-mesh = geometry.create_mesh(mesh_sizes=[2.5])
-
-section = CrossSection(geometry, mesh)
-section.calculate_geometric_properties()
-section.calculate_plastic_properties()
-section.calculate_warping_properties()
-
-section.plot_centroids()
-section.display_results()
-
-
-
-../_images/pfc_centroids.png -

Plot of the elastic centroid and shear centre for the above example generated -by plot_centroids()

-
-

Output generated by the display_results() -method:

-
Section Properties:
-A       = 2.919699e+03
-Qx      = 2.919699e+05
-Qy      = 7.122414e+04
-cx      = 2.439434e+01
-cy      = 1.000000e+02
-Ixx_g   = 4.831277e+07
-Iyy_g   = 3.392871e+06
-Ixy_g   = 7.122414e+06
-Ixx_c   = 1.911578e+07
-Iyy_c   = 1.655405e+06
-Ixy_c   = -6.519258e-09
-Zxx+    = 1.911578e+05
-Zxx-    = 1.911578e+05
-Zyy+    = 3.271186e+04
-Zyy-    = 6.786020e+04
-rx      = 8.091461e+01
-ry      = 2.381130e+01
-phi     = 0.000000e+00
-I11_c   = 1.911578e+07
-I22_c   = 1.655405e+06
-Z11+    = 1.911578e+05
-Z11-    = 1.911578e+05
-Z22+    = 3.271186e+04
-Z22-    = 6.786020e+04
-r11     = 8.091461e+01
-r22     = 2.381130e+01
-J       = 1.011522e+05
-Iw      = 1.039437e+10
-x_se    = -2.505109e+01
-y_se    = 1.000000e+02
-x_st    = -2.505109e+01
-y_st    = 1.000000e+02
-x1_se   = -4.944543e+01
-y2_se   = 4.905074e-06
-A_sx    = 9.468851e+02
-A_sy    = 1.106943e+03
-x_pc    = 1.425046e+01
-y_pc    = 1.000000e+02
-Sxx     = 2.210956e+05
-Syy     = 5.895923e+04
-SF_xx+  = 1.156613e+00
-SF_xx-  = 1.156613e+00
-SF_yy+  = 1.802381e+00
-SF_yy-  = 8.688337e-01
-x11_pc  = 1.425046e+01
-y22_pc  = 1.000000e+02
-S11     = 2.210956e+05
-S22     = 5.895923e+04
-SF_11+  = 1.156613e+00
-SF_11-  = 1.156613e+00
-SF_22+  = 1.802381e+00
-SF_22-  = 8.688337e-01
-
-
-

Refer to Viewing the Results for a more detailed explanation of the post-processing -stage.

-
-
- - -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/rst/theory.html b/docs/build/html/rst/theory.html deleted file mode 100644 index fd8c286e..00000000 --- a/docs/build/html/rst/theory.html +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - - Theoretical Background — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- - - - -
-
-
-
- -
-

Theoretical Background

-

coming soon…

-
- - -
- -
- - -
-
- -
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/search.html b/docs/build/html/search.html deleted file mode 100644 index 9cd783fd..00000000 --- a/docs/build/html/search.html +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - Search — sectionproperties 1.0.6 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - - - - -
- -
    - -
  • Docs »
  • - -
  • Search
  • - - -
  • - - - -
  • - -
- - -
-
-
-
- - - - -
- -
- -
- -
-
- - -
- -
-

- © Copyright 2020, Robbie van Leeuwen - -

-
- Built with Sphinx using a theme provided by Read the Docs. - -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js deleted file mode 100644 index 153546cc..00000000 --- a/docs/build/html/searchindex.js +++ /dev/null @@ -1 +0,0 @@ -Search.setIndex({docnames:["index","rst/analysis","rst/api","rst/examples","rst/geom_mesh","rst/installation","rst/post","rst/structure","rst/theory"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":2,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,"sphinx.ext.viewcode":1,sphinx:56},filenames:["index.rst","rst/analysis.rst","rst/api.rst","rst/examples.rst","rst/geom_mesh.rst","rst/installation.rst","rst/post.rst","rst/structure.rst","rst/theory.rst"],objects:{"sectionproperties.analysis.cross_section":{CrossSection:[2,0,1,""],MaterialGroup:[2,0,1,""],PlasticSection:[2,0,1,""],SectionProperties:[2,0,1,""],StressPost:[2,0,1,""],StressResult:[2,0,1,""]},"sectionproperties.analysis.cross_section.CrossSection":{assemble_torsion:[2,1,1,""],calculate_frame_properties:[2,1,1,""],calculate_geometric_properties:[2,1,1,""],calculate_plastic_properties:[2,1,1,""],calculate_stress:[2,1,1,""],calculate_warping_properties:[2,1,1,""],display_mesh_info:[2,1,1,""],display_results:[2,1,1,""],get_As:[2,1,1,""],get_As_p:[2,1,1,""],get_area:[2,1,1,""],get_beta:[2,1,1,""],get_beta_p:[2,1,1,""],get_c:[2,1,1,""],get_ea:[2,1,1,""],get_gamma:[2,1,1,""],get_ic:[2,1,1,""],get_ig:[2,1,1,""],get_ip:[2,1,1,""],get_j:[2,1,1,""],get_pc:[2,1,1,""],get_pc_p:[2,1,1,""],get_perimeter:[2,1,1,""],get_phi:[2,1,1,""],get_q:[2,1,1,""],get_rc:[2,1,1,""],get_rp:[2,1,1,""],get_s:[2,1,1,""],get_sc:[2,1,1,""],get_sc_p:[2,1,1,""],get_sc_t:[2,1,1,""],get_sf:[2,1,1,""],get_sf_p:[2,1,1,""],get_sp:[2,1,1,""],get_z:[2,1,1,""],get_zp:[2,1,1,""],plot_centroids:[2,1,1,""],plot_mesh:[2,1,1,""]},"sectionproperties.analysis.cross_section.MaterialGroup":{add_element:[2,1,1,""]},"sectionproperties.analysis.cross_section.PlasticSection":{add_line:[2,1,1,""],calculate_centroid:[2,1,1,""],calculate_extreme_fibres:[2,1,1,""],calculate_plastic_force:[2,1,1,""],calculate_plastic_properties:[2,1,1,""],check_convergence:[2,1,1,""],create_plastic_mesh:[2,1,1,""],evaluate_force_eq:[2,1,1,""],get_elements:[2,1,1,""],pc_algorithm:[2,1,1,""],plot_mesh:[2,1,1,""],point_within_element:[2,1,1,""],print_verbose:[2,1,1,""],rebuild_parent_facet:[2,1,1,""]},"sectionproperties.analysis.cross_section.SectionProperties":{calculate_centroidal_properties:[2,1,1,""],calculate_elastic_centroid:[2,1,1,""]},"sectionproperties.analysis.cross_section.StressPost":{get_stress:[2,1,1,""],plot_stress_contour:[2,1,1,""],plot_stress_m11_zz:[2,1,1,""],plot_stress_m22_zz:[2,1,1,""],plot_stress_m_zz:[2,1,1,""],plot_stress_mxx_zz:[2,1,1,""],plot_stress_myy_zz:[2,1,1,""],plot_stress_mzz_zx:[2,1,1,""],plot_stress_mzz_zxy:[2,1,1,""],plot_stress_mzz_zy:[2,1,1,""],plot_stress_n_zz:[2,1,1,""],plot_stress_v_zx:[2,1,1,""],plot_stress_v_zxy:[2,1,1,""],plot_stress_v_zy:[2,1,1,""],plot_stress_vector:[2,1,1,""],plot_stress_vm:[2,1,1,""],plot_stress_vx_zx:[2,1,1,""],plot_stress_vx_zxy:[2,1,1,""],plot_stress_vx_zy:[2,1,1,""],plot_stress_vy_zx:[2,1,1,""],plot_stress_vy_zxy:[2,1,1,""],plot_stress_vy_zy:[2,1,1,""],plot_stress_zx:[2,1,1,""],plot_stress_zxy:[2,1,1,""],plot_stress_zy:[2,1,1,""],plot_stress_zz:[2,1,1,""],plot_vector_mzz_zxy:[2,1,1,""],plot_vector_v_zxy:[2,1,1,""],plot_vector_vx_zxy:[2,1,1,""],plot_vector_vy_zxy:[2,1,1,""],plot_vector_zxy:[2,1,1,""]},"sectionproperties.analysis.cross_section.StressResult":{calculate_combined_stresses:[2,1,1,""]},"sectionproperties.analysis.fea":{Tri6:[2,0,1,""],extrapolate_to_nodes:[2,2,1,""],gauss_points:[2,2,1,""],global_coordinate:[2,2,1,""],point_above_line:[2,2,1,""],principal_coordinate:[2,2,1,""],shape_function:[2,2,1,""]},"sectionproperties.analysis.fea.Tri6":{element_stress:[2,1,1,""],geometric_properties:[2,1,1,""],monosymmetry_integrals:[2,1,1,""],plastic_properties:[2,1,1,""],point_within_element:[2,1,1,""],shear_coefficients:[2,1,1,""],shear_load_vectors:[2,1,1,""],shear_warping_integrals:[2,1,1,""],torsion_properties:[2,1,1,""]},"sectionproperties.analysis.solver":{function_timer:[2,2,1,""],solve_cgs:[2,2,1,""],solve_cgs_lagrange:[2,2,1,""],solve_direct:[2,2,1,""],solve_direct_lagrange:[2,2,1,""]},"sectionproperties.post.post":{draw_principal_axis:[2,2,1,""],finish_plot:[2,2,1,""],print_results:[2,2,1,""],setup_plot:[2,2,1,""]},"sectionproperties.pre.nastran_sections":{BARSection:[2,0,1,""],BOX1Section:[2,0,1,""],BOXSection:[2,0,1,""],CHAN1Section:[2,0,1,""],CHAN2Section:[2,0,1,""],CHANSection:[2,0,1,""],CROSSSection:[2,0,1,""],DBOXSection:[2,0,1,""],FCROSSSection:[2,0,1,""],GBOXSection:[2,0,1,""],HAT1Section:[2,0,1,""],HATSection:[2,0,1,""],HEXASection:[2,0,1,""],HSection:[2,0,1,""],I1Section:[2,0,1,""],LSection:[2,0,1,""],NISection:[2,0,1,""],RODSection:[2,0,1,""],T1Section:[2,0,1,""],T2Section:[2,0,1,""],TSection:[2,0,1,""],TUBE2Section:[2,0,1,""],TUBESection:[2,0,1,""],ZSection:[2,0,1,""]},"sectionproperties.pre.nastran_sections.BARSection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.BOX1Section":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.BOXSection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.CHAN1Section":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.CHAN2Section":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.CHANSection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.CROSSSection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.DBOXSection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.FCROSSSection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.GBOXSection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.HAT1Section":{create_mesh:[2,1,1,""],getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.HATSection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.HEXASection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.HSection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.I1Section":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.LSection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.NISection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.RODSection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.T1Section":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.T2Section":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.TSection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.TUBE2Section":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.TUBESection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.nastran_sections.ZSection":{getStressPoints:[2,1,1,""]},"sectionproperties.pre.offset":{offset_perimeter:[2,2,1,""]},"sectionproperties.pre.pre":{GeometryCleaner:[2,0,1,""],Material:[2,0,1,""],create_mesh:[2,2,1,""]},"sectionproperties.pre.pre.GeometryCleaner":{clean_geometry:[2,1,1,""],intersect_facets:[2,1,1,""],is_duplicate_facet:[2,1,1,""],is_intersect:[2,1,1,""],is_overlap:[2,1,1,""],remove_duplicate_facets:[2,1,1,""],remove_overlapping_facets:[2,1,1,""],remove_point_id:[2,1,1,""],remove_unused_points:[2,1,1,""],remove_zero_length_facets:[2,1,1,""],replace_point_id:[2,1,1,""],zip_points:[2,1,1,""]},"sectionproperties.pre.sections":{AngleSection:[2,0,1,""],BoxGirderSection:[2,0,1,""],CeeSection:[2,0,1,""],Chs:[2,0,1,""],CircularSection:[2,0,1,""],CruciformSection:[2,0,1,""],CustomSection:[2,0,1,""],Ehs:[2,0,1,""],EllipticalSection:[2,0,1,""],Geometry:[2,0,1,""],ISection:[2,0,1,""],MergedSection:[2,0,1,""],MonoISection:[2,0,1,""],PfcSection:[2,0,1,""],PolygonSection:[2,0,1,""],RectangularSection:[2,0,1,""],Rhs:[2,0,1,""],TaperedFlangeChannel:[2,0,1,""],TaperedFlangeISection:[2,0,1,""],TeeSection:[2,0,1,""],ZedSection:[2,0,1,""]},"sectionproperties.pre.sections.Geometry":{add_control_point:[2,1,1,""],add_facet:[2,1,1,""],add_hole:[2,1,1,""],add_point:[2,1,1,""],calculate_extents:[2,1,1,""],calculate_facet_length:[2,1,1,""],calculate_perimeter:[2,1,1,""],clean_geometry:[2,1,1,""],create_mesh:[2,1,1,""],draw_radius:[2,1,1,""],mirror_section:[2,1,1,""],plot_geometry:[2,1,1,""],rotate_section:[2,1,1,""],shift_section:[2,1,1,""]}},objnames:{"0":["py","class","Python class"],"1":["py","method","Python method"],"2":["py","function","Python function"]},objtypes:{"0":"py:class","1":"py:method","2":"py:function"},terms:{"000000e":[3,7],"00000e":3,"011522e":7,"012091e":3,"021183e":3,"02247e":3,"039413e":3,"039437e":7,"057805e":3,"058119e":3,"063407e":3,"076770e":3,"078317e":3,"080628821651535e":3,"091461e":7,"100d":[1,2,6],"100e3":[2,3,6],"100x100x6":3,"104723e":3,"10669e":3,"106943e":7,"107959e":3,"10e3":[2,3,6],"116232e":3,"120e6":3,"122414e":7,"12e":3,"140530e":3,"150pfc":3,"150x100x6":[2,3,4],"150x90x12":[2,6],"156613e":7,"157666e":3,"15e3":[2,6],"15e6":3,"160810e":3,"1790636349700628e":3,"1e3":[1,2,4],"1e6":[1,2,6],"200e3":[1,2,3,4,7],"200pfc":[2,3],"200ub25":[2,4],"2038x2038":3,"210956e":7,"2112746988930985e":3,"21319e":3,"223248e":3,"233734e":3,"248996e":3,"250000e":3,"250070e":3,"250071e":3,"251112e":3,"2562x2562":3,"267184e":3,"271186e":7,"282187e":3,"288066e":3,"2e6":[2,6],"30e3":[2,3,6],"310ub40":3,"313355e":3,"345949e":3,"352644e":3,"373725e":3,"381130e":7,"389212e":3,"392871e":7,"393296044849056e":3,"3c26":2,"3e3":[1,2],"3e6":[2,3,6],"412681e":3,"41585e":3,"421875e":3,"424642e":3,"425046e":7,"43134e":3,"439379e":3,"439434e":7,"451461e":3,"468851e":7,"4841x4841":3,"486328e":3,"49da":2,"503607e":3,"505109e":7,"50dx600w":3,"50e3":[2,6],"50w":[1,2,6],"50x50":3,"519258e":7,"521094e":3,"52298e":3,"554353e":3,"5e3":[2,6],"5e6":[2,3,6],"603760e":3,"6053x6053":3,"610373e":3,"610374e":3,"610673e":3,"616867e":3,"626709e":3,"638062e":3,"638064e":3,"644033e":3,"645438e":3,"648312e":3,"649671e":3,"655405e":7,"66608e":3,"671369e":3,"674792e":3,"680296e":3,"688337e":7,"691294e":3,"695762e":3,"699016e":3,"700106e":3,"710278e":3,"729240e":3,"740447e":3,"743533e":3,"743539e":3,"745613e":3,"746928e":3,"757767e":3,"75e3":3,"760642e":3,"7730935851751974e":3,"77651e":3,"785328e":3,"786020e":7,"788834e":3,"789062e":3,"801944e":3,"802381e":7,"822719e":3,"831277e":7,"832458e":3,"83761e":3,"851309e":3,"857074e":3,"863400e":3,"864400e":3,"878443e":3,"895923e":7,"8972x8972":3,"8e3":[1,2,3,4],"900702e":3,"905074e":7,"909747e":3,"911578e":7,"919699e":7,"932542e":3,"935211e":3,"944543e":7,"947113e":3,"958323e":3,"960343e":3,"962676e":3,"979733e":3,"9ee7":2,"case":3,"class":[1,3,4,7],"default":[1,2,4,6],"final":7,"float":[1,2,4,6],"function":[1,3],"import":[0,1,2,3,4,6,7],"int":[1,2,4],"new":[1,2,4],"return":[1,2,4,6],"true":[1,2,3,4,6],"try":7,"while":4,Added:2,Axes:[1,2,4],CGS:2,CHS:2,Chs:4,EHS:2,Ehs:4,For:7,IDs:2,One:2,RHS:[2,3],Rhs:[3,4],The:[0,1,2,3,4,5,6,7],There:[4,6],These:[4,5,6],Using:3,a308134:2,a_s11:[2,3,6],a_s22:[2,3,6],a_si:[2,3,6,7],a_sx:[2,3,6,7],a_sxi:2,about:[0,1,2,3,6],abov:[1,2,3,4,6,7],absolut:2,academ:3,access:7,accomod:2,accuraci:3,acheiev:2,act:[1,2],action:[1,2,6],actual:2,add:2,add_control_point:2,add_el:2,add_facet:2,add_hol:2,add_lin:2,add_point:2,added:[0,2],addit:4,adjac:3,after:[1,2,3,4,6],algorithm:[1,2,3,4],align:[2,4],all:[1,2,3,4,5,6,7],allow:[1,2,3],along:[2,3],alpha:[1,2,3,4],alreadi:7,also:[1,2],altern:6,alwai:[2,4],amongst:2,analys:[1,2,3,4,6,7],analysi:[0,4,5,6],anaylsi:3,angl:[1,2,3],anglesect:[3,4,6],ani:[2,3,4,5,7],answer:2,anti:[2,4],anticip:4,anticlockwis:2,api:[0,4],app:2,append:3,appli:[0,2,3,4,6],applic:6,approach:[2,6],appropri:5,approxim:2,arbitrari:[0,2,7],area:[0,1,2,3,4,7],arg:2,argument:2,aris:1,arrai:[1,2,3],artefact:[3,4],aspect:[2,3],assemb:3,assembl:[2,3],assemble_tors:2,assertionerror:[1,2,4],assign:[1,2,3,4],associ:2,assum:[2,3,4],astro:2,atol:2,attach:2,attribut:[1,2],autodesk:2,autom:2,automat:4,averag:2,axes:[1,2,4,6],axi:[0,1,2,3,4],axial:[1,2,3],b7044ba7:2,b_b:[2,4],b_l:[2,4],b_list:3,b_r:[2,4],b_t:[2,4],back:[2,3],background:[0,6],bar:2,base:[1,2,3,4],bbox_to_anchor:3,beam:2,been:[1,2,3,5,6,7],befor:[1,2,3,4],being:[2,6],belong:[2,6,7],below:[2,3,6],bend:[0,1,2,3],beta11:3,beta22:3,beta:4,beta_11_minu:[2,6],beta_11_plu:[2,6],beta_22_minu:[2,6],beta_22_plu:[2,6],beta_x_minu:[2,6],beta_x_plu:[2,6],beta_y_minu:[2,6],beta_y_plu:[2,6],betai:3,betax:3,between:[2,3,4],bolden:[2,4],bool:[1,2,4,6],both:[2,3,6,7],bottom:[1,2,3,4,6],bound:[2,4],boundari:2,box1:2,box:2,boxgirdersect:4,broken:7,build:3,built:4,bulk:2,burlywood:[1,2,3,4],c_bot:2,c_bot_i:2,c_bot_x:2,c_bottom:2,c_top:2,c_top_i:2,c_top_x:2,calcul:[0,2,3,4,6,7],calculate_centroid:2,calculate_centroidal_properti:2,calculate_combined_stress:2,calculate_elastic_centroid:2,calculate_ext:2,calculate_extreme_fibr:2,calculate_facet_length:2,calculate_frame_properti:[1,2,3],calculate_geometric_properti:[0,1,2,3,4,6,7],calculate_perimet:2,calculate_plastic_forc:2,calculate_plastic_properti:[1,2,3,6,7],calculate_stress:[1,2,3,6],calculate_warping_properti:[0,1,2,3,6,7],call:[1,2,6,7],can:[0,1,2,3,4,5,6,7],care:3,carri:[1,2,3,4,7],cartesian:2,case1:3,case2:3,caus:[4,6],cee:2,ceesect:4,center:[2,3,4],centr:[1,2,3,7],centroid:[0,1,2,3,7],certain:[2,4],cgs:[1,2],chan1:2,chan2:2,chan:2,chang:4,channel:2,check:2,check_converg:2,choos:4,circl:[2,3,4,7],circular:[2,3,7],circularsect:[3,4,7],circumfer:7,ciruclar:2,clean:[2,3],clean_geometri:[1,2,3,4],clockwis:[2,3,4],close:[1,2,4,6],code:[2,3],coeffici:[2,3],color:[1,2,3,4,7],colors_api:[2,4],colour:[1,2,3],column:2,com:[0,2],combin:[0,2,3,4],come:8,command:[1,2],commonli:7,compar:[2,3,4],complet:3,compon:[2,6],compos:4,composit:[4,7],compress:[2,6],compris:[1,2],comput:[1,2,3],concret:[2,4],conform:5,connect:[1,2,4],consecut:[2,4],consid:2,consist:2,constant:[0,1,2],construct:[2,4],constructor:[1,2,3],contact:0,contain:[1,2,4,6],content:[0,2],continu:[1,2,4,6],contour:[2,3,6,7],control:[2,3,4],control_point:[2,3,4],converg:[2,3],convert:3,coo:2,coord:2,coordin:[1,2],copi:[2,5],corner:[2,4],correct:[1,2,3],correct_v:3,correctli:5,correspond:[1,2,4],corrod:[2,4],corroded_area:[2,4],corroded_geometri:[2,4],corroded_ixx:[2,4],corroded_mesh:[2,4],corroded_sect:[2,4],corros:[2,4],cost:[1,2],counter:[2,3,4],counterclockwis:[2,4],cp36:5,cp36m:5,crash:2,creat:[0,1,2,6],create_mesh:[0,1,2,3,4,6,7],create_plastic_mesh:2,creation:[1,2,4],cross:[0,1,2,5,7],cross_sect:[0,1,3,4,6,7],crosssect:[0,1,3,4,6,7],cruciform:2,cruciformsect:4,csc:2,csc_matrix:2,current:[0,2,4,6],custom:[2,4],customsect:[3,4],d_list:3,d_x:[2,4],d_y:[2,4],da7505fd4b2c:2,data:[2,4],data_servic:2,dbox:2,debug:[1,2],decim:[2,6],deem:2,deep:2,defin:[1,2,3,7],definit:[1,2],deform:[2,3],degre:[2,3,4],delet:2,delta_:2,demonstr:[1,2,3],denot:6,depend:5,depth:[2,4],deriv:[2,4],describ:[1,2],descript:[1,2],design:[0,1,2],detail:[1,2,3,7],determin:[0,2,7],diamet:[2,3,4,7],dict:[2,6],dictionari:[2,6],did:2,differ:[2,3,4,7],difficulti:4,digit:[2,6],dim10:2,dim1:[2,3],dim2:[2,3],dim3:[2,3],dim4:[2,3],dim5:[2,3],dim6:2,dim7:2,dim8:2,dim9:2,dimens:[2,3,4,7],direct:[0,1,2,3,4,6],discret:[2,3],discretis:[2,3,4,7],discrit:2,displai:[1,2,3,4,6,7],display_mesh_info:[1,2,3],display_result:[2,3,6,7],distanc:[2,4],distinct:4,dka:2,dlim:2,dmax:2,dmi9:[],dmin:2,doc10351:2,doc:2,document:5,doe:[1,2,4],domain:4,don:0,done:2,down:[2,7],download:5,drastic:4,draw:2,draw_principal_axi:2,draw_radiu:2,dtic:2,duplic:[2,4],dure:3,each:[1,2,3,4,6],easi:4,easier:4,easili:7,edg:[2,4],effect:2,effici:[3,5],eight:2,either:[1,2,4,7],el_id:2,elast:[1,2,4,7],elastic_modulu:[1,2,3,4,7],element:[0,1,2,3,4,5,6,7],element_list:2,element_stress:2,ellips:[2,4],ellipt:2,ellipticalsect:4,email:0,empti:[2,4],en_u:2,enabl:4,enclos:[2,4],end:2,enhanc:2,ensur:[3,4],enter:[2,3,4],entir:[2,3],enu:2,equal:[1,2,3,4],equat:[1,2],equidist:[2,4],equilibrium:2,error:[2,3,4,7],error_v:3,eta:2,evalu:2,evaluate_force_eq:2,everi:6,exampl:[0,1,2,4,6,7],exce:2,except:[2,4],exectu:[],execut:[1,2,3,7],exist:2,explan:7,extent:2,extract:[1,2],extrapol:2,extrapolate_to_nod:2,extrem:2,f_bot:2,f_el:2,f_norm:3,f_phi:2,f_psi:2,f_top:2,f_torsion:2,f_y:[1,2,6],face:[2,4],facet:[2,3,4,7],factor:[1,2],fals:[1,2,3,4,6],far:3,fast:3,faster:1,fct1:2,fct2:2,fct_idx:2,featur:[0,4],few:[2,4],fibr:[2,6],fig:3,figur:[1,2,3,4,6],file:0,fill:2,find:2,finder:2,finest:3,finish:2,finish_plot:2,finit:[0,1,2,3,4,5,6,7],first:[1,2,3,7],five:2,fix:2,flang:[2,3,6],fmt:[2,6],follow:[1,2,3,4,6,7],forc:[0,1,2,3,6],form:6,format:[2,3,4,6,7],found:0,four:[2,7],frame:2,from:[0,1,2,3,4,6,7],full:[2,4],fulltext:2,function_tim:2,further:7,futur:0,gamma:[2,6],gareth:2,gauss:2,gauss_point:2,gaussian:2,gbox:2,gener:[0,1,2,3,5,6,7],geom_steel:[1,2],geom_timb:[1,2],geometr:[2,3,6,7],geometri:[0,1,6],geometric_properti:2,get:[0,3,5],get_:[2,6],get_a:[0,2,6],get_area:[0,2,4,6],get_as_p:[2,6],get_beta:[2,6],get_beta_p:[2,6],get_c:[2,6],get_ea:[2,6],get_el:2,get_gamma:[2,6],get_ic:[0,2,3,4,6],get_ig:[2,6],get_ip:[2,6],get_j:[0,2,3,6],get_pc:[2,6],get_pc_p:[2,6],get_perimet:[2,6],get_phi:[2,6],get_q:[2,6],get_rc:[2,6],get_rp:[2,6],get_sc:[2,6],get_sc_p:[2,6],get_sc_t:[2,6],get_sf:[2,6],get_sf_p:[2,6],get_sp:[2,6],get_stress:[2,6],get_z:[2,6],get_zp:[2,6],getstresspoint:2,gider:[2,4],girder:2,github:[0,5],give:[3,4],given:2,global:[1,2,6],global_coordin:2,gmail:0,goal:0,good:1,greater:[2,4],grei:[1,2,3,4,7],group:2,guid:2,gyrat:[1,2],half:[1,2],hand:2,har:0,has:[1,3,5,7],hat1:[2,3],hat1sect:3,hat:2,have:[0,1,2,5,6,7],height:[2,4],help:[2,7],here:[0,2],hesit:0,hexa:2,hexagon:2,hold:3,hole:[2,3,4,7],hollow:2,horizont:[2,4],how:3,howev:7,html:[2,4],http:[2,4],i11:2,i11_c:[2,3,6,7],i22:2,i22_c:[2,3,6,7],i_omega:2,i_xomega:2,i_yomega:2,id_new:2,id_old:2,idea:1,ident:2,identifi:4,ids:2,ignor:[2,4],iii:2,immedi:[1,2,4,6],imped:3,implement:[0,2],includ:[2,7],increas:4,independ:2,index:[2,4,5],indic:[2,4],indici:2,individu:7,info:3,infocent:2,inform:[1,2,3,4],inherit:[4,7],initi:[2,4],initialis:3,inner:[2,4],input:[2,4,7],insert:2,instal:0,instruct:5,int_11:2,int_22:2,int_i:2,int_x:2,integr:[2,3],interfac:[2,4],intersect:[2,4],intersect_facet:2,invers:2,investig:3,involv:[4,7],inward:[2,4],is_duplicate_facet:2,is_intersect:2,is_overlap:2,isect:[0,3,4],isoparametr:2,isotrop:[2,4],issu:[0,5],iter:[1,2,3],its:[0,2,3,4,5],ixi:[1,2],ixx:[1,2,3,4],ixx_c:[2,3,6,7],ixx_g:[2,3,6,7],ixy_c:[2,3,6,7],ixy_g:[2,3,6,7],iyi:[1,2,3],iyy_c:[2,3,6,7],iyy_g:[2,3,6,7],j_calc:3,j_list:3,j_np:3,j_refer:3,jacobian:2,jan:2,johndn90:2,jonathan:2,junction:3,k_el:2,k_lg:2,kappa_i:2,kappa_x:2,kappa_xi:2,keep:3,kei:[2,6],label:[2,3,4],lagrangian:2,lang:[2,4],last:[2,3],lead:2,leeuwen:0,left:[2,3,4],legend:3,len:3,length:[1,2,4],leq:[1,2],less:[2,4],lie:4,lies:2,life:4,lightgrei:[2,4],like:[2,4,7],linalg:2,line:[2,3],linear:[1,2],linearoper:2,linspac:3,lip:[2,4],list:[0,1,2,3,4,7],load:[2,3,6],loc:3,local:5,locat:[2,3,4,5],loglog:3,loop:3,m11:[1,2],m22:[1,2],m_p:[1,2,3,6],machin:5,mai:[2,3,4],make:[2,3,4],manual:[2,4],mask:[1,2],match:[2,4],materi:[0,1,3,6,7],material_group:[1,2],matplotlib:[1,2,3,4],matric:2,matrix:[2,3],max:[2,4],maximum:[1,2,3,4,7],mean:3,measur:[2,4],member:2,merg:[1,2],mergedsect:[1,3,4],mesh:[0,2,5,6],mesh_attribut:[1,2],mesh_el:[1,2,3],mesh_error_v:3,mesh_nod:[1,2],mesh_result:3,mesh_siz:[0,1,2,3,4,6,7],mesh_size_list:3,meshinfo:[1,2,4],meshpi:[1,2,4,5],messag:2,method:[0,1,2,3,4,6,7],mid:[2,4],middl:2,mil:2,minimum:2,minu:[2,6],mirror:2,mirror_point:[2,3],mirror_sect:[2,3],mise:[2,3],mit:0,model:[3,7],modifi:3,modul:[4,5,7],moduli:[1,2],modulu:[1,2,4,6],moment:[0,1,2,3],monoisect:4,monosymmetr:2,monosymmetri:[1,2,3],monosymmetry_integr:2,more:[2,3,4,7],most:2,moulu:[1,2],move:4,msc:2,mscsoftwar:2,multipl:[3,4],multipli:2,multitud:[2,4],must:[1,2,4,7],mxx:[1,2,3],myi:[1,2,3],mystran:2,mzz:[1,2,3],n_r:[0,2,3,4,6,7],n_side:[2,4],name:[1,2,3,4,6,7],named_color:[2,4],nastran:2,nastran_sect:3,navig:5,ndarrai:[1,2],need:[2,4,5],neg:2,new_lin:2,nodal:2,node:[1,2,3,4],node_id:2,noe:2,non:3,none:[1,2,4],norm:2,normal:2,note:[1,2,4,6],nr_element:3,nr_error_v:3,nr_list:3,nr_result:3,nsection:[2,3],nstrn:2,nu_eff:2,num_nod:[1,2],number:[1,2,3,4,6,7],numpi:[1,2,3],nxnastran:2,object:[0,1,2,3,4,6,7],obtain:3,octagon:[2,4],offset_perimet:[2,4],often:4,old:[2,4],omega:2,omit:6,onc:[3,5,7],one:[0,2,3,4],onli:[1,2,3],onlin:2,oper:7,optim:2,option:[2,4],order:[2,3,4,5,7],org:[2,4],origin:[2,4],original_area:[2,4],original_geometri:[2,4],original_ixx:[2,4],original_mesh:[2,4],original_sect:[2,4],other:2,out:[1,2,3,4,7],outer:[2,4],outlin:[1,2],output:7,outsid:4,over:[2,3],overlap:[2,3,4],overload:2,overwrit:4,packag:[0,3,5],page:[2,5],pair:[2,4],panel:3,parallel:2,paramet:[1,2,3,4,6],parent:[2,4],pass:[2,3,4],paus:[1,2,3,4,6],pbarl:2,pbeaml:2,pc_algorithm:2,pdf:2,peform:[2,4],perform:[1,2,4,5,6,7],perimet:[1,2],permit:[2,4],perpendicular:2,pfc1:3,pfc2:3,pfc:[2,3,6,7],pfc_left:2,pfc_right:2,pfcsection:[3,4,6,7],phi:[1,2,3,6,7],phi_shear:2,pip:5,pitch:[2,4],place:[1,2,3,4],plastic:[2,3,7],plastic_properti:2,plate:[2,3],pleas:0,plm:2,plot:[1,2,3,4,7],plot_:6,plot_centroid:[2,3,6,7],plot_geometri:[2,3,4],plot_mesh:[1,2,3],plot_offset:[2,4],plot_stress_contour:2,plot_stress_m11_zz:[2,6],plot_stress_m22_zz:[2,6],plot_stress_m_zz:[2,3,6],plot_stress_mxx_zz:[2,6],plot_stress_myy_zz:[2,6],plot_stress_mzz_zi:[2,6],plot_stress_mzz_zx:[2,6],plot_stress_mzz_zxi:[2,6],plot_stress_n_zz:[2,3,6],plot_stress_v_zi:[2,6],plot_stress_v_zx:[2,6],plot_stress_v_zxi:[2,3,6],plot_stress_vector:2,plot_stress_vm:[2,3,6],plot_stress_vx_zi:[2,6],plot_stress_vx_zx:[2,6],plot_stress_vx_zxi:[2,6],plot_stress_vy_zi:[2,6],plot_stress_vy_zx:[2,6],plot_stress_vy_zxi:[2,6],plot_stress_zi:[2,6],plot_stress_zx:[2,6],plot_stress_zxi:[2,6],plot_stress_zz:[2,6],plot_vector_mzz_zxi:[2,3,6],plot_vector_v_zxi:[2,6],plot_vector_vx_zxi:[2,6],plot_vector_vy_zxi:[2,6],plot_vector_zxi:[2,6],plt:3,plu:[2,6],point:[2,3,4,6,7],point_above_lin:2,point_id:2,point_within_el:2,poisson:[1,2,4],poissons_ratio:[1,2,3,4,7],polygon:2,polygonsect:4,portion:2,posit:2,possibl:4,post:[1,7],power:0,pre:[0,1,3,4,6,7],precondition:2,predefin:4,prefer:3,prerequisit:[1,7],present:7,previou:[2,7],princip:[1,2,3],principal_coordin:2,prinicip:2,prinicp:2,print:[0,1,2,3,4,7],print_result:2,print_verbos:2,prior:[1,2],procedur:5,process:[1,2,4,7],processor:7,produc:[2,3,4,6],product:2,program:[1,2,3,7],project:0,properti:[0,2,3,7],protrud:2,provid:[1,2,4,7],psi:2,psi_shear:2,pt_idx:2,pure:[1,2],purpos:[2,3],pyplot:3,python:[0,5],q_omega:2,qrg:2,quadrat:[1,2,4],quarter:2,question:2,quick:[0,2],r11:[2,3,6,7],r11_c:2,r22:[2,3,6,7],r22_c:2,r_f:[2,4],r_in:[2,4],r_out:[2,3,4],r_r:[2,3,4,6],r_t:[2,3,4,6],radian:2,radii:[1,2,4],radiu:[2,3,4],rais:[0,1,2,4],ratio:[1,2,3,4],readm:0,rebuild:2,rebuild_parent_facet:2,rebuilt:[2,3],rec1:[1,2],rec2:[1,2],recommend:[2,4],reconstruct:2,recov:6,rectangl:[1,2,4,6],rectangular:[2,3],rectangularsect:[1,3,4,6],reduc:[3,4],reduct:[2,4],ree:2,refer:[3,4,5,7],refin:4,region:[1,2,3,4],regular:[2,4],rejoin:2,rel:2,relat:[2,3,4,6],releas:0,remain:2,remov:[2,3],remove_duplicate_facet:2,remove_overlapping_facet:2,remove_point_id:2,remove_unused_point:2,remove_zero_length_facet:2,render:[1,2,4,6],renumb:2,replac:2,replace_point_id:2,request:0,requir:[1,2,3,4],requisit:3,residu:2,resist:2,resourc:2,respect:[2,6],rest:5,result:[0,1,2,3,4],rhs:3,right:[2,3,4],rigid:[1,2],robbi:0,rod:2,root:[2,3,4],root_result:2,rootresult:2,rot:[2,4],rot_point:2,rotat:[2,4],rotate_sect:[2,3],rtol:2,run:[0,3,5],runtimeerror:[1,2],rx_c:2,ry_c:2,s11:[2,3,6,7],s22:[2,3,6,7],sadkja:2,same:[2,3],satisfi:2,save:[2,3],sc_xint:2,sc_yint:2,scipi:2,script:[1,2,4,6],search:2,second:[0,1,2,3],section:[0,1,5,7],section_list:3,section_prop:[1,2],sectionpropert:5,sectionproperti:[0,1,3,4,6,7],see:[2,4,5],segment:2,self:2,separ:[3,4],set:[1,2,4,6],set_titl:3,set_xlabel:3,set_ylabel:3,setup_plot:2,sf_11:[3,7],sf_11_minu:[2,6],sf_11_plu:[2,6],sf_22:[3,7],sf_22_minu:[2,6],sf_22_plu:[2,6],sf_xx:[3,7],sf_xx_minu:[2,6],sf_xx_plu:[2,6],sf_yi:[3,7],sf_yy_minu:[2,6],sf_yy_plu:[2,6],shade:[1,2],shape:[1,2,4,7],shape_funct:2,shear:[0,1,2,3,4,7],shear_coeffici:2,shear_load_vector:2,shear_modulu:[2,4],shear_warping_integr:2,shewchuk:2,shift:[1,2,3,4],shift_sect:2,show:[0,2,3],shown:[3,6],side:[2,3,4],siemen:2,sig:2,sig_vm:[2,6],sig_zi:[2,6],sig_zx:[2,6],sig_zx_mzz:[2,6],sig_zx_v:[2,6],sig_zx_vi:[2,6],sig_zx_vx:[2,6],sig_zxi:[2,6],sig_zxy_mzz:[2,6],sig_zxy_v:[2,6],sig_zxy_vi:[2,6],sig_zxy_vx:[2,6],sig_zy_mzz:[2,6],sig_zy_v:[2,6],sig_zy_vi:[2,6],sig_zy_vx:[2,6],sig_zz:[2,6],sig_zz_m11:[2,6],sig_zz_m22:[2,6],sig_zz_m:[2,6],sig_zz_mxx:[2,6],sig_zz_myi:[2,6],sig_zz_n:[2,6],sigi:2,sigma:2,sigma_:2,significantli:1,sigx:2,simcompanion:2,simpl:[2,5],simplic:0,singl:[3,4],six:[1,2],size:[1,2,3,4],smaller:3,solid:[2,3,4],solut:[2,3],solv:[1,2,3],solve_cg:2,solve_cgs_lagrang:2,solve_direct:2,solve_direct_lagrang:2,solver:[1,3,7],solver_typ:[1,2],some:[0,1,4],soon:8,sourc:[1,2,4,6],sovler:2,space:2,spars:2,specif:[2,4],specifi:[1,2,3,4,6],split:2,stackoverflow:2,stage:[3,7],start:[2,3],start_tim:3,statist:[1,2,3],steel:[1,2,3,4,7],step:1,stiff:[2,3],stiffen:2,stop:3,storag:2,store:[1,2,3,4],str:3,straight:3,strength:[1,2,4],stress:[0,2,7],stress_post:[1,2,3,6],stress_result:2,stresspost:[1,6],stressresult:[1,6],stresstyp:6,string:[1,2,4,6],structur:[0,1,2,5],subject:2,subplot:3,suffici:2,sum:[2,3,6],suppli:[1,2,4],sure:4,sxx:[2,3,6,7],syi:[2,3,6,7],system:[1,2],t_calc:3,t_f:[0,2,3,4,6,7],t_fb:[2,4],t_ft:[2,4],t_w:[0,2,3,4,6,7],take:[1,2,3,6],taken:[2,3],taper:2,taperedflangechannel:4,taperedflangeisect:4,tdoc:2,tee:[1,2],teesect:4,templat:0,ten:2,termin:[1,2,3,4,6,7],test:2,test_rectangl:5,text:2,than:[1,2,4],thei:[2,6],them:[1,2],theoret:[0,2],therefor:4,theta:2,thi:[1,2,3,4,5,7],thick:[2,4],thicknesss:2,those:2,three:[2,3,6,7],through:[2,3,4,5],tight_layout:3,timber:[1,2,3,4],time:[1,2,3],time_info:[1,2,3],titl:2,toe:[2,4],togeth:[2,3],tol:2,toler:2,top:[1,2,3,4,6],torsion:[0,1,2,7],torsion_properti:2,total:2,touch:0,tracker:0,translat:[2,4],transpar:[1,2,3],trapezium:[2,4],treat:4,trefftz:2,tri6:1,tri:2,triangl:[1,2,3,4],triangular:[1,2,3,4,5,7],tube2:2,tube:2,tupl:[1,2,6],twice:2,two:[1,2,3,4],type:[1,2,3,4,6,7],typic:4,u_max:2,u_min:2,u_p:2,unconnect:4,under:[0,1,2],undertaken:3,unequ:6,uniqu:[2,4],unit:2,unittest:5,until:[1,2,4,6],unus:2,updat:2,use:[1,2,3,4,7],used:[0,1,2,3,4,7],useful:1,user:[2,3,4],uses:[2,5],using:[0,1,2,3,4,5,6,7],ust:[1,2],utilis:2,v_max:2,v_min:2,valu:[1,2,3,6],van:0,vanleeuwen:0,vari:3,variabl:[1,2,3,4],variat:3,variou:[0,1,2,3,6],vector:[2,3,4,6],venant:[2,6],verbos:[1,2,3,4],vertic:[2,4],view:[0,2],visualis:[0,7],vital:3,volum:2,von:[2,3],w_i:2,wai:[2,4],wall:[2,4],warp:[2,3,7],water:2,web:[2,4],weight:[1,2,6],were:2,what:4,wheel:5,when:[2,3,4],where:6,whether:2,which:[1,2,4],whilst:3,whl:5,width:[2,3,4],win_amd64:5,window:[1,2,4,6],wish:4,within:[2,4,6],without:7,work:[2,4,5],would:[2,7],written:0,www:2,x11:2,x11_pc:[2,3,6,7],x11_se:[2,6],x1_se:[3,7],x_max:2,x_min:2,x_pc:[2,3,6,7],x_se:[2,3,6,7],x_st:[2,3,6,7],xlabel:3,y22:2,y22_pc:[2,3,6,7],y22_se:[2,6],y2_se:[3,7],y_max:2,y_min:2,y_pc:[2,3,6,7],y_se:[2,3,6,7],y_st:[2,3,6,7],yield:[1,2,4],yield_strength:[1,2,3,4,7],ylabel:3,you:[0,4,5,7],your:[4,5,7],z11:[3,7],z11_minu:[2,6],z11_plu:[2,6],z22:[3,7],z22_minu:[2,6],z22_plu:[2,6],zed:2,zedsect:4,zero:[2,4],zeta:2,zip:2,zip_point:2,zxx:[3,7],zxx_minu:[2,6],zxx_plu:[2,6],zxy:2,zyi:[3,7],zyy_minu:[2,6],zyy_plu:[2,6]},titles:["Documentation","Running an Analysis","Python API Documentation","Examples","Creating a Geometry, Mesh and Material Properties","Installation","Viewing the Results","Structure of an Analysis","Theoretical Background"],titleterms:{"class":2,"function":2,CHS:4,Chs:2,EHS:4,Ehs:2,RHS:4,Rhs:2,advanc:3,analysi:[1,2,3,7],angl:[4,6],anglesect:2,api:2,arbitrari:4,area:6,axi:6,axial:6,background:8,barsect:2,bend:6,box1sect:2,box:4,boxgirdersect:2,boxsect:2,calcul:1,cee:4,ceesect:2,centr:6,centroid:6,chan1sect:2,chan2sect:2,channel:4,chansect:2,check:1,circular:4,circularsect:2,clean:4,combin:6,common:4,composit:3,constant:[3,6],creat:[3,4,7],cross:[3,4,6],cross_sect:2,crosssect:2,cruciform:4,cruciformsect:2,custom:3,customsect:2,dboxsect:2,defin:4,document:[0,2],elast:6,ellipt:4,ellipticalsect:2,exampl:3,factor:6,fcrosssect:2,fea:2,first:6,flang:4,frame:[1,3],gboxsect:2,gener:4,geometr:1,geometri:[2,3,4,7],geometryclean:2,get:6,girder:4,gyrat:6,hat1sect:2,hatsect:2,hexasect:2,hollow:4,hsection:2,i1sect:2,instal:5,isect:2,licens:0,linux:5,list:6,lsection:2,m11:6,m22:6,maco:5,materi:[2,4],materialgroup:2,merg:[3,4],mergedsect:2,mesh:[1,3,4,7],mirror:3,mise:6,modul:2,moduli:6,moment:6,monoisect:2,monosymmetr:4,monosymmetri:6,mxx:6,myi:6,mzz:6,nastran:3,nastran_sect:2,nisect:2,normal:6,offset:[2,4],packag:2,parallel:4,perform:3,perimet:[4,6],pfc:4,pfcsection:2,plastic:[1,6],plasticsect:2,plot:6,polygon:4,polygonsect:2,post:2,pre:2,primari:6,princip:6,print:6,processor:2,properti:[1,4,6],python:2,qualiti:1,radii:6,rectangl:3,rectangular:4,rectangularsect:2,refer:2,refin:3,result:[6,7],retriev:6,rigid:6,rodsect:2,rotat:3,run:[1,7],second:6,section:[2,3,4,6],sectionproperti:[2,5],shape:6,shear:6,sigma:6,sigma_:6,simpl:3,solver:2,specif:6,stress:[1,3,6],stresspost:2,stressresult:2,structur:[4,7],support:0,t1section:2,t2section:2,taper:4,taperedflangechannel:2,taperedflangeisect:2,tee:4,teesect:2,test:5,theoret:8,torsion:[3,6],trefftz:6,tri6:2,tsection:2,tube2sect:2,tubesect:2,unix:5,view:[6,7],visualis:4,von:6,warp:[1,6],window:5,zed:4,zedsect:2,zsection:2,zxy:6}}) \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 37ef8de0..1a9a5b0b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -91,7 +91,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +# html_static_path = ['_static'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. diff --git a/docs/source/images/tests/PeeryFigs.png b/docs/source/images/tests/PeeryFigs.png new file mode 100644 index 00000000..e4cf07e5 Binary files /dev/null and b/docs/source/images/tests/PeeryFigs.png differ diff --git a/docs/source/images/tests/Peery_7.2.1_geom.png b/docs/source/images/tests/Peery_7.2.1_geom.png new file mode 100644 index 00000000..f84285fc Binary files /dev/null and b/docs/source/images/tests/Peery_7.2.1_geom.png differ diff --git a/docs/source/index.rst b/docs/source/index.rst index 8354b47c..949d9add 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -30,6 +30,7 @@ can be found in the README file on github. rst/analysis rst/post rst/examples + rst/test rst/api rst/theory diff --git a/docs/source/rst/test.rst b/docs/source/rst/test.rst new file mode 100644 index 00000000..7a021df1 --- /dev/null +++ b/docs/source/rst/test.rst @@ -0,0 +1,136 @@ +.. highlight:: python + :linenothreshold: 5 + +Testing and Results Validation +=============================== + +sectionproperties has a (slowly) growing suite of tests. The testing suite +serves to verify functionality and find exceptions from edge cases, but +also validate the results against known cases. Since this library performs +engineering calculations, it should have some manner of proving its accuracy. +Obviously each analyst who uses it is responsible for their own projects +and calculations, but having a high level of confidence that the software +can produce *correct* results, *given the correct inputs*, is a boon to all users. +Some test results and explanations from the latter category will be outlined +on this page, since the former really serves no use to the end user. + + +Text Book Examples +-------------------- +An obvious starting location is replicating examples from academic texts. +"Aircraft Structures" by David J. Peery is a highly regarded text in the +field of aerospace structures [1]_. In the Unsymmetric Beams Chapter (Sec. 7.2), +Peery outlines the general formulas for beam bending. Example 1 will be +used here. + +In general, this example loads a Z-Section stringer with biaxial bending.:: + + class Z_Section: + ''' + This is basically just a fixture for testing purposes. + It's called by the actual pytest fixtures to generate + the Z-sections for analysis. + ''' + def __init__(self, DIM1, DIM2, DIM3, DIM4, shift, m, name): + # Setup the analysis, and calculate properties + self.geom = sections.ZSection(DIM1, DIM2, DIM3, DIM4, shift) + self.mesh = self.geom.create_mesh([m]) + self.xsect = CrossSection(self.geom, self.mesh) + self.xsect.calculate_geometric_properties() + + def apply_load(self, v): + ''' + This method applies the suplied load to the section. + + v is a list-like with the first entry being Mxx, and + second entry Myy. + ''' + self.xsect.calculate_warping_properties() + self.stress = self.xsect.calculate_stress(Mxx=v[0], Myy=v[1]) + + + @pytest.fixture + def PeeryEx7_2_1(): + ''' + Example 1 in Sec. 7.2. + This is an unsymmetric Z-section with no lateral supports. + + Note that units here are inches, to match the text. + ''' + return Z_Section(4,2,8,12,shift=[-2,0],m=0.25, name='Peery_7.2.1_geom.png') + + +Note the dimensions in the last line above, and the shift in the section. + +.. image:: ../images/tests/PeeryFigs.png + :scale: 50 % + :alt: From Peery, Sec. 7.2 + :align: center + +After creating the cross-section, the plot_centroids method can be called to +verify geometry matches, and we can already verify properties are calculated +correctly. + +.. image:: ../images/tests/Peery_7.2.1_geom.png + :scale: 80 % + :alt: From sectionproperties calculations + :align: center + +Test functions like the one below are included for I_x, I_y, I_xy, +I_11 (I_P), and I_22 (I_Q):: + + def test_ixx_g(PeeryEx7_2_1): + # Directly from the example, we know what + # the section properties should be. + xsect = PeeryEx7_2_1.xsect + assert round(xsect.section_props.ixx_g,1) == 693.3 + + +In order to test stress, matching load is applied, and a function to extract +stress as the specific node must be written [#f1]_:: + + def get_node(nodes, coord) -> (int, tuple): + ''' + This function will loop over the node list provided, + finding the index of the coordinates you want. + + Returns the index in the nodes list, and the coords. + ''' + for index,var in enumerate(nodes): + if all(var == coord): + return index, var + else: + continue + +And a stress testing function, which checks results within 0.5%:: + + def test_fb_A(PeeryEx7_2_1): + '''Check the stress at point A.''' + # Load from the text + v = [-1e5, 1e4] + A = (-5, 4) + perfect_result = 1210 + text_result = round(-494*-5 + -315*4) + nodes = PeeryEx7_2_1.xsect.mesh_nodes + index, _ = get_node(nodes, A) + stress = PeeryEx7_2_1.apply_load(v) + computed_result = PeeryEx7_2_1.stress.get_stress()[0]['sig_zz'][index] + + assert abs(text_result) == abs(perfect_result) + assert abs(computed_result) <= 1.005*abs(perfect_result) + assert abs(computed_result) >= 0.995*abs(perfect_result) + + +Combined together, this can all be easily executed via pytest: + +.. literalinclude:: ../../../sectionproperties/tests/peery.log + +100% passing tests validates the section properties and stress results to +match Peery's theoretical calculations. + + +.. [1] D. J. Peery, *Aircraft Structures.* New York: Dover Publications, 2011. + ISBN-10: 0-486-48580-3 + +.. [#f1] This function assumes there is a node at your desired coordinates. It does + *not* find the node closest to your input coords. \ No newline at end of file diff --git a/sectionproperties/tests/peery.log b/sectionproperties/tests/peery.log new file mode 100644 index 00000000..584b28cb --- /dev/null +++ b/sectionproperties/tests/peery.log @@ -0,0 +1,9 @@ +============================= test session starts ============================= +platform win32 -- Python 3.8.5, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 +rootdir: D:\Czarified\Documents\GitHub\section-properties +plugins: hypothesis-5.48.0 +collected 8 items + +test_Peery.py ........ [100%] + +============================== 8 passed in 6.38s ============================== diff --git a/sectionproperties/tests/test_Peery.py b/sectionproperties/tests/test_Peery.py new file mode 100644 index 00000000..adcd4fcf --- /dev/null +++ b/sectionproperties/tests/test_Peery.py @@ -0,0 +1,161 @@ +import matplotlib.pyplot as plt +import numpy as np + +import pytest +from hypothesis import given, settings +from hypothesis import strategies as st +import sectionproperties.pre.nastran_sections as sections +from sectionproperties.analysis.cross_section import CrossSection + +## +# This file tests a couple of distinct examples from +# "Aircraft Structures," by David Peery. +# These cases have known results, and the output from +# SectionProperties is compared for accuracy. + +def get_node(nodes, coord) -> (int, tuple): + ''' + This function will loop over the node list provided, + finding the index of the coordinates you want. + + Returns the index in the nodes list, and the coords. + ''' + for index,var in enumerate(nodes): + if all(var == coord): + return index, var + else: + continue + + +class Z_Section: + ''' + This is basically just a fixture for testing purposes. + It's called by the actual pytest fixtures to generate + the Z-sections for analysis. + ''' + def __init__(self, DIM1, DIM2, DIM3, DIM4, shift, m, name): + # Setup the analysis, and calculate properties + self.geom = sections.ZSection(DIM1, DIM2, DIM3, DIM4, shift) + self.mesh = self.geom.create_mesh([m]) + self.xsect = CrossSection(self.geom, self.mesh) + self.xsect.calculate_geometric_properties() + # fig, ax = self.xsect.plot_centroids() + # ax.grid(1, which='both', linestyle=':') + # fig.savefig('Peery_7.2.1_geom.png') + + def apply_load(self, v): + ''' + This method applies the suplied load to the section. + + v is a list-like with the first entry being Mxx, and + second entry Myy. + ''' + self.xsect.calculate_warping_properties() + self.stress = self.xsect.calculate_stress(Mxx=v[0], Myy=v[1]) + + +@pytest.fixture +def PeeryEx7_2_1(): + ''' + Example 1 in Sec. 7.2. + This is an unsymmetric Z-section with no lateral supports. + + Note that units here are inches, to match the text. + ''' + return Z_Section(4,2,8,12,shift=[-2,0],m=0.25, name='Peery_7.2.1_geom.png') + + + +def test_ixx_g(PeeryEx7_2_1): + # Directly from the example, we know what + # the section properties should be. + xsect = PeeryEx7_2_1.xsect + assert round(xsect.section_props.ixx_g,1) == 693.3 + +def test_iyy_g(PeeryEx7_2_1): + # Directly from the example, we know what + # the section properties should be. + xsect = PeeryEx7_2_1.xsect + assert round(xsect.section_props.iyy_g,1) == 173.3 + +def test_ixy_g(PeeryEx7_2_1): + # Directly from the example, we know what + # the section properties should be. + xsect = PeeryEx7_2_1.xsect + assert round(xsect.section_props.ixy_g,0) == -240 + +def test_i11_c(PeeryEx7_2_1): + # Directly from the example, we know what + # the section properties should be. + xsect = PeeryEx7_2_1.xsect + assert round(xsect.section_props.i11_c,0) == 787 + +def test_i22_c(PeeryEx7_2_1): + # Directly from the example, we know what + # the section properties should be. + xsect = PeeryEx7_2_1.xsect + assert round(xsect.section_props.i22_c,1) == 79.5 + + +def test_fb_C(PeeryEx7_2_1): + '''Check the stress at point C.''' + # Load from the text + v = [-1e5, 1e4] + C = PeeryEx7_2_1.geom.getStressPoints()[0] + perfect_result = -2384 + text_result = round(-494*1 + -315*6) + nodes = PeeryEx7_2_1.xsect.mesh_nodes + index, _ = get_node(nodes, C) + stress = PeeryEx7_2_1.apply_load(v) + computed_result = PeeryEx7_2_1.stress.get_stress()[0]['sig_zz'][index] + + assert abs(text_result) == abs(perfect_result) + assert abs(computed_result) <= 1.005*abs(perfect_result) + assert abs(computed_result) >= 0.995*abs(perfect_result) + + +def test_fb_B(PeeryEx7_2_1): + '''Check the stress at point B.''' + # Load from the text + v = [-1e5, 1e4] + B = PeeryEx7_2_1.geom.getStressPoints()[3] + perfect_result = 580 + text_result = round(-494*-5 + -315*6) + nodes = PeeryEx7_2_1.xsect.mesh_nodes + index, _ = get_node(nodes, B) + stress = PeeryEx7_2_1.apply_load(v) + computed_result = PeeryEx7_2_1.stress.get_stress()[0]['sig_zz'][index] + + assert abs(text_result) == abs(perfect_result) + assert abs(computed_result) <= 1.005*abs(perfect_result) + assert abs(computed_result) >= 0.995*abs(perfect_result) + + +def test_fb_A(PeeryEx7_2_1): + '''Check the stress at point A.''' + # Load from the text + v = [-1e5, 1e4] + A = (-5, 4) + perfect_result = 1210 + text_result = round(-494*-5 + -315*4) + nodes = PeeryEx7_2_1.xsect.mesh_nodes + index, _ = get_node(nodes, A) + stress = PeeryEx7_2_1.apply_load(v) + computed_result = PeeryEx7_2_1.stress.get_stress()[0]['sig_zz'][index] + + assert abs(text_result) == abs(perfect_result) + assert abs(computed_result) <= 1.005*abs(perfect_result) + assert abs(computed_result) >= 0.995*abs(perfect_result) + + +if __name__ == "__main__": + temp = Z_Section(4,2,8,12,shift=[-2,0],m=0.25, name='Peery_7.2.1_geom.png') + # Coord to find: + coord = (1, 6) + v = [-1e5, 1e4] + nodes = temp.xsect.mesh_nodes + i, c = get_node(nodes, coord) + print(nodes[i]) + temp.apply_load(v) + computed_result = temp.stress.get_stress()[0]['sig_zz'][i] + print(computed_result) \ No newline at end of file diff --git a/sectionproperties/tests/test_hyp.py b/sectionproperties/tests/test_hyp.py new file mode 100644 index 00000000..3f0d0688 --- /dev/null +++ b/sectionproperties/tests/test_hyp.py @@ -0,0 +1,86 @@ +import pytest +from hypothesis import given, settings +from hypothesis import strategies as st +import sectionproperties.pre.sections as sections +from sectionproperties.analysis.cross_section import CrossSection + +afloat = st.floats(min_value=0) + +@given( + d=st.floats(min_value=0.001), + b=st.floats(min_value=0.001), + shift=st.lists(afloat, min_size=2, max_size=2) +) +def test_rectangle_geom(d, b, shift): + ''' + This function tests the rectangular geometry. + The pre module is currently undergoing an overhaul, so this is really just + serving as the simplest point of entry for me to learn pytest/hypothesis. + ''' + xsect = sections.RectangularSection(d, b, shift=shift) + + assert len(xsect.points) == 4 + assert len(xsect.facets) == 4 + assert len(xsect.control_points) == 1 + assert xsect.control_points[0][0] == b/2 + shift[0] + assert xsect.control_points[0][1] == d/2 + shift[1] + + + +@given( + d=st.floats(min_value=0.1, max_value=999), + b=st.floats(min_value=0.1, max_value=999) +) +def test_rectangle_mesh(d, b): + ''' + This function tests the rectangular mesh. + The pre module is currently undergoing an overhaul, so this is really just + serving as the simplest point of entry for me to learn pytest/hypothesis. + ''' + xsect = sections.RectangularSection(d, b) + mesh = xsect.create_mesh([min(d,b)/50]) + + +@given( + d=st.floats(min_value=.01, max_value=10), + b=st.floats(min_value=.01, max_value=10) +) +def test_rectangle_mesh_size(d, b): + ''' + This function verifies that the ValueError is raised when mesh size is + set too small. + ''' + with pytest.raises(ValueError): + xsect = sections.RectangularSection(d, b) + mesh = xsect.create_mesh([0.1/251]) + + + +@given( + geom = st.builds( + sections.RectangularSection, + d = st.floats(min_value=0.1, max_value=10), + b = st.floats(min_value=0.1, max_value=10) + ) +) +@settings(deadline=1000) +def test_cross_section(geom): + ''' + This function tests a basic CrossSection object, instead of + just Geometry and Mesh from the prior funtions. It builds a + RectangularSection Geometry, then passes that to the + CrossSection Class for analysis. + ''' + b = geom.points[2][0] + d = geom.points[2][1] + mesh = geom.create_mesh([min(b,d)/5]) + + xsect = CrossSection(geom, mesh) + assert xsect.geometry == geom + assert xsect.num_nodes == len(mesh.points) + assert len(xsect.elements) == len(mesh.elements) + + xsect.calculate_geometric_properties() + xsect.calculate_frame_properties() + xsect.calculate_warping_properties() + xsect.calculate_geometric_properties() \ No newline at end of file