Skip to content

Commit

Permalink
move geometrical properties to sectionproperties and have concretepro…
Browse files Browse the repository at this point in the history
…perties extend that instead of separate class
  • Loading branch information
kpne committed Nov 6, 2024
1 parent 09bb64d commit d8eb739
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 77 deletions.
15 changes: 15 additions & 0 deletions ISectionProperties/IConcreteProperties.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
19 changes: 0 additions & 19 deletions ISectionProperties/IGeometricalProperties.cs

This file was deleted.

16 changes: 14 additions & 2 deletions ISectionProperties/ISectionProperties.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
6 changes: 0 additions & 6 deletions SectionProperties.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
46 changes: 0 additions & 46 deletions SectionProperties/GeometricalProperties.cs

This file was deleted.

36 changes: 32 additions & 4 deletions SectionProperties/SectionProperties.cs
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit d8eb739

Please sign in to comment.