public double GetResultsArea(RealPoint point)
        {
            double result = 0.0;

            foreach (var area in this.Areas)
            {
                foreach (var segmentI in area.Segments)
                {
                    int i = 0;
                    foreach (var collPointI in segmentI.CollocationPoints)
                    {
                        var functionT = Function_T.CalculateAreaValue(point, segmentI, collPointI, area.configurationData);
                        var functionq = Function_q.CalculateAreaValue(point, segmentI, collPointI, area.configurationData);

                        result += -functionq * segmentI.TemperatureBoundaryCondition.BoundaryConditionVector[i] + functionT * segmentI.HeatFluxBoundaryCondition.BoundaryConditionVector[i];
                        i++;
                    }
                }
            }
            foreach (var area in this.Areas)
            {
                var initial = InitialCondition.CalculateValue(area, point);
                result += initial;

                if (area.configurationData.addHeatSource)
                {
                    var subAreaIntegrationHelper = new SubAreaIntegrationHelper(4, area.Surfaces.Select(x => x.SurfaceShape).ToList());
                    result += HeatSource.CalculateValue(area, point, subAreaIntegrationHelper);
                }
            }

            return(result);
        }
        public double GetTemperatureFromSurfaceIntegrationPointConstants(SurfaceIntegrationPoint point)
        {
            double result = 0.0;

            int j = 0;

            foreach (var area in this.Areas)
            {
                foreach (var segment in area.Segments)
                {
                    foreach (var collPoint in segment.CollocationPoints)
                    {
                        result += -point.FunctionqConstantValue[j] * segment.TemperatureBoundaryCondition.BoundaryConditionVector[collPoint.Index] + point.FunctionTConstantValue[j] * segment.HeatFluxBoundaryCondition.BoundaryConditionVector[collPoint.Index];
                        j++;
                    }
                }
            }
            int k = 0;

            foreach (var area in this.Areas)
            {
                //To tradycyjnie
                result += InitialCondition.CalculateValue(area, point.RealPosition);

                //To w przypadku przechowywania parametrów
                //foreach (var surface in this.Surfaces)
                //{
                //    foreach (var surfaceIntegrationPoint in surface.SurfaceIntegrationPoints)
                //    {
                //        value += point.InitialConditionConstantValues[k] * surfaceIntegrationPoint.TemperatureValue;
                //        k++;
                //    }
                //}

                if (area.configurationData.addHeatSource)
                {
                    if (area.configurationData.isHeatSourceTimeDependent)
                    {
                        var subAreaIntegrationHelper = new SubAreaIntegrationHelper(4, area.Surfaces.Select(x => x.SurfaceShape).ToList());

                        result += HeatSource.CalculateValue(area, point.RealPosition, subAreaIntegrationHelper);
                    }
                    else
                    {
                        result += point.HeatSourceConstantValue;
                    }
                }
            }

            return(result);
        }
        public void CalculateSurfaceIntegrationPointsConstants()
        {
            //double denominator1 = InitialCondition.denominator1(configurationData);
            //double denominator2 = InitialCondition.denominator2(configurationData);
            foreach (var area in this.Areas)
            {
                foreach (var surface in area.Surfaces)
                {
                    Parallel.ForEach(surface.InitialConditionSurfaceIntegrationPoints, (surfaceIntegrationPoint) =>
                    {
                        var sur = surfaceIntegrationPoint;
                        foreach (var area1 in this.Areas)
                        {
                            foreach (var segmentI in area1.Segments)
                            {
                                foreach (var collPointI in segmentI.CollocationPoints)
                                {
                                    surfaceIntegrationPoint.FunctionTConstantValue.Add(Function_T.CalculateAreaValue(surfaceIntegrationPoint.RealPosition, segmentI, collPointI, area1.configurationData));
                                    surfaceIntegrationPoint.FunctionqConstantValue.Add(Function_q.CalculateAreaValue(surfaceIntegrationPoint.RealPosition, segmentI, collPointI, area1.configurationData));
                                }
                            }
                        }

                        //To w przypadku przechowywania parametrów
                        //foreach (var innerSurface in this.Surfaces)
                        //{
                        //    foreach (var innerSurfaceIntegrationPoint in innerSurface.SurfaceIntegrationPoints)
                        //    {
                        //        surfaceIntegrationPoint.InitialConditionConstantValues.Add(InitialCondition.CalculateSiglePointFunctionValue(surfaceIntegrationPoint.RealPosition, denominator1, denominator2, innerSurfaceIntegrationPoint));
                        //    }
                        //}

                        if (area.configurationData.addHeatSource)
                        {
                            if (!area.configurationData.isHeatSourceTimeDependent)
                            {
                                var subAreaIntegrationHelper = new SubAreaIntegrationHelper(4, area.Surfaces.Select(x => x.SurfaceShape).ToList());
                                surfaceIntegrationPoint.HeatSourceConstantValue = HeatSource.CalculateValue(area, surfaceIntegrationPoint.RealPosition, subAreaIntegrationHelper);
                            }
                        }
                    });
                }
            }
        }