Exemple #1
0
        public static double[,] ComputeConvectionMatrix(PolyMatrix N, double u, double v, double w, Point Size)
        {
            var ConvectionMatrix = N.Transpose() * (u * N.Differentiate(0) + v * N.Differentiate(1) + w * N.Differentiate(2));
            var Zero             = new Point(); // point that starts at the origin

            return(ConvectionMatrix.Integrate(Zero, Size));
        }
Exemple #2
0
        public static double[] ComputeHeatGenerationMatrix(double G, PolyMatrix N, Point a, Point b)
        {
            var P  = N.Transpose().Integrate(a, b);
            var P1 = new double[P.Length];

            for (int i = 0; i < P1.Length; i++)
            {
                P1 [i] = G * P [i, 0];
            }
            return(P1);
        }
Exemple #3
0
        public static double[,] ComputeConductionMatrix(PolyMatrix B, Point a, Point b, double kx, double ky, double kz)
        {
            double[,] D = new double[3, 3];
            D [0, 0]    = kx;
            D [1, 1]    = ky;
            D [2, 2]    = kz;
            var Kn = B.Transpose() * D * B;
            var Ke = Kn.Integrate(a, b);

            return(Ke);
        }
Exemple #4
0
        // For Volume Elements
        #region Volume Terms
        public static double[,] ComputeMassMatrix(PolyMatrix N, Point a, Point b)
        {
            if (N.Rows > 1)
            {
                throw new Exception("N must be 1 row x n cols");
            }
            N = N.Transpose() * N;
            var Me = N.Integrate(a, b);

            return(Me);
        }