private int GetResType(ListProc resultType) { /* * LT_CASE = 1, * LT_CS = 2, (construction stage) * LT_COMB = 3, * ... */ string r = resultType.ToString(); if (r.StartsWith("QuantityEstimation") || r.EndsWith("Utilization") || r.Contains("MaxComb") || r.StartsWith("FeaNode") || r.StartsWith("FeaBar") || r.StartsWith("FeaShell") || r.StartsWith("EigenFrequencies")) { return(0); } if (r.EndsWith("LoadCase")) { return(1); } if (r.EndsWith("LoadCombination")) { return(3); } if (r.StartsWith("NodalVibrationShape")) { return(6); } throw new NotImplementedException($"'restype' index for {r} is not implemented."); }
public Bsc(ListProc resultType, string bscPath, FemDesign.Results.UnitResults unitResult) { if (Path.GetExtension(bscPath) != ".bsc") { throw new ArgumentException($"File path must be '.bsc' but got '{bscPath}'"); } BscPath = Path.GetFullPath(bscPath); Cwd = Path.GetDirectoryName(BscPath); DocTable = new DocTable(resultType, unitResult); FdScriptHeader = new FdScriptHeader("Generated script.", Path.Combine(Cwd, "logfile.log")); CmdEndSession = new CmdEndSession(); SerializeBsc(); }
// Assumption // the method is returning the results every 50 cm for bar elements. // Future Development...Get the user to decide the step ? // It is RUBBISH code developed to Deconstruct the Results public static Options GetOptions(ListProc resultType) { string r = resultType.ToString(); if (r.StartsWith("BarsInternalForces") || r.StartsWith("BarsStresses") || r.StartsWith("BarsDisplacements") || r.StartsWith("LabelledSection")) { return(new Options(1, 0.5)); } else if (r.StartsWith("ShellDisplacement") || r.StartsWith("ShellStress") || r.StartsWith("ShellInternalForce") || r.StartsWith("ShellDerivedForce")) { return(new Options(1, "srf")); } else { return(new Options()); } }
/// <summary> /// DocTable constructor /// </summary> /// <param name="resultType"></param> /// <param name="caseIndex">Defaults to all loadcases or loadcombinations</param> public DocTable(ListProc resultType, int?caseIndex = null) { int cIndex; if (caseIndex.HasValue) { cIndex = caseIndex.Value; } else { cIndex = GetDefaultCaseIndex(resultType); } ListProc = resultType; CaseIndex = cIndex; ResType = GetResType(resultType); Option = Options.GetOptions(resultType); }
private int GetDefaultCaseIndex(ListProc resultType) { string r = resultType.ToString(); if (r.StartsWith("QuantityEstimation") || r.EndsWith("Utilization") || r.Contains("MaxComb") || r.StartsWith("FeaNode") || r.StartsWith("FeaBar") || r.StartsWith("FeaShell") || r.StartsWith("EigenFrequencies")) { return(0); } if (r.EndsWith("LoadCase")) { return(-65536); // All load cases } if (r.EndsWith("LoadCombination") || r.StartsWith("NodalVibrationShape")) { return(-1); // All load combinations } throw new FormatException($"Default case index of ResultType.{resultType} not known."); }
/// <summary> /// DocTable constructor /// </summary> /// <param name="resultType"></param> /// <param name="caseIndex">Defaults to all loadcases or loadcombinations</param> /// <param name="unitResult">Units for Results</param> public DocTable(ListProc resultType, FemDesign.Results.UnitResults unitResult, int?caseIndex = null) : this(resultType, caseIndex) { Units = Results.Units.GetUnits(unitResult); }
public Options(ListProc listProc, double step) { }
public Bsc(ListProc resultType, int caseIndex, string bscPath, FemDesign.Results.UnitResults unitResult) : this(resultType, bscPath, unitResult) { DocTable.CaseIndex = caseIndex; }
public Bsc(ListProc resultType, int caseIndex, string bscPath) : this(resultType, bscPath) { DocTable.CaseIndex = caseIndex; }