示例#1
0
        public virtual IMatrix StiffnessMatrix(IElement element)
        {
            var Kt = Matrix.CreateZero(40, 40);

            if (stiffnessCase == 1)
            {
                this.CalculateInitialConfigurationData(element, out double[][] tx_i);
                this.CalculateStrains(element, tx_i);

                for (int npoint = 0; npoint < materialsAtGaussPoints.Length; npoint++)
                {
                    materialsAtGaussPoints[npoint].UpdateMaterial(GLvec[npoint]);
                }

                this.UpdateForces(element);


                Kt            = this.UpdateKmatrices(element);
                stiffnessCase = 2;
                return(dofEnumerator.GetTransformedMatrix(Kt));
            }
            else
            {
                Kt = this.UpdateKmatrices(element);
                return(dofEnumerator.GetTransformedMatrix(Kt));
            }
        }
        public IMatrix StiffnessMatrix(IElement element)
        {
            Matrix rotationMatrixBlock  = this.CalculateBlockRotationMatrix();
            Matrix localStiffnessMatrix = this.CalculateLocalStiffnessMatrix();
            Matrix s = rotationMatrixBlock.MultiplyRight(localStiffnessMatrix).MultiplyRight(rotationMatrixBlock, false, true);

            return(dofEnumerator.GetTransformedMatrix(s));
        }
示例#3
0
        //[  c^2*E*A/L+12*s^2*E*I/L^3,  s*E*A/L*c-12*c*E*I/L^3*s,              -6*E*I/L^2*s, -c^2*E*A/L-12*s^2*E*I/L^3, -s*E*A/L*c+12*c*E*I/L^3*s,              -6*E*I/L^2*s]
        //[  s*E*A/L*c-12*c*E*I/L^3*s,  s^2*E*A/L+12*c^2*E*I/L^3,               6*E*I/L^2*c, -s*E*A/L*c+12*c*E*I/L^3*s, -s^2*E*A/L-12*c^2*E*I/L^3,               6*E*I/L^2*c]
        //[              -6*E*I/L^2*s,               6*E*I/L^2*c,                   4*E*I/L,               6*E*I/L^2*s,              -6*E*I/L^2*c,                   2*E*I/L]
        //[ -c^2*E*A/L-12*s^2*E*I/L^3, -s*E*A/L*c+12*c*E*I/L^3*s,               6*E*I/L^2*s,  c^2*E*A/L+12*s^2*E*I/L^3,  s*E*A/L*c-12*c*E*I/L^3*s,               6*E*I/L^2*s]
        //[ -s*E*A/L*c+12*c*E*I/L^3*s, -s^2*E*A/L-12*c^2*E*I/L^3,              -6*E*I/L^2*c,  s*E*A/L*c-12*c*E*I/L^3*s,  s^2*E*A/L+12*c^2*E*I/L^3,              -6*E*I/L^2*c]
        //[              -6*E*I/L^2*s,               6*E*I/L^2*c,                   2*E*I/L,               6*E*I/L^2*s,              -6*E*I/L^2*c,                   4*E*I/L]
        public virtual IMatrix StiffnessMatrix(IElement element)
        {
            double x2   = Math.Pow(element.Nodes[1].X - element.Nodes[0].X, 2);
            double y2   = Math.Pow(element.Nodes[1].Y - element.Nodes[0].Y, 2);
            double L    = Math.Sqrt(x2 + y2);
            double c    = (element.Nodes[1].X - element.Nodes[0].X) / L;
            double c2   = c * c;
            double s    = (element.Nodes[1].Y - element.Nodes[0].Y) / L;
            double s2   = s * s;
            double EL   = this.youngModulus / L;
            double EAL  = EL * SectionArea;
            double EIL  = EL * MomentOfInertia;
            double EIL2 = EIL / L;
            double EIL3 = EIL2 / L;

            //TODO: optimize this
            int order = 6;
            var k     = SymmetricMatrix.CreateFromPackedRowMajorArray(new double[]
            {
                c2 *EAL + 12 *s2 *EIL3, c *s *EAL - 12 *c *s *EIL3, -6 *s *EIL2, -c2 *EAL - 12 *s2 *EIL3, -c *s *EAL + 12 *c *s *EIL3, -6 *s *EIL2,
                s2 *EAL + 12 *c2 *EIL3, 6 *c *EIL2, -s *c *EAL + 12 *c *s *EIL3, -s2 *EAL - 12 *c2 *EIL3, 6 *c *EIL2,
                4 *EIL, 6 *s *EIL2, -6 *c *EIL2, 2 *EIL,
                c2 *EAL + 12 *s2 *EIL3, s *c *EAL - 12 *c *s *EIL3, 6 *s *EIL2,
                s2 *EAL + 12 *c2 *EIL3, -6 *c *EIL2,
                4 *EIL
            }, order);

            return(dofEnumerator.GetTransformedMatrix(k));
        }
