anastruct.preprocess.beam

Classes

SimpleBeam

Simple beam with a pin support at one end, and a roller support at the other.

CantileverBeam

Cantilever beam with a fixed support at one end and free at the other.

RightCantileverBeam

Cantilever beam with a fixed support at the left end and free (cantilevered) at the right.

LeftCantileverBeam

Cantilever beam with a free (cantilevered) left end and a fixed support at the right.

MultiSpanBeam

Simply supported multi-span beam. Assumes equal spans unless span_lengths provided.

TwoSpanBeam

Simply supported two-span beam with equal spans.

ThreeSpanBeam

Simply supported three-span beam with equal spans.

FourSpanBeam

Simply supported four-span beam with equal spans.

ProppedBeam

Propped beam with an interior simple span and a cantilever on one side.

RightProppedBeam

Propped beam with an interior simple span and a cantilever on the right side.

LeftProppedBeam

Propped beam with an interior simple span and a cantilever on the left side.

Functions

create_beam(→ anastruct.preprocess.beam_class.Beam)

Factory function to create beam instances by type name.

Module Contents

class anastruct.preprocess.beam.SimpleBeam(length: float, angle: float = 0.0, section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.beam_class.Beam

Simple beam with a pin support at one end, and a roller support at the other.

property type: str[source]

Return the human-readable name of the beam type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the beam. Should also populate self.node_ids dictionary mapping spanwise node indices to global node IDs.

define_supports() None[source]

Define support locations and types by populating self.support_definitions.

Must be implemented by subclasses.

class anastruct.preprocess.beam.CantileverBeam(length: float, cantilever_side: Literal['left', 'right'] = 'right', angle: float = 0.0, section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.beam_class.Beam

Cantilever beam with a fixed support at one end and free at the other.

The cantilever_side parameter specifies which end is the free (unsupported) end. For example, cantilever_side="right" means the right end is free and the left end is fixed.

cantilever_side = ''[source]
property type: str[source]

Return the human-readable name of the beam type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the beam. Should also populate self.node_ids dictionary mapping spanwise node indices to global node IDs.

define_supports() None[source]

Define support locations and types by populating self.support_definitions.

Must be implemented by subclasses.

class anastruct.preprocess.beam.RightCantileverBeam(length: float, angle: float = 0.0, section: anastruct._types.SectionProps | None = None)[source]

Bases: CantileverBeam

Cantilever beam with a fixed support at the left end and free (cantilevered) at the right.

property type: str[source]

Return the human-readable name of the beam type.

class anastruct.preprocess.beam.LeftCantileverBeam(length: float, angle: float = 0.0, section: anastruct._types.SectionProps | None = None)[source]

Bases: CantileverBeam

Cantilever beam with a free (cantilevered) left end and a fixed support at the right.

property type: str[source]

Return the human-readable name of the beam type.

class anastruct.preprocess.beam.MultiSpanBeam(length: float | None = None, num_spans: int | None = None, span_lengths: list[float] | None = None, cantilevers: Literal['left', 'right', 'both'] | None = None, angle: float = 0.0, section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.beam_class.Beam

Simply supported multi-span beam. Assumes equal spans unless span_lengths provided.

num_spans = None[source]
cantilevers = None[source]
property type: str[source]

Return the human-readable name of the beam type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the beam. Should also populate self.node_ids dictionary mapping spanwise node indices to global node IDs.

define_supports() None[source]

Define support locations and types by populating self.support_definitions.

Must be implemented by subclasses.

class anastruct.preprocess.beam.TwoSpanBeam(length: float, angle: float = 0.0, section: anastruct._types.SectionProps | None = None)[source]

Bases: MultiSpanBeam

Simply supported two-span beam with equal spans.

property type: str[source]

Return the human-readable name of the beam type.

class anastruct.preprocess.beam.ThreeSpanBeam(length: float, angle: float = 0.0, section: anastruct._types.SectionProps | None = None)[source]

Bases: MultiSpanBeam

Simply supported three-span beam with equal spans.

property type: str[source]

Return the human-readable name of the beam type.

class anastruct.preprocess.beam.FourSpanBeam(length: float, angle: float = 0.0, section: anastruct._types.SectionProps | None = None)[source]

Bases: MultiSpanBeam

Simply supported four-span beam with equal spans.

property type: str[source]

Return the human-readable name of the beam type.

class anastruct.preprocess.beam.ProppedBeam(interior_length: float, cantilever_length: float, cantilever_side: Literal['left', 'right'] = 'right', angle: float = 0.0, section: anastruct._types.SectionProps | None = None)[source]

Bases: MultiSpanBeam

Propped beam with an interior simple span and a cantilever on one side.

cantilever_side = ''[source]
property type: str[source]

Return the human-readable name of the beam type.

class anastruct.preprocess.beam.RightProppedBeam(interior_length: float, cantilever_length: float, angle: float = 0.0, section: anastruct._types.SectionProps | None = None)[source]

Bases: ProppedBeam

Propped beam with an interior simple span and a cantilever on the right side.

property type: str[source]

Return the human-readable name of the beam type.

class anastruct.preprocess.beam.LeftProppedBeam(interior_length: float, cantilever_length: float, angle: float = 0.0, section: anastruct._types.SectionProps | None = None)[source]

Bases: ProppedBeam

Propped beam with an interior simple span and a cantilever on the left side.

property type: str[source]

Return the human-readable name of the beam type.

anastruct.preprocess.beam.create_beam(beam_type: str, **kwargs: Any) anastruct.preprocess.beam_class.Beam[source]

Factory function to create beam instances by type name.

Provides a convenient way to create beams without importing specific classes. Type names are case-insensitive and can use underscores or hyphens as separators.

Args:

beam_type (str): The type of beam to create (e.g., “simple”, “cantilever”, “multi_span”) **kwargs: Arguments to pass to the beam constructor

Returns:

Beam: An instance of the requested beam type

Raises:

ValueError: If beam_type is not recognized

Examples:
>>> beam = create_beam("simple", length=10, section=section)
>>> beam = create_beam("cantilever", length=5, section=section)