From 5d74763ea406c8ebb489b973094eef4bfa97076c Mon Sep 17 00:00:00 2001 From: Morten Engen Date: Fri, 27 Mar 2026 13:37:55 +0100 Subject: [PATCH 1/2] Rename GenericSection and GenericSectionCalculator to BeamSection and BeamSectionCalculator --- docs/_example_code/quickstart_example.py | 4 +- .../usage_bending_strength_results.py | 6 +- .../usage_compute_3d_domain_from_mm.py | 6 +- ...e_surface_geometries_with_reinforcement.py | 6 +- .../usage_steel_profile_in_geometry.py | 4 +- docs/api/sections/section_calculator.md | 4 +- docs/api/sections/section_creation.md | 4 +- docs/quickstart/index.md | 4 +- docs/theory/section_calculator.md | 1 - docs/usage/sections/index.md | 62 ++++---- structuralcodes/geometry/_geometry.py | 2 +- structuralcodes/sections/__init__.py | 6 +- structuralcodes/sections/_generic.py | 50 +++---- structuralcodes/sections/_rc_utils.py | 14 +- .../section_integrators/_fiber_integrator.py | 4 +- tests/test_geometry/test_profiles/test_hd.py | 4 +- tests/test_geometry/test_profiles/test_hp.py | 4 +- tests/test_geometry/test_profiles/test_l.py | 4 +- tests/test_geometry/test_profiles/test_li.py | 4 +- .../test_profiles/test_profiles.py | 20 +-- tests/test_geometry/test_profiles/test_u.py | 4 +- tests/test_geometry/test_profiles/test_ub.py | 4 +- tests/test_geometry/test_profiles/test_upe.py | 4 +- tests/test_geometry/test_profiles/test_w.py | 4 +- tests/test_sections/test_generic_section.py | 132 +++++++++--------- .../test_rc_sections/test_rc_results.py | 4 +- .../test_rc_sections/test_rc_utils.py | 14 +- tests/test_sections/test_results.py | 6 +- 28 files changed, 190 insertions(+), 195 deletions(-) diff --git a/docs/_example_code/quickstart_example.py b/docs/_example_code/quickstart_example.py index e8ff9fdc..73a96b89 100644 --- a/docs/_example_code/quickstart_example.py +++ b/docs/_example_code/quickstart_example.py @@ -6,7 +6,7 @@ from structuralcodes.geometry import SurfaceGeometry, add_reinforcement from structuralcodes.materials.concrete import create_concrete from structuralcodes.materials.reinforcement import create_reinforcement -from structuralcodes.sections import GenericSection +from structuralcodes.sections import BeamSection # Set the active design code set_design_code('ec2_2004') @@ -62,7 +62,7 @@ ) # Create section -section = GenericSection(geometry) +section = BeamSection(geometry) # Calculate the moment-curvature response moment_curvature = section.section_calculator.calculate_moment_curvature() diff --git a/docs/_example_code/usage_bending_strength_results.py b/docs/_example_code/usage_bending_strength_results.py index ee4941da..f7307f85 100644 --- a/docs/_example_code/usage_bending_strength_results.py +++ b/docs/_example_code/usage_bending_strength_results.py @@ -13,7 +13,7 @@ ) from structuralcodes.materials.concrete import ConcreteEC2_2004 from structuralcodes.materials.reinforcement import ReinforcementEC2_2004 -from structuralcodes.sections import GenericSection +from structuralcodes.sections import BeamSection # Define parameters fck = 30 @@ -77,12 +77,12 @@ ) # Create a section -section_not_translated = GenericSection(geometry=t_geom) +section_not_translated = BeamSection(geometry=t_geom) # Use the centroid of the section, given in the gross properties, to re-allign # the geometry with the origin t_geom = t_geom.translate(dy=-section_not_translated.gross_properties.cz) -section = GenericSection(geometry=t_geom) +section = BeamSection(geometry=t_geom) # Calculate the bending strength bending_strength = section.section_calculator.calculate_bending_strength() diff --git a/docs/_example_code/usage_compute_3d_domain_from_mm.py b/docs/_example_code/usage_compute_3d_domain_from_mm.py index 084c7112..b97847e7 100644 --- a/docs/_example_code/usage_compute_3d_domain_from_mm.py +++ b/docs/_example_code/usage_compute_3d_domain_from_mm.py @@ -10,7 +10,7 @@ ) from structuralcodes.materials.concrete import create_concrete from structuralcodes.materials.reinforcement import create_reinforcement -from structuralcodes.sections import GenericSection +from structuralcodes.sections import BeamSection # Set parameters height = 625 @@ -50,9 +50,7 @@ n=n_bars, ) -section = GenericSection( - concrete_geometry, integrator='fiber', mesh_size=0.001 -) +section = BeamSection(concrete_geometry, integrator='fiber', mesh_size=0.001) # Perform the analyses and create the plot fig = plt.figure() diff --git a/docs/_example_code/usage_create_surface_geometries_with_reinforcement.py b/docs/_example_code/usage_create_surface_geometries_with_reinforcement.py index 6b7ea7f0..9f58937a 100644 --- a/docs/_example_code/usage_create_surface_geometries_with_reinforcement.py +++ b/docs/_example_code/usage_create_surface_geometries_with_reinforcement.py @@ -9,7 +9,7 @@ ) from structuralcodes.materials.concrete import ConcreteEC2_2004 from structuralcodes.materials.reinforcement import ReinforcementEC2_2004 -from structuralcodes.sections import GenericSection +from structuralcodes.sections import BeamSection # Define parameters fck = 30 @@ -70,12 +70,12 @@ ) # Create a section -section_not_translated = GenericSection(geometry=t_geom) +section_not_translated = BeamSection(geometry=t_geom) # Use the centroid of the section, given in the gross properties, to re-allign # the geometry with the origin t_geom = t_geom.translate(dy=-section_not_translated.gross_properties.cz) -section = GenericSection(geometry=t_geom) +section = BeamSection(geometry=t_geom) # Calculate the bending strength bending_strength = section.section_calculator.calculate_bending_strength() diff --git a/docs/_example_code/usage_steel_profile_in_geometry.py b/docs/_example_code/usage_steel_profile_in_geometry.py index 0f0be133..873df88c 100644 --- a/docs/_example_code/usage_steel_profile_in_geometry.py +++ b/docs/_example_code/usage_steel_profile_in_geometry.py @@ -3,7 +3,7 @@ from structuralcodes.geometry import SurfaceGeometry from structuralcodes.geometry.profiles import IPE from structuralcodes.materials.basic import ElasticPlasticMaterial -from structuralcodes.sections import GenericSection +from structuralcodes.sections import BeamSection # Create a profile ipe100 = IPE('IPE100') @@ -13,7 +13,7 @@ # Create a geometry and a section geom = SurfaceGeometry(poly=ipe100.polygon, material=steel) -section = GenericSection(geometry=geom) +section = BeamSection(geometry=geom) # Use the section calculator to calculate the bending strength bending_strength = section.section_calculator.calculate_bending_strength() diff --git a/docs/api/sections/section_calculator.md b/docs/api/sections/section_calculator.md index 5f46bef6..a12afd4c 100644 --- a/docs/api/sections/section_calculator.md +++ b/docs/api/sections/section_calculator.md @@ -1,10 +1,10 @@ (api-section-calculator)= # Section calculator -## Generic section calculator +## Beam section calculator ```{eval-rst} -.. autoclass:: structuralcodes.sections.GenericSectionCalculator +.. autoclass:: structuralcodes.sections.BeamSectionCalculator .. autoproperty:: n_min .. autoproperty:: n_max diff --git a/docs/api/sections/section_creation.md b/docs/api/sections/section_creation.md index 7fa58317..6326fc65 100644 --- a/docs/api/sections/section_creation.md +++ b/docs/api/sections/section_creation.md @@ -1,10 +1,10 @@ (api-section-creation)= # Section creation -## The generic section +## The beam section ```{eval-rst} -.. autoclass:: structuralcodes.sections.GenericSection +.. autoclass:: structuralcodes.sections.BeamSection .. automethod:: __init__ diff --git a/docs/quickstart/index.md b/docs/quickstart/index.md index 3f321044..feeb9de0 100644 --- a/docs/quickstart/index.md +++ b/docs/quickstart/index.md @@ -55,7 +55,7 @@ Add reinforcement to the geometry: :lines: 41-62 ::: -Create a {class}`GenericSection ` based on the geometry: +Create a {class}`BeamSection ` based on the geometry: :::{literalinclude} ../_example_code/quickstart_example.py :lines: 64-65 @@ -65,7 +65,7 @@ Create a {class}`GenericSection ` based {ref}`Section reference ` ::: -Call the {func}`.calculate_moment_curvature() ` method on the {class}`GenericSectionCalculator ` to calculate the moment-curvature relation: +Call the {func}`.calculate_moment_curvature() ` method on the {class}`BeamSectionCalculator ` to calculate the moment-curvature relation: :::{literalinclude} ../_example_code/quickstart_example.py :lines: 67-68 diff --git a/docs/theory/section_calculator.md b/docs/theory/section_calculator.md index 27908bd8..f05415e1 100644 --- a/docs/theory/section_calculator.md +++ b/docs/theory/section_calculator.md @@ -1,7 +1,6 @@ (theory-section-calculator)= # Section calculator - ## General concept Section calculators evaluate the structural response based on section properties and applied loads. They integrate results from the geometry and material models to provide insights into section performance by using a specific [*section integrator*](theory-section-integrators). diff --git a/docs/usage/sections/index.md b/docs/usage/sections/index.md index bdd9715e..00704efc 100644 --- a/docs/usage/sections/index.md +++ b/docs/usage/sections/index.md @@ -17,11 +17,11 @@ See the theory reference for a guide on the [sign convention](#theory-sign-conve The theory reference provides an overview of the theory behind the [section calculator](#theory-section-calculator) and the [section integrators](#theory-section-integrators). ::: -## The generic beam section +## The beam section -The {class}`GenericSection ` takes a {class}`SurfaceGeometry ` or a {class}`CompoundGeometry ` as input, and is capable of calculating the response of an arbitrarily shaped geometry with arbitrary reinforcement layout, subject to stresses in the direction of the beam axis. +The {class}`BeamSection ` takes a {class}`SurfaceGeometry ` or a {class}`CompoundGeometry ` as input, and is capable of calculating the response of an arbitrarily shaped geometry with arbitrary reinforcement layout, subject to stresses in the direction of the beam axis. -In the example [below](#code-usage-generic-section), we continue the example with the T-shaped geometry. +In the example [below](#code-usage-beam-section), we continue the example with the T-shaped geometry. (usage-sections-gross-properties-tip)= :::{tip} @@ -30,36 +30,36 @@ If you are looking for the gross properties of the section, these are available Since the axial force and the moments are all relative to the origin, we start by translating the geometry such that the centroid is alligned with the origin. -Notice how we can use {py:meth}`.calculate_bending_strength() ` and {py:meth}`.calculate_limit_axial_load() ` to calculate the bending strength and the limit axial loads in tension and compression. +Notice how we can use {py:meth}`.calculate_bending_strength() ` and {py:meth}`.calculate_limit_axial_load() ` to calculate the bending strength and the limit axial loads in tension and compression. Furthermore, we have the following methods: -{py:meth}`.integrate_strain_profile() ` +{py:meth}`.integrate_strain_profile() ` : Calculate the stress resultants for a given strain profile. -{py:meth}`.calculate_strain_profile() ` +{py:meth}`.calculate_strain_profile() ` : Calculate the strain profile for given stress resultants. -{py:meth}`.calculate_moment_curvature() ` +{py:meth}`.calculate_moment_curvature() ` : Calculate the moment-curvature relation. -{py:meth}`.calculate_nm_interaction_domain() ` +{py:meth}`.calculate_nm_interaction_domain() ` : Calculate the interaction domain between axial load and bending moment. -{py:meth}`.calculate_nmm_interaction_domain() ` +{py:meth}`.calculate_nmm_interaction_domain() ` : Calculate the interaction domain between axial load and biaxial bending. -{py:meth}`.calculate_mm_interaction_domain() ` +{py:meth}`.calculate_mm_interaction_domain() ` : Calculate the interaction domain between biaxial bending for a given axial load. -See the {class}`GenericSectionCalculator ` for a complete list. +See the {class}`BeamSectionCalculator ` for a complete list. (usage-sections-complete-nm-note)= :::{note} -Notice that a call to {py:meth}`.calculate_nm_interaction_domain() ` returns the interaction domain for a negative bending moment, i.e. a bending moment that gives compression at the top of the cross section according to the [sign convention](#theory-sign-convention). To obtain the interaction domain for the positive bending moment, the neutral axis for the calculation should be rotated an angle {math}`\theta = \pi`, i.e. the method should be called with the keyword argument `theta = np.pi` or `theta = math.pi`. Alternatively, to return the complete domain, the method could be called with the keyword argument `complete_domain = True`. +Notice that a call to {py:meth}`.calculate_nm_interaction_domain() ` returns the interaction domain for a negative bending moment, i.e. a bending moment that gives compression at the top of the cross section according to the [sign convention](#theory-sign-convention). To obtain the interaction domain for the positive bending moment, the neutral axis for the calculation should be rotated an angle {math}`\theta = \pi`, i.e. the method should be called with the keyword argument `theta = np.pi` or `theta = math.pi`. Alternatively, to return the complete domain, the method could be called with the keyword argument `complete_domain = True`. ::: -(code-usage-generic-section)= +(code-usage-beam-section)= ::::{dropdown-syntax} :::{literalinclude} ../../_example_code/usage_create_surface_geometries_with_reinforcement.py :lines: 12-13, 72-90 @@ -67,11 +67,11 @@ Notice that a call to {py:meth}`.calculate_nm_interaction_domain() ` returns a custom dataclass of type {class}`MomentCurvatureResults `. If we inspect this class further, we find among its attributes `chi_y` and `m_y`. These are the curvature and the moment about the selected global axis of the section. We also find the curvature and moment about the axis orthogonal to the global axis `chi_z` and `m_z`, and the axial strain at the level of the global axis `eps_axial`. All these attributes are stored as arrays, ready for visualization or further processing. +Notice how for example {py:meth}`.calculate_moment_curvature() ` returns a custom dataclass of type {class}`MomentCurvatureResults `. If we inspect this class further, we find among its attributes `chi_y` and `m_y`. These are the curvature and the moment about the selected global axis of the section. We also find the curvature and moment about the axis orthogonal to the global axis `chi_z` and `m_z`, and the axial strain at the level of the global axis `eps_axial`. All these attributes are stored as arrays, ready for visualization or further processing. :::::{tip} -Use your favourite plotting library to visualize the results from the {class}`GenericSectionCalculator `. The code below shows how to plot the moment-curvature relation in the figure [below](#fig-usage-moment-curvature) with [Matplotlib](https://matplotlib.org/). Notice how we are plotting the negative values of the curvatures and moments due to the sign convention. +Use your favourite plotting library to visualize the results from the {class}`BeamSectionCalculator `. The code below shows how to plot the moment-curvature relation in the figure [below](#fig-usage-moment-curvature) with [Matplotlib](https://matplotlib.org/). Notice how we are plotting the negative values of the curvatures and moments due to the sign convention. (code-usage-visualize-moment-curvature)= ::::{dropdown-syntax} @@ -85,7 +85,7 @@ Use your favourite plotting library to visualize the results from the {class}`Ge :::{figure} moment_curvature.png :width: 75% -The moment-curvature relation computed with the code [above](#code-usage-generic-section). +The moment-curvature relation computed with the code [above](#code-usage-beam-section). ::: ::::: @@ -94,7 +94,7 @@ The moment-curvature relation computed with the code [above](#code-usage-generic The results objects contain methods for inspecting and processing further the detailed results on the section after a calculation is performed. -For instance, calling the method {py:meth}`.calculate_bending_strength() ` returns an object of class {class}`UltimateBendingMomentResults `. +For instance, calling the method {py:meth}`.calculate_bending_strength() ` returns an object of class {class}`UltimateBendingMomentResults `. The object contains the following methods: @@ -107,9 +107,9 @@ The object contains the following methods: {py:meth}`.get_point_stress() ` : Get the stress at a point. -In the example [below](#code-usage-generic-section-result-strength), we continue the example with the T-shaped geometry and we create the detailed_result. +In the example [below](#code-usage-beam-section-result-strength), we continue the example with the T-shaped geometry and we create the detailed_result. -(code-usage-generic-section-result-strength)= +(code-usage-beam-section-result-strength)= ::::{dropdown-syntax} :::{literalinclude} ../../_example_code/usage_bending_strength_results.py :lines: 87-88, 100-101 @@ -117,9 +117,9 @@ In the example [below](#code-usage-generic-section-result-strength), we continue ::: :::: -If we inspect this result object, we find among its attributes `detailed_result` that has two useful datastructures: one for surface geometries and one for point geometries. The datastructure for surface geometries contains all points samples from the geometries. These data structures can be easily input for creating a DataFrame object permitting further processing. For instance in the example [below](#code-usage-generic-section-result-strength-plot), we use pandas plotting abilities to create a visualization of strain and stress fields. +If we inspect this result object, we find among its attributes `detailed_result` that has two useful datastructures: one for surface geometries and one for point geometries. The datastructure for surface geometries contains all points samples from the geometries. These data structures can be easily input for creating a DataFrame object permitting further processing. For instance in the example [below](#code-usage-beam-section-result-strength-plot), we use pandas plotting abilities to create a visualization of strain and stress fields. -(code-usage-generic-section-result-strength-plot)= +(code-usage-beam-section-result-strength-plot)= ::::{dropdown-syntax} :::{literalinclude} ../../_example_code/usage_bending_strength_results.py :lines: 103-141 @@ -131,19 +131,19 @@ If we inspect this result object, we find among its attributes `detailed_result` :::{figure} strain_field.png :width: 75% -The strain field plotted with the code [above](#code-usage-generic-section-result-strength-plot). +The strain field plotted with the code [above](#code-usage-beam-section-result-strength-plot). ::: (fig-usage-stress-field)= :::{figure} stress_field.png :width: 75% -The stress field plotted with the code [above](#code-usage-generic-section-result-strength-plot). +The stress field plotted with the code [above](#code-usage-beam-section-result-strength-plot). ::: -If we only want to know the strain and/or stress at a specific point we can directly use methods {py:meth}`.get_point_strain() ` or {py:meth}`.get_point_stress() ` without the need of creating the detailed result. For instance with the code [below](#code-usage-generic-section-result-strength-point-stress) we query the stress at a point for any geometry whose `group_label` matches the pattern `"reinforcement"`. Note that a pattern can be given with wildcards (like `'*'` or `'?'`); for more information refer to {py:meth}`.get_point_stress() ` and {py:meth}`.group_filter()`. +If we only want to know the strain and/or stress at a specific point we can directly use methods {py:meth}`.get_point_strain() ` or {py:meth}`.get_point_stress() ` without the need of creating the detailed result. For instance with the code [below](#code-usage-beam-section-result-strength-point-stress) we query the stress at a point for any geometry whose `group_label` matches the pattern `"reinforcement"`. Note that a pattern can be given with wildcards (like `'*'` or `'?'`); for more information refer to {py:meth}`.get_point_stress() ` and {py:meth}`.group_filter()`. -(code-usage-generic-section-result-strength-point-stress)= +(code-usage-beam-section-result-strength-point-stress)= ::::{dropdown-syntax} :::{literalinclude} ../../_example_code/usage_bending_strength_results.py :lines: 90-98 @@ -162,9 +162,9 @@ When dealing with analysis that do not involve a single section state, like for {py:meth}`.set_step() ` : Navigate to a specific step. -If we are not interested in getting the detailed results but we want to get the stresses and/or strains at specific points the same methods {py:meth}`.get_point_stress() ` and {py:meth}`.get_point_strain() ` can be used. In this case the return will be an array of stresses (or strains) for the point through the moment-curvature analysis. For instance with the code [below](#code-usage-generic-section-result-mcurv-point-stress) it is possible to plot the stress for one rebar at a given position for the increasing curvature. +If we are not interested in getting the detailed results but we want to get the stresses and/or strains at specific points the same methods {py:meth}`.get_point_stress() ` and {py:meth}`.get_point_strain() ` can be used. In this case the return will be an array of stresses (or strains) for the point through the moment-curvature analysis. For instance with the code [below](#code-usage-beam-section-result-mcurv-point-stress) it is possible to plot the stress for one rebar at a given position for the increasing curvature. -(code-usage-generic-section-result-mcurv-point-stress)= +(code-usage-beam-section-result-mcurv-point-stress)= ::::{dropdown-syntax} :::{literalinclude} ../../_example_code/usage_bending_strength_results.py :lines: 202-226 @@ -176,12 +176,12 @@ If we are not interested in getting the detailed results but we want to get the :::{figure} stress_at_rebar.png :width: 75% -The stress for increasing curvature plotted with the code [above](#code-usage-generic-section-result-mcurv-point-stress). +The stress for increasing curvature plotted with the code [above](#code-usage-beam-section-result-mcurv-point-stress). ::: -Using in a more advanced way matplotlib, it is possible to create an animation (like for instance a *gif* file) showing the stress field for the steps of the moment-curvature analysis. The code [below](code-usage-generic-section-result-mcurv-anim) create an animation with the moment curvature diagram on the left and the cross section stress field on the right. +Using in a more advanced way matplotlib, it is possible to create an animation (like for instance a *gif* file) showing the stress field for the steps of the moment-curvature analysis. The code [below](code-usage-beam-section-result-mcurv-anim) create an animation with the moment curvature diagram on the left and the cross section stress field on the right. -(code-usage-generic-section-result-mcurv-anim)= +(code-usage-beam-section-result-mcurv-anim)= ::::{dropdown-syntax} :::{literalinclude} ../../_example_code/usage_bending_strength_results.py :lines: 228-359 @@ -193,5 +193,5 @@ Using in a more advanced way matplotlib, it is possible to create an animation ( :::{figure} moment_curvature_stress_animation.gif :width: 75% -The animation of the stress field with increasing curvature created with the code [above](#code-usage-generic-section-result-mcurv-anim). +The animation of the stress field with increasing curvature created with the code [above](#code-usage-beam-section-result-mcurv-anim). ::: \ No newline at end of file diff --git a/structuralcodes/geometry/_geometry.py b/structuralcodes/geometry/_geometry.py index 900700fa..d5eb3455 100644 --- a/structuralcodes/geometry/_geometry.py +++ b/structuralcodes/geometry/_geometry.py @@ -1,4 +1,4 @@ -"""Generic class section implemenetation.""" +"""Geometry classes for beam sections.""" from __future__ import annotations # To have clean hints of ArrayLike in docs diff --git a/structuralcodes/sections/__init__.py b/structuralcodes/sections/__init__.py index 6a302251..de37efcf 100644 --- a/structuralcodes/sections/__init__.py +++ b/structuralcodes/sections/__init__.py @@ -1,6 +1,6 @@ """Main entry point for sections.""" -from ._generic import GenericSection, GenericSectionCalculator +from ._generic import BeamSection, BeamSectionCalculator from ._rc_utils import calculate_elastic_cracked_properties from .section_integrators import ( FiberIntegrator, @@ -11,8 +11,8 @@ ) __all__ = [ - 'GenericSection', - 'GenericSectionCalculator', + 'BeamSection', + 'BeamSectionCalculator', 'SectionIntegrator', 'FiberIntegrator', 'MarinIntegrator', diff --git a/structuralcodes/sections/_generic.py b/structuralcodes/sections/_generic.py index de78169b..8361f973 100644 --- a/structuralcodes/sections/_generic.py +++ b/structuralcodes/sections/_generic.py @@ -1,4 +1,4 @@ -"""Generic class section implemenetation.""" +"""Implementation of the beam section class.""" from __future__ import annotations # To have clean hints of ArrayLike in docs @@ -25,8 +25,8 @@ from .section_integrators import SectionIntegrator, integrator_factory -class GenericSection(Section): - """This is the implementation of the generic class section. +class BeamSection(Section): + """This is the implementation of the beam section. The section is a 2D geometry where Y axis is horizontal while Z axis is vertical. @@ -38,7 +38,7 @@ class GenericSection(Section): geometry (Union(SurfaceGeometry, CompoundGeometry)): The geometry of the section. name (str): The name of the section. - section_calculator (GenericSectionCalculator): The object responsible + section_calculator (BeamSectionCalculator): The object responsible for performing different calculations on the section (e.g. bending strength, moment curvature, etc.). """ @@ -52,7 +52,7 @@ def __init__( integrator: t.Literal['marin', 'fiber'] = 'marin', **kwargs, ) -> None: - """Initialize a GenericSection. + """Initialize a BeamSection. Arguments: geometry (Union(SurfaceGeometry, CompoundGeometry)): The geometry @@ -63,15 +63,15 @@ def __init__( section calculator. Note: - The GenericSection uses a GenericSectionCalculator for all - calculations. The GenericSectionCalculator uses a SectionIntegrator + The BeamSection uses a BeamSectionCalculator for all + calculations. The BeamSectionCalculator uses a SectionIntegrator for integrating over the section. Any additional keyword arguments - used when creating the GenericSection are passed on to the + used when creating the BeamSection are passed on to the SectionCalculator to customize the behaviour. See - GenericSectionCalculator for available keyword arguments. + BeamSectionCalculator for available keyword arguments. """ if name is None: - name = 'GenericSection' + name = 'BeamSection' super().__init__(name) # Since only CompoundGeometry has the attribute geometries, # if a SurfaceGeometry is input, we create a CompoundGeometry @@ -80,7 +80,7 @@ def __init__( if isinstance(geometry, SurfaceGeometry): geometry = CompoundGeometry([geometry]) self.geometry = geometry - self.section_calculator = GenericSectionCalculator( + self.section_calculator = BeamSectionCalculator( sec=self, integrator=integrator, **kwargs ) self._gross_properties = None @@ -95,22 +95,22 @@ def gross_properties(self) -> s_res.SectionProperties: return self._gross_properties -class GenericSectionCalculator(SectionCalculator): +class BeamSectionCalculator(SectionCalculator): """Calculator class implementing analysis algorithms for code checks.""" integrator: SectionIntegrator - section: GenericSection + section: BeamSection def __init__( self, - sec: GenericSection, + sec: BeamSection, integrator: t.Literal['marin', 'fiber'] = 'marin', **kwargs, ) -> None: - """Initialize the GenericSectionCalculator. + """Initialize the BeamSectionCalculator. Arguments: - section (GenericSection): The section object. + section (BeamSection): The section object. integrator (str): The SectionIntegrator to be used for computations (default = 'marin'). @@ -131,7 +131,7 @@ def __init__( self._n_min = None def _calculate_gross_section_properties(self) -> s_res.SectionProperties: - """Calculates the gross section properties of the GenericSection. + """Calculates the gross section properties of the BeamSection. This function is private and called when the section is created. It stores the result into the result object. @@ -139,7 +139,7 @@ def _calculate_gross_section_properties(self) -> s_res.SectionProperties: Returns: SectionProperties: The gross properties of the section. """ - # It will use the algorithms for generic sections + # It will use the algorithms for beam sections gp = s_res.SectionProperties() # Computation of perimeter using shapely @@ -467,7 +467,7 @@ def find_equilibrium_fixed_pivot( dn_a = dn_c it += 1 if it >= max_iter: - msg = 'GenericSectionCalculator::find_equilibrium_fixed_pivot\n\t' + msg = 'BeamSectionCalculator::find_equilibrium_fixed_pivot\n\t' msg += 'Maximum number of iterations reached.' msg += f' Last iteration reached a unbalance of {dn_c:.3e}' warnings.warn( @@ -664,7 +664,7 @@ def _prefind_range_curvature_equilibrium( if it >= max_iter and not found: msg = ( - 'GenericSectionCalculator::' + 'BeamSectionCalculator::' '_prefind_range_curvature_equilibrium\n\t' 'Maximum number of iterations reached.' f' Last iteration reached a unbalance of {dn_b:.3e} {suffix}' @@ -748,7 +748,7 @@ def find_equilibrium_fixed_curvature( eps_0_a = eps_0_c it += 1 if it >= max_iter: - msg = 'GenericSectionCalculator::find_equilibrium_fixed_curvature' + msg = 'BeamSectionCalculator::find_equilibrium_fixed_curvature' msg += '\n\tMaximum number of iterations reached. ' msg += f' Last iteration reached a unbalance of {dn_c:.3e}' warnings.warn( @@ -1012,7 +1012,7 @@ def _prepare_chi_array( warn = w[0] if issubclass(warn.category, NoConvergenceWarning): new_msg = ( - f'\nGenericSectionCalculator::calculate_moment_curvature' + f'\nBeamSectionCalculator::calculate_moment_curvature' f'\n\tNo convergence during computation of ultimate' f' curvature. Please check results properly.\n' f'{warn.message}' @@ -1032,7 +1032,7 @@ def _prepare_chi_array( warn = w[0] if issubclass(warn.category, NoConvergenceWarning): new_msg = ( - f'\nGenericSectionCalculator::calculate_moment_curvature' + f'\nBeamSectionCalculator::calculate_moment_curvature' f'\n\tNo convergence during computation of yielding' f' curvature. Please check results properly.\n' f'{warn.message}' @@ -1188,7 +1188,7 @@ def calculate_moment_curvature( warn = w[0] if issubclass(warn.category, NoConvergenceWarning): new_msg = ( - f'\nGenericSectionCalculator::calculate_moment_curvature\n' + f'\nBeamSectionCalculator::calculate_moment_curvature\n' f'\tNo convergence during computation of step {i}.' f' The computation is stopped at the current step\n' f'{warn.message}' @@ -1724,7 +1724,7 @@ def calculate_mm_interaction_domain( warn = w[0] if issubclass(warn.category, NoConvergenceWarning): new_msg = ( - '\nGenericSectionCalculator::' + '\nBeamSectionCalculator::' 'calculate_mm_interaction_domain\n' f'\tNo convergence during computation with theta {th}.' f'\n{warn.message}' diff --git a/structuralcodes/sections/_rc_utils.py b/structuralcodes/sections/_rc_utils.py index d6ca6927..5abe37e1 100644 --- a/structuralcodes/sections/_rc_utils.py +++ b/structuralcodes/sections/_rc_utils.py @@ -6,7 +6,7 @@ from structuralcodes.geometry import CompoundGeometry, SurfaceGeometry from structuralcodes.materials.basic import ElasticMaterial, GenericMaterial from structuralcodes.materials.constitutive_laws import UserDefined -from structuralcodes.sections import GenericSection +from structuralcodes.sections import BeamSection from structuralcodes.sections.section_integrators import FiberIntegrator @@ -26,20 +26,20 @@ def _create_surface_geometries(polygons_list, material): def calculate_elastic_cracked_properties( - section: GenericSection, + section: BeamSection, theta: float = 0, return_cracked_section: bool = False, ) -> t.Union[ s_res.SectionProperties, t.Tuple[s_res.SectionProperties, CompoundGeometry] ]: """Calculates the cracked section properties of a reinforced concrete - section. (GenericSection). Materials in surface geometries and point + section. (BeamSection). Materials in surface geometries and point geometries are elastic-linear in order to make the cracking properties independent of the stress state. Tension in all surface geometries is neglected. Args: - section (GenericSection): The section to use as basis for the + section (BeamSection): The section to use as basis for the calculation. theta (float): Angle of the neutral axis to the horizontal in radians. theta=0 implies upper compression block. @@ -47,7 +47,7 @@ def calculate_elastic_cracked_properties( section. Returns: - t.Union[SectionProperties, t.Tuple[SectionProperties, GenericSection]]: + t.Union[SectionProperties, t.Tuple[SectionProperties, BeamSection]]: SectionProperties data of a cracked section (i.e cracked section properties) and (if return_cracked_section is True) the cracked section. @@ -100,7 +100,7 @@ def calculate_elastic_cracked_properties( # Create a new temporary section geo = CompoundGeometry(geometries=processed_geometries) - elastic_section = GenericSection( + elastic_section = BeamSection( geo, integrator=integrator, mesh_size=mesh_size ) rotated_geometry = elastic_section.geometry @@ -131,7 +131,7 @@ def calculate_elastic_cracked_properties( cracked_geom = cut_geom.rotate(theta) # Define the cracked section - cracked_sec = GenericSection( + cracked_sec = BeamSection( cracked_geom, integrator=integrator, mesh_size=mesh_size ) diff --git a/structuralcodes/sections/section_integrators/_fiber_integrator.py b/structuralcodes/sections/section_integrators/_fiber_integrator.py index 46ecbfab..411ca9ec 100644 --- a/structuralcodes/sections/section_integrators/_fiber_integrator.py +++ b/structuralcodes/sections/section_integrators/_fiber_integrator.py @@ -210,8 +210,8 @@ def prepare_input( integration_data = kwargs.get('integration_data') if integration_data is None: # No triangulation is provided, triangulate the section - # Fiber integrator for generic section uses delaunay triangulation - # for discretizing in fibers + # Fiber integrator for arbitrary shaped geometries uses delaunay + # triangulation for discretizing in fibers mesh_size = kwargs.get('mesh_size', 0.01) integration_data = self.triangulate(geo, mesh_size) diff --git a/tests/test_geometry/test_profiles/test_hd.py b/tests/test_geometry/test_profiles/test_hd.py index 2d9f117b..a6352ca5 100644 --- a/tests/test_geometry/test_profiles/test_hd.py +++ b/tests/test_geometry/test_profiles/test_hd.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import GenericSection +from structuralcodes.sections._generic import BeamSection def load_hd_profiles_data(): @@ -238,7 +238,7 @@ def test_hd_massprops_polygon( # Create geometry geo = SurfaceGeometry(HD.get_polygon(profile_name), material=steel) # Create the section - sec = GenericSection(geo) + sec = BeamSection(geo) # Get values from section a_section = sec.gross_properties.area diff --git a/tests/test_geometry/test_profiles/test_hp.py b/tests/test_geometry/test_profiles/test_hp.py index 74f8e690..fd0e38f1 100644 --- a/tests/test_geometry/test_profiles/test_hp.py +++ b/tests/test_geometry/test_profiles/test_hp.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import GenericSection +from structuralcodes.sections._generic import BeamSection def load_hp_profiles_data(): @@ -238,7 +238,7 @@ def test_hp_massprops_polygon( # Create geometry geo = SurfaceGeometry(HP.get_polygon(profile_name), material=steel) # Create the section - sec = GenericSection(geo) + sec = BeamSection(geo) # Get values from section a_section = sec.gross_properties.area diff --git a/tests/test_geometry/test_profiles/test_l.py b/tests/test_geometry/test_profiles/test_l.py index ee9b1cce..dbbfac7b 100644 --- a/tests/test_geometry/test_profiles/test_l.py +++ b/tests/test_geometry/test_profiles/test_l.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import GenericSection +from structuralcodes.sections._generic import BeamSection def load_L_profiles_data(): @@ -258,7 +258,7 @@ def test_L_massprops_polygon( # Create geometry geo = SurfaceGeometry(L.get_polygon(profile_name), material=steel) # Create the section - sec = GenericSection(geo) + sec = BeamSection(geo) # Get values from section a_section = sec.gross_properties.area diff --git a/tests/test_geometry/test_profiles/test_li.py b/tests/test_geometry/test_profiles/test_li.py index cdcde8f7..f70c96e3 100644 --- a/tests/test_geometry/test_profiles/test_li.py +++ b/tests/test_geometry/test_profiles/test_li.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import GenericSection +from structuralcodes.sections._generic import BeamSection def load_LI_profiles_data(): @@ -258,7 +258,7 @@ def test_L_massprops_polygon( # Create geometry geo = SurfaceGeometry(LI.get_polygon(profile_name), material=steel) # Create the section - sec = GenericSection(geo) + sec = BeamSection(geo) # Get values from section a_section = sec.gross_properties.area diff --git a/tests/test_geometry/test_profiles/test_profiles.py b/tests/test_geometry/test_profiles/test_profiles.py index 105d5647..96c040db 100644 --- a/tests/test_geometry/test_profiles/test_profiles.py +++ b/tests/test_geometry/test_profiles/test_profiles.py @@ -27,7 +27,7 @@ from structuralcodes.materials.constitutive_laws import ( UserDefined, ) -from structuralcodes.sections._generic import GenericSection +from structuralcodes.sections._generic import BeamSection # Test steel I section @@ -256,7 +256,7 @@ def test_section_get_polygon(cls, name): # Create geometry geo = SurfaceGeometry(cls.get_polygon(name), steel) - sec = GenericSection(geo) + sec = BeamSection(geo) # Compute expected values xy = sec.geometry.geometries[0].polygon.exterior.coords.xy @@ -972,7 +972,7 @@ def test_Isection_elastic_fiber(cls, name): my_expected = wy_el * fy * 1e-6 mz_expected = wz_el * fy * 1e-6 # Create the section with fiber - sec = GenericSection(geo, integrator='Fiber', mesh_size=0.001) + sec = BeamSection(geo, integrator='Fiber', mesh_size=0.001) results = sec.section_calculator.calculate_bending_strength(theta=0, n=0) assert math.isclose(-results.m_y * 1e-6, my_expected, rel_tol=1e-3) results = sec.section_calculator.calculate_bending_strength( @@ -1033,7 +1033,7 @@ def test_Isection_elastic_marin(cls, name): my_expected = wy_el * fy * 1e-6 mz_expected = wz_el * fy * 1e-6 # Create the section with Marin integrator - sec = GenericSection(geo) + sec = BeamSection(geo) results = sec.section_calculator.calculate_bending_strength(theta=0, n=0) assert math.isclose(-results.m_y * 1e-6, my_expected, rel_tol=1e-3) results = sec.section_calculator.calculate_bending_strength( @@ -1094,7 +1094,7 @@ def test_Isection_plastic_fiber(cls, name): my_expected = wy_pl * fy * 1e-6 mz_expected = wz_pl * fy * 1e-6 # Create the section with fiber - sec = GenericSection(geo, integrator='Fiber', mesh_size=0.001) + sec = BeamSection(geo, integrator='Fiber', mesh_size=0.001) results = sec.section_calculator.calculate_bending_strength(theta=0, n=0) assert math.isclose(-results.m_y * 1e-6, my_expected, rel_tol=1e-2) results = sec.section_calculator.calculate_bending_strength( @@ -1155,7 +1155,7 @@ def test_Isection_plastic_marin(cls, name): my_expected = wy_pl * fy * 1e-6 mz_expected = wz_pl * fy * 1e-6 # Create the section with marin integrator - sec = GenericSection(geo) + sec = BeamSection(geo) results = sec.section_calculator.calculate_bending_strength(theta=0, n=0) assert math.isclose(-results.m_y * 1e-6, my_expected, rel_tol=1e-2) results = sec.section_calculator.calculate_bending_strength( @@ -1214,7 +1214,7 @@ def test_Isection_elastic_material_marin(cls, name): my_expected = wy_el * fy * 1e-6 mz_expected = wz_el * fy * 1e-6 # Create the section with marin integrator - sec = GenericSection(geo) + sec = BeamSection(geo) results = sec.section_calculator.calculate_bending_strength(theta=0, n=0) assert math.isclose(-results.m_y * 1e-6, my_expected, rel_tol=1e-3) results = sec.section_calculator.calculate_bending_strength( @@ -1276,7 +1276,7 @@ def test_Isection_user_material_marin(cls, name): my_expected = wy_pl * fy * 1e-6 mz_expected = wz_pl * fy * 1e-6 # Create the section with fiber - sec = GenericSection(geo) + sec = BeamSection(geo) results = sec.section_calculator.calculate_bending_strength(theta=0, n=0) assert math.isclose(-results.m_y * 1e-6, my_expected, rel_tol=1e-3) results = sec.section_calculator.calculate_bending_strength( @@ -1439,7 +1439,7 @@ def test_profiles(cls, name, Wyel, Wzel, Wypl, Wzpl): steel = GenericMaterial(density=7850, constitutive_law=steel_law) geo = CompoundGeometry([SurfaceGeometry(beam.polygon, steel)]) # Create the section with fiber - sec = GenericSection(geo, integrator='fiber', mesh_size=0.001) + sec = BeamSection(geo, integrator='fiber', mesh_size=0.001) results = sec.section_calculator.calculate_bending_strength(theta=0, n=0) assert math.isclose(-results.m_y * 1e-6, mye_expected, rel_tol=2.5e-2) results = sec.section_calculator.calculate_bending_strength( @@ -1453,7 +1453,7 @@ def test_profiles(cls, name, Wyel, Wzel, Wypl, Wzpl): steel = GenericMaterial(density=7850, constitutive_law=steel_law) geo = CompoundGeometry([SurfaceGeometry(beam.polygon, steel)]) # Create the section with fiber - sec = GenericSection(geo, integrator='fiber', mesh_size=0.001) + sec = BeamSection(geo, integrator='fiber', mesh_size=0.001) results = sec.section_calculator.calculate_bending_strength(theta=0, n=0) assert math.isclose(-results.m_y * 1e-6, myp_expected, rel_tol=2.5e-2) results = sec.section_calculator.calculate_bending_strength( diff --git a/tests/test_geometry/test_profiles/test_u.py b/tests/test_geometry/test_profiles/test_u.py index 44b1d803..6d0bdb78 100644 --- a/tests/test_geometry/test_profiles/test_u.py +++ b/tests/test_geometry/test_profiles/test_u.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import GenericSection +from structuralcodes.sections._generic import BeamSection def load_U_profiles_data(): @@ -243,7 +243,7 @@ def test_U_massprops_polygon( # Create geometry geo = SurfaceGeometry(U.get_polygon(profile_name), material=steel) # Create the section - sec = GenericSection(geo) + sec = BeamSection(geo) # Get values from section a_section = sec.gross_properties.area diff --git a/tests/test_geometry/test_profiles/test_ub.py b/tests/test_geometry/test_profiles/test_ub.py index 29027694..2f827ce6 100644 --- a/tests/test_geometry/test_profiles/test_ub.py +++ b/tests/test_geometry/test_profiles/test_ub.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import GenericSection +from structuralcodes.sections._generic import BeamSection def load_ub_profiles_data(): @@ -238,7 +238,7 @@ def test_ub_massprops_polygon( # Create geometry geo = SurfaceGeometry(UB.get_polygon(profile_name), material=steel) # Create the section - sec = GenericSection(geo) + sec = BeamSection(geo) # Get values from section a_section = sec.gross_properties.area diff --git a/tests/test_geometry/test_profiles/test_upe.py b/tests/test_geometry/test_profiles/test_upe.py index 00d25153..f91b1005 100644 --- a/tests/test_geometry/test_profiles/test_upe.py +++ b/tests/test_geometry/test_profiles/test_upe.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import GenericSection +from structuralcodes.sections._generic import BeamSection def load_upe_profiles_data(): @@ -300,7 +300,7 @@ def test_upe_massprops_polygon( # Create geometry geo = SurfaceGeometry(UPE.get_polygon(profile_name), material=steel) # Create the section - sec = GenericSection(geo) + sec = BeamSection(geo) # Get values from section a_section = sec.gross_properties.area diff --git a/tests/test_geometry/test_profiles/test_w.py b/tests/test_geometry/test_profiles/test_w.py index 37b8f1a1..447aea5b 100644 --- a/tests/test_geometry/test_profiles/test_w.py +++ b/tests/test_geometry/test_profiles/test_w.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import GenericSection +from structuralcodes.sections._generic import BeamSection def load_w_profiles_data(): @@ -238,7 +238,7 @@ def test_w_massprops_polygon( # Create geometry geo = SurfaceGeometry(W.get_polygon(profile_name), material=steel) # Create the section - sec = GenericSection(geo) + sec = BeamSection(geo) # Get values from section a_section = sec.gross_properties.area diff --git a/tests/test_sections/test_generic_section.py b/tests/test_sections/test_generic_section.py index f24c8056..65d044e3 100644 --- a/tests/test_sections/test_generic_section.py +++ b/tests/test_sections/test_generic_section.py @@ -1,4 +1,4 @@ -"""Tests for the Generic Section.""" +"""Tests for the Beam Section.""" import math @@ -40,7 +40,7 @@ ReinforcementMC2010, ) from structuralcodes.sections import ( - GenericSection, + BeamSection, calculate_elastic_cracked_properties, ) @@ -62,8 +62,8 @@ def test_rectangular_section(): assert geo.geometries[0].centroid[1] == 0 # Create the section (default Marin integrator) - sec = GenericSection(geo) - assert sec.name == 'GenericSection' + sec = BeamSection(geo) + assert sec.name == 'BeamSection' assert math.isclose(sec.gross_properties.area, 200 * 400) @@ -89,7 +89,7 @@ def test_rectangular_section(): ) # Use fiber integration - sec = GenericSection(geo, integrator='Fiber', mesh_size=0.0001) + sec = BeamSection(geo, integrator='Fiber', mesh_size=0.0001) assert math.isclose(sec.gross_properties.area, 200 * 400) # Compute bending strength @@ -170,8 +170,8 @@ def test_rectangular_section_tangent_stiffness(b, h, E, integrator): assert geo.polygon.centroid.coords[0][1] == 0 # Create the section with fiber integrator - sec = GenericSection(geo, integrator=integrator, mesh_size=0.0001) - assert sec.name == 'GenericSection' + sec = BeamSection(geo, integrator=integrator, mesh_size=0.0001) + assert sec.name == 'BeamSection' assert math.isclose(sec.gross_properties.area, b * h) @@ -255,7 +255,7 @@ def test_rectangular_rc_section_initial_tangent_stiffness( EIzz_gross += Es * As * y[0] ** 2 # Create the section with fiber integrator - sec = GenericSection(geo, integrator=integrator, mesh_size=0.0001) + sec = BeamSection(geo, integrator=integrator, mesh_size=0.0001) # compute initial stiffness matrix (gross) stiffness = sec.section_calculator.integrate_strain_profile( @@ -346,7 +346,7 @@ def test_rectangular_rc_section_tangent_stiffness( EIyy += EA * (h / 2 - x) ** 2 # Create the section with fiber integrator - sec = GenericSection(geo, integrator=integrator, mesh_size=0.0001) + sec = BeamSection(geo, integrator=integrator, mesh_size=0.0001) # compute tangent stiffness matrix (cracked) # for the given position of n.a. and a very small curvature @@ -396,7 +396,7 @@ def test_rectangular_rc_section_tangent_stiffness( ) # create this effective elastic section - sec = GenericSection(geo, integrator=integrator, mesh_size=0.0001) + sec = BeamSection(geo, integrator=integrator, mesh_size=0.0001) stiffness2 = sec.section_calculator.integrate_strain_profile( [0, 0, 0], 'modulus' @@ -435,8 +435,8 @@ def test_rectangular_section_tangent_stiffness_translated(b, h, E, integrator): assert geo.polygon.centroid.coords[0][1] == h / 2 # Create the section with fiber integrator - sec = GenericSection(geo, integrator=integrator, mesh_size=0.0001) - assert sec.name == 'GenericSection' + sec = BeamSection(geo, integrator=integrator, mesh_size=0.0001) + assert sec.name == 'BeamSection' assert math.isclose(sec.gross_properties.area, b * h) @@ -491,13 +491,13 @@ def test_rectangular_section_parabola_rectangle(fck, fyk, ductility_class): geo = geo.translate(-100, -200) # Create the section with fiber integrator - sec_fiber = GenericSection(geo, integrator='fiber', mesh_size=0.001) + sec_fiber = BeamSection(geo, integrator='fiber', mesh_size=0.001) # Compute bending strength My- res_fiber = sec_fiber.section_calculator.calculate_bending_strength() # Create the section with default marin integrator - sec_marin = GenericSection(geo) + sec_marin = BeamSection(geo) # Compute bending strength My- res_marin = sec_marin.section_calculator.calculate_bending_strength() @@ -519,7 +519,7 @@ def test_rectangular_section_mn_domain(): geo = geo.translate(-100, -200) # Create the section (default Marin integrator) - sec_marin = GenericSection(geo) + sec_marin = BeamSection(geo) # Compute MN domain mn_res_marin = ( @@ -527,7 +527,7 @@ def test_rectangular_section_mn_domain(): ) # Use fiber integration - sec_fiber = GenericSection(geo, integrator='Fiber', mesh_size=0.0001) + sec_fiber = BeamSection(geo, integrator='Fiber', mesh_size=0.0001) # compute MN domain # Fast version @@ -556,14 +556,14 @@ def test_rectangular_section_mm_domain(): geo = geo.translate(-100, -200) # Create the section (default Marin integrator) - sec_marin = GenericSection(geo) + sec_marin = BeamSection(geo) # Compute MN domain mm_res_marin = ( sec_marin.section_calculator.calculate_mm_interaction_domain(n=0) ) # Use fiber integration - sec_fiber = GenericSection(geo, integrator='Fiber', mesh_size=0.0001) + sec_fiber = BeamSection(geo, integrator='Fiber', mesh_size=0.0001) # compute MN domain mm_res_fiber = ( sec_fiber.section_calculator.calculate_mm_interaction_domain(n=0) @@ -595,14 +595,14 @@ def test_rectangular_section_nmm_domain(): geo = geo.translate(-100, -200) # Create the section (default Marin integrator) - sec_marin = GenericSection(geo) + sec_marin = BeamSection(geo) # Compute MN domain mm_res_marin = ( sec_marin.section_calculator.calculate_nmm_interaction_domain() ) # Use fiber integration - sec_fiber = GenericSection(geo, integrator='Fiber', mesh_size=0.0001) + sec_fiber = BeamSection(geo, integrator='Fiber', mesh_size=0.0001) # compute MN domain mm_res_fiber = ( sec_fiber.section_calculator.calculate_nmm_interaction_domain() @@ -641,7 +641,7 @@ def test_rectangular_section_Sargin(): assert geo.geometries[0].centroid[1] == 0 # Create the section (default Marin integrator) - sec = GenericSection(geo) + sec = BeamSection(geo) assert math.isclose(sec.gross_properties.area, 200 * 400) @@ -649,7 +649,7 @@ def test_rectangular_section_Sargin(): res_marin = sec.section_calculator.calculate_bending_strength(theta=0, n=0) # Use fiber integration - sec = GenericSection(geo, integrator='Fiber', mesh_size=0.0001) + sec = BeamSection(geo, integrator='Fiber', mesh_size=0.0001) assert math.isclose(sec.gross_properties.area, 200 * 400) # Compute bending strength @@ -681,8 +681,8 @@ def test_holed_section(): assert geo.geometries[0].centroid[1] == 0 # Create the section (default Marin integrator) - sec = GenericSection(geo) - assert sec.name == 'GenericSection' + sec = BeamSection(geo) + assert sec.name == 'BeamSection' assert math.isclose(sec.gross_properties.area, 260000) @@ -690,7 +690,7 @@ def test_holed_section(): res_marin = sec.section_calculator.calculate_bending_strength(theta=0, n=0) # Use fiber integration - sec = GenericSection(geo, integrator='Fiber', mesh_size=0.0001) + sec = BeamSection(geo, integrator='Fiber', mesh_size=0.0001) assert math.isclose(sec.gross_properties.area, 260000) # Compute bending strength @@ -727,8 +727,8 @@ def test_u_section(): assert geo.geometries[0].centroid[1] == 0 # Create the section (default Marin integrator) - sec = GenericSection(geo) - assert sec.name == 'GenericSection' + sec = BeamSection(geo) + assert sec.name == 'BeamSection' assert math.isclose(sec.gross_properties.area, 230000) @@ -736,7 +736,7 @@ def test_u_section(): res_marin = sec.section_calculator.calculate_bending_strength(theta=0, n=0) # Use fiber integration - sec = GenericSection(geo, integrator='Fiber', mesh_size=0.0001) + sec = BeamSection(geo, integrator='Fiber', mesh_size=0.0001) assert math.isclose(sec.gross_properties.area, 230000) # Compute bending strength @@ -759,7 +759,7 @@ def test_refined_moment_curvature(): geo = geo.translate(-100, -200) # Create the section - sec = GenericSection(geo, integrator='fiber') + sec = BeamSection(geo, integrator='fiber') # Calculate default moment-curvature relation res_default = sec.section_calculator.calculate_moment_curvature() @@ -798,7 +798,7 @@ def test_refined_mn_domain(): geo = geo.translate(-100, -200) # Create the section - sec = GenericSection(geo, integrator='fiber') + sec = BeamSection(geo, integrator='fiber') # Calculate default moment-curvature relation res_default = sec.section_calculator.calculate_nm_interaction_domain() @@ -847,7 +847,7 @@ def test_rectangular_section_biaxial_moment(theta): geo = geo.translate(-100, -200) # Create the section - sec = GenericSection(geo, integrator='fiber') + sec = BeamSection(geo, integrator='fiber') # Calculate default moment-curvature relation res = sec.section_calculator.calculate_bending_strength(theta=theta) @@ -899,13 +899,13 @@ def test_strain_plane_calculation_elastic_Nmm(n, my, mz, Ec, b, h): ) # Fiber - section = GenericSection(geom, integrator='fiber', mesh_size=0.001) + section = BeamSection(geom, integrator='fiber', mesh_size=0.001) strain_fiber = section.section_calculator.calculate_strain_profile( n=n, my=my, mz=mz, tol=1e-7 ) # Marin - section = GenericSection(geom) + section = BeamSection(geom) strain_marin = section.section_calculator.calculate_strain_profile( n=n, my=my, mz=mz, tol=1e-7 ) @@ -973,13 +973,13 @@ def test_strain_plane_calculation_elastic_kNm(n, my, mz, Ec, b, h): ) # Fiber - section = GenericSection(geom, integrator='fiber', mesh_size=0.001) + section = BeamSection(geom, integrator='fiber', mesh_size=0.001) strain_fiber = section.section_calculator.calculate_strain_profile( n=n, my=my, mz=mz, tol=1e-7 ) # Marin - section = GenericSection(geom) + section = BeamSection(geom) strain_marin = section.section_calculator.calculate_strain_profile( n=n, my=my, mz=mz, tol=1e-7 ) @@ -1049,13 +1049,13 @@ def test_strain_plane_calculation_rectangular_rc(n, my, mz, fck, b, h): ) # Check with given loads that both marin and fiber gives same result - section = GenericSection(geo) + section = BeamSection(geo) strain_marin = section.section_calculator.calculate_strain_profile( n, my, mz, tol=1e-7 ) strain_marin_array = np.array(strain_marin.to_list()) - section = GenericSection(geo, integrator='fiber', mesh_size=0.0001) + section = BeamSection(geo, integrator='fiber', mesh_size=0.0001) strain_fiber = section.section_calculator.calculate_strain_profile( n, my, mz, tol=1e-7 @@ -1122,7 +1122,7 @@ def test_strain_plane_calculation_rectangular_rc_high_load( ) # Check that with given loads we don't reach convergence - section = GenericSection(geo) + section = BeamSection(geo) with pytest.warns( NoConvergenceWarning, match='Maximum number of iterations reached' ): @@ -1162,10 +1162,10 @@ def test_moment_curvature_slender( ) # Create fiber section - section_fiber = GenericSection(geometry=geometry, integrator='fiber') + section_fiber = BeamSection(geometry=geometry, integrator='fiber') # Create marin section - section_marin = GenericSection( + section_marin = BeamSection( geometry=geometry, ) @@ -1257,7 +1257,7 @@ def test_moment_curvature_large_circular_section(): ) # Section - section = GenericSection(geometry=shaft, integrator='fiber') + section = BeamSection(geometry=shaft, integrator='fiber') # Moment-curvature result = section.section_calculator.calculate_moment_curvature(n=-1e6) @@ -1377,7 +1377,7 @@ def test_rotate_triangulation_data(): ) # geometry = geometry.translate(width/2, height/2) - section = GenericSection( + section = BeamSection( geometry=geometry, integrator='Fiber', mesh_size=0.001, @@ -1388,7 +1388,7 @@ def test_rotate_triangulation_data(): res1 = section.section_calculator.calculate_bending_strength(theta=np.pi) # geometry = geometry.translate(width/2, height/2) - section = GenericSection( + section = BeamSection( geometry=geometry, integrator='Fiber', mesh_size=0.001, @@ -1449,13 +1449,13 @@ def test_rectangular_section_init_strain(fck, fyk, ductility_class): geo = geo.translate(-100, -200) # Create the section with fiber integrator - sec_fiber = GenericSection(geo, integrator='fiber', mesh_size=0.001) + sec_fiber = BeamSection(geo, integrator='fiber', mesh_size=0.001) # Compute bending strength My- res_fiber = sec_fiber.section_calculator.calculate_bending_strength() # Create the section with default marin integrator - sec_marin = GenericSection(geo) + sec_marin = BeamSection(geo) # Compute bending strength My- res_marin = sec_marin.section_calculator.calculate_bending_strength() @@ -1483,13 +1483,13 @@ def test_rectangular_section_init_strain(fck, fyk, ductility_class): geo = geo.translate(-100, -200) # Create the section with fiber integrator - sec_fiber = GenericSection(geo, integrator='fiber', mesh_size=0.001) + sec_fiber = BeamSection(geo, integrator='fiber', mesh_size=0.001) # Compute bending strength My- res_fiber_i = sec_fiber.section_calculator.calculate_bending_strength() # Create the section with default marin integrator - sec_marin = GenericSection(geo) + sec_marin = BeamSection(geo) # Compute bending strength My- res_marin_i = sec_marin.section_calculator.calculate_bending_strength() @@ -1507,7 +1507,7 @@ def test_section_parallel_material_elastic(): geo = RectangularGeometry( width=100, height=100, material=ElasticMaterial(E=30000, density=2500) ) - section = GenericSection(geometry=geo) + section = BeamSection(geometry=geo) res = section.section_calculator.integrate_strain_profile( (0, 1e-5, 0) @@ -1522,7 +1522,7 @@ def test_section_parallel_material_elastic(): geo = RectangularGeometry( width=100, height=100, material=GenericMaterial(2500, const_law) ) - section = GenericSection(geometry=geo) + section = BeamSection(geometry=geo) res = section.section_calculator.integrate_strain_profile( (0, 1e-5, 0) @@ -1540,7 +1540,7 @@ def test_section_parallel_material_elastic(): geo = RectangularGeometry( width=100, height=100, material=GenericMaterial(2500, const_law) ) - section = GenericSection(geometry=geo) + section = BeamSection(geometry=geo) res = section.section_calculator.integrate_strain_profile( (0, 1e-5, 0) @@ -1557,7 +1557,7 @@ def test_section_parallel_material_elasticplastic(): const_law = ElasticPlastic(E=10000, fy=10, Eh=0, eps_su=2e-3) mat = GenericMaterial(constitutive_law=const_law, density=600) geo = RectangularGeometry(width=100, height=100, material=mat) - section = GenericSection(geometry=geo) + section = BeamSection(geometry=geo) res = section.section_calculator.integrate_strain_profile( (0, 3e-5, 0) @@ -1570,7 +1570,7 @@ def test_section_parallel_material_elasticplastic(): const_law = Parallel([const_law_1, const_law_2]) mat = GenericMaterial(constitutive_law=const_law, density=600) geo = RectangularGeometry(width=100, height=100, material=mat) - section = GenericSection(geometry=geo) + section = BeamSection(geometry=geo) res = section.section_calculator.integrate_strain_profile( (0, 3e-5, 0) @@ -1587,7 +1587,7 @@ def test_section_parallel_material_elasticplastic(): constitutive_laws=[const_law_1, const_law_2], weights=[7.0, 3.0] ) geo = RectangularGeometry(width=100, height=100, material=mat) - section = GenericSection(geometry=geo) + section = BeamSection(geometry=geo) res = section.section_calculator.integrate_strain_profile( (0, 3e-5, 0) @@ -1609,9 +1609,7 @@ def test_section_parallel_marin_concrete_tension(): geo = RectangularGeometry(width=100, height=100, material=mat) # Use fiber integrator - section = GenericSection( - geometry=geo, integrator='fiber', mesh_size=0.0001 - ) + section = BeamSection(geometry=geo, integrator='fiber', mesh_size=0.0001) res = section.section_calculator.integrate_strain_profile( (0, 4e-5, 0) @@ -1619,7 +1617,7 @@ def test_section_parallel_marin_concrete_tension(): M_f = res[1] # Use marin integrator - section = GenericSection(geometry=geo) + section = BeamSection(geometry=geo) res = section.section_calculator.integrate_strain_profile( (0, 4e-5, 0) @@ -1654,7 +1652,7 @@ def test_issue_cracked_properties(): ) pile_steel = pile_gross - pile_concrete pile_geometry = pile_steel + pile_concrete - pile_section = GenericSection(geometry=pile_geometry, integrator='fiber') + pile_section = BeamSection(geometry=pile_geometry, integrator='fiber') # Calculate cracked properties before cracked_properties_before = calculate_elastic_cracked_properties( @@ -1710,7 +1708,7 @@ def test_mn_full_domain(): ) # Create section - section = GenericSection(geometry, integrator='fiber') + section = BeamSection(geometry, integrator='fiber') # Calculate interaction domain for theta = 0 interaction_domain_0 = ( @@ -1786,7 +1784,7 @@ def test_issue_gross_props_after_calculation(integrator): n=4, ) - section = GenericSection(geometry=geo, integrator=integrator) + section = BeamSection(geometry=geo, integrator=integrator) gp_before = section.gross_properties res = section.section_calculator.calculate_bending_strength() @@ -1797,7 +1795,7 @@ def test_issue_gross_props_after_calculation(integrator): assert gp_before.isclose(gp_after, rtol=1e-3, atol=1e-6) # Now create a new section but compute first the strength - section = GenericSection(geometry=geo, integrator=integrator) + section = BeamSection(geometry=geo, integrator=integrator) res = section.section_calculator.calculate_bending_strength() m_2 = -res.m_y @@ -1842,7 +1840,7 @@ def test_issue_gross_props_after_calculation(integrator): 3, ) - section = GenericSection(geometry=geometry, integrator=integrator) + section = BeamSection(geometry=geometry, integrator=integrator) gp_before = section.gross_properties res = section.section_calculator.calculate_moment_curvature() @@ -1853,7 +1851,7 @@ def test_issue_gross_props_after_calculation(integrator): assert gp_before.isclose(gp_after, rtol=1e-3, atol=1e-6) # Now create a new section but compute first the strength - section = GenericSection(geometry=geometry, integrator=integrator) + section = BeamSection(geometry=geometry, integrator=integrator) res = section.section_calculator.calculate_moment_curvature() m_max2 = np.max(np.abs(res.m_y)) @@ -1893,7 +1891,7 @@ def test_section_strength_warning(b, h, n_bars, diameter, fck, fyk): material=steel, n=n_bars, ) - section = GenericSection(geo) + section = BeamSection(geo) # Compute bending strength without reaching equilibrium # This is fictitiously tested forcing a low max_iter @@ -1928,7 +1926,7 @@ def test_section_moment_curvature_warning(b, h, n_bars, diameter, fck, fyk): material=steel, n=n_bars, ) - section = GenericSection(geo) + section = BeamSection(geo) n_u = section.section_calculator.calculate_limit_axial_load()[0] # Compute moment curvature with no warning res_good = section.section_calculator.calculate_moment_curvature( @@ -1981,7 +1979,7 @@ def test_section_mm_domain_warning(b, h, n_bars, diameter, fck, fyk): material=steel, n=n_bars, ) - section = GenericSection(geo) + section = BeamSection(geo) n_u = section.section_calculator.calculate_limit_axial_load()[0] # Compute moment curvature with no warning res_good = section.section_calculator.calculate_mm_interaction_domain( @@ -2015,7 +2013,7 @@ def test_perimeter_multipolygon(): ) compound = CompoundGeometry([rect1, rect2]) - section = GenericSection(compound, integrator='marin') + section = BeamSection(compound, integrator='marin') with pytest.warns(InformationWarning): gp = section.gross_properties diff --git a/tests/test_sections/test_rc_sections/test_rc_results.py b/tests/test_sections/test_rc_sections/test_rc_results.py index ec695e05..212aab84 100644 --- a/tests/test_sections/test_rc_sections/test_rc_results.py +++ b/tests/test_sections/test_rc_sections/test_rc_results.py @@ -12,7 +12,7 @@ ) from structuralcodes.materials.concrete import ConcreteMC2010 from structuralcodes.materials.reinforcement import ReinforcementMC2010 -from structuralcodes.sections import GenericSection +from structuralcodes.sections import BeamSection @pytest.fixture @@ -51,7 +51,7 @@ def simple_rc_section(): group_label='top', ) - return GenericSection(geo, integrator='fiber') + return BeamSection(geo, integrator='fiber') ## Test utility functions developed as non public diff --git a/tests/test_sections/test_rc_sections/test_rc_utils.py b/tests/test_sections/test_rc_sections/test_rc_utils.py index 5ff389eb..8a1be92d 100644 --- a/tests/test_sections/test_rc_sections/test_rc_utils.py +++ b/tests/test_sections/test_rc_sections/test_rc_utils.py @@ -8,7 +8,7 @@ from structuralcodes.materials.basic import ElasticMaterial from structuralcodes.materials.concrete import create_concrete from structuralcodes.materials.reinforcement import create_reinforcement -from structuralcodes.sections import GenericSection +from structuralcodes.sections import BeamSection from structuralcodes.sections._rc_utils import ( calculate_elastic_cracked_properties, ) @@ -58,7 +58,7 @@ def test_calculate_elastic_cracked_properties_comparison(): ) # Create section - section1 = GenericSection(geometry) + section1 = BeamSection(geometry) # endregion # region Create cracked section to compare (section2) @@ -90,7 +90,7 @@ def test_calculate_elastic_cracked_properties_comparison(): reinforcement, ) - section2 = GenericSection(geometry_cracked) + section2 = BeamSection(geometry_cracked) # end region # Calculate cracked properties for both sections @@ -130,7 +130,7 @@ def test_calculate_elastic_cracked_properties_comparison(): # check if it works with multiples geometries geometry_dummy = SurfaceGeometry(poly=polygon, material=concrete) geometry += geometry_dummy - section1 = GenericSection(geometry, integrator='fiber') + section1 = BeamSection(geometry, integrator='fiber') result = calculate_elastic_cracked_properties(section1, 0) # check if it is not reinforced concrete section1.geometry._reinforced_concrete = False @@ -182,7 +182,7 @@ def test_calculate_elastic_cracked_properties_return_geometry(): ) # Create section - section1 = GenericSection(geometry) + section1 = BeamSection(geometry) # endregion # check if works when geometry is required @@ -195,7 +195,7 @@ def test_calculate_elastic_cracked_properties_return_geometry(): # check if it works with multiples geometries geometry_dummy = SurfaceGeometry(poly=polygon, material=concrete) geometry += geometry_dummy - section1 = GenericSection(geometry, integrator='fiber') + section1 = BeamSection(geometry, integrator='fiber') result = calculate_elastic_cracked_properties(section1, 0) # check if it is not reinforced concrete section1.geometry._reinforced_concrete = False @@ -220,7 +220,7 @@ def test_calculate_elastic_cracked_properties_no_reinforced_concrete(): ] ) geometry = SurfaceGeometry(poly=polygon, material=elastic) - section1 = GenericSection(geometry, integrator='fiber') + section1 = BeamSection(geometry, integrator='fiber') assert not section1.geometry.reinforced_concrete # Calculate cracked properties diff --git a/tests/test_sections/test_results.py b/tests/test_sections/test_results.py index d99df92d..c62ef016 100644 --- a/tests/test_sections/test_results.py +++ b/tests/test_sections/test_results.py @@ -7,7 +7,7 @@ from structuralcodes.geometry import RectangularGeometry from structuralcodes.materials.basic import ElasticMaterial -from structuralcodes.sections import GenericSection +from structuralcodes.sections import BeamSection width = 200 height = 400 @@ -16,7 +16,7 @@ @pytest.fixture -def elastic_rec_section() -> GenericSection: +def elastic_rec_section() -> BeamSection: """Create a simple rectangular section with known properties.""" # Square section centered at (0, 0) mat = ElasticMaterial(E=E, density=700, ultimate_strain=eps_u) @@ -26,7 +26,7 @@ def elastic_rec_section() -> GenericSection: # It should not be concrete assert not geo.concrete - return GenericSection(geo, integrator='marin') + return BeamSection(geo, integrator='marin') # Test the string representation of gross properties From ba347b9b9b5343e3b4638cff930e40167876f12d Mon Sep 17 00:00:00 2001 From: Morten Engen Date: Fri, 27 Mar 2026 13:46:30 +0100 Subject: [PATCH 2/2] Rename internal module and tests --- structuralcodes/sections/__init__.py | 2 +- structuralcodes/sections/{_generic.py => _beam_section.py} | 0 tests/test_geometry/test_profiles/test_hd.py | 2 +- tests/test_geometry/test_profiles/test_hp.py | 2 +- tests/test_geometry/test_profiles/test_l.py | 2 +- tests/test_geometry/test_profiles/test_li.py | 2 +- tests/test_geometry/test_profiles/test_profiles.py | 2 +- tests/test_geometry/test_profiles/test_u.py | 2 +- tests/test_geometry/test_profiles/test_ub.py | 2 +- tests/test_geometry/test_profiles/test_upe.py | 2 +- tests/test_geometry/test_profiles/test_w.py | 2 +- .../{test_generic_section.py => test_beam_section.py} | 0 12 files changed, 10 insertions(+), 10 deletions(-) rename structuralcodes/sections/{_generic.py => _beam_section.py} (100%) rename tests/test_sections/{test_generic_section.py => test_beam_section.py} (100%) diff --git a/structuralcodes/sections/__init__.py b/structuralcodes/sections/__init__.py index de37efcf..39dfb28b 100644 --- a/structuralcodes/sections/__init__.py +++ b/structuralcodes/sections/__init__.py @@ -1,6 +1,6 @@ """Main entry point for sections.""" -from ._generic import BeamSection, BeamSectionCalculator +from ._beam_section import BeamSection, BeamSectionCalculator from ._rc_utils import calculate_elastic_cracked_properties from .section_integrators import ( FiberIntegrator, diff --git a/structuralcodes/sections/_generic.py b/structuralcodes/sections/_beam_section.py similarity index 100% rename from structuralcodes/sections/_generic.py rename to structuralcodes/sections/_beam_section.py diff --git a/tests/test_geometry/test_profiles/test_hd.py b/tests/test_geometry/test_profiles/test_hd.py index a6352ca5..84808304 100644 --- a/tests/test_geometry/test_profiles/test_hd.py +++ b/tests/test_geometry/test_profiles/test_hd.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import BeamSection +from structuralcodes.sections import BeamSection def load_hd_profiles_data(): diff --git a/tests/test_geometry/test_profiles/test_hp.py b/tests/test_geometry/test_profiles/test_hp.py index fd0e38f1..9ce16be5 100644 --- a/tests/test_geometry/test_profiles/test_hp.py +++ b/tests/test_geometry/test_profiles/test_hp.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import BeamSection +from structuralcodes.sections import BeamSection def load_hp_profiles_data(): diff --git a/tests/test_geometry/test_profiles/test_l.py b/tests/test_geometry/test_profiles/test_l.py index dbbfac7b..0496cb3e 100644 --- a/tests/test_geometry/test_profiles/test_l.py +++ b/tests/test_geometry/test_profiles/test_l.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import BeamSection +from structuralcodes.sections import BeamSection def load_L_profiles_data(): diff --git a/tests/test_geometry/test_profiles/test_li.py b/tests/test_geometry/test_profiles/test_li.py index f70c96e3..8b82ad47 100644 --- a/tests/test_geometry/test_profiles/test_li.py +++ b/tests/test_geometry/test_profiles/test_li.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import BeamSection +from structuralcodes.sections import BeamSection def load_LI_profiles_data(): diff --git a/tests/test_geometry/test_profiles/test_profiles.py b/tests/test_geometry/test_profiles/test_profiles.py index 96c040db..6aab9325 100644 --- a/tests/test_geometry/test_profiles/test_profiles.py +++ b/tests/test_geometry/test_profiles/test_profiles.py @@ -27,7 +27,7 @@ from structuralcodes.materials.constitutive_laws import ( UserDefined, ) -from structuralcodes.sections._generic import BeamSection +from structuralcodes.sections import BeamSection # Test steel I section diff --git a/tests/test_geometry/test_profiles/test_u.py b/tests/test_geometry/test_profiles/test_u.py index 6d0bdb78..80186558 100644 --- a/tests/test_geometry/test_profiles/test_u.py +++ b/tests/test_geometry/test_profiles/test_u.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import BeamSection +from structuralcodes.sections import BeamSection def load_U_profiles_data(): diff --git a/tests/test_geometry/test_profiles/test_ub.py b/tests/test_geometry/test_profiles/test_ub.py index 2f827ce6..dca922bd 100644 --- a/tests/test_geometry/test_profiles/test_ub.py +++ b/tests/test_geometry/test_profiles/test_ub.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import BeamSection +from structuralcodes.sections import BeamSection def load_ub_profiles_data(): diff --git a/tests/test_geometry/test_profiles/test_upe.py b/tests/test_geometry/test_profiles/test_upe.py index f91b1005..00df768f 100644 --- a/tests/test_geometry/test_profiles/test_upe.py +++ b/tests/test_geometry/test_profiles/test_upe.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import BeamSection +from structuralcodes.sections import BeamSection def load_upe_profiles_data(): diff --git a/tests/test_geometry/test_profiles/test_w.py b/tests/test_geometry/test_profiles/test_w.py index 447aea5b..0931c1a6 100644 --- a/tests/test_geometry/test_profiles/test_w.py +++ b/tests/test_geometry/test_profiles/test_w.py @@ -16,7 +16,7 @@ from structuralcodes.materials.basic import ( ElasticMaterial, ) -from structuralcodes.sections._generic import BeamSection +from structuralcodes.sections import BeamSection def load_w_profiles_data(): diff --git a/tests/test_sections/test_generic_section.py b/tests/test_sections/test_beam_section.py similarity index 100% rename from tests/test_sections/test_generic_section.py rename to tests/test_sections/test_beam_section.py