public List <Area> CalculateIterationForMultipleAreas() { foreach (var area in this.Problem.Areas) { area.calculateVariableBoundaryConditions(); area.CalculateBoundaryTemperature(); } int j = 0; foreach (var area in this.Problem.Areas) { var areaVector = area.GetKnownBoundaryVector(); foreach (var value in areaVector) { this.vectorF[j++] = value; } } if (Problem.IterationProcess.CurrentIteration == 1 || this.Problem.Areas[0].configurationData.arePropertiesTimeDependent()) { BuildMatrixesForMultipleAreas(); } if (Problem.IterationProcess.CurrentIteration == 1) { Problem.CalculateCollocationPointsConstants(); Problem.CalculateSurfaceIntegrationPointsConstants(); } this.SeparateKnownFromUnknownForMultipleAreas(); this.CalculateKnownVectorForMultipleAreas(); j = 0; foreach (var area in this.Problem.Areas) { var areaVector = InitialCondition.CalculateBoundaryVector(area); foreach (var value in areaVector) { this.initialCondition[j++] = value; } } this.AddInitialConditionForMultipleAreas(); this.SolveEquations(); this.SetUnknownBoundaryConditionsForMultipleAreas(); return(this.Problem.Areas); }
public Area CalculateIterationForSingleArea() { this.Problem.Areas[0].calculateVariableBoundaryConditions(); this.Problem.Areas[0].CalculateBoundaryTemperature(); this.vectorF = this.Problem.Areas[0].GetKnownBoundaryVector(); if (this.Problem.IterationProcess.CurrentIteration == 1 || this.Problem.Areas[0].configurationData.arePropertiesTimeDependent()) { this.matrixT = Function_T.CalculateBoundaryMatrix(this.Problem.Areas[0]); this.matrixq = Function_q.CalculateBoundaryMatrix(this.Problem.Areas[0]); } if (Problem.IterationProcess.CurrentIteration == 1) { Problem.CalculateCollocationPointsConstants(); Problem.CalculateSurfaceIntegrationPointsConstants(); } this.SeparateKnownFromUnknownForSingleArea(); this.CalculateKnownVectorForSingleArea(); //To tradycyjnie this.initialCondition = InitialCondition.CalculateBoundaryVector(this.Problem.Areas[0]); //To w przypadku przechowywania parametrów //this.GetInitialConditionVectorFromCollocationPointsConstants(); this.AddInitialConditionForSingleArea(); if (this.Problem.Areas[0].configurationData.addHeatSource) { if (this.Problem.Areas[0].configurationData.isHeatSourceTimeDependent || this.Problem.IterationProcess.CurrentIteration == 1) { this.heatSource = HeatSource.CalculateBoundaryVector(this.Problem.Areas[0]); } this.AddHeatSource(); } this.SolveEquations(); this.SetUnknownBoundaryConditionsForSingleArea(); return(this.Problem.Areas[0]); }