"""Defines material objects to be used with concreteproperties."""from__future__importannotationsfromdataclassesimportdataclass,fieldimportconcreteproperties.stress_strain_profileasssp
[docs]@dataclassclassMaterial:"""Generic class for a ``concreteproperties`` material. Args: name: Material name density: Material density (mass per unit volume) stress_strain_profile: Material stress-strain profile colour: Colour of the material for rendering, see https://matplotlib.org/stable/gallery/color/named_colors.html for a list of named colours meshed: If set to True, the entire material region is meshed; if set to False, the material region is treated as a lumped circular mass at its centroid """name:strdensity:floatstress_strain_profile:ssp.StressStrainProfilecolour:strmeshed:booldef__post_init__(self)->None:"""Post init method."""# set elastic modulusself.elastic_modulus=self.stress_strain_profile.get_elastic_modulus()
[docs]@dataclassclassConcrete(Material):"""Class for a concrete material. Args: name: Concrete material name density: Concrete density (mass per unit volume) stress_strain_profile: Service concrete stress-strain profile ultimate_stress_strain_profile: Ultimate concrete stress-strain profile flexural_tensile_strength: Absolute value of the concrete flexural tensile strength colour: Colour of the material for rendering, see https://matplotlib.org/stable/gallery/color/named_colors.html for a list of named colours Raises: ValueError: If concrete ``stress_strain_profile`` is not a ``ConcreteServiceProfile`` object ValueError: If concrete ``ultimate_stress_strain_profile`` is not a ``ConcreteUltimateProfile`` object """name:strdensity:floatstress_strain_profile:ssp.ConcreteServiceProfile# pyright: ignore [reportIncompatibleVariableOverride]ultimate_stress_strain_profile:ssp.ConcreteUltimateProfileflexural_tensile_strength:floatcolour:strmeshed:bool=field(default=True,init=False)def__post_init__(self)->None:"""Post init method. Raises: ValueError: If concrete ``stress_strain_profile`` is not a ``ConcreteServiceProfile`` object ValueError: If concrete ``ultimate_stress_strain_profile`` is not a ``ConcreteUltimateProfile`` object """super().__post_init__()ifnotisinstance(self.stress_strain_profile,ssp.ConcreteServiceProfile):msg="Concrete stress_strain_profile must be a "msg+="ConcreteServiceProfile object."raiseValueError(msg)ifnotisinstance(self.ultimate_stress_strain_profile,ssp.ConcreteUltimateProfile):msg="Concrete ultimate_stress_strain_profile must be a "msg+="ConcreteUltimateProfile object."raiseValueError(msg)
[docs]@dataclassclassSteel(Material):"""Class for a steel material. This steel material has the entire region meshed to allow for strain variation across the section, e.g. structural steel profiles in composite sections. Args: name: Steel material name density: Steel density (mass per unit volume) stress_strain_profile: Steel stress-strain profile colour: Colour of the material for rendering, see https://matplotlib.org/stable/gallery/color/named_colors.html for a list of named colours """name:strdensity:floatstress_strain_profile:ssp.StressStrainProfilecolour:strmeshed:bool=field(default=True,init=False)
[docs]@dataclassclassSteelBar(Steel):"""Class for a steel bar material. This steel material is treated as a lumped circular mass with a constant strain. Args: name: Steel bar material name density: Steel bar density (mass per unit volume) stress_strain_profile: Steel bar stress-strain profile colour: Colour of the material for rendering, see https://matplotlib.org/stable/gallery/color/named_colors.html for a list of named colours """name:strdensity:floatstress_strain_profile:ssp.StressStrainProfilecolour:strmeshed:bool=field(default=False,init=False)
[docs]@dataclassclassSteelStrand(Steel):"""Class for a steel strand material. This steel strand material is treated as a lumped circular mass with a constant strain. .. note:: A :class:`~concreteproperties.stress_strain_profile.StrandProfile` must be used if using a :class:`~concreteproperties.material.SteelStrand` object. .. note:: The strand is assumed to be bonded to the concrete. Args: name: Steel strand material name density: Steel strand density (mass per unit volume) stress_strain_profile: Steel strand stress-strain profile colour: Colour of the material for rendering, see https://matplotlib.org/stable/gallery/color/named_colors.html for a list of named colours prestress_stress: Prestressing stress applied to the strand. Defaults to ``0``. """name:strdensity:floatstress_strain_profile:ssp.StrandProfile# pyright: ignore [reportIncompatibleVariableOverride]colour:strprestress_stress:float=0meshed:bool=field(default=False,init=False)
[docs]defget_prestress_stress(self)->float:"""Returns the prestress stress. Returns: Prestress stress """returnself.prestress_stress
[docs]defget_prestress_strain(self)->float:"""Returns the prestress strain. Returns: Prestress strain """stress=self.get_prestress_stress()returnself.stress_strain_profile.get_strain(stress=stress)