RectangularPatch
RectangularPatch
RectangularPatch(material: Union[int, str, Material], num_subdiv_y: int, num_subdiv_z: int, y1: float, z1: float, y2: float, z2: float)
Bases: PatchBase
Rectangular patch for fiber sections.
This class defines a rectangular region in a fiber section. The region is discretized into a grid of fibers with uniform area and material.
Tcl form
patch rect <matTag> <numSubdivY> <numSubdivZ> <yStart> <zStart> <yEnd> <zEnd>
Attributes:
| Name | Type | Description |
|---|---|---|
num_subdiv_y |
Number of subdivisions along the local y-axis. |
|
num_subdiv_z |
Number of subdivisions along the local z-axis. |
|
y1 |
Local y-coordinate of the bottom-left corner. |
|
z1 |
Local z-coordinate of the bottom-left corner. |
|
y2 |
Local y-coordinate of the top-right corner. |
|
z2 |
Local z-coordinate of the top-right corner. |
Example
from femora.core.model import Model
import femora.components.section.fiber # noqa: F401
model = Model()
mat = model.material.uniaxial.elastic(user_name="Core", E=3600.0)
section = model.section.fiber.section(user_name="PatchSection")
section.add_rectangular_patch(
material=mat,
num_subdiv_y=4,
num_subdiv_z=8,
y1=-5.0,
z1=-10.0,
y2=5.0,
z2=10.0,
)
print(section.tag)
Create a RectangularPatch with validated geometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
material
|
Union[int, str, Material]
|
Uniaxial material reference (object, tag, or name). |
required |
num_subdiv_y
|
int
|
Number of fibers along y. |
required |
num_subdiv_z
|
int
|
Number of fibers along z. |
required |
y1
|
float
|
Minimum local y. |
required |
z1
|
float
|
Minimum local z. |
required |
y2
|
float
|
Maximum local y. |
required |
z2
|
float
|
Maximum local z. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If parameters are not numeric, if counts are non-positive, or if coordinates are inconsistent (y1 >= y2 or z1 >= z2). |