示例#1
0
        private void InitializeDGElement()
        {
            LegendrePolynomEvaluator.computeGaussLobattoNodesAndWeights(N, out Nodes, out IntegrationWeights);
            InitializeStartSolution();

            BottomBorderValues = new Matrix3D(N + 1, 1, SystemDimension);
            TopBorderValues = new Matrix3D(N + 1, 1, SystemDimension);
            LeftBorderValues = new Matrix3D(N + 1, 1, SystemDimension);
            RightBorderValues = new Matrix3D(N + 1, 1, SystemDimension);

            this.FluxF = new Matrix3D(N + 1, N + 1, SystemDimension);
            this.FluxG = new Matrix3D(N + 1, N + 1, SystemDimension);

            this.UpdateBorderValues();

            S = new Matrix(N + 1, N + 1);
            S[0, 0] = 1.0 / IntegrationWeights[0];
            S[N, N] = -1.0 / IntegrationWeights[N];

            interpolator = new LagrangeInterpolator(Nodes);
            DifferentialMatrix = interpolator.computeLagrangePolynomeDerivativeMatrix();
            DifferentialMatrixTransposed = !DifferentialMatrix;

            J = ((RightXBorder - LeftXBorder) * (TopYBorder - BottomYBorder)) / 4.0;
        }
示例#2
0
        private void InitializeDGWithGaussLobattoNodes()
        {
            fluxEvaluation = new Vector(N + 1);

            LegendrePolynomEvaluator.computeGaussLobattoNodesAndWeights(N, out nodes, out integrationWeights);

            solution = ComputeStartSolution() ;
            this.UpdateBorderValues();

            interpolator = new LagrangeInterpolator(nodes);
            massMatrix = IntegrationToolbox.generateMassMatrix(integrationWeights);

            invMassMatrix = new Matrix(N + 1, N+1);
            for (int i = 0; i < N + 1; i++)
                invMassMatrix[i,i] = 1.0 / massMatrix[i,i];

            differentialMatrix = interpolator.computeLagrangePolynomeDerivativeMatrix();
            B = new Matrix(N + 1, N + 1);
            B[0, 0] = -1.0;
            B[N, N] = 1.0;

            volumeMatrix = invMassMatrix*(!differentialMatrix) * massMatrix;
            surfaceMatrix = invMassMatrix * B;
        }
示例#3
0
        private void InitializeDGWithGaussNodes()
        {
            fluxEvaluation = new Vector(N + 1);

            LegendrePolynomEvaluator.computeLegendreGaussNodesAndWeights(N, out nodes, out integrationWeights);

            solution = ComputeStartSolution();

            interpolator = new LagrangeInterpolator(nodes);
            massMatrix = IntegrationToolbox.generateMassMatrix(integrationWeights);
            this.UpdateBorderValues();

            invMassMatrix = new Matrix(N + 1, N + 1);
            for (int i = 0; i < N + 1; i++)
                invMassMatrix[i, i] = 1.0 / massMatrix[i, i];

            differentialMatrix = interpolator.computeLagrangePolynomeDerivativeMatrix();

            LeftBoarderInterpolation = new Vector(nodes.Length);
            RightBoarderInterpolation = new Vector(nodes.Length);

            for (int i = 0; i < nodes.Length; i++)
            {
                LeftBoarderInterpolation[i] = interpolator.evaluateLagrangePolynome(-1.0, i);
                RightBoarderInterpolation[i] = interpolator.evaluateLagrangePolynome(1.0, i);
            }

            B = new Matrix(N + 1, N + 1);
            for (int i = 0; i <= N; i++)
            {
                B[i, 0] = LeftBoarderInterpolation[i];
                B[i, N] = RightBoarderInterpolation[i];
            }

            volumeMatrix = invMassMatrix * (!differentialMatrix) * massMatrix;
            LeftBoarderInterpolation = invMassMatrix * LeftBoarderInterpolation;
            RightBoarderInterpolation = invMassMatrix * RightBoarderInterpolation;
        }
示例#4
0
        public void Initialize()
        {
            FluxEvaluation = new Matrix(N + 1, SystemDimension);
            LegendrePolynomEvaluator.computeGaussLobattoNodesAndWeights(N, out nodes, out integrationWeights);
            SolutionSystem = ComputeStartSolution();
            LeftBoarderValue = new Vector(SystemDimension);
            RightBoarderValue = new Vector(SystemDimension);

            this.UpdateBorderValues();

            interpolator = new LagrangeInterpolator(nodes);
            MassMatrix = IntegrationToolbox.generateMassMatrix(integrationWeights);

            InvMassMatrix = new Matrix(N + 1, N + 1);
            for (int i = 0; i < N + 1; i++)
                InvMassMatrix[i, i] = 1.0 / MassMatrix[i, i];

            DifferentialMatrix = interpolator.computeLagrangePolynomeDerivativeMatrix();
            B = new Matrix(N + 1, N + 1);
            B[0, 0] = -1.0;
            B[N, N] = 1.0;

            VolumeMatrix = InvMassMatrix * (!DifferentialMatrix) * MassMatrix;
            SurfaceMatrix = InvMassMatrix * B;
        }