Ejemplo n.º 1
0
        public static void SaveElements(Dictionary <Guid, Element> elements)
        {
            var serialized = new ElementsDictionary
            {
                dictionary = elements.ToDictionary(x => x.Key.ToString(), x => x.Value.ToSerializable())
            };

            Save(serialized, OpenedElementsFileName);
        }
Ejemplo n.º 2
0
        public int CountOf(params string[] elements)
        {
            elements = elements.Select(x => x.ToLower()).ToArray();
            int counter = 0;

            foreach (var element in elements)
            {
                if (ElementsDictionary.TryGetValue(element, out int val))
                {
                    counter += val;
                }
            }
            return(counter);
        }
Ejemplo n.º 3
0
 //What is the purpose of this method? If someone wanted to clear the Model, they could just create a new one.
 public void Clear()
 {
     Loads.Clear();
     ClustersDictionary.Clear();
     SubdomainsDictionary.Clear();
     ElementsDictionary.Clear();
     NodesDictionary.Clear();
     GlobalDofOrdering = null;
     Constraints.Clear();
     ElementMassAccelerationHistoryLoads.Clear();
     ElementMassAccelerationLoads.Clear();
     MassAccelerationHistoryLoads.Clear();
     MassAccelerationLoads.Clear();
 }
Ejemplo n.º 4
0
 public ISet <string> OccurMoreThan(int n)
 {
     return(new SortedSet <string>(ElementsDictionary.Where(kvp => kvp.Value > n).Select(kvp => kvp.Key)));
 }