Beispiel #1
0
 static bool IsEqual(FrameElementEndForce o1, FrameElementEndForce o2)
 {
     return
         (CompareDouble(o1.ElementIdx, o2.ElementIdx) &&
          CompareDouble(o1.NodeIdx, o2.NodeIdx) &&
          CompareDouble(o1.Nx, o2.Nx) &&
          CompareDouble(o1.Vy, o2.Vy) &&
          CompareDouble(o1.Vz, o2.Vz) &&
          CompareDouble(o1.Txx, o2.Txx) &&
          CompareDouble(o1.Myy, o2.Myy) &&
          CompareDouble(o1.Mzz / 100000, o2.Mzz / 100000));
 }
Beispiel #2
0
        private List <LoadCaseOutput> ParseLines(string frame3DDoutput)
        {
            List <LoadCaseOutput> outputLines = new List <LoadCaseOutput>();
            var reader = new StringReader(frame3DDoutput);

            while (true)
            {
                string currentLine               = ReadUntil(reader, (s) => s.StartsWith("L O A D   C A S E"));
                var    forceLines                = new List <PeakFrameElementInternalForce>();
                var    displacementLines         = new List <NodeDisplacement>();
                var    reactionLines             = new List <ReactionOutput>();
                var    frameElementEndForceLines = new List <FrameElementEndForce>();

                if (currentLine == null)
                {
                    return(outputLines);
                }
                int loadCaseIdx =
                    int.Parse(Regex.Match(currentLine, @"L O A D   C A S E\s*(\d+)\s*O F\s*(\d+)").Groups[1].Value) - 1;

                // node displacements
                if (ReadUntil(reader,
                              s => s.StartsWith("N O D E   D I S P L A C E M E N T S  					(global)")) == null)
                {
                    break;
                }
                if (reader.ReadLine() == null) //skip headers
                {
                    break;
                }
                while (true)
                {
                    var resultLine = NodeDisplacement.FromLine(reader.ReadLine(), loadCaseIdx);
                    if (resultLine == null)
                    {
                        break;
                    }
                    displacementLines.Add(resultLine);
                }

                // frame element end forces
                if (ReadUntil(reader,
                              s => s.Contains("Elmnt")) == null)
                {
                    break;
                }
                while (true)
                {
                    var resultLine = FrameElementEndForce.FromLine(reader.ReadLine(), loadCaseIdx);
                    if (resultLine == null)
                    {
                        break;
                    }
                    frameElementEndForceLines.Add(resultLine);
                }

                // reactions
                if (ReadUntil(reader,
                              s => s.Contains("Node")) == null)
                {
                    break;
                }
                while (true)
                {
                    var resultLine = ReactionOutput.FromLine(reader.ReadLine(), loadCaseIdx);
                    if (resultLine == null)
                    {
                        break;
                    }
                    reactionLines.Add(resultLine);
                }

                // internal forces
                if (ReadUntil(reader,
                              s => s.StartsWith("P E A K   F R A M E   E L E M E N T   I N T E R N A L   F O R C E S")) == null)
                {
                    break;
                }
                if (reader.ReadLine() == null) //skip headers
                {
                    break;
                }
                while (true)
                {
                    var resultLine = PeakFrameElementInternalForce.FromLine(reader.ReadLine(), loadCaseIdx);
                    if (resultLine == null)
                    {
                        break;
                    }
                    forceLines.Add(resultLine);
                }

                outputLines.Add(new LoadCaseOutput(0, displacementLines, frameElementEndForceLines, reactionLines,
                                                   forceLines));
            }
            return(outputLines);
        }