Constitutive laws

Constitutive law factory

structuralcodes.materials.constitutive_laws.get_constitutive_laws_list() List[str][source]

Returns a list with valid keywords for constitutive law factory.

structuralcodes.materials.constitutive_laws.create_constitutive_law(constitutive_law_name: str, material: Material) ConstitutiveLaw[source]

A factory function to create the constitutive law.

Parameters:
  • constitutive_law_name (str) – A string defining a valid constitutive law type. The available keys can be get with the method get_constitutive_laws_list.

  • material (Material) – The material containing the properties needed for the definition of the constitutive law.

Note

For working with this facotry function, the material class implementations need to provide special dunder methods (__elastic__, __parabolarectangle__, etc.) needed for the specific material that return the kwargs needed to create the corresponding constitutive law object. If the special dunder method is not found an exception will be raised.

If the consitutive law selected is not available for the specific material, an exception will be raised.

Linear elastic

class structuralcodes.materials.constitutive_laws.Elastic(E: float, name: str | None = None)[source]

Class for elastic constitutive law.

__init__(E: float, name: str | None = None) None[source]

Initialize an Elastic Material.

Parameters:

E (float) – The elastic modulus.

Keyword Arguments:

name (str) – A descriptive name for the constitutive law.

get_stress(eps: ArrayLike) ArrayLike[source]

Return stress given strain.

get_tangent(eps: ArrayLike) ArrayLike[source]

Return the tangent.

get_ultimate_strain(**kwargs) Tuple[float, float][source]

Return the ultimate strain (negative and positive).

set_ultimate_strain(eps_su=typing.Union[float, typing.Tuple[float, float]]) None[source]

Set ultimate strains for Elastic Material if needed.

Parameters:

eps_su (float or (float, float)) – Defining ultimate strain. If a single value is provided the same is adopted for both negative and positive strains. If a tuple is provided, it should be given as (negative, positive).

Elastic plastic

class structuralcodes.materials.constitutive_laws.ElasticPlastic(E: float, fy: float, Eh: float = 0.0, eps_su: float | None = None, name: str | None = None)[source]

Class for elastic-plastic Constitutive Law.

__init__(E: float, fy: float, Eh: float = 0.0, eps_su: float | None = None, name: str | None = None) None[source]

Initialize an Elastic-Plastic Material.

Parameters:
  • E (float) – The elastic modulus.

  • fy (float) – The yield strength.

Keyword Arguments:
  • Eh (float) – The hardening modulus.

  • eps_su (float) – The ultimate strain.

  • name (str) – A descriptive name for the constitutive law.

get_stress(eps: ArrayLike) ArrayLike[source]

Return the stress given strain.

get_tangent(eps: ArrayLike) ArrayLike[source]

Return the tangent for given strain.

get_ultimate_strain(yielding: bool = False) Tuple[float, float][source]

Return the ultimate strain (negative and positive).

Parabola rectangle

class structuralcodes.materials.constitutive_laws.ParabolaRectangle(fc: float, eps_0: float = -0.002, eps_u: float = -0.0035, n: float = 2.0, name: str | None = None)[source]

Class for parabola rectangle constitutive law.

The stresses and strains are assumed negative in compression and positive in tension.

__init__(fc: float, eps_0: float = -0.002, eps_u: float = -0.0035, n: float = 2.0, name: str | None = None) None[source]

Initialize a Parabola-Rectangle Material.

Parameters:

fc (float) – The strength of concrete in compression.

Keyword Arguments:
  • eps_0 (float) – Peak strain of concrete in compression. Default value = -0.002.

  • eps_u (float) – Ultimate strain of concrete in compression. Default value = -0.0035.

  • n (float) – Exponent for the pre-peak branch. Default value = 2.

  • name (str) – A name for the constitutive law.

get_stress(eps: ArrayLike) ArrayLike[source]

Return the stress given strain.

get_tangent(eps: ArrayLike) ArrayLike[source]

Return the tangent given strain.

get_ultimate_strain(yielding: bool = False) Tuple[float, float][source]

Return the ultimate strain (negative and positive).

Bilinear elastic perfectly plastic

class structuralcodes.materials.constitutive_laws.BilinearCompression(fc: float, eps_c: float, eps_cu: float | None = None, name: str | None = None)[source]

Class for Bilinear Elastic-PerfectlyPlastic Constitutive Law for Concrete (only compression behavior).

__init__(fc: float, eps_c: float, eps_cu: float | None = None, name: str | None = None) None[source]

Initialize a BilinearCompression Material.

Parameters:
  • fc (float) – Compressive strength (negative number).

  • eps_c (float) – Strain at compressive strength (pure number).

Keyword Arguments:
  • eps_cu (float) – Ultimate strain (pure number).

  • name (str) – A descriptive name for the constitutive law.

get_stress(eps: ArrayLike) ArrayLike[source]

Return the stress given strain.

get_tangent(eps: ArrayLike) ArrayLike[source]

Return the tangent for given strain.

get_ultimate_strain(yielding: bool = False) Tuple[float, float][source]

Return the ultimate strain (negative and positive).

