Section integrator

Base class for section integrators

class structuralcodes.sections.SectionIntegrator[source]

Abstract base class for section integrators.

abstract prepare_input(geo: CompoundGeometry, strain: ArrayLike)[source]

Prepare general input to the integration method.

Parameters:
  • geo (CompoundGeometry) – The geometry to integrate over.

  • strain (ArrayLike) – The scalar strain components necessary for describing the assumed strain distribution over the geometry.

abstract integrate(*prepared_input, **kwargs)[source]

Integrate stresses over the geometry.

The input to this method is generated by the prepare_input method. It also takes kwargs depending on the concrete implementation.

Parameters:

*prepared_input – The input prepared by the prepare_input method.

Keyword Arguments:

**kwargs – Keyword arguments depending on the concrete implementation.

abstract integrate_strain_response_on_geometry(geo: CompoundGeometry, strain: ArrayLike, **kwargs)[source]

Integrate stresses over the geometry to obtain the response due to strains.

Integrator factory

structuralcodes.sections.integrator_factory(method: Literal['marin', 'fiber']) SectionIntegrator

A factory for integrators.

The Marin integrator

class structuralcodes.sections.MarinIntegrator[source]

Section integrator based on the Marin algorithm.

prepare_input(geo: CompoundGeometry, strain: ArrayLike) Tuple[float, Tuple[ndarray, ndarray, ndarray]][source]

Prepare general input to the integration.

Calculate the stresses based on strains in a set of points.

Keyword Arguments:
  • geo (CompoundGeometry) – The geometry of the section.

  • strain (ArrayLike) – The strains and curvatures of the section, given in the format (ea, ky, kz) which are i) strain at 0,0, ii) curvature y axis, iii) curvature z axis.

  • mesh_size – Percentage of area (number from 0 to 1) max for triangle elements.

Returns:

The prepared input represented as the angle of rotation computed (needed for rotating back the resultants) and as a tuple with 3 ndarrys collecting respectively y, z and stress coefficients for each sub-part.

Return type:

Tuple(float, Tuple(ndarray, ndarray, ndarray))

integrate(angle: float, prepared_input: List[Tuple[int, ndarray, ndarray, ndarray]]) Tuple[float, float, float][source]

Integrate stresses over the geometry.

Parameters:

prepared_input (List) – The prepared input from .prepare_input().

Returns:

The stress resultants N, Mx and My.

Return type:

Tuple(float, float, float)

integrate_strain_response_on_geometry(geo: CompoundGeometry, strain: ArrayLike, **kwargs)[source]

Integrate the strain response with the Marin algorithm.

Parameters:
  • geo (CompoundGeometry) – The geometry of the section.

  • strain (ArrayLike) – The strains and curvatures of the section, given in the format (ea, ky, kz) which are i) strain at 0,0, ii) curvature y axis, iii) curvature z axis.

Returns:

The stress resultants N, Mx and My and the triangulation data.

Return type:

Tuple(Tuple(float, float, float), Dict)

structuralcodes.sections.marin_integration(y: List[float], z: List[float], m: int, n: int) float[source]

Marin’s algorithm for integrating a polynomial over a closed polygon.

The order of the polygon vertices is significant. If the points are in counterclockwise order the integral is positive, otherwise the integral is negative.

Parameters:
  • y (List(float)) – Y coordinates of polygon vertices.

  • z (List(float)) – Z coordinates of polygon vertices.

  • m (int) – The degree of the polynomial in the y direction.

  • n (int) – The degree of the polynomial in the z direction.

Returns:

The result of the integrated polynomial.

Return type:

float

The fiber integrator

class structuralcodes.sections.FiberIntegrator[source]

Section integrator based on the Marin algorithm.

prepare_input(geo: CompoundGeometry, strain: ArrayLike, **kwargs) Tuple[Tuple[ndarray, ndarray, ndarray]][source]

Prepare general input to the integration.

Calculate the stresses based on strains in a set of points.

Keyword Arguments:
  • geo (CompoundGeometry) – The geometry of the section.

  • strain (ArrayLike) – The strains and curvatures of the section, given in the format (ea, ky, kz) which are i) strain at 0,0, ii) curvature y axis, iii) curvature z axis.

  • mesh_size – Percentage of area (number from 0 to 1) max for triangle elements.

Returns:

The prepared input representing a list with x-coordinates, y-coordinates and force for each fiber and a dictionary containing the triangulation data that can be stored and used later to avoid repetition of triangulation.

Return type:

Tuple(List, Dict)

integrate(prepared_input: List[Tuple[int, ndarray, ndarray, ndarray]]) Tuple[float, float, float][source]

Integrate stresses over the geometry.

Parameters:

prepared_input (List) – The prepared input from .prepare_input().

Returns:

The stress resultants N, Mx and My.

Return type:

Tuple(float, float, float)

integrate_strain_response_on_geometry(geo: CompoundGeometry, strain: ArrayLike, **kwargs)[source]

Integrate the strain response with the fiber algorithm.

Parameters:
  • geo (CompoundGeometry) – The geometry of the section.

  • strain (ArrayLike) – The strains and curvatures of the section, given in the format (ea, ky, kz) which are i) strain at 0,0, ii) curvature y axis, iii) curvature z axis.

  • mesh_size – Percentage of area (number from 0 to 1) max for triangle elements.

Returns:

The stress resultants N, Mx and My and the triangulation data.

Return type:

Tuple(Tuple(float, float, float), Dict)

prepare_triangulation(geo: SurfaceGeometry) Dict[source]

Triangulate a SurfaceGeometry object.

Parameters:

geo (SurfaceGeometry) – The geometry to triangulate.

Returns:

The triangulation data.

Return type:

Dict