Basic materials

Elastic material

class structuralcodes.materials.basic.ElasticMaterial(E: float, density: float, ultimate_strain: float | Tuple[float, float] | None = None, initial_strain: float | None = None, initial_stress: float | None = None, strain_compatibility: float | None = None, name: str | None = None)[source]

A material class with elastic properties.

__init__(E: float, density: float, ultimate_strain: float | Tuple[float, float] | None = None, initial_strain: float | None = None, initial_stress: float | None = None, strain_compatibility: float | None = None, name: str | None = None)[source]

Initialize a material with an elastic plastic constitutive law.

Parameters:
  • E (float) – The Young’s modulus.

  • density (float) – The density.

  • ultimate_strain (Optional[float, Tuple[float, float]]) – The ultimate strain of the material. If a single float is given, it is used for both the positive and negative directions. If a tuple of two floats is given, the first value is used for the negative direction and the second value is used for the positive direction. If None, the material has no ultimate strain. Default value is None.

  • initial_strain (Optional[float]) – Initial strain of the material.

  • initial_stress (Optional[float]) – Initial stress of the material.

  • strain_compatibility (Optional[bool]) – Only relevant if initial_strain or initial_stress are different from zero. If True, the material deforms with the geometry. If False, the stress in the material upon loading is kept constant corresponding to the initial strain.

  • name (str, optional) – The name of the material, default value None.

property E: float

Returns the Young’s modulus.

property constitutive_law: ConstitutiveLaw

Returns the ConstitutiveLaw of the object.

property name

Returns the name of the material.

property density

Returns the density of the material in kg/m3.

classmethod from_material(other_material: Material)[source]

Create an elastic material based on another material.

Elastic-plastic material

class structuralcodes.materials.basic.ElasticPlasticMaterial(E: float, fy: float, density: float, Eh: float = 0, eps_su: float | None = None, initial_strain: float | None = None, initial_stress: float | None = None, strain_compatibility: float | None = None, name: str | None = None)[source]

A material class with elastic plastic properties.

__init__(E: float, fy: float, density: float, Eh: float = 0, eps_su: float | None = None, initial_strain: float | None = None, initial_stress: float | None = None, strain_compatibility: float | None = None, name: str | None = None)[source]

Initialize a material with an elastic plastic constitutive law.

Parameters:
  • E (float) – The Young’s modulus.

  • fy (float) – The yield stress.

  • density (float) – The density.

  • Eh (float, optional) – The hardening modulus, default value 0.

  • eps_su (float, optional) – The ultimate strain, default value None.

  • initial_strain (Optional[float]) – Initial strain of the material.

  • initial_stress (Optional[float]) – Initial stress of the material.

  • strain_compatibility (Optional[bool]) – Only relevant if initial_strain or initial_stress are different from zero. If True, the material deforms with the geometry. If False, the stress in the material upon loading is kept constant corresponding to the initial strain.

  • name (str, optional) – The name of the material, default value None.

property E: float

Returns the Young’s modulus.

property fy: float

Returns the yield stress.

property Eh: float

Returns the hardening modulus.

property eps_su: float

Returns the ultimate strain.

property constitutive_law: ConstitutiveLaw

Returns the ConstitutiveLaw of the object.

property name

Returns the name of the material.

property density

Returns the density of the material in kg/m3.

Generic material

class structuralcodes.materials.basic.GenericMaterial(density: float, constitutive_law: ConstitutiveLaw, initial_strain: float | None = None, initial_stress: float | None = None, strain_compatibility: bool | None = None, name: str | None = None)[source]

A material class that accepts any constitutive law.

__init__(density: float, constitutive_law: ConstitutiveLaw, initial_strain: float | None = None, initial_stress: float | None = None, strain_compatibility: bool | None = None, name: str | None = None)[source]

Initialize a material with a constitutive law.

Parameters:
  • density (float) – The density.

  • constitutive_law (ConstitutiveLaw) – The constitutive law of the material.

  • initial_strain (Optional[float]) – Initial strain of the material.

  • initial_stress (Optional[float]) – Initial stress of the material.

  • strain_compatibility (Optional[bool]) – Only relevant if initial_strain or initial_stress are different from zero. If True, the material deforms with the geometry. If False, the stress in the material upon loading is kept constant corresponding to the initial strain.

  • name (str, optional) – The name of the material, default value None.

property constitutive_law: ConstitutiveLaw

Returns the ConstitutiveLaw of the object.

property name

Returns the name of the material.

property density

Returns the density of the material in kg/m3.