Sargin

class structuralcodes.materials.constitutive_laws.Sargin(fc: float, eps_c1: float = -0.0023, eps_cu1: float = -0.0035, k: float = 2.04, name: str | None = None)[source]

Class for Sargin constitutive law.

The stresses and strains are assumed negative in compression and positive in tension.

References: Sargin, M. (1971), “Stress-strain relationship for concrete and the analysis of structural concrete section, Study No. 4, Solid Mechanics Division, University of Waterloo, Ontario, Canada

__init__(fc: float, eps_c1: float = -0.0023, eps_cu1: float = -0.0035, k: float = 2.04, name: str | None = None) None[source]

Initialize a Sargin Material.

Parameters:

fc (float) – The strength of concrete in compression

Keyword Arguments:
  • eps_c1 (float) – Peak strain of concrete in compression. Default value = -0.0023.

  • eps_u (float) – Ultimate strain of concrete in compression. Default value = -0.0035.

  • k (float) – Plasticity number. Default value = 2.04.

  • name (str) – A name for the constitutive law.

Raises:

ValueError – If k is less or equal to 0.

Note

If positive values are input for fc, eps_c1 and eps_cu1 are input, they will be assumed negative.

get_stress(eps: ArrayLike) ArrayLike[source]

Return the stress given the strain.

get_tangent(eps: ArrayLike) ArrayLike[source]

Return the tangent given strain.

get_ultimate_strain(yielding: bool = False) Tuple[float, float][source]

Return the ultimate strain (negative and positive).

Popovics

class structuralcodes.materials.constitutive_laws.Popovics(fc: float, eps_c: float = -0.002, eps_cu: float = -0.0035, Ec: float | None = None, name: str | None = None)[source]

Class for Popovics-Mander constitutive law.

The stresses and strains are assumed negative in compression and positive in tension.

If the relation Ec = 5000 * sqrt(fc) is used for elastic modulus, the constitutive law is identical to the one proposed by Mander et al. (1988).

References: Popovics, S., 1973, “A Numerical Approach to the Complete Stress-Strain Curve of Concrete”, Cement and Concrete Research, 3(4), 583-599.

Mander, J.B., Priestley, M.J.N., Park, R., 1988, “Theoretical Stress-Strain Model for Confined Concrete”, Journal of Structural Engineering, 114(8), 1804-1826.

__init__(fc: float, eps_c: float = -0.002, eps_cu: float = -0.0035, Ec: float | None = None, name: str | None = None) None[source]

Initialize a Popovics Material.

Parameters:

fc (float) – the strength of concrete in compression

Keyword Arguments:
  • eps_c (float) – Peak strain of concrete in compression. Default value = -0.002.

  • eps_cu (float) – Ultimate strain of concrete in compression. Default value = -0.0035.

  • E (optional float) – Elastic modulus of concrete. If None, the equation Ec = 5000 * fc**0.5 proposed by Mander et al. (1988) is adopted (fc in MPa). Default value = None.

  • name (str) – A name for the constitutive law.

Raises:

ValueError – If E is less or equal to 0.

Note

If positive values are input for fc, eps_c and eps_cu are input, they will be assumed negative.

get_stress(eps: ArrayLike) ArrayLike[source]

Return the stress given the strain.

get_tangent(eps: ArrayLike) ArrayLike[source]

Return the tangent given strain.

get_ultimate_strain(yielding: bool = False) Tuple[float, float][source]

Return the ultimate strain (negative and positive).

Userdefined

class structuralcodes.materials.constitutive_laws.UserDefined(x: ArrayLike, y: ArrayLike, name: str | None = None, flag: int = 0)[source]

Class for a user defined constitutive law.

The curve is defined with positive and optionally negative values. After the last value, the stress can go to zero to simulate failure (default), or be maintained constante, or the last tanget or secant values may be maintained indefinetely. The flag parameter controls this behavior.

__init__(x: ArrayLike, y: ArrayLike, name: str | None = None, flag: int = 0) None[source]

Initialize a UserDefined constitutive law.

Parameters:
  • x (ArrayLike) – Data for strains.

  • y (ArrayLike) – Data for stresses. Must be of same length as x.

Keyword Arguments:
  • name (Optional, str) – A name for the constitutive law.

  • flag (Optional) – A flag specifying the behavior after the last point. Admissible values: 0 (default): stress drops to zero after ultimate strain, 1: stress is mantained constant, 2: last tangent is used, 3: last secant is used.

get_stress(eps: ArrayLike) ArrayLike[source]

Return the stress given strain.

get_tangent(eps: ArrayLike) ArrayLike[source]

Return the tangent given strain.

get_ultimate_strain(**kwargs) Tuple[float, float][source]

Return the ultimate strain (negative and positive).

set_ultimate_strain(eps_su=typing.Union[float, typing.Tuple[float, float]]) None[source]

Set ultimate strains for Elastic Material if needed.

Parameters:

eps_su (float or (float, float)) – Defining ultimate strain. If a single value is provided the same is adopted for both negative and positive strains. If a tuple is provided, it should be given as (negative, positive).