Esempio n. 1
0
        private void InitializeFFTRepulsion(double[] Y, double[] GradT)
        {
            switch (Dims)
            {
            case 1:
                FFTR = new FFTRepulsion1D(Y, GradT, N, PIConfig);
                break;

            case 2:
                FFTR = new FFTRepulsion2D(Y, GradT, N, PIConfig);
                break;

            case 3:
                FFTR = new FFTRepulsion3D(Y, GradT, N, PIConfig);
                break;

            default:
                switch (ChosenRepulsionMethod)
                {
                case RepulsionMethods.fft:
                    throw new NotImplementedException("Polynomial interpolation for dimensionality larger than 3D is not implemented!");

                case RepulsionMethods.auto:
                    Console.WriteLine("Polynomial interpolation for dimensionality larger than 3D is not implemented!");
                    break;
                }
                break;
            }
        }
Esempio n. 2
0
        private void ChooseRepulsionMethod(long[] test_repulsion)
        {
            long min_time = long.MaxValue;

            for (int i = 1; i < test_repulsion.Length; i++)
            {
                if (min_time > test_repulsion[i])
                {
                    min_time = test_repulsion[i];
                    ChosenRepulsionMethod = (RepulsionMethods)i;
                }
            }

            Console.WriteLine("Chosen repulsion method:\t{0}", ChosenRepulsionMethod);

            if (ChosenRepulsionMethod != RepulsionMethods.barnes_hut)
            {
                HST = null;
            }
            if (ChosenRepulsionMethod != RepulsionMethods.fft)
            {
                FFTR = null;
            }
        }