Beispiel #1
0
        /// <summary>
        /// Gather member which provide continuity with the specified member
        /// </summary>
        /// <param name="Member"></param>
        /// <returns></returns>
        public static IEnumerable<Member> GatherParallelMembers(Member Member, Node LastNode = null, bool MoveDownstream = false)
        {
            Node currentNode;
            Member nextMember;
            IEnumerable<Member> connectedParallelMembers;
            HashSet<Member> parallelMembers;

            parallelMembers = new HashSet<Member>();
            if (MoveDownstream)
                parallelMembers.Add(Member);

            // Determine which will be the next node
            currentNode = MemberHelpers.DetermineNextNode(Member, LastNode, MoveDownstream);

            connectedParallelMembers = currentNode.ConnectedBeams.Select(b => b.Member).Where(m => m != null && m != Member && m.DetermineMemberRelation(Member) == MEMBERRELATION.PARALLEL);
            if (connectedParallelMembers.Any())
            {
                nextMember = connectedParallelMembers.First();
                parallelMembers.UnionWith(GatherParallelMembers(nextMember, currentNode, MoveDownstream));
            }
            else
            {
                if (!MoveDownstream)
                    parallelMembers.UnionWith(GatherParallelMembers(Member, currentNode, true));
            }

            return parallelMembers;
        }
Beispiel #2
0
        /// <summary>
        /// Determine the next node to go to on the specified member, depending on which the last node was
        /// </summary>
        /// <param name="Beam">The member to inspect</param>
        /// <param name="LastNode">The previously visited node</param>
        /// <param name="MoveDownstream">The direction in which to move along the member</param>
        /// <returns>The next node</returns>
        public static Node DetermineNextNode(Member Member, Node LastNode = null, bool MoveDownstream = false)
        {
            Node currentNode;

            // Determine which will be the next node depending on the beam orientation and direction of travel
            if (MoveDownstream)
            {
                currentNode = Member.EndNode;
                if (LastNode != null && LastNode == Member.EndNode)
                    currentNode = Member.StartNode;
            }
            else
            {
                currentNode = Member.StartNode;
                if (LastNode != null && LastNode == Member.StartNode)
                    currentNode = Member.EndNode;
            }

            return currentNode;
        }
 public MemberGeneratorStatusUpdateEventArgs(string Status = "", double CompletionRate = 0, Member CurrentMember = null)
 {
     this.Status = Status;
     this.CompletionRate = CompletionRate;
     this.CurrentMember = CurrentMember;
 }
Beispiel #4
0
        public bool Equals(Member m)
        {
            if ((object)m == null)
                return false;

            return this.ID == m.ID;
        }
