/// <summary> /// Determines the maximum admissible step-size in the local chunk of /// cells from <paramref name="i0"/> to /// <paramref name="i0"/> + <paramref name="Length"/>. /// </summary> /// <param name="i0">First cell index</param> /// <param name="Length">Number of cells</param> /// <returns> /// The maximum admissible step-size for explicit time integrators in /// the local chunk of cells from <paramref name="i0"/> to /// <paramref name="i0"/> + <paramref name="Length"/>. /// </returns> public override double GetLocalStepSize(int i0, int Length) { NodeSet evaluationPoints = EvaluationPoints[this.gridData.Cells.GetRefElementIndex(i0)]; // If called via GetGloballyAdmissibleStepSize, these buffers have // already been created with an optimal size if (densityValues == null || densityValues.GetLength(0) < Length) { int maxNoOfNodesPerCell = EvaluationPoints.Max(c => c.NoOfNodes); densityValues = MultidimensionalArray.Create(Length, maxNoOfNodesPerCell); momentumValues = new MultidimensionalArray[CNSEnvironment.NumberOfDimensions]; for (int d = 0; d < CNSEnvironment.NumberOfDimensions; d++) { momentumValues[d] = MultidimensionalArray.Create(Length, maxNoOfNodesPerCell); } energyValues = MultidimensionalArray.Create(Length, maxNoOfNodesPerCell); } workingSet.Density.Evaluate(i0, Length, evaluationPoints, densityValues, 0.0); for (int d = 0; d < CNSEnvironment.NumberOfDimensions; d++) { workingSet.Momentum[d].Evaluate(i0, Length, evaluationPoints, momentumValues[d], 0, 0.0); } workingSet.Energy.Evaluate(i0, Length, evaluationPoints, energyValues, 0.0); return(GetCFLStepSize(i0, Length)); }
internal EvaluationPointsBLL MapEvaluationPoint(EvaluationPoints item) { try { EvaluationPointsBLL EvaluationPointBLL = null; if (item != null) { EvaluationPointBLL = new EvaluationPointsBLL() { EvaluationPointID = item.EvaluationPointID, Evaluation = item.Evaluation, EvaluationPoint = (float)item.EvaluationPoint, IsExcludedFromPromotion = item.IsExcludedFromPromotion }; } return(EvaluationPointBLL); } catch { throw; } }