Пример #1
0
        private double SetUpConfiguration()
        {
            testCase.UpdateLevelSet(levelSet);
            levelSetTracker.UpdateTracker(__NearRegionWith: 0, incremental: false, __LevSetAllowedMovement: 2);

            XDGField.Clear();
            XDGField.GetSpeciesShadowField("A").ProjectField(
                1.0, testCase.JumpingFieldSpeciesAInitialValue, default(CellQuadratureScheme));
            XDGField.GetSpeciesShadowField("B").ProjectField(
                1.0, testCase.JumpingFieldSpeciesBInitialValue, default(CellQuadratureScheme));

            SinglePhaseField.Clear();
            SinglePhaseField.ProjectField(testCase.ContinuousFieldInitialValue);

            double referenceValue = testCase.Solution;

            if (testCase is IVolumeTestCase)
            {
                QuadRule standardRule = Grid.RefElements[0].GetQuadratureRule(2 * XDGField.Basis.Degree + 1);
                ScalarFieldQuadrature uncutQuadrature = new ScalarFieldQuadrature(
                    GridData,
                    XDGField,
                    new CellQuadratureScheme(
                        new FixedRuleFactory <QuadRule>(standardRule),
                        levelSetTracker.Regions.GetCutCellSubGrid().Complement().VolumeMask),
                    standardRule.OrderOfPrecision);
                uncutQuadrature.Execute();

                referenceValue -= uncutQuadrature.Result;
            }

            return(referenceValue);
        }
Пример #2
0
        private double PerformVolumeQuadrature(Modes mode, IQuadRuleFactory <QuadRule> factory, SubGrid cutCellGrid, int order, Stopwatch timer)
        {
            using (new FuncTrace()) {
                ScalarFieldQuadrature quadrature;
                CellQuadratureScheme  quadInstr = new CellQuadratureScheme(
                    factory, cutCellGrid.VolumeMask);
                if (testCase is ISurfaceTestCase)
                {
                    quadrature = new ScalarFieldQuadrature(GridData, SinglePhaseField, quadInstr, order);
                }
                else
                {
                    quadrature = new ScalarFieldQuadrature(GridData, XDGField, quadInstr, order);
                }

                timer.Start();
                quadrature.Execute();
                timer.Stop();

                return(quadrature.Result);
            }
        }