public static double CalculateAreaValue(RealPoint resultPoint, Segment segmentI, CollocationPoint collPointI, ConfigurationData configurationData) { double result = 0.0; double denominator2 = Function_q.denominator2(configurationData.GetDiffusionCoefficient(segmentI.TemperatureValue), configurationData.iterationProcess.TimeStep); foreach (var integrationPoint in segmentI.SingularBoundaryIntegrationPointsForArea) { result += CalculateCore(denominator2, resultPoint, integrationPoint, segmentI, collPointI); } return(result); }
public static double[,] CalculateBoundaryMatrix(Area Area) { double[,] matrix = matrix = new double[Area.NumberOfCollocationPoints, Area.NumberOfCollocationPoints]; double denominator2 = Function_q.denominator2(Area.configurationData.GetDiffusionCoefficient(0), Area.configurationData.iterationProcess.TimeStep); int r = 0, i = 0; //Parallel.ForEach(Area.Segments, (segmentR) => foreach (var segmentR in Area.Segments) { foreach (var collPointR in segmentR.CollocationPoints) { foreach (var segmentI in Area.Segments) { if (Area.configurationData.arePropertiesTimeDependent()) { denominator2 = Function_q.denominator2(Area.configurationData.GetDiffusionCoefficient(segmentI.TemperatureValue), Area.configurationData.iterationProcess.TimeStep); } foreach (var collPointI in segmentI.CollocationPoints) { r = Area.Segments.Where(x => x.Index < segmentR.Index).Sum(x => x.CollocationPoints.Count) + collPointR.Index; i = Area.Segments.Where(x => x.Index < segmentI.Index).Sum(x => x.CollocationPoints.Count) + collPointI.Index; double value = 0.0; if (segmentI.Index != segmentR.Index) { foreach (var integrationPoint in segmentI.BoundaryIntegrationPoints) { value -= (double)(CalculateCore(denominator2, collPointR.RealPosition, integrationPoint, segmentI, collPointI)); } } else { if (segmentR.DistanceFromSingularPoint == 0.0) { value -= SigularSeparate(denominator2, segmentR, collPointR, segmentI, collPointI); } else { value -= SigularSeparateWithAnalitycal(denominator2, segmentR, collPointR, segmentI, collPointI); } //value = -SigularAnalitycalMajchrzak(denominator2, segmentR, collPointR, segmentI, collPointI); } matrix[r, i] = value; } } } }//); return(matrix); }