Ejemplo n.º 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]);
             }
         }
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 private void CalculateNeumann(LoadProvider provider, NeumannBoundaryCondition condition, Dictionary <int, double> load)
 {
     foreach (var element in ElementsDictionary.Values)
     {
         var loadNeumann = provider.LoadNeumann(element, this, condition);
         foreach (int dof in loadNeumann.Keys)
         {
             if (load.ContainsKey(dof))
             {
                 load[dof] += loadNeumann[dof];
             }
             else
             {
                 load.Add(dof, loadNeumann[dof]);
             }
         }
     }
 }
Ejemplo n.º 4
0
        private Dictionary <int, double> CalculateLoadingCondition(LoadingCondition loading)
        {
            var provider = new LoadProvider();

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

            switch (loading)
            {
            case NeumannBoundaryCondition condition:
                CalculateNeumann(provider, condition, load);
                break;

            case PressureBoundaryCondition condition:
                CalculatePressure(provider, condition, load);
                break;
            }
            return(load);
        }