OrderUnconstrainedDofs(Model2D_old model)
        {
            ITable <XNode, StructuralDof, double> constraints = model.Constraints;
            var standardDofs = new DofTable <StructuralDof>();
            var enrichedDofs = new DofTable <EnrichedDof>();
            int dofCounter   = 0;

            foreach (XNode node in model.Nodes)
            {
                // Standard free dofs. No rotational dofs. They can be X or Y. One or both of them may be constrained.
                if (!constraints.Contains(node, StructuralDof.TranslationX))
                {
                    standardDofs[node, StructuralDof.TranslationX] = dofCounter++;
                }
                if (!constraints.Contains(node, StructuralDof.TranslationY))
                {
                    standardDofs[node, StructuralDof.TranslationY] = dofCounter++;
                }

                // Enriched dofs. No rotational dofs. They cannot be constrained.
                foreach (IEnrichmentItem2D enrichment in node.EnrichmentItems.Keys)
                {
                    foreach (EnrichedDof dofType in enrichment.Dofs)
                    {
                        enrichedDofs[node, dofType] = dofCounter++;
                    }
                }
            }
            return(standardDofs, enrichedDofs);
            //TODO: Also return each table's count, by keeping separate counters. This avoids the O(numRows) Table.Count()
        }
        private static (int numStandardDofs, DofTable <StructuralDof> standardDofs) OrderStandardDofs(Model2D_old model)
        {
            ITable <XNode, StructuralDof, double> constraints = model.Constraints;
            var standardDofs = new DofTable <StructuralDof>();
            int counter      = 0;

            foreach (var node in model.Nodes)
            {
                if (!constraints.Contains(node, StructuralDof.TranslationX))
                {
                    standardDofs[node, StructuralDof.TranslationX] = counter++;
                }
                if (!constraints.Contains(node, StructuralDof.TranslationY))
                {
                    standardDofs[node, StructuralDof.TranslationY] = counter++;
                }
            }
            return(counter, standardDofs);
        }
        //Node major ordering
        private static (int standardDofsCount, DofTable <StructuralDof> standardDofs) OrderStandardDofs(
            IDictionary <XNode, HashSet <StructuralDof> > nodalDofTypes, ITable <XNode, StructuralDof, double> constraints)
        {
            var standardDofs = new DofTable <StructuralDof>();
            int counter      = 0;

            foreach (var pair in nodalDofTypes)
            {
                XNode node = pair.Key;
                foreach (StructuralDof dofType in pair.Value)
                {
                    if (!constraints.Contains(node, dofType))
                    {
                        standardDofs[node, dofType] = counter++;
                    }
                }
            }
            return(counter, standardDofs);
        }
        public bool Exists(GenericEntityType entity)
        {
            ITable <GenericEntityType> table = _DataContext.GetTable <GenericEntityType>();

            return(table.Contains(entity));
        }
Exemple #5
0
 public bool Contains(ITable table)
 {
     return(outer.Contains(table) || inner.Contains(table));
 }