Exemple #1
0
        public Vector GetLocalVector(int k)
        {
            Vector v = new Vector(2 * p.s);
            double temp;

            for (int i = 0; i < p.s; i++)
            {
                temp       = GaussIntegrator.Integrate(X[k - 1], X[k], baseFunctionVec, p.f[i, 0], X[k - 1]);
                v[i]       = -temp / h;
                v[i + p.s] = temp / h;
            }

            return(v);
        }
Exemple #2
0
        public Matrix GetLocalWeightMatrix(int k)
        {
            Matrix m = new Matrix(2 * p.s, 2 * p.s);
            double temp;

            for (int i = 0; i < p.s; i++)
            {
                for (int j = 0; j < p.s; j++)
                {
                    temp          = GaussIntegrator.Integrate(X[k - 1], X[k], baseFunction, p.Q[i, j], X[k - 1]) / (h * h);
                    m[i, j]       = m[i + p.s, j + p.s] = temp;
                    m[i + p.s, j] = m[i, j + p.s] = -temp;
                }
            }

            return(m);
        }