Esempio n. 1
0
        /// <summary>
        /// Identify secondary structure: All members spanning directly between primary members
        /// </summary>
        /// <param name="members">The list of members to process (all members minus the primary members)</param>
        /// <returns>The list of members identified as being part of the secondary structure</returns>
        private IEnumerable <Beam> GetSecondarySupportStructure(IEnumerable <Member> Members)
        {
            HashSet <Beam> secondaryStructure;

            secondaryStructure = new HashSet <Beam>();
            foreach (var member in Members.Where(m => this.PrimaryMembers.SelectMany(pm => pm.ConnectedMembers).Contains(m)))
            {
                int primaryCount;
                IEnumerable <Member> parallelMembers;
                IEnumerable <Member> spanningMembers;

                parallelMembers = MemberHelpers.GatherParallelMembers(member);
                spanningMembers = this.GatherMembersBetweenPrimaryMembers(member, parallelMembers).ToList();
                primaryCount    = spanningMembers.SelectMany(m => m.Nodes).Distinct().Count(n => n.ConnectedBeams.Any(b => this.PrimaryBeams.Contains(b)));
                if (primaryCount >= 2)
                {
                    secondaryStructure.UnionWith(spanningMembers.SelectMany(m => m.Beams));
                }
            }

            return(secondaryStructure.ToList());
        }
Esempio n. 2
0
        /// <summary>
        /// Identify primary structure: All members spanning directly between columns
        /// </summary>
        /// <param name="members">The list of members to process (all members)</param>
        /// <returns>The list of members identified as being part of the primary structure</returns>
        private IEnumerable <Beam> GetPrimarySupportStructure(IEnumerable <Member> Members)
        {
            IEnumerable <Member> columns;
            HashSet <Beam>       primaryStructure;
            HashSet <Member>     processedMembers;

            primaryStructure = new HashSet <Beam>();
            processedMembers = new HashSet <Member>();

            // Identify primary structure: All members spanning directly between columns
            columns = Members.Where(m => m.Type == MemberType.COLUMN);
            foreach (var column in columns)
            {
                primaryStructure.UnionWith(column.Beams);
                processedMembers.Add(column);
                foreach (var connectedMember in column.ConnectedMembers.Except(processedMembers))
                {
                    int columnCount;
                    IEnumerable <Member> parallelMembers;
                    IEnumerable <Member> spanningMembers;

                    parallelMembers = MemberHelpers.GatherParallelMembers(connectedMember);

                    spanningMembers = GatherMembersBetweenColumns(connectedMember, parallelMembers);

                    columnCount = spanningMembers.SelectMany(m => m.Nodes).Distinct().Count(n => n.ConnectedMembers.Any(m => m.Type == MemberType.COLUMN));

                    if (columnCount >= 2)
                    {
                        primaryStructure.UnionWith(spanningMembers.SelectMany(m => m.Beams));
                    }

                    processedMembers.UnionWith(spanningMembers);
                }
            }

            return(primaryStructure);
        }