Пример #1
0
 private void CalculatePressure(LoadProvider provider, PressureBoundaryCondition condition, Dictionary <int, double> load)
 {
     foreach (Element element in ElementsDictionary.Values)
     {
         foreach (int dof in provider.LoadPressure(element, this, condition).Keys)
         {
             if (load.ContainsKey(dof))
             {
                 load[dof] += provider.LoadPressure(element, this, condition)[dof];
             }
             else
             {
                 load.Add(dof, provider.LoadPressure(element, this, condition)[dof]);
             }
         }
     }
 }
Пример #2
0
        private Dictionary <int, double> CalculateLoadingCondition(LoadingCondition loading)
        {
            LoadProvider provider = new LoadProvider();

            if (ElementsDictionary.Count == 0)
            {
                CreateFaceElements();
            }
            Dictionary <int, double> load = new Dictionary <int, double>();

            if (loading is NeumannBoundaryCondition)
            {
                foreach (Element element in ElementsDictionary.Values)
                {
                    foreach (int dof in provider.LoadNeumann(element, this, loading as NeumannBoundaryCondition).Keys)
                    {
                        if (load.ContainsKey(dof))
                        {
                            load[dof] += provider.LoadNeumann(element, this, loading as NeumannBoundaryCondition)[dof];
                        }
                        else
                        {
                            load.Add(dof, provider.LoadNeumann(element, this, loading as NeumannBoundaryCondition)[dof]);
                        }
                    }
                }
            }
            else if (loading is PressureBoundaryCondition)
            {
                foreach (Element element in ElementsDictionary.Values)
                {
                    foreach (int dof in provider.LoadPressure(element, this, loading as PressureBoundaryCondition).Keys)
                    {
                        if (load.ContainsKey(dof))
                        {
                            load[dof] += provider.LoadPressure(element, this, loading as PressureBoundaryCondition)[dof];
                        }
                        else
                        {
                            load.Add(dof, provider.LoadPressure(element, this, loading as PressureBoundaryCondition)[dof]);
                        }
                    }
                }
            }
            return(load);
        }