public static void CreateEntry( string ValueName, double Value, BeamTemplateType TemplateType, int SubTypeIndex, Dictionary<string, double> DependencyValues, string CaseId, IAnalysisBeam beam, bool AddMax = false, bool AddMin = false) { ICalcLogEntry Entry = new CalcLogEntry(); Entry.ValueName = ValueName; Entry.VariableValue = Math.Round(Value, 3).ToString(); if (DependencyValues!=null) { foreach (var depVal in DependencyValues) { Entry.AddDependencyValue(depVal.Key, Math.Round(depVal.Value, 3)); } } if (AddMax == true) { Entry.AddDependencyValue("Maximum", "Maximum"); Entry.AddDependencyValue("maximum", "Maximum"); } if (AddMin==true) { Entry.AddDependencyValue("Maximum", "Minimum"); Entry.AddDependencyValue("maximum", "Minimum"); } Entry.AddDependencyValue("CF", "1728"); Entry.Reference = ""; //Entry.DescriptionReference = beam.ResourceLocator.GetTemplatePath(TemplateType, CaseId, SubTypeIndex); Entry.FormulaID = null; //reference to formula from code //beam.Log.AddEntry(Entry); // this bypasses the check for LogMode beam.AddToLog(Entry); }
public void C1B_1ReturnsMaxDeflection() { double L = 240; double w = 0.125; IAnalysisBeam bm = GetBeam(L, w); double Delta = bm.GetMaximumDeflection(); Assert.AreEqual(0.3651, Math.Round(Delta, 4)); }
public ISingleLoadCaseDeflectionBeam GetDeflectionCase(LoadBeam load, IAnalysisBeam beam) { BeamCase bc = GetCase(load, beam); if (bc.DeflectionCase == null) { throw new Exception(CaseNotSupportedExceptionText); } return bc.DeflectionCase; }
public void C1B_1ReturnsPositiveMoment() { double L = 20; double w = 1.5; IAnalysisBeam bm = GetBeam(L, w); double M_max = bm.GetMomentMaximum().Value; Assert.AreEqual(75, M_max); }
public ISingleLoadCaseDeflectionBeam GetDeflectionCase(LoadBeam load, IAnalysisBeam beam) { BeamCase bc = GetCase(load, beam); if (bc.DeflectionCase == null) { throw new Exception(CaseNotSupportedExceptionText); } return(bc.DeflectionCase); }
public void C3A_2ReturnsNegativeMoment() { double L = 120; double a = L / 2.0; double P = 20; IAnalysisBeam bm = GetBeam(L, a, P); double X = L; double M_min = bm.GetMomentMinimum().Value; Assert.AreEqual(-3.0 * P * L / 16.0, M_min); }
IAnalysisBeam GetBeam(double L, double a, double P) { BeamFactoryData dat = new BeamFactoryData(L, P, 0, 0, a, 0, 0, 0, 0, 0, 0, 29000, 510); //W18X35 string BeamCaseId = "C3A_2"; BeamLoadFactoryLocator loc = new BeamLoadFactoryLocator(); IBeamLoadFactory loadFactory = loc.GetLoadFactory(BeamCaseId, dat); LoadBeam load = loadFactory.GetLoad(BeamCaseId); BeamInstanceFactory beamFactory = new BeamInstanceFactory(dat); IAnalysisBeam bm = beamFactory.CreateBeamInstance(BeamCaseId, load, null); return(bm); }
public void C1B_1ReturnsPositiveMomentAtX() { double L = 20; double w = 1.5; IAnalysisBeam bm = GetBeam(L, w); double X = L / 2; double M_x = bm.GetMoment(X); Assert.AreEqual(75, M_x); //double V_x = bm.GetShear(X); // //double M_min = bm.GetMomentMinimum(); //double V_max = bm.GetShearMaximumValue(); }
public BeamCase GetCase(LoadBeam load, IAnalysisBeam beam) { this.beam = beam as BeamSimpleWithOverhang; BeamCase BeamLoadCase = null; if (load is LoadConcentrated) { BeamLoadCase = GetConcentratedLoadCase(load); } else if (load is LoadDistributed) { BeamLoadCase = GetDistributedLoadCase(load); } return(BeamLoadCase); }
public BeamCase GetCase(LoadBeam load, IAnalysisBeam beam) { this.beam = beam as BeamSimpleWithOverhang; BeamCase BeamLoadCase = null; if (load is LoadConcentrated) { BeamLoadCase = GetConcentratedLoadCase(load); } else if (load is LoadDistributed) { BeamLoadCase = GetDistributedLoadCase(load); } return BeamLoadCase; }
public void C2A_1ReturnsNegativeMoment() { double L = 120; double a = 48; double P = -20; IAnalysisBeam bm = GetBeam(L, a, P); double X = L; double M_min = bm.GetMomentMinimum().Value; Assert.AreEqual(-48 * 20, M_min); //double M_x = bm.GetMoment(X); //double V_x = bm.GetShear(X); // //double M_min = bm.GetMomentMinimum(); //double V_max = bm.GetShearMaximumValue(); }
private BeamCase GetCase(LoadBeam load, IAnalysisBeam beam) { this.beam = beam as BeamFixedFixed; BeamCase BeamLoadCase = null; if (load is LoadConcentrated) { BeamLoadCase = GetConcentratedLoadCase(load); } else if (load is LoadDistributed) { BeamLoadCase = GetDistributedLoadCase(load); } else if (load is LoadMoment) { BeamLoadCase = GetMomentLoadCase(load); } return(BeamLoadCase); }
private BeamCase GetCase(LoadBeam load, IAnalysisBeam beam) { this.beam = beam as BeamFixedFixed; BeamCase BeamLoadCase = null; if (load is LoadConcentrated) { BeamLoadCase = GetConcentratedLoadCase(load); } else if (load is LoadDistributed) { BeamLoadCase = GetDistributedLoadCase(load); } else if (load is LoadMoment) { BeamLoadCase = GetMomentLoadCase(load); } return BeamLoadCase; }
public static Dictionary <string, object> BeamDeflections(string BeamDeflectionCaseId, double L, double P, double M, double w, double E, double I, double a_load = 0, double b_load = 0, double c_load = 0, double P1 = 0, double P2 = 0, double M1 = 0, double M2 = 0) { //Default values double Delta_max = 0; //Calculation logic: BeamFactoryData dat = new BeamFactoryData(L, P, M, w, a_load, b_load, c_load, P1, P2, M1, M2, E, I); BeamLoadFactoryLocator loc = new BeamLoadFactoryLocator(); IBeamLoadFactory loadFactory = loc.GetLoadFactory(BeamDeflectionCaseId, dat); LoadBeam load = loadFactory.GetLoad(BeamDeflectionCaseId); BeamInstanceFactory beamFactory = new BeamInstanceFactory(dat); IAnalysisBeam bm = beamFactory.CreateBeamInstance(BeamDeflectionCaseId, load, null); Delta_max = bm.GetMaximumDeflection(); return(new Dictionary <string, object> { { "Delta_max", Delta_max } }); }
public static Dictionary <string, object> BeamForces(string BeamForcesCaseId, double L, double X = 0, double P = 0, double M = 0, double w = 0, double a_load = 0, double b_load = 0, double c_load = 0, double P1 = 0, double P2 = 0, double M1 = 0, double M2 = 0) { //Default values double M_max = 0; double M_min = 0; double V_max = 0; double M_x = 0; double V_x = 0; //Calculation logic: BeamFactoryData dat = new BeamFactoryData(L, P, M, w, a_load, b_load, c_load, P1, P2, M1, M2); BeamLoadFactoryLocator loc = new BeamLoadFactoryLocator(); IBeamLoadFactory loadFactory = loc.GetLoadFactory(BeamForcesCaseId, dat); LoadBeam load = loadFactory.GetLoad(BeamForcesCaseId); BeamInstanceFactory beamFactory = new BeamInstanceFactory(dat); IAnalysisBeam bm = beamFactory.CreateBeamInstance(BeamForcesCaseId, load, null); M_x = bm.GetMoment(X); V_x = bm.GetShear(X); M_max = bm.GetMomentMaximum().Value; M_min = bm.GetMomentMinimum().Value; V_max = bm.GetShearMaximumValue().Value; return(new Dictionary <string, object> { { "M_max", M_max } , { "M_min", M_min } , { "V_max", V_max } , { "M_x", M_x } , { "V_x", V_x } }); }
public ISingleLoadCaseBeam GetForceCase(LoadBeam load, IAnalysisBeam beam) { BeamCase bc = GetCase(load, beam); return(bc.ForceCase); }
public static void CreateEntry(string ValueName, double Value, BeamTemplateType TemplateType, int SubTypeIndex, Dictionary <string, double> DependencyValues, string CaseId, IAnalysisBeam beam, bool AddMax = false, bool AddMin = false) { ICalcLogEntry Entry = new CalcLogEntry(); Entry.ValueName = ValueName; Entry.VariableValue = Math.Round(Value, 3).ToString(); if (DependencyValues != null) { foreach (var depVal in DependencyValues) { Entry.AddDependencyValue(depVal.Key, Math.Round(depVal.Value, 3)); } } if (AddMax == true) { Entry.AddDependencyValue("Maximum", "Maximum"); Entry.AddDependencyValue("maximum", "Maximum"); } if (AddMin == true) { Entry.AddDependencyValue("Maximum", "Minimum"); Entry.AddDependencyValue("maximum", "Minimum"); } Entry.AddDependencyValue("CF", "1728"); Entry.Reference = ""; //Entry.DescriptionReference = beam.ResourceLocator.GetTemplatePath(TemplateType, CaseId, SubTypeIndex); Entry.FormulaID = null; //reference to formula from code //beam.Log.AddEntry(Entry); // this bypasses the check for LogMode beam.AddToLog(Entry); }
public ISingleLoadCaseBeam GetForceCase(LoadBeam load, IAnalysisBeam beam) { BeamCase bc = GetCase(load, beam); return bc.ForceCase; }