Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matter_Engine: Improve Density Management for Physical materials #2935

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
203f1e4
Update Density to work with new IDensityProvider
IsakNaslundBh Oct 27, 2022
b867303
Make use of new DensityExtractionOptions object to improve control of…
IsakNaslundBh Oct 27, 2022
e124db4
Adding method to set the density to a Material
IsakNaslundBh Oct 27, 2022
e2b895c
Add UTs for SetDensity
IsakNaslundBh Oct 27, 2022
75d6ead
Update confidence and add names to TestData
IsakNaslundBh Oct 27, 2022
8d809ea
enable handling of fallback
IsakNaslundBh Oct 27, 2022
5070512
Minor refactoring and updated descriptions and comments
IsakNaslundBh Oct 28, 2022
d905a98
WIth explicit casting implemented, adding PreviousInputName from type…
IsakNaslundBh Oct 28, 2022
88668d3
updates following addition of Density property on the material
IsakNaslundBh Oct 28, 2022
536088b
Update create Material methods to acount for new DensityProeprty
IsakNaslundBh Oct 28, 2022
326b764
Add methods for getting density from a list of IDensityProviders and …
IsakNaslundBh Oct 31, 2022
4b6b627
Add method for checking all densities equal on a material
IsakNaslundBh Oct 31, 2022
57b7fac
Default NaN values for density for material creates
IsakNaslundBh Oct 31, 2022
dc2fa94
Update method for getting mass out from element with changes for Dens…
IsakNaslundBh Oct 31, 2022
3e9db63
Remove added UT for refactored out method
IsakNaslundBh Oct 31, 2022
075e374
Improved NaN checking and handling for all densities equal
IsakNaslundBh Nov 1, 2022
c20ec7e
UTs
IsakNaslundBh Nov 1, 2022
2323901
check and war for 0 density materials when computing the mass
IsakNaslundBh Nov 1, 2022
863b1b0
punctuation
IsakNaslundBh Nov 1, 2022
265eefc
Fix warning for 0 density
IsakNaslundBh Nov 1, 2022
c582da0
Add Mass unit tests
IsakNaslundBh Nov 1, 2022
2fd996b
Merge branch 'main' into pr/2935
IsakNaslundBh Nov 1, 2022
0d12996
null check for Density
IsakNaslundBh Nov 1, 2022
e2f7d99
Refactor modify method from void return to return material instead
IsakNaslundBh Nov 1, 2022
d031b94
Regenerated UTs for MatComposition and VolTakeoff
IsakNaslundBh Nov 1, 2022
0d82371
Align with addition of Matter_oM
IsakNaslundBh Nov 2, 2022
116897f
Re-serialise Test Datasets after changes to Migration of Options to M…
IsakNaslundBh Nov 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .ci/Datasets/Matter_Engine/Query/AllDensitiesEqual.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "_t" : "BH.oM.Data.Library.Dataset", "BHoM_Guid" : "d17097dd-9094-47bd-b13f-d96bb04c5659", "Name" : "AllDensitiesEqual", "Fragments" : [], "Tags" : [], "CustomData" : { }, "SourceInformation" : { "_t" : "BH.oM.Data.Library.Source", "BHoM_Guid" : "a0d06589-392f-4f7e-bd69-9cc79f803e55", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "SourceLink" : "", "Title" : "AllDensitiesEqual", "Author" : "Isak Naslund", "ItemReference" : "", "Version" : "", "Publisher" : "", "Schema" : "", "Language" : "", "Location" : "", "Copyright" : "", "Contributors" : "", "Confidence" : "Medium" }, "TimeOfCreation" : { "$date" : 1667378803308 }, "Data" : [{ "_t" : "BH.oM.Test.UnitTests.UnitTest", "BHoM_Guid" : "419707ca-52a2-4235-9c03-5f06790d58f0", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Method" : { "_t" : "System.Reflection.MethodBase", "TypeName" : "{ \"_t\" : \"System.Type\", \"Name\" : \"BH.Engine.Matter.Query, Matter_Engine, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null\", \"_bhomVersion\" : \"6.0\" }", "MethodName" : "AllDensitiesEqual", "Parameters" : ["{ \"_t\" : \"System.Type\", \"Name\" : \"BH.oM.Physical.Materials.Material\", \"_bhomVersion\" : \"6.0\" }", "{ \"_t\" : \"System.Type\", \"Name\" : \"System.Double, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\", \"_bhomVersion\" : \"6.0\" }"], "_bhomVersion" : "6.0" }, "Data" : [{ "_t" : "BH.oM.Test.UnitTests.TestData", "BHoM_Guid" : "cb489b11-4a4a-46b5-8f65-7464fa066c3d", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Inputs" : [{ "_t" : "BH.oM.Physical.Materials.Material", "BHoM_Guid" : "c76a83ec-eb42-451c-8419-87f08f519ed7", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7850.0, "Properties" : [{ "_t" : "BH.oM.Structure.MaterialFragments.Steel", "BHoM_Guid" : "01fd7fb5-d5fc-43e0-97de-149d164dfb10", "Name" : null, "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7850.0, "DampingRatio" : 0.0, "PoissonsRatio" : 0.0, "ThermalExpansionCoeff" : 0.0, "YoungsModulus" : 0.0, "YieldStress" : 0.0, "UltimateStress" : 0.0 }, { "_t" : "BH.oM.Environment.MaterialFragments.SolidMaterial", "BHoM_Guid" : "21c1f9d3-df36-4ea1-8550-9b7a2a68102b", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7850.0, "Conductivity" : 0.0, "SpecificHeat" : 0.0, "VapourResistivity" : 0.0, "Description" : "", "Roughness" : "Undefined", "Refraction" : 0.0, "SolarReflectanceExternal" : 0.0, "SolarReflectanceInternal" : 0.0, "SolarTransmittance" : 0.0, "LightReflectanceExternal" : 0.0, "LightReflectanceInternal" : 0.0, "LightTransmittance" : 0.0, "EmissivityExternal" : 0.0, "EmissivityInternal" : 0.0, "Specularity" : 0.0, "TransmittedDiffusivity" : 0.0, "TransmittedSpecularity" : 0.0, "IgnoreInUValueCalculation" : false }, { "_t" : "BH.oM.MEP.System.MaterialFragments.DuctMaterial", "BHoM_Guid" : "3353fe68-6e74-4575-902d-ede31610535d", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Roughness" : 0.0 }] }, 9.9999999999999995E-07], "Outputs" : [true] }, { "_t" : "BH.oM.Test.UnitTests.TestData", "BHoM_Guid" : "0c6d6861-4dca-4ac0-bdcd-a6bc5714aa1a", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Inputs" : [{ "_t" : "BH.oM.Physical.Materials.Material", "BHoM_Guid" : "53be1c41-1d62-481a-a146-2b4344e8de3d", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 5000.0, "Properties" : [{ "_t" : "BH.oM.Structure.MaterialFragments.Steel", "BHoM_Guid" : "01fd7fb5-d5fc-43e0-97de-149d164dfb10", "Name" : null, "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7850.0, "DampingRatio" : 0.0, "PoissonsRatio" : 0.0, "ThermalExpansionCoeff" : 0.0, "YoungsModulus" : 0.0, "YieldStress" : 0.0, "UltimateStress" : 0.0 }, { "_t" : "BH.oM.Environment.MaterialFragments.SolidMaterial", "BHoM_Guid" : "21c1f9d3-df36-4ea1-8550-9b7a2a68102b", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7850.0, "Conductivity" : 0.0, "SpecificHeat" : 0.0, "VapourResistivity" : 0.0, "Description" : "", "Roughness" : "Undefined", "Refraction" : 0.0, "SolarReflectanceExternal" : 0.0, "SolarReflectanceInternal" : 0.0, "SolarTransmittance" : 0.0, "LightReflectanceExternal" : 0.0, "LightReflectanceInternal" : 0.0, "LightTransmittance" : 0.0, "EmissivityExternal" : 0.0, "EmissivityInternal" : 0.0, "Specularity" : 0.0, "TransmittedDiffusivity" : 0.0, "TransmittedSpecularity" : 0.0, "IgnoreInUValueCalculation" : false }, { "_t" : "BH.oM.MEP.System.MaterialFragments.DuctMaterial", "BHoM_Guid" : "3353fe68-6e74-4575-902d-ede31610535d", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Roughness" : 0.0 }] }, 9.9999999999999995E-07], "Outputs" : [false] }, { "_t" : "BH.oM.Test.UnitTests.TestData", "BHoM_Guid" : "bb38d199-9630-47cd-ae74-6cfeb062157e", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Inputs" : [{ "_t" : "BH.oM.Physical.Materials.Material", "BHoM_Guid" : "9d66e174-66c4-4aea-ac00-9b9fdb8bf207", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : NaN, "Properties" : [{ "_t" : "BH.oM.Structure.MaterialFragments.Steel", "BHoM_Guid" : "b0da390e-c329-41ee-a5eb-528d81eca083", "Name" : null, "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7850.0, "DampingRatio" : 0.0, "PoissonsRatio" : 0.0, "ThermalExpansionCoeff" : 0.0, "YoungsModulus" : 0.0, "YieldStress" : 0.0, "UltimateStress" : 0.0 }, { "_t" : "BH.oM.Environment.MaterialFragments.SolidMaterial", "BHoM_Guid" : "89c1d27d-5cb8-4b76-9bc9-c9f8651bd79e", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7800.0, "Conductivity" : 0.0, "SpecificHeat" : 0.0, "VapourResistivity" : 0.0, "Description" : "", "Roughness" : "Undefined", "Refraction" : 0.0, "SolarReflectanceExternal" : 0.0, "SolarReflectanceInternal" : 0.0, "SolarTransmittance" : 0.0, "LightReflectanceExternal" : 0.0, "LightReflectanceInternal" : 0.0, "LightTransmittance" : 0.0, "EmissivityExternal" : 0.0, "EmissivityInternal" : 0.0, "Specularity" : 0.0, "TransmittedDiffusivity" : 0.0, "TransmittedSpecularity" : 0.0, "IgnoreInUValueCalculation" : false }, { "_t" : "BH.oM.Structure.MaterialFragments.Concrete", "BHoM_Guid" : "5ade9266-11d3-43b9-b70b-83802722ed95", "Name" : null, "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 1.0, "DampingRatio" : 0.0, "PoissonsRatio" : 0.0, "ThermalExpansionCoeff" : 0.0, "YoungsModulus" : 0.0, "CylinderStrength" : 0.0, "CubeStrength" : 0.0 }, { "_t" : "BH.oM.MEP.System.MaterialFragments.DuctMaterial", "BHoM_Guid" : "a4230550-b0e0-4f62-a7ea-72d6674ac64a", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Roughness" : 0.0 }] }, 9.9999999999999995E-07], "Outputs" : [false] }, { "_t" : "BH.oM.Test.UnitTests.TestData", "BHoM_Guid" : "dcf5a0ce-eb71-40a1-86af-781573f04976", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Inputs" : [{ "_t" : "BH.oM.Physical.Materials.Material", "BHoM_Guid" : "e2a74771-d34b-4081-8cc2-86716edcad35", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 5000.0, "Properties" : [{ "_t" : "BH.oM.Structure.MaterialFragments.Steel", "BHoM_Guid" : "b0da390e-c329-41ee-a5eb-528d81eca083", "Name" : null, "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7850.0, "DampingRatio" : 0.0, "PoissonsRatio" : 0.0, "ThermalExpansionCoeff" : 0.0, "YoungsModulus" : 0.0, "YieldStress" : 0.0, "UltimateStress" : 0.0 }, { "_t" : "BH.oM.Environment.MaterialFragments.SolidMaterial", "BHoM_Guid" : "89c1d27d-5cb8-4b76-9bc9-c9f8651bd79e", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7800.0, "Conductivity" : 0.0, "SpecificHeat" : 0.0, "VapourResistivity" : 0.0, "Description" : "", "Roughness" : "Undefined", "Refraction" : 0.0, "SolarReflectanceExternal" : 0.0, "SolarReflectanceInternal" : 0.0, "SolarTransmittance" : 0.0, "LightReflectanceExternal" : 0.0, "LightReflectanceInternal" : 0.0, "LightTransmittance" : 0.0, "EmissivityExternal" : 0.0, "EmissivityInternal" : 0.0, "Specularity" : 0.0, "TransmittedDiffusivity" : 0.0, "TransmittedSpecularity" : 0.0, "IgnoreInUValueCalculation" : false }, { "_t" : "BH.oM.Structure.MaterialFragments.Concrete", "BHoM_Guid" : "5ade9266-11d3-43b9-b70b-83802722ed95", "Name" : null, "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 1.0, "DampingRatio" : 0.0, "PoissonsRatio" : 0.0, "ThermalExpansionCoeff" : 0.0, "YoungsModulus" : 0.0, "CylinderStrength" : 0.0, "CubeStrength" : 0.0 }, { "_t" : "BH.oM.MEP.System.MaterialFragments.DuctMaterial", "BHoM_Guid" : "a4230550-b0e0-4f62-a7ea-72d6674ac64a", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Roughness" : 0.0 }] }, 9.9999999999999995E-07], "Outputs" : [false] }, { "_t" : "BH.oM.Test.UnitTests.TestData", "BHoM_Guid" : "c090aed2-d3e1-4d19-a453-1f2d9604a205", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Inputs" : [{ "_t" : "BH.oM.Physical.Materials.Material", "BHoM_Guid" : "8f066309-1e79-4c38-a13f-70cdfab654e4", "Name" : "Steel", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7850.0, "Properties" : [{ "_t" : "BH.oM.Structure.MaterialFragments.Steel", "BHoM_Guid" : "893b804a-a5b1-47ec-9d11-9aba72472e6a", "Name" : "Steel", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7850.0, "DampingRatio" : 0.0, "PoissonsRatio" : 0.0, "ThermalExpansionCoeff" : 0.0, "YoungsModulus" : 0.0, "YieldStress" : 0.0, "UltimateStress" : 0.0 }] }, 9.9999999999999995E-07], "Outputs" : [true] }, { "_t" : "BH.oM.Test.UnitTests.TestData", "BHoM_Guid" : "ad6fae91-4fde-4407-80a7-77ed55a346ef", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Inputs" : [{ "_t" : "BH.oM.Physical.Materials.Material", "BHoM_Guid" : "edc7c62a-cbce-4609-9a71-d90671d80a10", "Name" : "Concrete", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 2500.0, "Properties" : [{ "_t" : "BH.oM.Structure.MaterialFragments.Concrete", "BHoM_Guid" : "86df3cb8-4da6-47c4-aced-14235b2ed993", "Name" : "Concrete", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 2500.0, "DampingRatio" : 0.0, "PoissonsRatio" : 0.0, "ThermalExpansionCoeff" : 0.0, "YoungsModulus" : 0.0, "CylinderStrength" : 0.0, "CubeStrength" : 0.0 }] }, 9.9999999999999995E-07], "Outputs" : [true] }, { "_t" : "BH.oM.Test.UnitTests.TestData", "BHoM_Guid" : "fbe142c3-e2c7-4de4-aeb9-1f1a2dc58930", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Inputs" : [{ "_t" : "BH.oM.Physical.Materials.Material", "BHoM_Guid" : "fdc0263f-66fd-4080-86b4-4c8217d38569", "Name" : "Solid", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7850.0, "Properties" : [{ "_t" : "BH.oM.Environment.MaterialFragments.SolidMaterial", "BHoM_Guid" : "27aff233-a7ff-45bc-abd4-43999bbfe9b2", "Name" : "Solid", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7850.0, "Conductivity" : 0.0, "SpecificHeat" : 0.0, "VapourResistivity" : 0.0, "Description" : "", "Roughness" : "Undefined", "Refraction" : 0.0, "SolarReflectanceExternal" : 0.0, "SolarReflectanceInternal" : 0.0, "SolarTransmittance" : 0.0, "LightReflectanceExternal" : 0.0, "LightReflectanceInternal" : 0.0, "LightTransmittance" : 0.0, "EmissivityExternal" : 0.0, "EmissivityInternal" : 0.0, "Specularity" : 0.0, "TransmittedDiffusivity" : 0.0, "TransmittedSpecularity" : 0.0, "IgnoreInUValueCalculation" : false }] }, 9.9999999999999995E-07], "Outputs" : [true] }, { "_t" : "BH.oM.Test.UnitTests.TestData", "BHoM_Guid" : "ed8d9a87-9c14-412e-8768-da808e51b9b3", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Inputs" : [{ "_t" : "BH.oM.Physical.Materials.Material", "BHoM_Guid" : "5d1e5378-bbcd-4e02-af0c-95c153dc7819", "Name" : "Duct", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : NaN, "Properties" : [{ "_t" : "BH.oM.MEP.System.MaterialFragments.DuctMaterial", "BHoM_Guid" : "9d334f9b-ee69-4b02-b137-8467e2a1bbf9", "Name" : "Duct", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Roughness" : 0.0 }] }, 9.9999999999999995E-07], "Outputs" : [false] }, { "_t" : "BH.oM.Test.UnitTests.TestData", "BHoM_Guid" : "f70bf1e1-d7a4-4aa5-b20c-933f33ba9a40", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Inputs" : [{ "_t" : "BH.oM.Physical.Materials.Material", "BHoM_Guid" : "e18f6c60-3a5c-4c78-99e3-aba0c2aa2385", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7850.0, "Properties" : [{ "_t" : "BH.oM.Structure.MaterialFragments.Steel", "BHoM_Guid" : "37c9a731-9f51-45bd-9ce7-ce1e9d055f7a", "Name" : null, "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : NaN, "DampingRatio" : 0.0, "PoissonsRatio" : 0.0, "ThermalExpansionCoeff" : 0.0, "YoungsModulus" : 0.0, "YieldStress" : 0.0, "UltimateStress" : 0.0 }, { "_t" : "BH.oM.Environment.MaterialFragments.SolidMaterial", "BHoM_Guid" : "cc31cf9d-d6f6-4a27-9c5f-6cd47036dd13", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Density" : 7850.0, "Conductivity" : 0.0, "SpecificHeat" : 0.0, "VapourResistivity" : 0.0, "Description" : "", "Roughness" : "Undefined", "Refraction" : 0.0, "SolarReflectanceExternal" : 0.0, "SolarReflectanceInternal" : 0.0, "SolarTransmittance" : 0.0, "LightReflectanceExternal" : 0.0, "LightReflectanceInternal" : 0.0, "LightTransmittance" : 0.0, "EmissivityExternal" : 0.0, "EmissivityInternal" : 0.0, "Specularity" : 0.0, "TransmittedDiffusivity" : 0.0, "TransmittedSpecularity" : 0.0, "IgnoreInUValueCalculation" : false }, { "_t" : "BH.oM.MEP.System.MaterialFragments.DuctMaterial", "BHoM_Guid" : "ef7d87db-ca7a-43fc-be46-8f45c6f7aaf6", "Name" : "", "Fragments" : [], "Tags" : [], "CustomData" : { }, "Roughness" : 0.0 }] }, 9.9999999999999995E-07], "Outputs" : [false] }] }], "_bhomVersion" : "6.0" }
1 change: 1 addition & 0 deletions .ci/Datasets/Matter_Engine/Query/Density.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .ci/Datasets/Matter_Engine/Query/Mass.json

Large diffs are not rendered by default.

Loading