Ejemplo n.º 1
0
 public FLS_Timestepper_AB(FourierLevSetControl Control, double[] currentState, DelComputeChangerate _DelCompChange, DelEvolveFourier _DelEvolveFourier, int ABorder)
     : base(Control, currentState, _DelCompChange, _DelEvolveFourier)
 {
     ABsc_chain = new ABSchemeCoeff[ABorder];
     for (int i = 0; i < ABorder; i++)
     {
         ABsc_chain[i] = ABSchemeCoeff.AB(i + 1);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Control"></param>
        /// <param name="currentState"></param>
        public FourierLevSetTimestepper(FourierLevSetControl Control, RungeKuttaScheme _RKscheme, double[] currentState, DelComputeChangerate _DelCompChange, DelEvolveFourier _DelEvolveFourier)
        {
            this.Timestepper      = Control.Timestepper;
            this.RKscheme         = _RKscheme;
            this.underrelaxation  = Control.UnderRelax;
            this.DelCompChange    = _DelCompChange;
            this.DelEvolveFourier = _DelEvolveFourier;

            current_FLSproperty = currentState;
        }
Ejemplo n.º 3
0
        /// <summary>
        ///  Main Method of the FactoryClass for <see cref="FourierLevSetBase"/>, creating the instance specified in the <paramref name="Control"/>
        /// </summary>
        /// <param name="Control"></param>
        /// <returns></returns>
        public static FourierLevSetBase Build(FourierLevSetControl Control)
        {
            switch (Control.FType)
            {
            case FourierType.Planar:
                return(new PlanarFourierLevSet(Control));

            case FourierType.Polar:
                return(new PolarFourierLevSet(Control));

            default: throw new ArgumentException();
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Ctr
        /// </summary>
        public PlanarFourierLevSet(FourierLevSetControl Control) : base(Control)
        {
            setProjectingFourierModes();

            // set the material sample points
            current_interfaceP = new MultidimensionalArray(2);
            current_interfaceP.Allocate(numFp, 2);
            for (int sp = 0; sp < numFp; sp++)
            {
                current_interfaceP[sp, 0] = FourierP[sp];
                current_interfaceP[sp, 1] = current_samplP[sp];
            }
            setInterfaceLength(current_interfaceP);
            InterfaceResolution = interfaceLength / numFp;
        }
Ejemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Control"></param>
        /// <returns></returns>
        public static FourierLevSetTimestepper Build_Timestepper(FourierLevSetControl Control, double[] currentState, DelComputeChangerate _DelCompChange, DelEvolveFourier _DelEvolveFourier)
        {
            RungeKuttaScheme RKscheme;

            switch (Control.Timestepper)
            {
            case FourierLevelSet_Timestepper.ExplicitEuler:
                RKscheme = RungeKuttaScheme.ExplicitEuler;
                break;

            case FourierLevelSet_Timestepper.Middlepoint:
                RKscheme = RungeKuttaScheme.Middlepoint;
                break;

            case FourierLevelSet_Timestepper.RungeKutta1901:
                RKscheme = RungeKuttaScheme.RungeKutta1901;
                break;

            case FourierLevelSet_Timestepper.ThreeOverEight:
                RKscheme = RungeKuttaScheme.ThreeOverEight;
                break;

            case FourierLevelSet_Timestepper.Heun:
                RKscheme = RungeKuttaScheme.Heun2;
                break;

            case FourierLevelSet_Timestepper.Heun3:
                RKscheme = RungeKuttaScheme.Heun;
                break;

            case FourierLevelSet_Timestepper.TVD3:
                RKscheme = RungeKuttaScheme.TVD3;
                break;

            case FourierLevelSet_Timestepper.RungeKutta3:
                RKscheme = RungeKuttaScheme.RungeKutta3;
                break;

            default:
                throw new ArgumentException();
            }
            return(new FourierLevSetTimestepper(Control, RKscheme, currentState, _DelCompChange, _DelEvolveFourier));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Initiate the Series
        /// </summary>
        /// <param name="Control">Control Options for the FourierLevSet</param>
        protected FourierLevSetBase(FourierLevSetControl Control)
        {
            this.control = Control;

            this.FourierP       = Control.FourierP;
            this.current_samplP = Control.samplP;
            this.numFp          = FourierP.Length;
            this.DomainSize     = Control.DomainSize;
            this.h_min          = Control.h_min;
            this.mode           = Control.mode;
            this.FourierEvolve  = Control.FourierEvolve;

            // set up DFT
            invDFT_coeff = new Complex[numFp];
            for (int sp = 0; sp < numFp; sp++)
            {
                invDFT_coeff[sp] = (Complex)current_samplP[sp];
            }
            DFT       = new DiscreteFourierTransform();
            DFT_coeff = DFT.NaiveForward(invDFT_coeff, FourierOptions.Matlab);
        }
Ejemplo n.º 7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ctrl"></param>
        public PolarFourierLevSet(FourierLevSetControl ctrl) : base(ctrl)
        {
            this.DomainSize = 2 * Math.PI;

            this.center = new MultidimensionalArray(2);
            this.center.Allocate(1, 2);
            this.center[0, 0] = ctrl.center[0];
            this.center[0, 1] = ctrl.center[1];

            this.CenterMove = ctrl.centerMove;

            this.LevSetForm = ctrl.PLevSetForm;

            this.curvComp_extended = ctrl.curvComp_extended;

            // set material polar coordinates
            interfaceP_polar = new MultidimensionalArray(2);
            interfaceP_polar.Allocate(numFp, 2);
            for (int sp = 0; sp < numFp; sp++)
            {
                interfaceP_polar[sp, 0] = FourierP[sp];
                interfaceP_polar[sp, 1] = current_samplP[sp];
            }

            setProjectingFourierModes();

            // set the material sample points (cartesian)
            current_interfaceP = new MultidimensionalArray(2);
            current_interfaceP.Allocate(numFp, 2);
            for (int sp = 0; sp < numFp; sp++)
            {
                current_interfaceP[sp, 0] = center[0, 0] + (interfaceP_polar[sp, 1] * Math.Cos(interfaceP_polar[sp, 0]));
                current_interfaceP[sp, 1] = center[0, 1] + (interfaceP_polar[sp, 1] * Math.Sin(interfaceP_polar[sp, 0]));
            }
            setInterfaceLength(current_interfaceP);
            InterfaceResolution = interfaceLength / numFp;
        }