/// <inheritdoc/>
        public Matrix CalcLocalStiffnessMatrix(Element targetElement)
        {
            //edit
            var b = GetBMatrixAt(targetElement, 0, 0, 0);
            var d = GetDMatrixAt(targetElement, 0, 0, 0);

            var k = b.Transpose() * d * b;

            var v = GetJMatrixAt(targetElement, 0, 0, 0).Determinant() / 6.0;

            k.Scale(v);

            return(k);

            return(ElementHelperExtensions.CalcLocalKMatrix_Tetrahedron(this, targetElement));
        }
示例#2
0
        /// <inheritdoc/>
        public Matrix CalcLocalStiffnessMatrix(Element targetElement)
        {
            /**/
            var tetra = targetElement as TetrahedronElement;

            var X = (Matrix)targetElement.AllocateFromPool(4, 4);

            {
                var ps = tetra.Nodes.Select(i => i.Location).ToArray();

                {//9.11
                    X.SetRow(0, new double[] { 1, 1, 1, 1 });
                    X.SetRow(1, new double[] { ps[0].X, ps[1].X, ps[2].X, ps[3].X });
                    X.SetRow(2, new double[] { ps[0].Y, ps[1].Y, ps[2].Y, ps[3].Y });
                    X.SetRow(3, new double[] { ps[0].Z, ps[1].Z, ps[2].Z, ps[3].Z });
                }
            }
            /**/
            //edit
            var b = GetBMatrixAt(targetElement, 0, 0, 0);
            var d = GetDMatrixAt(targetElement, 0, 0, 0);

            var k = (b.Transpose() * d) * b;

            var v = X.Determinant() / 6.0;


            if (v < 0)
            {
                throw new Exception();
            }


            k.Scale(v);

            return(k);

            return(ElementHelperExtensions.CalcLocalKMatrix_Tetrahedron(this, targetElement));
        }