Skip to content

Commit 624e9f9

Browse files
Merge pull request #132 from robbievanleeuwen/new_section_library
New section library
2 parents 49a09bd + 8a4fe78 commit 624e9f9

39 files changed

+2584
-2189
lines changed

docs/source/conf.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import locale
1111

1212

13-
locale.setlocale(locale.LC_ALL, '')
13+
locale.setlocale(locale.LC_ALL, "")
1414

1515
# -- Path setup --------------------------------------------------------------
1616

@@ -50,10 +50,10 @@
5050
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
5151
# ones.
5252
extensions = [
53-
'sphinx.ext.autodoc',
54-
'sphinx.ext.mathjax',
55-
'sphinx.ext.viewcode',
56-
'sphinx_gallery.gen_gallery',
53+
"sphinx.ext.autodoc",
54+
"sphinx.ext.mathjax",
55+
"sphinx.ext.viewcode",
56+
"sphinx_gallery.gen_gallery",
5757
]
5858

5959
# Add any paths that contain templates here, relative to this directory.
@@ -181,23 +181,23 @@
181181

182182
sphinx_gallery_conf = {
183183
# convert rst to md for ipynb
184-
'pypandoc': False,
184+
"pypandoc": False,
185185
# path to your examples scripts
186-
'examples_dirs': ['../../examples/'],
186+
"examples_dirs": ["../../examples/"],
187187
# path where to save gallery generated examples
188-
'gallery_dirs': ['sphinx_gallery_examples'],
188+
"gallery_dirs": ["sphinx_gallery_examples"],
189189
# Patter to search for example files
190-
'filename_pattern': r'\.py',
190+
"filename_pattern": r"\.py",
191191
# Remove the 'Download all examples' button from the top level gallery
192-
'download_all_examples': False,
192+
"download_all_examples": False,
193193
# Sort gallery example by file name instead of number of lines (default)
194-
'within_subsection_order': FileNameSortKey,
194+
"within_subsection_order": FileNameSortKey,
195195
# directory where function granular galleries are stored
196-
'backreferences_dir': None,
196+
"backreferences_dir": None,
197197
# Modules for which function level galleries are created. In
198-
'doc_module': 'sectionproperties',
199-
'image_scrapers': ('matplotlib',),
200-
'first_notebook_cell': ('%matplotlib inline\n'),
198+
"doc_module": "sectionproperties",
199+
"image_scrapers": ("matplotlib",),
200+
"first_notebook_cell": ("%matplotlib inline\n"),
201201
}
202202

203203
# sphinx_gallery_conf = {
62.1 KB
Loading
129 KB
Loading
27.9 KB
Loading
132 KB
Loading
29.5 KB
Loading
112 KB
Loading

docs/source/index.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ can be found in the README file on github.
2727
rst/installation
2828
rst/structure
2929
rst/geom_mesh
30+
rst/section_library
3031
rst/advanced_geom
3132
rst/analysis
3233
rst/post
@@ -36,14 +37,14 @@ can be found in the README file on github.
3637

3738
Here's a quick example that harnesses some of the power of *sectionproperties* and shows its simplicity::
3839

39-
import sectionproperties.pre.sections as sections
40+
import sectionproperties.pre.library.steel_sections as steel_sections
4041
from sectionproperties.analysis.cross_section import Section
4142

4243
# create geometry of the cross-section
43-
geometry = sections.i_section(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
44+
geometry = steel_sections.i_section(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
4445

4546
# generate a finite element mesh
46-
geometry.create_mesh(mesh_sizes=[2.5])
47+
geometry.create_mesh(mesh_sizes=[10])
4748

4849
# create a Section object for analysis
4950
section = Section(geometry)
@@ -58,9 +59,9 @@ Here's a quick example that harnesses some of the power of *sectionproperties* a
5859
print(section.get_ic()) # second moments of area about the centroidal axis
5960
>>>(23544664.29, 3063383.07, 0.00)
6061
print(section.get_j()) # torsion constant
61-
>>>62907.79
62+
>>>62954.43
6263
print(section.get_As()) # shear areas in the x & y directions
63-
>>>(1842.17, 1120.18)
64+
>>>(1842.24, 1120.19)
6465

6566
Support
6667
-------

docs/source/rst/advanced_geom.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ Creating Merged Sections
2424

2525
For this example, we will create a custom section out of two similar "I" sections::
2626

27-
import sectionproperties.pre.sections as sections
27+
import sectionproperties.pre.library.steel_sections as steel_sections
2828
import sectionproperties.analysis.cross_section as cross_section
2929

30-
i_sec1 = sections.i_section(d=250, b=150, t_f=13, t_w=10, r=12, n_r=12)
30+
i_sec1 = steel_sections.i_section(d=250, b=150, t_f=13, t_w=10, r=12, n_r=12)
3131
i_sec2 = i_sec1.rotate_section(45)
3232

3333
.. figure:: ../images/examples/i_sec1.png
@@ -159,11 +159,11 @@ Another example
159159

160160
Here, we will simply combine two squares with the default material::
161161

162-
import sectionproperties.pre.sections as sections
162+
import sectionproperties.pre.library.standard_sections as standard_sections
163163
from sectionproperties.analysis.cross_section import Section
164164

165-
s1 = sections.rectangular_section(1,1)
166-
s2 = sections.rectangular_section(0.5,0.5).shift_section(1,0.25)
165+
s1 = standard_sections.rectangular_section(1,1)
166+
s2 = standard_sections.rectangular_section(0.5,0.5).shift_section(1,0.25)
167167
geometry = s1 + s2
168168
geometry
169169

0 commit comments

Comments
 (0)