anastruct.preprocess.beam ========================= .. py:module:: anastruct.preprocess.beam Classes ------- .. autoapisummary:: anastruct.preprocess.beam.SimpleBeam anastruct.preprocess.beam.CantileverBeam anastruct.preprocess.beam.RightCantileverBeam anastruct.preprocess.beam.LeftCantileverBeam anastruct.preprocess.beam.MultiSpanBeam anastruct.preprocess.beam.TwoSpanBeam anastruct.preprocess.beam.ThreeSpanBeam anastruct.preprocess.beam.FourSpanBeam anastruct.preprocess.beam.ProppedBeam anastruct.preprocess.beam.RightProppedBeam anastruct.preprocess.beam.LeftProppedBeam Functions --------- .. autoapisummary:: anastruct.preprocess.beam.create_beam Module Contents --------------- .. py:class:: SimpleBeam(length: float, angle: float = 0.0, section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`anastruct.preprocess.beam_class.Beam` Simple beam with a pin support at one end, and a roller support at the other. .. py:property:: type :type: str Return the human-readable name of the beam type. .. py:method:: define_nodes() -> None 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. .. py:method:: define_supports() -> None Define support locations and types by populating self.support_definitions. Must be implemented by subclasses. .. py:class:: CantileverBeam(length: float, cantilever_side: Literal['left', 'right'] = 'right', angle: float = 0.0, section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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. .. py:attribute:: cantilever_side :value: '' .. py:property:: type :type: str Return the human-readable name of the beam type. .. py:method:: define_nodes() -> None 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. .. py:method:: define_supports() -> None Define support locations and types by populating self.support_definitions. Must be implemented by subclasses. .. py:class:: RightCantileverBeam(length: float, angle: float = 0.0, section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`CantileverBeam` Cantilever beam with a fixed support at the left end and free (cantilevered) at the right. .. py:property:: type :type: str Return the human-readable name of the beam type. .. py:class:: LeftCantileverBeam(length: float, angle: float = 0.0, section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`CantileverBeam` Cantilever beam with a free (cantilevered) left end and a fixed support at the right. .. py:property:: type :type: str Return the human-readable name of the beam type. .. py:class:: MultiSpanBeam(length: Optional[float] = None, num_spans: Optional[int] = None, span_lengths: Optional[list[float]] = None, cantilevers: Optional[Literal['left', 'right', 'both']] = None, angle: float = 0.0, section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`anastruct.preprocess.beam_class.Beam` Simply supported multi-span beam. Assumes equal spans unless span_lengths provided. .. py:attribute:: num_spans :value: None .. py:attribute:: cantilevers :value: None .. py:property:: type :type: str Return the human-readable name of the beam type. .. py:method:: define_nodes() -> None 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. .. py:method:: define_supports() -> None Define support locations and types by populating self.support_definitions. Must be implemented by subclasses. .. py:class:: TwoSpanBeam(length: float, angle: float = 0.0, section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`MultiSpanBeam` Simply supported two-span beam with equal spans. .. py:property:: type :type: str Return the human-readable name of the beam type. .. py:class:: ThreeSpanBeam(length: float, angle: float = 0.0, section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`MultiSpanBeam` Simply supported three-span beam with equal spans. .. py:property:: type :type: str Return the human-readable name of the beam type. .. py:class:: FourSpanBeam(length: float, angle: float = 0.0, section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`MultiSpanBeam` Simply supported four-span beam with equal spans. .. py:property:: type :type: str Return the human-readable name of the beam type. .. py:class:: ProppedBeam(interior_length: float, cantilever_length: float, cantilever_side: Literal['left', 'right'] = 'right', angle: float = 0.0, section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`MultiSpanBeam` Propped beam with an interior simple span and a cantilever on one side. .. py:attribute:: cantilever_side :value: '' .. py:property:: type :type: str Return the human-readable name of the beam type. .. py:class:: RightProppedBeam(interior_length: float, cantilever_length: float, angle: float = 0.0, section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`ProppedBeam` Propped beam with an interior simple span and a cantilever on the right side. .. py:property:: type :type: str Return the human-readable name of the beam type. .. py:class:: LeftProppedBeam(interior_length: float, cantilever_length: float, angle: float = 0.0, section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`ProppedBeam` Propped beam with an interior simple span and a cantilever on the left side. .. py:property:: type :type: str Return the human-readable name of the beam type. .. py:function:: create_beam(beam_type: str, **kwargs: Any) -> anastruct.preprocess.beam_class.Beam 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)