public double[,] CreateMassMatrix() { double[,] tempM = MatrixOperations.CreateDiagonalMatrix(6, 1.0); double[] xUpdated = UpdateNodalCoordinates(DisplacementVector); double a = Math.Pow(Math.Pow(xUpdated[0] - xUpdated[2], 2) + Math.Pow(xUpdated[1] - xUpdated[3], 2), 0.5); double b = Math.Pow(Math.Pow(xUpdated[0] - xUpdated[4], 2) + Math.Pow(xUpdated[1] - xUpdated[5], 2), 0.5); double c = Math.Pow(Math.Pow(xUpdated[2] - xUpdated[4], 2) + Math.Pow(xUpdated[3] - xUpdated[5], 2), 0.5); double t = (a + b + c) / 2; double area = Math.Pow(t * (t - a) * (t - b) * (t - c), 0.5); double scalar = Properties.Density * Properties.Thickness * area / 3.0; double[,] M = MatrixOperations.ScalarMatrixProductNew(scalar, tempM); double waveSpeed = Math.Sqrt(Properties.YoungMod / Properties.Density); return(M); }
public double[,] CreateMassMatrix() { //double[,] M = new double[8, 8]; double[,] tempM = MatrixOperations.CreateDiagonalMatrix(8, 1.0); double length = 0.3; double scalar = Properties.Density * Properties.Thickness * length * (length / 3.0) / 4.0; double[,] M = MatrixOperations.ScalarMatrixProductNew(scalar, tempM); double waveSpeed = Math.Sqrt(Properties.YoungMod / Properties.Density); double deltatCritical = length * Math.Sqrt(1.0 - 0.33) / waveSpeed; //-------------------------------------------------------------- //for (int i = 0; i < 2; i++) //{ // for (int j = 0; j < 2; j++) // { // double[] gP = GaussPoints(i, j).Item1; // double[] gW = GaussPoints(i, j).Item2; // Dictionary<string, double[]> localdN = CalculateShapeFunctionsLocalDerivatives(gP); // double[,] J = CalculateJacobian(localdN); // double[,] invJ = CalculateInverseJacobian(J).Item1; // double detJ = CalculateInverseJacobian(J).Item2; // double[,] Nmatrix = CalculateShapeFunctionMatrix(gP[i], gP[j]); // M = MatrixOperations.MatrixAddition(M, MatrixOperations.ScalarMatrixProductNew(Properties.Density * Properties.Thickness * detJ * gW[i] * gW[j], // MatrixOperations.MatrixProduct(MatrixOperations.Transpose(Nmatrix), Nmatrix))); // } //} //-------------------------------------------------------- //for (int i = 0; i < 8; i++) //{ // M[i, i] = 4.0; //} //for (int i = 0; i < 6; i++) //{ // M[i, i + 2] = 2.0; // M[i + 2, i] = 2.0; //} //for (int i = 0; i < 4; i++) //{ // M[i, i + 4] = 1.0; // M[i + 4, i] = 1.0; //} //for (int i = 0; i < 2; i++) //{ // M[i, i + 6] = 2.0; // M[i + 6, i] = 2.0; //} //M = MatrixOperations.ScalarMatrixProductNew(0.67 * 0.8 * Properties.Density * Properties.Thickness / 32, M); //MatrixOperations.PrintMatrix(M); return(M); }