Beispiel #5
0
 public MEMBERRELATION DetermineMemberRelation(Member Member)
 {
     switch (this.Beams.First().DetermineBeamRelationship(Member.Beams.First()))
     {
         case BEAMRELATION.PARALLEL:
             return MEMBERRELATION.PARALLEL;
         case BEAMRELATION.ORTHOGONAL:
             return MEMBERRELATION.ORTHOGONAL;
         case BEAMRELATION.OTHER:
         default:
             return MEMBERRELATION.OTHER;
     }
 }
        /// <summary>
        /// Gather all members within the specified chain which connect between two primary members, centred on the specified member
        /// </summary>
        /// <param name="Member">The member on which to base the chain</param>
        /// <param name="ParallelMembers">All the members which provide continuity with the specified member</param>
        /// <param name="LastNode">The last visited node (leave blank at the start)</param>
        /// <param name="MoveDownstream">The direction in which to move next (leave blank at start)</param>
        /// <returns>A list of parallel members spanning between two primary members</returns>
        private IEnumerable<Member> GatherMembersBetweenPrimaryMembers(Member Member, IEnumerable<Member> ParallelMembers, Node LastNode = null, bool MoveDownstream = false)
        {
            bool endHere;
            Node currentNode;
            Member nextMember;
            HashSet<Member> members;

            members = new HashSet<Member>() { Member };

            // Determine the next node depending on the beam orientation with regards to the direction of travel
            currentNode = MemberHelpers.DetermineNextNode(Member, LastNode, MoveDownstream);

            // Check if the member is connected to a primary member
            endHere = currentNode.ConnectedBeams.Any(b => this.PrimaryBeams.Contains(b));

            // Get the next member
            nextMember = null;
            if (!endHere)
            {
                if (!currentNode.ConnectedMembers.Intersect(ParallelMembers).Where(m => m != Member).Any())
                    nextMember = null;
                else
                    nextMember = currentNode.ConnectedMembers.Intersect(ParallelMembers).First(m => m != Member);
            }
            endHere = nextMember == null;

            if (endHere)
            {
                if (!MoveDownstream)
                    members.UnionWith(this.GatherMembersBetweenPrimaryMembers(Member, ParallelMembers, currentNode, true));
            }
            else
            {
                IEnumerable<Member> output = this.GatherMembersBetweenPrimaryMembers(nextMember, ParallelMembers, currentNode, MoveDownstream);
                if (MoveDownstream)
                    members.UnionWith(output);
            }

            return members;
        }
        /// <summary>
        /// Gather member which provide continuity with the specified member, i.e. are parallel and unreleased, between columns.
        /// </summary>
        /// <param name="Member"></param>
        /// <returns></returns>
        private IEnumerable<Member> GatherMembersBetweenColumns(Member Member, IEnumerable<Member> ParallelMembers, Node LastNode = null, bool MoveDownstream = false)
        {
            bool endHere;
            Node currentNode;
            Beam nextBeam;
            Member nextMember;
            List<Member> members;

            members = new List<Member>() {Member};

            // Determine the next node depending on the beam orientation with regards to the direction of travel
            currentNode = MemberHelpers.DetermineNextNode(Member, LastNode, MoveDownstream);

            // Check if the member is released
            endHere = currentNode.ConnectedBeams.Intersect(Member.Beams).Any(b => b.HasReleases);

            // Get the next member
            nextMember = null;
            if (!endHere)
            {
                if (!currentNode.ConnectedMembers.Intersect(ParallelMembers).Where(m => m != Member).Any())
                    nextMember = null;
                else
                    nextMember = currentNode.ConnectedMembers.Intersect(ParallelMembers).First(m => m != Member);
            }
            endHere = nextMember == null;

            // Get the next beam
            nextBeam = nextMember == null ? null : currentNode.ConnectedBeams.Intersect(nextMember.Beams).First();

            // Check if the next Beam is released right after the current node
            if (!endHere)
                endHere = currentNode == nextBeam.StartNode ? nextBeam.StartRelease.IsReleased : nextBeam.EndRelease.IsReleased;

            // Check if the member connects to a column
            if (!endHere && currentNode.ConnectedMembers.Any(m => m.Type == MEMBERTYPE.COLUMN))
                if (nextBeam != null && nextBeam.SectionProperty != currentNode.ConnectedBeams.Intersect(Member.Beams).First().SectionProperty)
                    endHere = true;

            // Determine what to do depending on whether or not the chain stop here. if moving upstream, reverse and start gathering beams,
            // if moving upstream, return the chain.
            if (endHere)
            {
                if (!MoveDownstream)
                    members.AddRange(this.GatherMembersBetweenColumns(Member, ParallelMembers, currentNode, true));
            }
            else
            {
                IEnumerable<Member> output = this.GatherMembersBetweenColumns(nextMember, ParallelMembers, currentNode, MoveDownstream);
                if (MoveDownstream)
                    members.AddRange(output);
            }

            return new HashSet<Member>(members).ToList();
        }
        /// <summary>
        /// Determine the class of the specified member
        /// </summary>
        private MEMBERCLASS DetermineMemberClass(Member Member)
        {
            MEMBERCLASS memberClass;

            if (this.PrimaryMembers.Contains(Member))
                memberClass = MEMBERCLASS.PRIMARY;
            else if (this.SecondaryMembers.Contains(Member))
                memberClass = MEMBERCLASS.SECONDARY;
            else if (this.TertiaryMembers.Contains(Member))
                memberClass = MEMBERCLASS.TERTIARY;
            else
                memberClass = MEMBERCLASS.UNSPECIFIED;

            return memberClass;
        }
        private bool CheckMemberRestraint(Member MemberToCheck, Beam StartBeam, MEMBERCLASS MemberClass)
        {
            bool output;
            HashSet<Node> nodes;

            // Gather all nodes connected to the beam to check or any beams parallel to it
            nodes = new HashSet<Node>(BeamHelpers.GatherParallelBeams(StartBeam).SelectMany(b => new List<Node>() { b.StartNode, b.EndNode}));

            // Check if any of the connected members are class above the current member
            IEnumerable<Member> connectedMembers = nodes.SelectMany(n => n.ConnectedMembers).Where(m => m != null && m != MemberToCheck);
            if (MemberClass == MEMBERCLASS.PRIMARY)
                output = connectedMembers.Any(m => this.PrimaryMembers.Contains(m));
            else if (MemberClass == MEMBERCLASS.SECONDARY)
                output = connectedMembers.Any(m => this.PrimaryMembers.Contains(m) || this.SecondaryMembers.Contains(m));
            else if (MemberClass == MEMBERCLASS.TERTIARY)
                output = connectedMembers.Any(m => this.PrimaryMembers.Contains(m) || this.SecondaryMembers.Contains(m) || this.TertiaryMembers.Contains(m));
            else
                output = false;

            return output;
        }
        private IEnumerable<BucklingLength> CalculateMemberUnsupportedLength(Member Member)
        {
            Node currentNode;
            BucklingLength currentBucklingLength;
            List<BucklingLength> bucklingLengths;
            MEMBERCLASS memberClass;

            bucklingLengths = new List<BucklingLength>();

            memberClass = this.DetermineMemberClass(Member);

            currentNode = Member.StartNode;
            currentBucklingLength = new BucklingLength();
            foreach (Beam beam in Member.Beams)
            {
                currentBucklingLength.Beams.Add(beam);
                currentNode = (currentNode == beam.StartNode) ? beam.EndNode : beam.StartNode;

                foreach (Beam connectedBeam in currentNode.ConnectedBeams.Where(cb => !Member.Beams.Contains(cb) && cb.Spec != BEAMSPEC.MEMBERTRUSS))
                {
                    double connectionAngle;
                    bool memberInPlaneWithAxis;

                    memberInPlaneWithAxis = beam.CheckIBeamInAxisPlane(connectedBeam, BEAMAXIS.MAJOR);
                    connectionAngle = Math.Abs((beam.GetAngleRelativeToBeamAxis(connectedBeam, BEAMAXIS.MAJOR) + 90) % 180 - 90);

                    if (memberInPlaneWithAxis || (!memberInPlaneWithAxis && connectionAngle <= 45))
                        if (CheckMemberRestraint(Member, connectedBeam, memberClass))
                        {
                            if (currentBucklingLength.Beams.Count > 1)
                                bucklingLengths.Add(currentBucklingLength);
                            currentBucklingLength = new BucklingLength();
                            break;
                        }
                }
            }
            if (currentBucklingLength.Beams.Count > 1)
                bucklingLengths.Add(currentBucklingLength);

            bucklingLengths.ForEach(bl => bl.Member = Member);
            return bucklingLengths;
        }
        private IEnumerable<BucklingLength> CalculateMemberBucklingLengths(Member Member, BEAMAXIS Axis)
        {
            Node currentNode;
            BucklingLength currentBucklingLength;
            List<BucklingLength> bucklingLengths;
            MEMBERCLASS memberClass;

            bucklingLengths = new List<BucklingLength>();

            memberClass = this.DetermineMemberClass(Member);

            currentNode = Member.StartNode;
            currentBucklingLength = new BucklingLength();
            foreach (Beam beam in Member.Beams)
            {
                currentBucklingLength.Beams.Add(beam);
                // Determine the next node in case one of the beams is flipped
                currentNode = (currentNode == beam.StartNode) ? beam.EndNode : beam.StartNode;

                // Loop through connected beams to see if one of them is a stability brace
                foreach (Beam connectedBeam in currentNode.ConnectedBeams.Where(b => !Member.Beams.Contains(b) && this.StabilityBraces.Contains(b)))
                {
                    double connectionAngle;
                    bool memberInPlaneWithAxis;
                    BEAMAXIS checkAxis;

                    // Check the connection plane and angle of the brace
                    checkAxis = Axis == BEAMAXIS.MAJOR ? BEAMAXIS.MINOR : BEAMAXIS.MAJOR;
                    memberInPlaneWithAxis = beam.CheckIBeamInAxisPlane(connectedBeam, checkAxis);
                    connectionAngle = Math.Abs((beam.GetAngleRelativeToBeamAxis(connectedBeam, checkAxis) + 90) % 180 - 90);

                    // Split the member if the brace connects in the correct place or within 45 of that plane
                    if (memberInPlaneWithAxis || (!memberInPlaneWithAxis && connectionAngle <= 45))
                    {
                        if (currentBucklingLength.Beams.Count > 1)
                            bucklingLengths.Add(currentBucklingLength);
                        currentBucklingLength = new BucklingLength();
                        break;
                    }
                }
            }
            if (currentBucklingLength.Beams.Count > 1)
                bucklingLengths.Add(currentBucklingLength);

            bucklingLengths.ForEach(bl => bl.Member = Member);

            return bucklingLengths;
        }