コード例 #1
0
        private BaseDyadCoordinate <Complex, ComplexCalculator> setDiagonalElements(
            DispersionParameter dispersion,
            double radius,
            CartesianCoordinate exyz)
        {
            double medRef = dispersion.MediumRefractiveIndex * dispersion.MediumRefractiveIndex;//this is correct

            Complex eps = this.mediumManager.GetEpsilon(dispersion, radius);

            // Complex value inverted to Clausius-Mossotti polarization.
            Complex clausiusMosottiPolar = (eps - 1.0 * medRef) / (eps + 2.0 * medRef);
            Complex multiplier           = Complex.Reciprocal(clausiusMosottiPolar);

            double volumeFactorInverted = 1 / (radius * radius * radius);
            var    complex =
                new DyadCoordinate <Complex, ComplexCalculator>(multiplier * volumeFactorInverted);

            double kmod      = dispersion.WaveVector.Norm;
            double radiation = 2.0 / 3.0 * kmod * kmod * kmod; // доданок, що відповідає за релаксаційне випромінювання.

            var radiativeReaction =
                new DyadCoordinate <Complex, ComplexCalculator>(Complex.ImaginaryOne * radiation);

            BaseDyadCoordinate <Complex, ComplexCalculator> surfaceInteraction = SurfaceInteractionCoeff(dispersion, exyz);

            return(complex - radiativeReaction + surfaceInteraction);
        }
コード例 #2
0
        private BaseDyadCoordinate <Complex, ComplexCalculator> setNonDiagonalElements(
            DispersionParameter dispersion,
            CartesianCoordinate displacement)
        {
            double rmod  = displacement.Norm;
            double rmod2 = rmod * rmod;
            double rmod3 = rmod2 * rmod;

            double kmod = dispersion.WaveVector.Norm;
            double kr   = kmod * rmod;

            BaseDyadCoordinate <Complex, ComplexCalculator> dyadProduct =
                CoordinateExtensions.DyadProduct(ref displacement, ref displacement);

            var initDyad =
                new DiagonalDyadCoordinate <Complex, ComplexCalculator>(rmod2);

            BaseDyadCoordinate <Complex, ComplexCalculator> firstMember = (kmod * kmod) * (dyadProduct - initDyad);


            BaseDyadCoordinate <Complex, ComplexCalculator> secondMember = (1 / rmod2) * (Complex.ImaginaryOne * kr - 1) *
                                                                           (3 * dyadProduct - initDyad);

            Complex multiplier = Complex.FromPolarCoordinates(1 / rmod3, kr);

            return(multiplier * (firstMember + secondMember));
        }