public static string Description(this GenericOrthotropicMaterial material) { if (material == null) { return("null material"); } return("Gen " + material.MaterialAnalyticalValues()); }
public static MaterialType MaterialType(this GenericOrthotropicMaterial materialFragment) { return(materialFragment.IsNull() ? oM.Structure.MaterialFragments.MaterialType.Undefined : oM.Structure.MaterialFragments.MaterialType.Undefined); }
/***************************************************/ /**** Private Methods ****/ /***************************************************/ private List <IMaterialFragment> ReadMaterial(List <string> ids = null) { List <IMaterialFragment> materialList = new List <IMaterialFragment>(); int nameCount = 0; string[] nameArr = { }; m_model.PropMaterial.GetNameList(ref nameCount, ref nameArr); ids = FilterIds(ids, nameArr); foreach (string id in ids) { eMatType matType = eMatType.NoDesign; int symType = 0; int colour = 0; string guid = ""; string notes = ""; if (m_model.PropMaterial.GetMaterial(id, ref matType, ref colour, ref notes, ref guid) == 0) { IMaterialFragment bhMaterial; m_model.PropMaterial.GetTypeOAPI(id, ref matType, ref symType); double e = 0; double v = 0; double thermCo = 0; double g = 0; double[] E = new double[3]; double[] V = new double[3]; double[] ThermCo = new double[3]; double[] G = new double[3]; if (symType == 0)// Isotropic { m_model.PropMaterial.GetMPIsotropic(id, ref e, ref v, ref thermCo, ref g); } else if (symType == 1) // Orthotropic { m_model.PropMaterial.GetMPOrthotropic(id, ref E, ref V, ref ThermCo, ref G); } else if (symType == 2) //Anisotropic { m_model.PropMaterial.GetMPAnisotropic(id, ref E, ref V, ref ThermCo, ref G); } else if (symType == 3) //Uniaxial { m_model.PropMaterial.GetMPUniaxial(id, ref e, ref thermCo); } double mass = 0; double weight = 0; m_model.PropMaterial.GetWeightAndMass(id, ref weight, ref mass); double fc = 0; //compressive stress double ft = 0; //tensile stress double fy = 0; //yield stress double fu = 0; //ultimate stress double efy = 0; //expected yield stress double efu = 0; //expected tensile stress double strainHardening = 0; //strain at hardening double strainMaxF = 0; //strain at max stress double strainRupture = 0; //strain at rupture double strainFc = 0; //strain at f'c int i0 = 0; //stress-strain curvetype int i1 = 0; //stress-strain hysteresis type bool b0 = false; //is lightweight switch (matType) { case eMatType.Steel: m_model.PropMaterial.GetOSteel(id, ref fy, ref fu, ref efy, ref efu, ref i0, ref i1, ref strainHardening, ref strainMaxF, ref strainRupture); bhMaterial = Engine.Structure.Create.Steel(id, e, v, thermCo, mass, 0, fy, fu); break; case eMatType.Concrete: m_model.PropMaterial.GetOConcrete(id, ref fc, ref b0, ref ft, ref i0, ref i1, ref efy, ref efu, ref strainFc, ref strainMaxF); bhMaterial = Engine.Structure.Create.Concrete(id, e, v, thermCo, mass, 0, 0, fy); break; case eMatType.Aluminum: bhMaterial = Engine.Structure.Create.Aluminium(id, e, v, thermCo, mass, 0); break; case eMatType.ColdFormed: m_model.PropMaterial.GetOColdFormed(id, ref fy, ref fu, ref i1); bhMaterial = Engine.Structure.Create.Steel(id, e, v, thermCo, mass, 0, fy, fu); break; case eMatType.Rebar: m_model.PropMaterial.GetORebar(id, ref fy, ref fu, ref efy, ref efu, ref i0, ref i1, ref strainHardening, ref strainMaxF, ref b0); bhMaterial = Engine.Structure.Create.Steel(id, e, v, thermCo, mass, 0, fy, fu); break; case eMatType.Tendon: m_model.PropMaterial.GetOTendon(id, ref fy, ref fu, ref i0, ref i1); bhMaterial = Engine.Structure.Create.Steel(id, e, v, thermCo, mass, 0, fy, fu); break; case eMatType.NoDesign: switch (symType) { case 0: bhMaterial = new GenericIsotropicMaterial() { Name = id, YoungsModulus = e, PoissonsRatio = v, ThermalExpansionCoeff = thermCo, Density = mass }; break; case 1: bhMaterial = new GenericOrthotropicMaterial() { Name = id, YoungsModulus = E.ToVector(), PoissonsRatio = V.ToVector(), ThermalExpansionCoeff = ThermCo.ToVector(), Density = mass }; break; case 2: case 3: default: bhMaterial = Engine.Structure.Create.Steel(id); Engine.Base.Compute.RecordWarning("Could not extract structural properties for material " + id); break; } break; default: bhMaterial = Engine.Structure.Create.Steel(id); Engine.Base.Compute.RecordWarning("Could not extract structural properties for material " + id); break; } SetAdapterId(bhMaterial, id); materialList.Add(bhMaterial); } } return(materialList); }
/***************************************************/ private List <IMaterialFragment> ReadMaterial(List <string> ids = null) { int nameCount = 0; string[] names = { }; List <IMaterialFragment> materialList = new List <IMaterialFragment>(); m_model.PropMaterial.GetNameList(ref nameCount, ref names); ids = FilterIds(ids, names); foreach (string id in ids) { eMatType matType = eMatType.NoDesign; int colour = 0; string guid = null; string notes = ""; if (m_model.PropMaterial.GetMaterial(id, ref matType, ref colour, ref notes, ref guid) == 0) { IMaterialFragment m = null; double e = 0; double v = 0; double thermCo = 0; double g = 0; double mass = 0; double weight = 0; m_model.PropMaterial.GetWeightAndMass(id, ref weight, ref mass); if (m_model.PropMaterial.GetMPIsotropic(id, ref e, ref v, ref thermCo, ref g) != 0) { double[] eArr = new double[3]; double[] vArr = new double[3]; double[] aArr = new double[3]; double[] gArr = new double[3]; if (m_model.PropMaterial.GetMPOrthotropic(id, ref eArr, ref vArr, ref aArr, ref gArr) != 0) { string msg = string.Format("Could not extract structural properties for material {0}, this has been replaced with a GenericIsotropicMaterial with no properties.", id); Engine.Base.Compute.RecordWarning(msg); m = new GenericIsotropicMaterial() { Name = id + "_replacment" }; } else { m = new GenericOrthotropicMaterial() { Name = id, YoungsModulus = eArr.ToVector(), PoissonsRatio = vArr.ToVector(), ShearModulus = gArr.ToVector(), ThermalExpansionCoeff = aArr.ToVector(), Density = mass }; } } else { double compStr = 0; double tensStr = 0; double fy = 0; //expected yield stress double fu = 0; //expected tensile stress double efy = 0; //expected yield stress double efu = 0; //expected tensile stress double v3 = 0; //strain at hardening double v4 = 0; //strain at max stress double v5 = 0; //strain at rupture double strainAtFc = 0; double strainUlt = 0; int i1 = 0;//stress-strain curvetype int i2 = 0; bool b1 = false; if (m_model.PropMaterial.GetOSteel(id, ref fy, ref fu, ref efy, ref efu, ref i1, ref i2, ref v3, ref v4, ref v5) == 0 || matType == eMatType.Steel || matType == eMatType.ColdFormed || m_model.PropMaterial.GetORebar(id, ref fy, ref fu, ref efy, ref efu, ref i1, ref i2, ref v3, ref v4, ref b1) == 0 || matType == eMatType.Rebar || m_model.PropMaterial.GetOTendon(id, ref fy, ref fu, ref i1, ref i2) == 0 || matType == eMatType.Tendon) { m = new Steel() { Name = id, YoungsModulus = e, PoissonsRatio = v, ThermalExpansionCoeff = thermCo, Density = mass, YieldStress = fy, UltimateStress = fu }; } else if (m_model.PropMaterial.GetOConcrete(id, ref compStr, ref b1, ref tensStr, ref i1, ref i2, ref strainAtFc, ref strainUlt, ref v3, ref v4) == 0 || matType == eMatType.Concrete) { m = new Concrete() { Name = id, YoungsModulus = e, PoissonsRatio = v, ThermalExpansionCoeff = thermCo, Density = mass, CylinderStrength = compStr }; } else if (matType == eMatType.Aluminum) { m = new Aluminium() { Name = id, YoungsModulus = e, PoissonsRatio = v, ThermalExpansionCoeff = thermCo, Density = mass }; } else { string msg = string.Format("Could not extract structural properties for material {0}, this has been replaced with a GenericIsotropicMaterial with no properties.", id); Engine.Base.Compute.RecordWarning(msg); m = new GenericIsotropicMaterial() { Name = id + "_replacment" }; } } SetAdapterId(m, id); materialList.Add(m); } } return(materialList); }