SectionManager
SectionManager
Local manager for Section lifecycle and tag assignment.
The manager is intentionally not a singleton. Each instance owns an
independent tag space so Model instances keep their own section collections.
Access it through model.section rather than constructing another manager.
Attributes:
| Name | Type | Description |
|---|---|---|
beam |
|
|
composite |
|
|
fiber |
|
|
shell |
|
|
special |
|
Each namespace accepts user_name and component-specific keyword options,
forwarding them to create_section. Concrete section parameters are
documented in the Components section reference. All namespaces share this
manager's registry and require unique section names.
Example
Warning
Removing a section can retag survivors. Elements that reference removed sections are not repaired, and already exported solver files are unchanged.
Create an empty manager with tags starting at 1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mesh_maker
|
Model
|
The owning Model instance. |
required |
Raises:
| Type | Description |
|---|---|
TypeError
|
If mesh_maker is not a Model instance. |
RuntimeError
|
If the Model already owns a SectionManager. |
Methods:
| Name | Description |
|---|---|
create_section |
Create and manage a section by type name using the manager factory map. |
add |
Add an existing section and assign a tag if needed. |
get |
Return the section with |
get_all |
Return a shallow copy of all managed sections keyed by tag. |
remove |
Remove a managed section and compact the remaining tags. |
clear |
Remove all sections and clear their assigned tags. |
set_tag_start |
Set the first tag used by this manager and retag existing objects. |
resolve_material |
Resolve a material using this manager's owning Model. |
get_section_types |
Return a new list of keys in the class-wide section factory map. |
register_section_type |
Install a section constructor in the class-wide factory map. |
Methods:
create_section
Create and manage a section by type name using the manager factory map.
This is the authoritative creation path for the active runtime. It ensures that the section is context-aware during its initialization so it can resolve materials and other dependencies without global state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
section_type
|
str
|
Registered section type name. |
required |
user_name
|
str
|
Unique name for the section. |
required |
**section_params
|
Any
|
Constructor arguments for the selected concrete class. |
{}
|
Returns:
| Type | Description |
|---|---|
Section
|
Managed |
Raises:
| Type | Description |
|---|---|
KeyError
|
If |
add
Add an existing section and assign a tag if needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
section
|
Section
|
Unmanaged or already-managed |
required |
Returns:
| Type | Description |
|---|---|
Section
|
The same |
Raises:
| Type | Description |
|---|---|
TypeError
|
If |
ValueError
|
If its preassigned tag conflicts or name is duplicate. |
get
Return the section with tag or user_name if it exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
Union[int, str]
|
Section tag (int) or name (str) to look up. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Section]
|
The matching |
remove
Remove a managed section and compact the remaining tags.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
Union[int, str]
|
Tag or name of the section to remove. Missing sections are ignored. |
required |
set_tag_start
Set the first tag used by this manager and retag existing objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_tag
|
int
|
Positive integer for the first assigned tag. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
resolve_material
Resolve a material using this manager's owning Model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
material_input
|
int | str | Material | None
|
Integer registry tag, exact material name, object, or None. Strings are names, not numeric tags, unlike the element material resolver. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
material |
Material | None
|
Direct object unchanged, lookup result, or None for absent input or a missing name/tag. Objects are not registered or checked for cross-model ownership by this helper. |
Raises:
| Type | Description |
|---|---|
TypeError
|
A non-string lookup value cannot be converted to an integer. |
ValueError
|
Integer conversion fails. |
get_section_types
classmethod
Return a new list of keys in the class-wide section factory map.
These are type names for create_section, not user names of registered
instances. Built-ins are loaded when a SectionManager is constructed.
register_section_type
classmethod
Install a section constructor in the class-wide factory map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Factory key used by |
required |
section_class
|
type[Section]
|
Constructor implementing the Section
contract and accepting |
required |
Note
This is an extension operation shared across manager instances. Existing keys are replaced without subclass validation; existing section objects are not changed. Prefer built-in namespaces for ordinary model scripts.
Factory namespaces
These helper types are accessed through the owning manager's attributes; do not instantiate them directly. Expand a method to see its calling contract.
model.section.beam
Beam-section factory namespace bound to a SectionManager.
Methods:
| Name | Description |
|---|---|
elastic |
Create an ElasticSection with validated geometric properties. |
uniaxial |
Create a UniaxialSection with validated material and response code. |
wf2d |
Create a WFSection2d with validated dimensions and discretization. |
Attributes:
| Name | Type | Description |
|---|---|---|
_manager |
|
Attributes
Methods:
elastic
elastic(user_name: str = 'Unnamed', *, E: float, A: float, Iz: float, Iy: float | None = None, G: float | None = None, J: float | None = None) -> ElasticSection
Create an ElasticSection with validated geometric properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_name
|
str
|
User-specified name for the section. |
'Unnamed'
|
E
|
float
|
Young's modulus. |
required |
A
|
float
|
Cross-sectional area. |
required |
Iz
|
float
|
Second moment of area about the local z-axis. |
required |
Iy
|
float | None
|
Optional second moment of area about the local y-axis (for 3D). |
None
|
G
|
float | None
|
Optional shear modulus (for 3D). |
None
|
J
|
float | None
|
Optional torsional constant (for 3D). |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If parameters are not numeric or if essential values (E, A, Iz) are non-positive. |
Returns:
| Name | Type | Description |
|---|---|---|
section |
ElasticSection
|
Registered section using the owning Model context. |
uniaxial
uniaxial(user_name: str = 'Unnamed', *, material: int | str | Material, response_code: str = 'P') -> UniaxialSection
Create a UniaxialSection with validated material and response code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_name
|
str
|
User-specified name for the section. |
'Unnamed'
|
material
|
int | str | Material
|
Uniaxial material reference (object, tag, or name). |
required |
response_code
|
str
|
Section response code. Must be one of: 'P', 'Mz', 'My', 'Vy', 'Vz', 'T'. |
'P'
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the response code is invalid or the material cannot be resolved. |
Returns:
| Name | Type | Description |
|---|---|---|
section |
UniaxialSection
|
Registered section using the owning Model context. |
wf2d
wf2d(user_name: str = 'Unnamed', *, material: int | str | Material, d: float, tw: float, bf: float, tf: float, Nflweb: int, Nflflange: int) -> WFSection2d
Create a WFSection2d with validated dimensions and discretization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_name
|
str
|
Unique identifier for the section. |
'Unnamed'
|
material
|
int | str | Material
|
Uniaxial material reference for the entire section. |
required |
d
|
float
|
Total section depth. |
required |
tw
|
float
|
Web thickness. |
required |
bf
|
float
|
Flange width. |
required |
tf
|
float
|
Flange thickness. |
required |
Nflweb
|
int
|
Number of fibers along the web depth. |
required |
Nflflange
|
int
|
Number of fibers along each flange width. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the material cannot be resolved, or if any dimension is non-positive, or if fiber counts are not positive integers. |
Returns:
| Name | Type | Description |
|---|---|---|
section |
WFSection2d
|
Registered section using the owning Model context. |
model.section.composite
Composite-section factory namespace bound to a SectionManager.
Methods:
| Name | Description |
|---|---|
aggregator |
Create an AggregatorSection with validated materials and response codes. |
parallel |
Create a ParallelSection with validated constituent sections. |
Attributes:
| Name | Type | Description |
|---|---|---|
_manager |
|
Attributes
Methods:
aggregator
aggregator(user_name: str = 'Unnamed', *, materials: dict[str, int | str | Material] | None = None, base_section: int | str | Section | None = None) -> AggregatorSection
Create an AggregatorSection with validated materials and response codes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_name
|
str
|
User-specified name for the section. |
'Unnamed'
|
materials
|
dict[str, int | str | Material] | None
|
Optional dictionary mapping section response codes (e.g., 'P', 'Mz') to uniaxial materials (object, tag, or name). |
None
|
base_section
|
int | str | Section | None
|
Optional base section to be augmented (object, tag, or name). |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If response codes are invalid or materials/sections cannot be resolved. |
Returns:
| Name | Type | Description |
|---|---|---|
section |
AggregatorSection
|
Registered section using the owning Model context. |
parallel
parallel(user_name: str = 'Unnamed', *, sections: list[int | str | Section] | None = None) -> ParallelSection
Create a ParallelSection with validated constituent sections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_name
|
str
|
User-specified name for the section. |
'Unnamed'
|
sections
|
list[int | str | Section] | None
|
Optional list of constituent sections (objects, tags, or names). |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If constituent sections cannot be resolved. |
Returns:
| Name | Type | Description |
|---|---|---|
section |
ParallelSection
|
Registered section using the owning Model context. |
model.section.fiber
Fiber-section factory namespace bound to a SectionManager.
Methods:
| Name | Description |
|---|---|
section |
Create a FiberSection with optional initial components. |
rc |
Create an RCSection with validated materials and dimensions. |
Attributes:
| Name | Type | Description |
|---|---|---|
_manager |
|
Attributes
Methods:
section
section(user_name: str = 'Unnamed', *, GJ: float | None = None, components: list[FiberElement | PatchBase | LayerBase] | None = None) -> FiberSection
Create a FiberSection with optional initial components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_name
|
str
|
Unique identifier for the section. |
'Unnamed'
|
GJ
|
float | None
|
Optional linear torsional stiffness constant. If provided, this stiffness is added to the section's torsional response. |
None
|
components
|
list[FiberElement | PatchBase | LayerBase] | None
|
Optional list of pre-created fiber elements, patches, or layers to populate the section. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If GJ is not numeric or is non-positive. |
Returns:
| Name | Type | Description |
|---|---|---|
section |
FiberSection
|
Registered section using the owning Model context. |
rc
rc(user_name: str = 'Unnamed', *, core_material: int | str | Material, cover_material: int | str | Material, steel_material: int | str | Material, d: float, b: float, cover_to_center_of_bar: float) -> RCSection
Create an RCSection with validated materials and dimensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_name
|
str
|
User-specified name for the section. |
'Unnamed'
|
core_material
|
int | str | Material
|
Reference to the core concrete material. |
required |
cover_material
|
int | str | Material
|
Reference to the cover concrete material. |
required |
steel_material
|
int | str | Material
|
Reference to the reinforcement material. |
required |
d
|
float
|
Total section depth. |
required |
b
|
float
|
Total section width. |
required |
cover_to_center_of_bar
|
float
|
Concrete cover to bar centers. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If materials cannot be resolved, if dimensions are not numeric, or if dimensions are non-positive. |
Returns:
| Name | Type | Description |
|---|---|---|
section |
RCSection
|
Registered section using the owning Model context. |
model.section.shell
Shell-section factory namespace bound to a SectionManager.
Methods:
| Name | Description |
|---|---|
elastic_membrane_plate |
Create an ElasticMembranePlateSection with validated constants. |
plate_fiber |
Create a PlateFiberSection with a validated nD material. |
Attributes:
| Name | Type | Description |
|---|---|---|
_manager |
|
Attributes
Methods:
elastic_membrane_plate
elastic_membrane_plate(user_name: str = 'Unnamed', *, E: float, nu: float, h: float, rho: float) -> ElasticMembranePlateSection
Create an ElasticMembranePlateSection with validated constants.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_name
|
str
|
Unique identifier for the section. |
'Unnamed'
|
E
|
float
|
Young's modulus of the shell material. |
required |
nu
|
float
|
Poisson's ratio. |
required |
h
|
float
|
Thickness of the shell. |
required |
rho
|
float
|
Mass density (mass per unit volume). |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If any parameter is not numeric, if E or h are non-positive, if nu is not in [0, 0.5), or if rho is negative. |
Returns:
| Name | Type | Description |
|---|---|---|
section |
ElasticMembranePlateSection
|
Registered section using the owning Model context. |
plate_fiber
Create a PlateFiberSection with a validated nD material.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_name
|
str
|
Unique identifier for the section. |
'Unnamed'
|
material
|
int | str | Material
|
nD material reference (object, tag, or name). |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the material cannot be resolved, or if it is not recognized as an nDMaterial. |
Returns:
| Name | Type | Description |
|---|---|---|
section |
PlateFiberSection
|
Registered section using the owning Model context. |
model.section.special
Special-section factory namespace bound to a SectionManager.
Methods:
| Name | Description |
|---|---|
bidirectional |
Create a BidirectionalSection with validated parameters. |
isolator2spring |
Create an Isolator2SpringSection with validated parameters. |
Attributes:
| Name | Type | Description |
|---|---|---|
_manager |
|
Attributes
Methods:
bidirectional
bidirectional(user_name: str = 'Unnamed', *, E: float, Fy: float, Hiso: float, Hkin: float) -> BidirectionalSection
Create a BidirectionalSection with validated parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_name
|
str
|
User-specified name for the section. |
'Unnamed'
|
E
|
float
|
Elastic modulus. |
required |
Fy
|
float
|
Yield force. |
required |
Hiso
|
float
|
Isotropic hardening modulus. |
required |
Hkin
|
float
|
Kinematic hardening modulus. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If parameters are not numeric, if E or Fy are non-positive, or if hardening moduli are negative. |
Returns:
| Name | Type | Description |
|---|---|---|
section |
BidirectionalSection
|
Registered section using the owning Model context. |
isolator2spring
isolator2spring(user_name: str = 'Unnamed', *, tol: float, k1: float, Fy: float, k2: float, kv: float, hb: float, Pe: float, Po: float) -> Isolator2SpringSection
Create an Isolator2SpringSection with validated parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_name
|
str
|
User-specified name for the section. |
'Unnamed'
|
tol
|
float
|
Tolerance. |
required |
k1
|
float
|
Initial horizontal stiffness. |
required |
Fy
|
float
|
Yield force. |
required |
k2
|
float
|
Post-yield horizontal stiffness. |
required |
kv
|
float
|
Vertical stiffness. |
required |
hb
|
float
|
Bearing height. |
required |
Pe
|
float
|
Buckling load. |
required |
Po
|
float
|
Axial load. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If parameters are not numeric, if dimensions/stiffnesses are non-positive, or if loads are negative. |
Returns:
| Name | Type | Description |
|---|---|---|
section |
Isolator2SpringSection
|
Registered section using the owning Model context. |