From d8eb739b56231882e202f87f4839154514951cab Mon Sep 17 00:00:00 2001 From: kpne Date: Wed, 6 Nov 2024 18:24:38 +0100 Subject: [PATCH] move geometrical properties to sectionproperties and have concreteproperties extend that instead of separate class --- ISectionProperties/IConcreteProperties.cs | 15 +++++++ ISectionProperties/IGeometricalProperties.cs | 19 -------- ISectionProperties/ISectionProperties.cs | 16 ++++++- SectionProperties.sln | 6 --- SectionProperties/GeometricalProperties.cs | 46 -------------------- SectionProperties/SectionProperties.cs | 36 +++++++++++++-- 6 files changed, 61 insertions(+), 77 deletions(-) create mode 100644 ISectionProperties/IConcreteProperties.cs delete mode 100644 ISectionProperties/IGeometricalProperties.cs delete mode 100644 SectionProperties/GeometricalProperties.cs diff --git a/ISectionProperties/IConcreteProperties.cs b/ISectionProperties/IConcreteProperties.cs new file mode 100644 index 0000000..8128de7 --- /dev/null +++ b/ISectionProperties/IConcreteProperties.cs @@ -0,0 +1,15 @@ +using OasysUnits; + +namespace MagmaWorks.Taxonomy.Sections.SectionProperties +{ + public interface IConcreteProperties : ISectionProperties + { + Length EffectiveDepthY { get; } + Length EffectiveDepthZ { get; } + Area CompressionReinforcementAreaY { get; } + Area CompressionReinforcementAreaZ { get; } + Area TensionReinforcementAreaY { get; } + Area TensionReinforcementAreaZ { get; } + Area ShearReinforcementArea { get; } + } +} diff --git a/ISectionProperties/IGeometricalProperties.cs b/ISectionProperties/IGeometricalProperties.cs deleted file mode 100644 index a826a4b..0000000 --- a/ISectionProperties/IGeometricalProperties.cs +++ /dev/null @@ -1,19 +0,0 @@ -using MagmaWorks.Geometry; -using OasysUnits; - -namespace MagmaWorks.Taxonomy.Sections.SectionProperties -{ - public interface IGeometricalProperties - { - ILocalDomain2d Extends { get; } - ILocalPoint2d Centroid { get; } - Length Perimeter { get; } - Area Area { get; } - SectionModulus ElasticSectionModulusYy { get; } - SectionModulus ElasticSectionModulusZz { get; } - AreaMomentOfInertia MomentOfInertiaYy { get; } - AreaMomentOfInertia MomentOfInertiaZz { get; } - Length RadiusOfGyrationYy { get; } - Length RadiusOfGyrationZz { get; } - } -} diff --git a/ISectionProperties/ISectionProperties.cs b/ISectionProperties/ISectionProperties.cs index 1085b10..b1236e8 100644 --- a/ISectionProperties/ISectionProperties.cs +++ b/ISectionProperties/ISectionProperties.cs @@ -1,7 +1,19 @@ -namespace MagmaWorks.Taxonomy.Sections.SectionProperties +using MagmaWorks.Geometry; +using OasysUnits; + +namespace MagmaWorks.Taxonomy.Sections.SectionProperties { public interface ISectionProperties { - IGeometricalProperties GeometricalProperties { get; } + ILocalDomain2d Extends { get; } + ILocalPoint2d Centroid { get; } + Length Perimeter { get; } + Area Area { get; } + SectionModulus ElasticSectionModulusYy { get; } + SectionModulus ElasticSectionModulusZz { get; } + AreaMomentOfInertia MomentOfInertiaYy { get; } + AreaMomentOfInertia MomentOfInertiaZz { get; } + Length RadiusOfGyrationYy { get; } + Length RadiusOfGyrationZz { get; } } } diff --git a/SectionProperties.sln b/SectionProperties.sln index 0eee250..b6adda8 100644 --- a/SectionProperties.sln +++ b/SectionProperties.sln @@ -7,8 +7,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MagmaWorks.Taxonomy.Section EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MagmaWorks.Taxonomy.Sections.SectionProperties", "SectionProperties\MagmaWorks.Taxonomy.Sections.SectionProperties.csproj", "{53294695-E114-4DA9-9F1A-F8E2C289DB60}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MagmaWorks.Taxonomy.Sections.SectionProperties.Serialization", "Serialization\MagmaWorks.Taxonomy.Sections.SectionProperties.Serialization.csproj", "{1E0D2D34-40B9-48C4-9A43-D8C078B2BCE4}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SectionPropertiesTests", "SectionPropertiesTests\SectionPropertiesTests.csproj", "{86D261B4-B15C-4F44-B655-CE127B7CC3C0}" EndProject Global @@ -25,10 +23,6 @@ Global {53294695-E114-4DA9-9F1A-F8E2C289DB60}.Debug|Any CPU.Build.0 = Debug|Any CPU {53294695-E114-4DA9-9F1A-F8E2C289DB60}.Release|Any CPU.ActiveCfg = Release|Any CPU {53294695-E114-4DA9-9F1A-F8E2C289DB60}.Release|Any CPU.Build.0 = Release|Any CPU - {1E0D2D34-40B9-48C4-9A43-D8C078B2BCE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1E0D2D34-40B9-48C4-9A43-D8C078B2BCE4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1E0D2D34-40B9-48C4-9A43-D8C078B2BCE4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1E0D2D34-40B9-48C4-9A43-D8C078B2BCE4}.Release|Any CPU.Build.0 = Release|Any CPU {86D261B4-B15C-4F44-B655-CE127B7CC3C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {86D261B4-B15C-4F44-B655-CE127B7CC3C0}.Debug|Any CPU.Build.0 = Debug|Any CPU {86D261B4-B15C-4F44-B655-CE127B7CC3C0}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/SectionProperties/GeometricalProperties.cs b/SectionProperties/GeometricalProperties.cs deleted file mode 100644 index a4b4b3e..0000000 --- a/SectionProperties/GeometricalProperties.cs +++ /dev/null @@ -1,46 +0,0 @@ -using MagmaWorks.Geometry; -using MagmaWorks.Taxonomy.Profiles; -using OasysUnits; - -namespace MagmaWorks.Taxonomy.Sections.SectionProperties -{ - public class GeometricalProperties : IGeometricalProperties - { - public ILocalPoint2d Centroid - => _centroid ??= Utility.Centroid.CalculateCentroid(_profile); - public Length Perimeter - => _perimeter ??= Utility.PerimeterLength.CalculatePerimeter(_profile); - public ILocalDomain2d Extends => _domain ??= Utility.Extends.GetDomain(_profile); - public Area Area => _area ??= Utility.Area.CalculateArea(_profile); - public SectionModulus ElasticSectionModulusYy - => _elasticSectionModulusYy ??= Utility.SectionModulus.CalculateSectionModulusYy(_profile); - public SectionModulus ElasticSectionModulusZz - => _elasticSectionModulusZz ??= Utility.SectionModulus.CalculateSectionModulusZz(_profile); - public AreaMomentOfInertia MomentOfInertiaYy - => _momentOfInertiaYy ??= Utility.Inertia.CalculateInertiaYy(_profile); - public AreaMomentOfInertia MomentOfInertiaZz - => _momentOfInertiaZz ??= Utility.Inertia.CalculateInertiaZz(_profile); - public Length RadiusOfGyrationYy - => _radiusOfGyrationYy ??= Utility.RadiusOfGyration.CalculateRadiusOfGyrationYy(_profile); - public Length RadiusOfGyrationZz - => _radiusOfGyrationZz ??= Utility.RadiusOfGyration.CalculateRadiusOfGyrationZz(_profile); - - private ILocalPoint2d _centroid; - private Length? _perimeter; - private ILocalDomain2d _domain; - private Area? _area; - private SectionModulus? _elasticSectionModulusYy; - private SectionModulus? _elasticSectionModulusZz; - private AreaMomentOfInertia? _momentOfInertiaYy; - private AreaMomentOfInertia? _momentOfInertiaZz; - private Length? _radiusOfGyrationYy; - private Length? _radiusOfGyrationZz; - private IProfile _profile; - - private GeometricalProperties() { } - public GeometricalProperties(IProfile profile) - { - _profile = profile; - } - } -} diff --git a/SectionProperties/SectionProperties.cs b/SectionProperties/SectionProperties.cs index 4d5bb67..77038ff 100644 --- a/SectionProperties/SectionProperties.cs +++ b/SectionProperties/SectionProperties.cs @@ -1,16 +1,44 @@ -using MagmaWorks.Taxonomy.Profiles; +using MagmaWorks.Geometry; +using MagmaWorks.Taxonomy.Profiles; +using OasysUnits; namespace MagmaWorks.Taxonomy.Sections.SectionProperties { public class SectionProperties : ISectionProperties { - public IGeometricalProperties GeometricalProperties - => _geometricalProperties ??= new GeometricalProperties(_profile); + public ILocalPoint2d Centroid + => _centroid ??= Utility.Centroid.CalculateCentroid(_profile); + public Length Perimeter + => _perimeter ??= Utility.PerimeterLength.CalculatePerimeter(_profile); + public ILocalDomain2d Extends => _domain ??= Utility.Extends.GetDomain(_profile); + public Area Area => _area ??= Utility.Area.CalculateArea(_profile); + public SectionModulus ElasticSectionModulusYy + => _elasticSectionModulusYy ??= Utility.SectionModulus.CalculateSectionModulusYy(_profile); + public SectionModulus ElasticSectionModulusZz + => _elasticSectionModulusZz ??= Utility.SectionModulus.CalculateSectionModulusZz(_profile); + public AreaMomentOfInertia MomentOfInertiaYy + => _momentOfInertiaYy ??= Utility.Inertia.CalculateInertiaYy(_profile); + public AreaMomentOfInertia MomentOfInertiaZz + => _momentOfInertiaZz ??= Utility.Inertia.CalculateInertiaZz(_profile); + public Length RadiusOfGyrationYy + => _radiusOfGyrationYy ??= Utility.RadiusOfGyration.CalculateRadiusOfGyrationYy(_profile); + public Length RadiusOfGyrationZz + => _radiusOfGyrationZz ??= Utility.RadiusOfGyration.CalculateRadiusOfGyrationZz(_profile); - private IGeometricalProperties _geometricalProperties; + private ILocalPoint2d _centroid; + private Length? _perimeter; + private ILocalDomain2d _domain; + private Area? _area; + private SectionModulus? _elasticSectionModulusYy; + private SectionModulus? _elasticSectionModulusZz; + private AreaMomentOfInertia? _momentOfInertiaYy; + private AreaMomentOfInertia? _momentOfInertiaZz; + private Length? _radiusOfGyrationYy; + private Length? _radiusOfGyrationZz; private IProfile _profile; private SectionProperties() { } + public SectionProperties(ISection section) : this(section.Profile) { } public SectionProperties(IProfile profile)