protected KeyedSquareMatrix<Strain> CreateMaterialMatrix(double lameConstantLambda, double lameConstantMu) { IList<Strain> keys = new List<Strain> { Strain.LinearStrainX, Strain.LinearStrainY, Strain.LinearStrainZ, Strain.ShearStrainXY, Strain.ShearStrainYZ, Strain.ShearStrainXZ }; KeyedSquareMatrix<Strain> matrix = new KeyedSquareMatrix<Strain>(keys); matrix.At(Strain.LinearStrainX, Strain.LinearStrainX, lameConstantLambda + 2 * lameConstantMu); matrix.At(Strain.LinearStrainY, Strain.LinearStrainY, lameConstantLambda + 2 * lameConstantMu); matrix.At(Strain.LinearStrainZ, Strain.LinearStrainZ, lameConstantLambda + 2 * lameConstantMu); matrix.At(Strain.LinearStrainX, Strain.LinearStrainY, lameConstantLambda); matrix.At(Strain.LinearStrainX, Strain.LinearStrainZ, lameConstantLambda); matrix.At(Strain.LinearStrainY, Strain.LinearStrainX, lameConstantLambda); matrix.At(Strain.LinearStrainY, Strain.LinearStrainZ, lameConstantLambda); matrix.At(Strain.LinearStrainZ, Strain.LinearStrainX, lameConstantLambda); matrix.At(Strain.LinearStrainZ, Strain.LinearStrainY, lameConstantLambda); matrix.At(Strain.ShearStrainXY, Strain.ShearStrainXY, lameConstantMu); matrix.At(Strain.ShearStrainYZ, Strain.ShearStrainYZ, lameConstantMu); matrix.At(Strain.ShearStrainXZ, Strain.ShearStrainXZ, lameConstantMu); return matrix; }
/// <summary> /// Builds the rotational matrix from local coordinates to global coordinates. /// </summary> /// <returns></returns> protected KeyedSquareMatrix <NodalDegreeOfFreedom> BuildStiffnessRotationMatrixFromLocalToGlobalCoordinates() { KeyedSquareMatrix <DegreeOfFreedom> rotationMatrix = this.Element.CalculateElementRotationMatrix(); KeyedSquareMatrix <NodalDegreeOfFreedom> elementRotationMatrixFromLocalToGlobalCoordinates = new KeyedSquareMatrix <NodalDegreeOfFreedom>(this.Element.SupportedGlobalNodalDegreeOfFreedoms); foreach (IFiniteElementNode node in this.Element.Nodes) { foreach (DegreeOfFreedom dofi in this.Element.SupportedGlobalBoundaryConditionDegreeOfFreedom) { foreach (DegreeOfFreedom dofj in this.Element.SupportedGlobalBoundaryConditionDegreeOfFreedom) { if (!((dofi.IsLinear() && dofj.IsLinear()) || (dofi.IsRotational() && dofj.IsRotational()))) { continue; } //HACK it is used to copy the keyed matrix [x] into a larger keyed matrix of: //[x 0, // 0 x] DegreeOfFreedom i = dofi; DegreeOfFreedom j = dofj; if (dofi.IsRotational() && dofj.IsRotational()) { // shift from rotational to linear i = (DegreeOfFreedom)((int)dofi - 3); j = (DegreeOfFreedom)((int)dofj - 3); } double valueToBeCopied = rotationMatrix.At(i, j); elementRotationMatrixFromLocalToGlobalCoordinates.At(new NodalDegreeOfFreedom(node, dofi), new NodalDegreeOfFreedom(node, dofj), valueToBeCopied); } } } return(elementRotationMatrixFromLocalToGlobalCoordinates); }
protected KeyedSquareMatrix <Strain> CreateMaterialMatrix(double lameConstantLambda, double lameConstantMu) { IList <Strain> keys = new List <Strain> { Strain.LinearStrainX, Strain.LinearStrainY, Strain.LinearStrainZ, Strain.ShearStrainXY, Strain.ShearStrainYZ, Strain.ShearStrainXZ }; KeyedSquareMatrix <Strain> matrix = new KeyedSquareMatrix <Strain>(keys); matrix.At(Strain.LinearStrainX, Strain.LinearStrainX, lameConstantLambda + 2 * lameConstantMu); matrix.At(Strain.LinearStrainY, Strain.LinearStrainY, lameConstantLambda + 2 * lameConstantMu); matrix.At(Strain.LinearStrainZ, Strain.LinearStrainZ, lameConstantLambda + 2 * lameConstantMu); matrix.At(Strain.LinearStrainX, Strain.LinearStrainY, lameConstantLambda); matrix.At(Strain.LinearStrainX, Strain.LinearStrainZ, lameConstantLambda); matrix.At(Strain.LinearStrainY, Strain.LinearStrainX, lameConstantLambda); matrix.At(Strain.LinearStrainY, Strain.LinearStrainZ, lameConstantLambda); matrix.At(Strain.LinearStrainZ, Strain.LinearStrainX, lameConstantLambda); matrix.At(Strain.LinearStrainZ, Strain.LinearStrainY, lameConstantLambda); matrix.At(Strain.ShearStrainXY, Strain.ShearStrainXY, lameConstantMu); matrix.At(Strain.ShearStrainYZ, Strain.ShearStrainYZ, lameConstantMu); matrix.At(Strain.ShearStrainXZ, Strain.ShearStrainXZ, lameConstantMu); return(matrix); }