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); }
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); }