Source code for concreteproperties.design_codes.design_code
"""Abstract class for a design code."""from__future__importannotationsfromtypingimportTYPE_CHECKINGifTYPE_CHECKING:importconcreteproperties.resultsasresfromconcreteproperties.concrete_sectionimportConcreteSectionfromconcreteproperties.materialimportConcrete,SteelBar
[docs]classDesignCode:"""Abstract class for a design code object."""
[docs]def__init__(self)->None:"""Inits the DesignCode class."""pass
[docs]defassign_concrete_section(self,concrete_section:ConcreteSection,)->None:"""Assigns a concrete section to the design code. Args: concrete_section: Concrete section object to analyse """self.concrete_section=concrete_section
[docs]defcreate_concrete_material(self,compressive_strength:float,colour:str="lightgrey",)->Concrete:"""Returns a concrete material object. List assumptions of material properties here... Args: compressive_strength: Concrete compressive strength colour: Colour of the concrete for rendering Raises: NotImplementedError: If this method has not been implemented by the child class """raiseNotImplementedError
[docs]defcreate_steel_material(self,yield_strength:float,colour:str="grey",)->SteelBar:"""Returns a steel bar material object. List assumptions of material properties here... Args: yield_strength: Steel yield strength colour: Colour of the steel for rendering Raises: NotImplementedError: If this method has not been implemented by the child class """raiseNotImplementedError
[docs]defget_gross_properties(self,**kwargs,)->res.GrossProperties:"""Returns the gross section properties of the reinforced concrete section. Args: kwargs: Keyword arguments passed to :meth:`~concreteproperties.concrete_section.ConcreteSection.get_gross_properties` Returns: Concrete properties object """returnself.concrete_section.get_gross_properties(**kwargs)
[docs]defmoment_curvature_analysis(self,**kwargs,)->res.MomentCurvatureResults:"""Performs a moment curvature analysis (no reduction factors applied). Args: kwargs: Keyword arguments passed to :meth:`~concreteproperties.concrete_section.ConcreteSection.moment_curvature_analysis` Returns: Moment curvature results object """returnself.concrete_section.moment_curvature_analysis(**kwargs)
[docs]defultimate_bending_capacity(self,**kwargs,)->res.UltimateBendingResults:"""Calculates the ultimate bending capacity. Args: kwargs: Keyword arguments passed to :meth:`~concreteproperties.concrete_section.ConcreteSection.ultimate_bending_capacity` Returns: Ultimate bending results object """returnself.concrete_section.ultimate_bending_capacity(**kwargs)
[docs]defmoment_interaction_diagram(self,**kwargs,)->res.MomentInteractionResults:"""Generates a moment interaction diagram. Args: kwargs: Keyword arguments passed to :meth:`~concreteproperties.concrete_section.ConcreteSection.moment_interaction_diagram` Returns: Moment interaction results object """returnself.concrete_section.moment_interaction_diagram(**kwargs)
[docs]defbiaxial_bending_diagram(self,**kwargs,)->res.BiaxialBendingResults:"""Generates a biaxial bending diagram. Args: kwargs: Keyword arguments passed to :meth:`~concreteproperties.concrete_section.ConcreteSection.biaxial_bending_diagram` Returns: Biaxial bending results """returnself.concrete_section.biaxial_bending_diagram(**kwargs)
[docs]defcalculate_uncracked_stress(self,**kwargs,)->res.StressResult:"""Calculates uncracked stresses within the reinforced concrete section. Args: kwargs: Keyword arguments passed to :meth:`~concreteproperties.concrete_section.ConcreteSection.calculate_uncracked_stress` Returns: Stress results object """returnself.concrete_section.calculate_uncracked_stress(**kwargs)
[docs]defcalculate_cracked_stress(self,**kwargs,)->res.StressResult:"""Calculates cracked stresses within the reinforced concrete section. Args: kwargs: Keyword arguments passed to :meth:`~concreteproperties.concrete_section.ConcreteSection.calculate_cracked_stress` Returns: Stress results object """returnself.concrete_section.calculate_cracked_stress(**kwargs)
[docs]defcalculate_service_stress(self,**kwargs,)->res.StressResult:"""Calculates service stresses within the reinforced concrete section. Args: kwargs: Keyword arguments passed to :meth:`~concreteproperties.concrete_section.ConcreteSection.calculate_service_stress` Returns: Stress results object """returnself.concrete_section.calculate_service_stress(**kwargs)
[docs]defcalculate_ultimate_stress(self,**kwargs,)->res.StressResult:"""Calculates ultimate stresses within the reinforced concrete section. Args: kwargs: Keyword arguments passed to :meth:`~concreteproperties.concrete_section.ConcreteSection.calculate_ultimate_stress` Returns: Stress results object """returnself.concrete_section.calculate_ultimate_stress(**kwargs)