Skip to content

Commit

Permalink
update CircularRC
Browse files Browse the repository at this point in the history
  • Loading branch information
talledodiego committed Nov 22, 2024
1 parent af61245 commit b3edac3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
20 changes: 13 additions & 7 deletions structuralcodes/geometry/_circular.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
"""

import typing as t
from itertools import chain

import numpy as np
from shapely import Polygon

from structuralcodes.core.base import ConstitutiveLaw, Material

from ._geometry import CompoundGeometry, SurfaceGeometry
from ._reinforcement import add_reinforcement_circle


def _create_circle(radius, npoints=20):
Expand Down Expand Up @@ -100,10 +102,10 @@ def __init__(
diameter: float,
number: int,
reinforcement_material: t.Union[Material, ConstitutiveLaw],
cover: float,
is_radius: bool = False,
n_points: int = 20,
surface_density: t.Optional[float] = None,
reinforcement_density: t.Optional[float] = None,
concrete: bool = False,
) -> None:
"""Initialize a CircularRCGeometry.
Expand All @@ -118,6 +120,8 @@ def __init__(
number (int): The number of bars to distribute.
reinforcement_material (Union(Material, ConstitutiveLaw)): A
Material or ConsitutiveLaw class applied to the point geometry.
cover (float): The cover of concrete intended as the distance
between outer line and barycenter of longitudinal bars.
is_radius (bool): Indicates if size is interpreted as radius
(default = False).
n_points (int): The number of points used to discretize the
Expand All @@ -126,10 +130,6 @@ def __init__(
as surface_material, the density can be provided by this
argument. When surface_material is a Material object the
density is taken from the material.
reinforcement_density (Optional(float)): When a ConstitutiveLaw is
passed as reinforcement_material, the density can be provided
by this argument. When reinforcement_material is a Material
object the density is taken from the material.
concrete (bool): Flag to indicate if the surface geometry is
concrete.
Expand All @@ -151,9 +151,15 @@ def __init__(
surface_density,
concrete,
)
# Pass everything to the base class
# Add the reinforcement
r = geometry.radius - cover
rc_geometry = add_reinforcement_circle(
geometry, (0, 0), r, diameter, reinforcement_material, number
)

# Pass everything to the base class CompoundGeometry
super().__init__(
poly=polygon, material=material, density=density, concrete=concrete
list(chain(rc_geometry.geometries, rc_geometry.point_geometries))
)

@property
Expand Down
7 changes: 2 additions & 5 deletions structuralcodes/geometry/_reinforcement.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
from shapely import Point

from structuralcodes.core.base import ConstitutiveLaw, Material
from structuralcodes.geometry import (
CompoundGeometry,
PointGeometry,
SurfaceGeometry,
)

from ._geometry import CompoundGeometry, PointGeometry, SurfaceGeometry


def add_reinforcement(
Expand Down

0 comments on commit b3edac3

Please sign in to comment.