示例#4
0
        public virtual IMatrix StiffnessMatrix(IElement element)
        {
            double[, ,] afE = new double[iInt3, 6, 6];

            for (int i = 0; i < iInt3; i++)
            {
                IMatrixView constitutive = materialsAtGaussPoints[i].ConstitutiveMatrix;
                for (int j = 0; j < 6; j++)
                {
                    for (int k = 0; k < 6; k++)
                    {
                        afE[i, j, k] = constitutive[j, k];
                    }
                }
            }

            double[,] faXYZ = GetCoordinates(element);
            double[,] faDS  = new double[iInt3, 24];
            double[,] faS   = new double[iInt3, 8];
            double[, ,] faB = new double[iInt3, 24, 6];
            double[] faDetJ = new double[iInt3];
            double[, ,] faJ = new double[iInt3, 3, 3];
            double[] faWeight = new double[iInt3];
            double[] faK      = new double[300];
            CalcH8GaussMatrices(ref iInt, faXYZ, faWeight, faS, faDS, faJ, faDetJ, faB);
            CalcH8K(ref iInt, afE, faB, faWeight, faK);
            return(dofEnumerator.GetTransformedMatrix(SymmetricMatrix.CreateFromPackedRowMajorArray(faK)));
        }
示例#5
0
        public IMatrix StiffnessMatrix(IElement element)
        {
            double x2 = Math.Pow(element.Nodes[1].X - element.Nodes[0].X, 2);
            double y2 = Math.Pow(element.Nodes[1].Y - element.Nodes[0].Y, 2);
            double L  = Math.Sqrt(x2 + y2);
            double c  = (element.Nodes[1].X - element.Nodes[0].X) / L;
            double c2 = c * c;
            double s  = (element.Nodes[1].Y - element.Nodes[0].Y) / L;
            double s2 = s * s;
            double cs = c * s;
            double E  = this.youngModulus;
            double A  = SectionArea;

            return(dofEnumerator.GetTransformedMatrix(
                       Matrix.CreateFromArray(new double[, ]
            {
                { A *E *c2 / L, A *E *cs / L, -A *E *c2 / L, -A *E *cs / L },
                { A *E *cs / L, A *E *s2 / L, -A *E *cs / L, -A *E *s2 / L },
                { -A * E * c2 / L, -A * E * cs / L, A * E * c2 / L, A * E * cs / L },
                { -A * E * cs / L, -A * E * s2 / L, A * E * cs / L, A * E * s2 / L }
            })));
        }
示例#6
0
        public virtual IMatrix StiffnessMatrix(IElement element)
        {
            double[,] k_stoixeiou_coh2 = new double[64, 64];
            if (MatrixIsNotInitialized)
            {
                this.GetInitialGeometricDataAndInitializeMatrices(element);
                this.UpdateCoordinateDataAndCalculateDisplacementVector(new double[64]);                 //returns Delta that can't be used for the initial material state
                MatrixIsNotInitialized = false;
            }

            Tuple <Matrix[], double[]> RtN3AndIntegrationCoeffs;

            RtN3AndIntegrationCoeffs = CalculateNecessaryMatricesForStiffnessMatrixAndForcesVectorCalculations();
            Matrix[] RtN3;
            RtN3 = RtN3AndIntegrationCoeffs.Item1;
            double[] integrationCoeffs;
            integrationCoeffs = RtN3AndIntegrationCoeffs.Item2;

            k_stoixeiou_coh2 = this.UpdateKmatrices(element, RtN3, integrationCoeffs);
            IMatrix element_stiffnessMatrix = Matrix.CreateFromArray(k_stoixeiou_coh2);

            return(dofEnumerator.GetTransformedMatrix(element_stiffnessMatrix));            // embedding
        }
示例#7
0
 public IMatrix StiffnessMatrix(IElement element)
 {
     CalculateRotTranformation(element);
     return(dofEnumerator.GetTransformedMatrix(
                rotTransformation.ThisTransposeTimesOtherTimesThis(StiffnessMatrixPure(element))));
 }