diff --git a/docs/BHoM_oM/Structure_oM/Design-Results.md b/docs/BHoM_oM/Structure_oM/Design-Results.md new file mode 100644 index 000000000..40413feca --- /dev/null +++ b/docs/BHoM_oM/Structure_oM/Design-Results.md @@ -0,0 +1,112 @@ +## Design Results +Design results represents the outputs from design checks carried out by bespoke engine methods. They are explicit in their properties and relate to specific design codes and actions. + +This is intentional and preferred to more generic implementations such as having a generic `Parameters` property of type `Dictionary` where the properties can fluccuate between implementations. + +To provide consistency across different design result objects a base `IDesignResult` is provided that inherits from existing classes in the `Structure` and `Analytical` namespaces. + +### Base Class +The base class for all structural design results is stored in `BH.oM.Structure.Design` as an `IDesignResult` which inherits from the [`IStructuralResultClass`](https://github.com/BHoM/BHoM/blob/develop/Structure_oM/Results/IStructuralResult.cs) and [`IResultItem`](https://github.com/BHoM/BHoM/blob/cded0de0047171577144479fe8165684648f1ac3/Analytical_oM/Results/IResultItem.cs). + +### Creating your own design result class +The first decision to make is what namespace our class will sit in. + +#### Namespaces +The namespace is used to designate the design code, for example `BH.oM.Structure.Design.Eurocode`, `BH.oM.Structure.Design.AISC` or `BH.oM.Structure.Design.SHC`. + +This keeps the object and engine method names clean. + +These can be extended to materials too (e.g. `BH.oM.Structure.Design.Eurocode.Timber` and `BH.oM.Structure.Design.Eurocode.Steel`). + +!!! tip + + We do not need to include the subsection and part of the code in the namespace - that is covered in the designation `ENum`. + +Next, we need to decide on an object name. + +#### Class name +Name the class after the structural action being checked such as `Tension, `Bending` or `Torsion` using the language in the design code. + +#### Designations +This is an `Enum` that is included on the specific object to designate the specific version or annex of that code. + +!!! example "What a steel design designation might look like" + ```c# + public enum SteelDesignation + { + [Description("Part 1-1: General rules and rules for buildings")] + [DisplayText("UK National Annex to EN 1993-1-1:2005")] + UK_NA_EN_1993-1-1_2005_A1-2014 = 0, + [Description("Specification for structural steel buildings")] + [DisplayText("AISC 360-22 : 2022")] + AISC_360-22_2022 = 1 + } + ``` + +#### Example Class +Bringing together those decisions, we can create a class for tension design in accordance with EN 1993-1-1:2005 + A1:2014 + +!!! example "What a tension design class in Eurocode may look like" + ```c# + namespace BH.oM.Structure.Design.Eurocode + { + + [Description("An object that contains the outputs from a tension check.")] + public class Tension : IDesignResult, IImmutable + { + /***************************************************/ + /**** Properties ****/ + /***************************************************/ + [Description("Id of the structure. Unused for many results.")] + public virtual IComparable ObjectId { get; } + + [Description("Identifier for the Loadcase or LoadCombination that the result belongs to. Is generally name or number of the loadcase, depending on the analysis package.")] + public virtual IComparable ResultCase { get; } + + [Description("Positive index, starting at one. Only set for cases with modal outputs such as dynamic cases.")] + public virtual int ModeNumber { get; } + + [Description("Time step for time history results.")] + public virtual double TimeStep { get; } + + [Description("The utilisation of the design check.")] + public virtual double Utilisation { get; } + + [Description("The specific national annex the design check relates to.")] + public virtual SteelDesignation NationalAnnex { get; } + + [Description("The partial safety factor for the resistance of cross-sections.")] + public virtual double GammaM0 { get; } + + [Force] + [Description("The design axial force derived from the characteristic load multiplied by the relevant partial safety factors.")] + public virtual double DesignAxial { get; } + + [Force] + [Description("The design ultimate resistance of the net cross section subject to tension.")] + public virtual double ResistanceAxial { get; } + } + } + ``` + +1. Note that properties such as `Area` are not stored on the `TensionDesign` object as that is queryable from the `Bar.SectionProperty.Area` to avoid bloating objects and duplicating data. +2. Only properties that are dervied from the design code should be stored on the `DesignCheck` object. +3. [Quantity Attributes](https://github.com/BHoM/BHoM/tree/develop/Quantities_oM/Attributes) are used to specify the units (adhering to the BHoM SI). + +Similar classes can be derived for `CompressionDesign`, `BucklingDesign` and `ShearAndTorsionDesign`. + +!!! tip + + The `IImmutable` is not strictly required on the class definition as it's implicit from `IDesignResult` but it's clearer to state explicitly. You can read from about [`IImmutable` here.](https://bhom.xyz/documentation/BHoM_oM/Base_oM/Interfaces/IImmutable/) + +#### Hashing +Specific results can be identified using a combination of `ObjectId`, `ResultCase`, `TimeStep`, `ModeNumber`. + +For example, when a user wants to retrieve a specific result from a database. + +!!! tip + + If you are writing multiple iterations of design results to a database you will need to include an iteration property on your design result object. + + +