예제 #1
0
        protected override void CreateEquationsAndSolvers(GridUpdateDataVaultBase L)
        {
            SpatialOperator diffOp = new SpatialOperator(1, 0, 1, QuadOrderFunc.MaxDegTimesTwo(), "u", "codom1");

            diffOp.EquationComponents["codom1"].Add(new ScalarTransportFlux());
            diffOp.Commit();

            CustomTimestepConstraint = new SurrogateConstraint(GridData, dt_input, dt_input, double.MaxValue, endTime);

            if (LTS)
            {
                AdamsBashforthLTS ltsTimeStepper = new AdamsBashforthLTS(
                    diffOp,
                    new CoordinateMapping(u),
                    null,
                    ABorder,
                    numOfSubgrids,
                    fluxCorrection: true,
                    reclusteringInterval: 0,
                    timeStepConstraints: new List <TimeStepConstraint>()
                {
                    CustomTimestepConstraint
                });
                timeStepper = ltsTimeStepper;
            }
            else if (ALTS)
            {
                AdamsBashforthLTS ltsTimeStepper = new AdamsBashforthLTS(
                    diffOp,
                    new CoordinateMapping(u),
                    null,
                    ABorder,
                    numOfSubgrids,
                    fluxCorrection: false,
                    reclusteringInterval: 1,
                    timeStepConstraints: new List <TimeStepConstraint>()
                {
                    CustomTimestepConstraint
                });
                timeStepper = ltsTimeStepper;
            }
            else
            {
                timeStepper = new AdamsBashforth(diffOp, new CoordinateMapping(u), null, ABorder);
                //timeStepper = new RungeKutta(RungeKutta.RungeKuttaScheme.Heun, diffOp, new CoordinateMapping(u),null);
                //timeStepper = RungeKutta.Factory(ABorder, diffOp, new CoordinateMapping(u));
            }
        }