Skip to content

Commit

Permalink
Add CHS sections
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM committed Dec 30, 2024
1 parent 36b9e34 commit c3a9aef
Show file tree
Hide file tree
Showing 7 changed files with 610 additions and 1,419 deletions.
676 changes: 532 additions & 144 deletions docs/Library/Section/Code/US.md

Large diffs are not rendered by default.

Binary file added docs/Library/Section/Code/US.pdf
Binary file not shown.
66 changes: 48 additions & 18 deletions docs/Library/Section/Code/Validation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -70,7 +70,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -111,7 +111,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -137,7 +137,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -162,7 +162,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -174,10 +174,6 @@
" if designation.startswith(\"MC\"):\n",
" continue\n",
"\n",
" # ignore pipes\n",
" if designation.startswith(\"HSS\") and row[\"Ht\"] == \"\":\n",
" continue\n",
"\n",
" validate(designation)"
]
},
Expand Down Expand Up @@ -229,7 +225,7 @@
"plot(\"Weak Axis Moment of Inertia\", 2, hss_results)\n",
"plot(\"Area\", 0, i_results)\n",
"plot(\"Strong Axis Moment of Inertia\", 1, i_results)\n",
"plot(\"Weak Axis Moment of Inertia\", 2, i_results)\n"
"plot(\"Weak Axis Moment of Inertia\", 2, i_results)"
]
},
{
Expand Down Expand Up @@ -259,32 +255,34 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
"fig.savefig(\"us.pdf\")"
"fig.savefig(\"US.pdf\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The figures can be downloaded: [us](../us.pdf).\n",
"The figures can be downloaded: [us](../US.pdf).\n",
"\n",
"The following is the script to generate autocompletion.\n",
"Readers can safely ignore."
]
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
"us_section = {}\n",
"\n",
"key: str\n",
"for key, value in all_results.items():\n",
" num_ip = 10 if \"HSS\" in key and key.count(\"X\") == 1 else 6\n",
"\n",
" us_section[f\"{key}-2D\"] = {\n",
" \"prefix\": key,\n",
" \"description\": f\"US 2D section {key}, accuracy: {value[0]:.2f}/{value[1]:.2f}\",\n",
Expand All @@ -293,7 +291,7 @@
" \"# (1) int, unique tag\",\n",
" \"# (2) int, material tag\",\n",
" \"# [3] double, scale, default: 1.0\",\n",
" \"# [4] int, number of integration points, default: 6\",\n",
" f\"# [4] int, number of integration points, default: {num_ip}\",\n",
" \"# [5] double, eccentricity, default: 0.0\",\n",
" \"\",\n",
" ],\n",
Expand All @@ -307,7 +305,7 @@
" \"# (1) int, unique tag\",\n",
" \"# (2) int, material tag\",\n",
" \"# [3] double, scale, default: 1.0\",\n",
" \"# [4] int, number of integration points, default: 6\",\n",
" f\"# [4] int, number of integration points, default: {num_ip}\",\n",
" \"# [5] double, eccentricity of y axis, default: 0.0\",\n",
" \"# [6] double, eccentricity of z axis, default: 0.0\",\n",
" \"\",\n",
Expand All @@ -317,7 +315,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 32,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -351,6 +349,38 @@
" + r\")\\b\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from itertools import zip_longest\n",
"\n",
"\n",
"all_w = [x for x in all_results.keys() if x.startswith(\"W\") and not x.startswith(\"WT\")]\n",
"all_m = [x for x in all_results.keys() if x.startswith(\"M\")]\n",
"all_s = [x for x in all_results.keys() if x.startswith(\"S\") and not x.startswith(\"ST\")]\n",
"all_hp = [x for x in all_results.keys() if x.startswith(\"HP\")]\n",
"all_wt = [x for x in all_results.keys() if x.startswith(\"WT\")]\n",
"all_mt = [x for x in all_results.keys() if x.startswith(\"MT\")]\n",
"all_st = [x for x in all_results.keys() if x.startswith(\"ST\")]\n",
"all_rhs = [x for x in all_results.keys() if x.startswith(\"HSS\") and x.count(\"X\") == 2]\n",
"all_chs = [x for x in all_results.keys() if x.startswith(\"HSS\") and x.count(\"X\") == 1]\n",
"\n",
"md_table = [\n",
" \"| W | M | S | HP | WT | MT | ST | HSS (Rectangle) | HSS (Circle) |\",\n",
" \"|:--------|:-----------|:---------|:---------|:-------------|:-----------|:------------|:--------------------|:----------------|\",\n",
"]\n",
"for w, m, s, hp, wt, mt, st, rhs, chs in zip_longest(\n",
" all_w, all_m, all_s, all_hp, all_wt, all_mt, all_st, all_rhs, all_chs, fillvalue=\"\"\n",
"):\n",
" md_table.append(f\"|{w}|{m}|{s}|{hp}|{wt}|{mt}|{st}|{rhs}|{chs}|\")\n",
"\n",
"\n",
"print(\"\\n\".join(md_table))"
]
}
],
"metadata": {
Expand Down
Binary file removed docs/Library/Section/Code/us.pdf
Binary file not shown.
4 changes: 3 additions & 1 deletion docs/Library/Section/Section2D/CircularHollow2D.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

![arrangement](PIC/CircularHollow.svg)

The radius should be the outer radius, which shall be half of the overall diameter.

## Syntax

```
Expand All @@ -12,7 +14,7 @@ section CircularHollow2D (1) (2) (3) (4) [5] [6]
# (2) double, radius
# (3) double, thickness
# (4) int, material tag
# [5] int, number of integration points for half circle, default: 6
# [5] int, number of integration points for half circle, default: 10
# [6] double, eccentricity/location, default: 0.0
```

Expand Down
4 changes: 3 additions & 1 deletion docs/Library/Section/Section3D/CircularHollow3D.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

![arrangement](PIC/CircularHollow.svg)

The radius should be the outer radius, which shall be half of the overall diameter.

## Syntax

```
Expand All @@ -12,7 +14,7 @@ section CircularHollow3D (1) (2) (3) (4) [5] [6] [7]
# (2) double, radius
# (3) double, thickness
# (4) int, material tag
# [5] int, number of integration points of half circle, default: 6
# [5] int, number of integration points of half circle, default: 10
# [6] double, eccentricity along y axis, default: 0.0
# [7] double, eccentricity along z axis, default: 0.0
```
Loading

0 comments on commit c3a9aef

Please sign in to comment.