private void AddToQBuffAlongYElectric(IntegralFactors factors, int index) { var buffer = _qBuffer; var seg = _segments.SingleSegment[index]; if (CalculateXx) { FillQ(seg.I2A, buffer.Qxx, factors.D2A); FillQ(seg.I2B, buffer.Qxx, factors.D2B); } if (CalculateYy) { FillQ(seg.I1A, buffer.Qyy, factors.D2A); FillQ(seg.I1B, buffer.Qyy, factors.D2B); } if (CalculateZz) { FillQ(seg.I5A, buffer.Qzz, factors.D2A); FillQ(seg.I5B, buffer.Qzz, factors.D2B); } if (CalculateXy) { FillQ(seg.I1A, buffer.Qxy, factors.D3A); FillQ(seg.I1B, buffer.Qxy, factors.D3B); } if (CalculateXz) { FillQ(seg.I3A, buffer.Qxz, factors.D1A); FillQ(seg.I3B, buffer.Qxz, factors.D1B); } if (CalculateZx) { FillQ(seg.I4A, buffer.Qzx, factors.D1A); FillQ(seg.I4B, buffer.Qzx, factors.D1B); } }
private void AddToQBuffAlongYMagnetic(IntegralFactors factors, int index) { var buffer = _qBuffer; var seg = _segments.SingleSegment[index]; if (CalculateYx) { FillQ(seg.I2A, buffer.Qyx, factors.D2A); FillQ(seg.I2B, buffer.Qyx, factors.D2B); } if (CalculateXy) { FillQ(seg.I1A, buffer.Qxy, factors.D2A); FillQ(seg.I1B, buffer.Qxy, factors.D2B); } if (CalculateXx) { FillQ(seg.I1A, buffer.Qxx, factors.D3A); FillQ(seg.I1B, buffer.Qxx, factors.D3B); } if (CalculateYz) { FillQ(seg.I3A, buffer.Qyz, factors.D1A); FillQ(seg.I3B, buffer.Qyz, factors.D1B); } if (CalculateZy) { FillQ(seg.I4A, buffer.Qzy, factors.D1A); FillQ(seg.I4B, buffer.Qzy, factors.D1B); } }
private void Integrate(Action <IntegralFactors, int> addIntegralSegmentToQ, GreenTensorKnot left, GreenTensorKnot right, double s, double u, double v) { ClearQBuffer(); int i1 = left.Index; int i2 = right.Index; if (i1 == i2) { var factors = IntegralFactors.Prepare(s, u, left.Radius, right.Radius, v); addIntegralSegmentToQ(factors, i1); } else { var r1 = left.Radius; var r2 = _radii[i1 + 1]; var sj = s; var uj = Math.Sqrt(r2 * r2 - v * v); var factors = IntegralFactors.Prepare(sj, uj, r1, r2, v); addIntegralSegmentToQ(factors, i1); for (int i = i1 + 1; i < i2; i++) { r1 = r2; r2 = _radii[i + 1]; sj = uj; uj = Math.Sqrt(r2 * r2 - v * v); factors = IntegralFactors.Prepare(sj, uj, r1, r2, v); addIntegralSegmentToQ(factors, i); } sj = uj; uj = u; r1 = r2; r2 = right.Radius; factors = IntegralFactors.Prepare(sj, uj, r1, r2, v); addIntegralSegmentToQ(factors, i2); } }