private double[,] CalculateDeformationMatrix( Jacobian3D jacobian, ShapeFunctionNaturalDerivatives3D[] shapeFunctionDerivatives) { double[,] jacobianInverse = jacobian.CalculateJacobianInverse(); double[,] b = new double[6, 24]; for (int shapeFunction = 0; shapeFunction < 8; shapeFunction++) { b[0, (3 * shapeFunction) + 0] = (jacobianInverse[0, 0] * shapeFunctionDerivatives[shapeFunction].Xi) + (jacobianInverse[0, 1] * shapeFunctionDerivatives[shapeFunction].Eta) + (jacobianInverse[0, 2] * shapeFunctionDerivatives[shapeFunction].Zeta); b[1, (3 * shapeFunction) + 1] = (jacobianInverse[1, 0] * shapeFunctionDerivatives[shapeFunction].Xi) + (jacobianInverse[1, 1] * shapeFunctionDerivatives[shapeFunction].Eta) + (jacobianInverse[1, 2] * shapeFunctionDerivatives[shapeFunction].Zeta); b[2, (3 * shapeFunction) + 2] = (jacobianInverse[2, 0] * shapeFunctionDerivatives[shapeFunction].Xi) + (jacobianInverse[2, 1] * shapeFunctionDerivatives[shapeFunction].Eta) + (jacobianInverse[2, 2] * shapeFunctionDerivatives[shapeFunction].Zeta); b[3, (3 * shapeFunction) + 0] = b[1, (3 * shapeFunction) + 1]; b[3, (3 * shapeFunction) + 1] = b[0, (3 * shapeFunction) + 0]; b[4, (3 * shapeFunction) + 1] = b[2, (3 * shapeFunction) + 2]; b[4, (3 * shapeFunction) + 2] = b[1, (3 * shapeFunction) + 1]; b[5, (3 * shapeFunction) + 0] = b[2, (3 * shapeFunction) + 2]; b[5, (3 * shapeFunction) + 2] = b[0, (3 * shapeFunction) + 0]; } return(b); }
private GaussLegendrePoint3D[] CalculateGaussMatrices(double[,] nodeCoordinates) { GaussLegendrePoint1D[] integrationPointsPerAxis = GaussQuadrature.GetGaussLegendrePoints(iInt); int totalSamplingPoints = (int)Math.Pow(integrationPointsPerAxis.Length, 3); GaussLegendrePoint3D[] integrationPoints = new GaussLegendrePoint3D[totalSamplingPoints]; int counter = -1; foreach (GaussLegendrePoint1D pointXi in integrationPointsPerAxis) { foreach (GaussLegendrePoint1D pointEta in integrationPointsPerAxis) { foreach (GaussLegendrePoint1D pointZeta in integrationPointsPerAxis) { counter += 1; double xi = pointXi.Coordinate; double eta = pointEta.Coordinate; double zeta = pointZeta.Coordinate; ShapeFunctionNaturalDerivatives3D[] shapeDerivativeValues = this.CalculateShapeDerivativeValues(xi, eta, zeta); Jacobian3D jacobian = new Jacobian3D(nodeCoordinates, shapeDerivativeValues); double[,] deformationMatrix = this.CalculateDeformationMatrix(jacobian, shapeDerivativeValues); double weightFactor = pointXi.WeightFactor * pointEta.WeightFactor * pointZeta.WeightFactor * jacobian.Determinant; integrationPoints[counter] = new GaussLegendrePoint3D( xi, eta, zeta, deformationMatrix, weightFactor); } } } return(integrationPoints); }