private Matrix CalculateMembraneDeformationMatrix(Nurbs2D nurbs, int j, Vector surfaceBasisVector1, Vector surfaceBasisVector2, NurbsKirchhoffLoveShellElement element) { var elementControlPoints = element.ControlPoints.ToArray(); Matrix dRIa = Matrix.CreateZero(3, elementControlPoints.Length); for (int i = 0; i < elementControlPoints.Length; i++) { for (int m = 0; m < 3; m++) { dRIa[m, i] = nurbs.NurbsDerivativeValuesHeta[i, j] * surfaceBasisVector1[m] + nurbs.NurbsDerivativeValuesKsi[i, j] * surfaceBasisVector2[m]; } } Matrix Bmembrane = Matrix.CreateZero(3, elementControlPoints.Length * 3); for (int column = 0; column < elementControlPoints.Length * 3; column += 3) { Bmembrane[0, column] = nurbs.NurbsDerivativeValuesKsi[column / 3, j] * surfaceBasisVector1[0]; Bmembrane[0, column + 1] = nurbs.NurbsDerivativeValuesKsi[column / 3, j] * surfaceBasisVector1[1]; Bmembrane[0, column + 2] = nurbs.NurbsDerivativeValuesKsi[column / 3, j] * surfaceBasisVector1[2]; Bmembrane[1, column] = nurbs.NurbsDerivativeValuesHeta[column / 3, j] * surfaceBasisVector2[0]; Bmembrane[1, column + 1] = nurbs.NurbsDerivativeValuesHeta[column / 3, j] * surfaceBasisVector2[1]; Bmembrane[1, column + 2] = nurbs.NurbsDerivativeValuesHeta[column / 3, j] * surfaceBasisVector2[2]; Bmembrane[2, column] = dRIa[0, column / 3]; Bmembrane[2, column + 1] = dRIa[1, column / 3]; Bmembrane[2, column + 2] = dRIa[2, column / 3]; } return(Bmembrane); }
private static void CalculateNeumannLoad2D(Element element, NeumannBoundaryCondition neumann, Dictionary <int, double> neumannLoad, Nurbs2D nurbs, int j, double jacdet, IList <GaussLegendrePoint3D> gaussPoints, double xGaussPoint, double yGaussPoint, double zGaussPoint, Vector surfaceBasisVector3) { var elementControlPoints = element.ControlPoints.ToArray(); for (int k = 0; k < elementControlPoints.Length; k++) { int dofIDX = element.Model.GlobalDofOrdering.GlobalFreeDofs[elementControlPoints[k], StructuralDof.TranslationX]; int dofIDY = element.Model.GlobalDofOrdering.GlobalFreeDofs[elementControlPoints[k], StructuralDof.TranslationY]; int dofIDZ = element.Model.GlobalDofOrdering.GlobalFreeDofs[elementControlPoints[k], StructuralDof.TranslationZ]; if (neumannLoad.ContainsKey(dofIDX)) { neumannLoad[dofIDX] += nurbs.NurbsValues[k, j] * jacdet * gaussPoints[j].WeightFactor * neumann.Value(xGaussPoint, yGaussPoint, zGaussPoint)[0] * surfaceBasisVector3[0]; } else { neumannLoad.Add( dofIDX, nurbs.NurbsValues[k, j] * jacdet * gaussPoints[j].WeightFactor * neumann.Value(xGaussPoint, yGaussPoint, zGaussPoint)[0] * surfaceBasisVector3[0]); } if (neumannLoad.ContainsKey(dofIDY)) { neumannLoad[dofIDY] += nurbs.NurbsValues[k, j] * jacdet * gaussPoints[j].WeightFactor * neumann.Value(xGaussPoint, yGaussPoint, zGaussPoint)[1] * surfaceBasisVector3[1]; } else { neumannLoad.Add( dofIDY, nurbs.NurbsValues[k, j] * jacdet * gaussPoints[j].WeightFactor * neumann.Value(xGaussPoint, yGaussPoint, zGaussPoint)[1] * surfaceBasisVector3[1]); } if (neumannLoad.ContainsKey(dofIDZ)) { neumannLoad[dofIDZ] += nurbs.NurbsValues[k, j] * jacdet * gaussPoints[j].WeightFactor * neumann.Value(xGaussPoint, yGaussPoint, zGaussPoint)[2] * surfaceBasisVector3[2]; } else { neumannLoad.Add(dofIDZ, nurbs.NurbsValues[k, j] * jacdet * gaussPoints[j].WeightFactor * neumann.Value(xGaussPoint, yGaussPoint, zGaussPoint)[2] * surfaceBasisVector3[2]); } } }
/// <summary> /// Calculates the stiffness matrix of the element. /// </summary> /// <param name="element">An element of type <see cref="NurbsKirchhoffLoveShellElement"/>.</param> /// <returns>An <see cref="IMatrix"/> containing the stiffness matrix of an <see cref="NurbsKirchhoffLoveShellElement"/>.</returns> public IMatrix StiffnessMatrix(IElement element) { var shellElement = (NurbsKirchhoffLoveShellElement)element; var elementControlPoints = shellElement.ControlPoints.ToArray(); IList <GaussLegendrePoint3D> gaussPoints = CreateElementGaussPoints(shellElement); Matrix stiffnessMatrixElement = Matrix.CreateZero(shellElement.ControlPointsDictionary.Count * 3, shellElement.ControlPointsDictionary.Count * 3); Nurbs2D nurbs = new Nurbs2D(shellElement, elementControlPoints); for (int j = 0; j < gaussPoints.Count; j++) { var jacobianMatrix = CalculateJacobian(shellElement, nurbs, j); var hessianMatrix = CalculateHessian(shellElement, nurbs, j); var surfaceBasisVector1 = CalculateSurfaceBasisVector1(jacobianMatrix, 0); var surfaceBasisVector2 = CalculateSurfaceBasisVector1(jacobianMatrix, 1); var surfaceBasisVector3 = surfaceBasisVector1.CrossProduct(surfaceBasisVector2); var J1 = surfaceBasisVector3.Norm2(); surfaceBasisVector3.ScaleIntoThis(1 / J1); var surfaceBasisVectorDerivative1 = CalculateSurfaceBasisVector1(hessianMatrix, 0); var surfaceBasisVectorDerivative2 = CalculateSurfaceBasisVector1(hessianMatrix, 1); var surfaceBasisVectorDerivative12 = CalculateSurfaceBasisVector1(hessianMatrix, 2); Matrix constitutiveMatrix = CalculateConstitutiveMatrix(shellElement, surfaceBasisVector1, surfaceBasisVector2); var Bmembrane = CalculateMembraneDeformationMatrix(nurbs, j, surfaceBasisVector1, surfaceBasisVector2, shellElement); var Bbending = CalculateBendingDeformationMatrix(surfaceBasisVector3, nurbs, j, surfaceBasisVector2, surfaceBasisVectorDerivative1, surfaceBasisVector1, J1, surfaceBasisVectorDerivative2, surfaceBasisVectorDerivative12, shellElement); double membraneStiffness = ((IIsotropicContinuumMaterial2D)shellElement.Patch.Material).YoungModulus * shellElement.Patch.Thickness / (1 - Math.Pow(((IIsotropicContinuumMaterial2D)shellElement.Patch.Material).PoissonRatio, 2)); var Kmembrane = Bmembrane.Transpose() * constitutiveMatrix * Bmembrane * membraneStiffness * J1 * gaussPoints[j].WeightFactor; double bendingStiffness = ((IIsotropicContinuumMaterial2D)shellElement.Patch.Material).YoungModulus * Math.Pow(shellElement.Patch.Thickness, 3) / 12 / (1 - Math.Pow(((IIsotropicContinuumMaterial2D)shellElement.Patch.Material).PoissonRatio, 2)); var Kbending = Bbending.Transpose() * constitutiveMatrix * Bbending * bendingStiffness * J1 * gaussPoints[j].WeightFactor; stiffnessMatrixElement.AddIntoThis(Kmembrane); stiffnessMatrixElement.AddIntoThis(Kbending); } return(stiffnessMatrixElement); }
/// <summary> /// Calculates displacements of knots for post-processing with Paraview. /// </summary> /// <param name="element">An element of type <see cref="NurbsElement2D"/>.</param> /// <param name="localDisplacements">A <see cref="Matrix"/> containing the displacements for the degrees of freedom of the element.</param> /// <returns>A <see cref="double"/> array calculating the displacement of the element Knots'. /// The rows of the matrix denote the knot numbering while the columns the displacements for each degree of freedom.</returns> public double[,] CalculateDisplacementsForPostProcessing(Element element, Matrix localDisplacements) { Contract.Requires(element != null, "The element cannot be null"); var nurbsElement = (NurbsElement2D)element; var elementControlPoints = nurbsElement.ControlPoints.ToArray(); var elemenetKnots = nurbsElement.Knots.ToArray(); var knotParametricCoordinatesKsi = Vector.CreateFromArray(new double[] { elemenetKnots[0].Ksi, elemenetKnots[2].Ksi }); var knotParametricCoordinatesHeta = Vector.CreateFromArray(new double[] { elemenetKnots[0].Heta, elemenetKnots[1].Heta }); Nurbs2D nurbs = new Nurbs2D(nurbsElement, elementControlPoints, knotParametricCoordinatesKsi, knotParametricCoordinatesHeta); var knotDisplacements = new double[4, 2]; var paraviewKnotRenumbering = new int[] { 0, 3, 1, 2 }; for (int j = 0; j < elemenetKnots.Length; j++) { for (int i = 0; i < elementControlPoints.Length; i++) { knotDisplacements[paraviewKnotRenumbering[j], 0] += nurbs.NurbsValues[i, j] * localDisplacements[i, 0]; knotDisplacements[paraviewKnotRenumbering[j], 1] += nurbs.NurbsValues[i, j] * localDisplacements[i, 1]; } } return(knotDisplacements); }
private static Matrix JacobianMatrixForLoadCalculation(Element element, Nurbs2D nurbs, int j, out double xGaussPoint, out double yGaussPoint, out double zGaussPoint) { var elementControlPoints = element.ControlPoints.ToArray(); Matrix jacobianMatrix = Matrix.CreateZero(2, 3); xGaussPoint = 0; yGaussPoint = 0; zGaussPoint = 0; for (int k = 0; k < elementControlPoints.Length; k++) { xGaussPoint += nurbs.NurbsValues[k, j] * elementControlPoints[k].X; yGaussPoint += nurbs.NurbsValues[k, j] * elementControlPoints[k].Y; zGaussPoint += nurbs.NurbsValues[k, j] * elementControlPoints[k].Z; jacobianMatrix[0, 0] += nurbs.NurbsDerivativeValuesKsi[k, j] * elementControlPoints[k].X; jacobianMatrix[0, 1] += nurbs.NurbsDerivativeValuesKsi[k, j] * elementControlPoints[k].Y; jacobianMatrix[0, 2] += nurbs.NurbsDerivativeValuesKsi[k, j] * elementControlPoints[k].Z; jacobianMatrix[1, 0] += nurbs.NurbsDerivativeValuesHeta[k, j] * elementControlPoints[k].X; jacobianMatrix[1, 1] += nurbs.NurbsDerivativeValuesHeta[k, j] * elementControlPoints[k].Y; jacobianMatrix[1, 2] += nurbs.NurbsDerivativeValuesHeta[k, j] * elementControlPoints[k].Z; } return(jacobianMatrix); }
/// <summary> /// This method calculates the Neumann boundary condition when applied to a two-dimensional NURBS element. /// </summary> /// <param name="element">An element of type <see cref="NurbsElement2D"/></param> /// <param name="face">An two dimensional boundary entity. For more info see <see cref="Face"/>.</param> /// <param name="neumann"><inheritdoc cref="NeumannBoundaryCondition"/>.</param> /// <returns>A <see cref="Dictionary{TKey,TValue}"/> where integer values denote the degree of freedom that has a value double load value due to the enforcement of the <see cref="NeumannBoundaryCondition"/>.</returns> public Dictionary <int, double> CalculateLoadingCondition(Element element, Face face, NeumannBoundaryCondition neumann) { Contract.Requires(element != null, "The element cannot be null"); Contract.Requires(face != null, "The face cannot be null"); Contract.Requires(neumann != null, "The Neumann Boundary condition cannot be null"); IList <GaussLegendrePoint3D> gaussPoints = CreateElementGaussPoints(element, face.Degrees[0], face.Degrees[1]); Dictionary <int, double> neumannLoad = new Dictionary <int, double>(); var elementControlPoints = element.ControlPoints.ToArray(); Nurbs2D nurbs = new Nurbs2D(element, elementControlPoints, face); for (int j = 0; j < gaussPoints.Count; j++) { var jacobianMatrix = JacobianMatrixForLoadCalculation(element, nurbs, j, out var xGaussPoint, out var yGaussPoint, out var zGaussPoint); Vector surfaceBasisVector1 = Vector.CreateZero(3); surfaceBasisVector1[0] = jacobianMatrix[0, 0]; surfaceBasisVector1[1] = jacobianMatrix[0, 1]; surfaceBasisVector1[2] = jacobianMatrix[0, 2]; Vector surfaceBasisVector2 = Vector.CreateZero(3); surfaceBasisVector2[0] = jacobianMatrix[1, 0]; surfaceBasisVector2[1] = jacobianMatrix[1, 1]; surfaceBasisVector2[2] = jacobianMatrix[1, 2]; Vector surfaceBasisVector3 = surfaceBasisVector1.CrossProduct(surfaceBasisVector2); double jacdet = jacobianMatrix[0, 0] * jacobianMatrix[1, 1] - jacobianMatrix[1, 0] * jacobianMatrix[0, 1]; CalculateNeumannLoad2D(element, neumann, neumannLoad, nurbs, j, jacdet, gaussPoints, xGaussPoint, yGaussPoint, zGaussPoint, surfaceBasisVector3); } return(neumannLoad); }
/// <summary> /// This method calculates the Pressure boundary condition when applied to a two-dimensional NURBS element. /// </summary> /// <param name="element">An element of type <see cref="NurbsElement2D"/>.</param> /// <param name="face">An two dimensional boundary entity. For more info see <see cref="Face"/>.</param> /// <param name="pressure"><inheritdoc cref="NeumannBoundaryCondition"/>.</param> /// <returns>A <see cref="Dictionary{TKey,TValue}"/> where integer values denote the degree of freedom that has a value double load value due to the enforcement of the <see cref="PressureBoundaryCondition"/>.</returns> public Dictionary <int, double> CalculateLoadingCondition(Element element, Face face, PressureBoundaryCondition pressure) { Contract.Requires(element != null, "The element cannot be null"); Contract.Requires(face != null, "The face cannot be null"); Contract.Requires(pressure != null, "The pressure boundary condition cannot be null"); var dofs = new IDofType[] { StructuralDof.TranslationX, StructuralDof.TranslationY, StructuralDof.TranslationZ }; IList <GaussLegendrePoint3D> gaussPoints = CreateElementGaussPoints(element, face.Degrees[0], face.Degrees[1]); Dictionary <int, double> pressureLoad = new Dictionary <int, double>(); var elementControlPoints = element.ControlPoints.ToArray(); Nurbs2D nurbs = new Nurbs2D(element, elementControlPoints, face); for (int j = 0; j < gaussPoints.Count; j++) { Matrix jacobianMatrix = Matrix.CreateZero(2, 3); double xGaussPoint = 0; double yGaussPoint = 0; double zGaussPoint = 0; for (int k = 0; k < elementControlPoints.Length; k++) { xGaussPoint += nurbs.NurbsValues[k, j] * elementControlPoints[k].X; yGaussPoint += nurbs.NurbsValues[k, j] * elementControlPoints[k].Y; zGaussPoint += nurbs.NurbsValues[k, j] * elementControlPoints[k].Z; jacobianMatrix[0, 0] += nurbs.NurbsDerivativeValuesKsi[k, j] * elementControlPoints[k].X; jacobianMatrix[0, 1] += nurbs.NurbsDerivativeValuesKsi[k, j] * elementControlPoints[k].Y; jacobianMatrix[0, 2] += nurbs.NurbsDerivativeValuesKsi[k, j] * elementControlPoints[k].Z; jacobianMatrix[1, 0] += nurbs.NurbsDerivativeValuesHeta[k, j] * elementControlPoints[k].X; jacobianMatrix[1, 1] += nurbs.NurbsDerivativeValuesHeta[k, j] * elementControlPoints[k].Y; jacobianMatrix[1, 2] += nurbs.NurbsDerivativeValuesHeta[k, j] * elementControlPoints[k].Z; } Vector surfaceBasisVector1 = Vector.CreateZero(3); surfaceBasisVector1[0] = jacobianMatrix[0, 0]; surfaceBasisVector1[1] = jacobianMatrix[0, 1]; surfaceBasisVector1[2] = jacobianMatrix[0, 2]; Vector surfaceBasisVector2 = Vector.CreateZero(3); surfaceBasisVector2[0] = jacobianMatrix[1, 0]; surfaceBasisVector2[1] = jacobianMatrix[1, 1]; surfaceBasisVector2[2] = jacobianMatrix[1, 2]; Vector surfaceBasisVector3 = surfaceBasisVector1.CrossProduct(surfaceBasisVector2); double jacdet = (jacobianMatrix[0, 0] * jacobianMatrix[1, 1]) - (jacobianMatrix[1, 0] * jacobianMatrix[0, 1]); for (int k = 0; k < elementControlPoints.Length; k++) { for (int m = 0; m < 3; m++) { int dofID = element.Model.GlobalDofOrdering.GlobalFreeDofs[elementControlPoints[k], dofs[m]]; if (pressureLoad.ContainsKey(dofID)) { pressureLoad[dofID] += nurbs.NurbsValues[k, j] * jacdet * gaussPoints[j].WeightFactor * pressure.Value * surfaceBasisVector3[m]; } else { pressureLoad.Add(dofID, nurbs.NurbsValues[k, j] * jacdet * gaussPoints[j].WeightFactor * pressure.Value * surfaceBasisVector3[m]); } } } } return(pressureLoad); }
/// <summary> /// Calculates the stiffness matrix of the element. /// </summary> /// <param name="element">An element of type <see cref="NurbsElement2D"/>.</param> /// <returns>An <see cref="IMatrix"/> containing the stiffness matrix of an <see cref="NurbsElement2D"/>.</returns> public IMatrix StiffnessMatrix(IElement element) { Contract.Requires(element != null, "The element cannot be null"); var nurbsElement = (NurbsElement2D)element; var gaussPoints = CreateElementGaussPoints(nurbsElement); var stiffnessMatrixElement = Matrix.CreateZero( nurbsElement.ControlPointsDictionary.Count * 2, nurbsElement.ControlPointsDictionary.Count * 2); var elementControlPoints = nurbsElement.ControlPoints.ToArray(); var nurbs = new Nurbs2D(nurbsElement, elementControlPoints); for (var j = 0; j < gaussPoints.Count; j++) { var jacobianMatrix = Matrix.CreateZero(2, 2); for (int k = 0; k < elementControlPoints.Length; k++) { jacobianMatrix[0, 0] += nurbs.NurbsDerivativeValuesKsi[k, j] * elementControlPoints[k].X; jacobianMatrix[0, 1] += nurbs.NurbsDerivativeValuesKsi[k, j] * elementControlPoints[k].Y; jacobianMatrix[1, 0] += nurbs.NurbsDerivativeValuesHeta[k, j] * elementControlPoints[k].X; jacobianMatrix[1, 1] += nurbs.NurbsDerivativeValuesHeta[k, j] * elementControlPoints[k].Y; } double jacdet = (jacobianMatrix[0, 0] * jacobianMatrix[1, 1]) - (jacobianMatrix[1, 0] * jacobianMatrix[0, 1]); Matrix B1 = Matrix.CreateZero(3, 4); B1[0, 0] += jacobianMatrix[1, 1] / jacdet; B1[0, 1] += -jacobianMatrix[0, 1] / jacdet; B1[1, 2] += -jacobianMatrix[1, 0] / jacdet; B1[1, 3] += jacobianMatrix[0, 0] / jacdet; B1[2, 0] += -jacobianMatrix[1, 0] / jacdet; B1[2, 1] += jacobianMatrix[0, 0] / jacdet; B1[2, 2] += jacobianMatrix[1, 1] / jacdet; B1[2, 3] += -jacobianMatrix[0, 1] / jacdet; Matrix B2 = Matrix.CreateZero(4, 2 * elementControlPoints.Length); for (int column = 0; column < 2 * elementControlPoints.Length; column += 2) { B2[0, column] += nurbs.NurbsDerivativeValuesKsi[column / 2, j]; B2[1, column] += nurbs.NurbsDerivativeValuesHeta[column / 2, j]; B2[2, column + 1] += nurbs.NurbsDerivativeValuesKsi[column / 2, j]; B2[3, column + 1] += nurbs.NurbsDerivativeValuesHeta[column / 2, j]; } Matrix B = B1 * B2; IMatrixView elasticityMatrix = ((IContinuumMaterial2D)nurbsElement.Patch.Material).ConstitutiveMatrix; Matrix stiffnessMatrixGaussPoint = B.ThisTransposeTimesOtherTimesThis(elasticityMatrix); stiffnessMatrixGaussPoint *= jacdet * gaussPoints[j].WeightFactor * nurbsElement.Patch.Thickness; for (int m = 0; m < elementControlPoints.Length * 2; m++) { for (int n = 0; n < elementControlPoints.Length * 2; n++) { stiffnessMatrixElement[m, n] += stiffnessMatrixGaussPoint[m, n]; } } } return(stiffnessMatrixElement); }
private Matrix CalculateBendingDeformationMatrix(Vector surfaceBasisVector3, Nurbs2D nurbs, int j, Vector surfaceBasisVector2, Vector surfaceBasisVectorDerivative1, Vector surfaceBasisVector1, double J1, Vector surfaceBasisVectorDerivative2, Vector surfaceBasisVectorDerivative12, NurbsKirchhoffLoveShellElement element) { var elementControlPoints = element.ControlPoints.ToArray(); Matrix Bbending = Matrix.CreateZero(3, elementControlPoints.Length * 3); for (int column = 0; column < elementControlPoints.Length * 3; column += 3) { #region BI1 var BI1 = surfaceBasisVector3.CrossProduct(surfaceBasisVector3); BI1.ScaleIntoThis(nurbs.NurbsDerivativeValuesHeta[column / 3, j]); var auxVector = surfaceBasisVector2.CrossProduct(surfaceBasisVector3); auxVector.ScaleIntoThis(nurbs.NurbsDerivativeValuesKsi[column / 3, j]); BI1.AddIntoThis(auxVector); BI1.ScaleIntoThis(surfaceBasisVector3.DotProduct(surfaceBasisVectorDerivative1)); auxVector = surfaceBasisVector1.CrossProduct(surfaceBasisVectorDerivative1); auxVector.ScaleIntoThis(nurbs.NurbsDerivativeValuesHeta[column / 3, j]); BI1.AddIntoThis(auxVector); BI1.ScaleIntoThis(1 / J1); auxVector[0] = surfaceBasisVector3[0]; auxVector[1] = surfaceBasisVector3[1]; auxVector[2] = surfaceBasisVector3[2]; auxVector.ScaleIntoThis(-nurbs.NurbsSecondDerivativeValueKsi[column / 3, j]); BI1.AddIntoThis(auxVector); #endregion BI1 #region BI2 Vector BI2 = surfaceBasisVector3.CrossProduct(surfaceBasisVector3); BI2.ScaleIntoThis(nurbs.NurbsDerivativeValuesHeta[column / 3, j]); auxVector = surfaceBasisVector2.CrossProduct(surfaceBasisVector3); auxVector.ScaleIntoThis(nurbs.NurbsDerivativeValuesKsi[column / 3, j]); BI2.AddIntoThis(auxVector); BI2.ScaleIntoThis(surfaceBasisVector3.DotProduct(surfaceBasisVectorDerivative2)); auxVector = surfaceBasisVector1.CrossProduct(surfaceBasisVectorDerivative2); auxVector.ScaleIntoThis(nurbs.NurbsDerivativeValuesHeta[column / 3, j]); BI2.AddIntoThis(auxVector); auxVector = surfaceBasisVectorDerivative2.CrossProduct(surfaceBasisVector2); auxVector.ScaleIntoThis(nurbs.NurbsDerivativeValuesKsi[column / 3, j]); BI2.AddIntoThis(auxVector); BI2.ScaleIntoThis(1 / J1); auxVector[0] = surfaceBasisVector3[0]; auxVector[1] = surfaceBasisVector3[1]; auxVector[2] = surfaceBasisVector3[2]; auxVector.ScaleIntoThis(-nurbs.NurbsSecondDerivativeValueHeta[column / 3, j]); BI2.AddIntoThis(auxVector); #endregion BI2 #region BI3 Vector BI3 = surfaceBasisVector3.CrossProduct(surfaceBasisVector3); BI3.ScaleIntoThis(nurbs.NurbsDerivativeValuesHeta[column / 3, j]); auxVector = surfaceBasisVector2.CrossProduct(surfaceBasisVector3); auxVector.ScaleIntoThis(nurbs.NurbsDerivativeValuesKsi[column / 3, j]); BI3.AddIntoThis(auxVector); BI3.ScaleIntoThis(surfaceBasisVector3.DotProduct(surfaceBasisVectorDerivative12)); auxVector = surfaceBasisVector1.CrossProduct(surfaceBasisVectorDerivative12); auxVector.ScaleIntoThis(nurbs.NurbsDerivativeValuesHeta[column / 3, j]); BI3.AddIntoThis(auxVector); auxVector = surfaceBasisVectorDerivative2.CrossProduct(surfaceBasisVector2); auxVector.ScaleIntoThis(nurbs.NurbsDerivativeValuesKsi[column / 3, j]); BI3.AddIntoThis(auxVector); BI3.ScaleIntoThis(1 / J1); auxVector[0] = surfaceBasisVector3[0]; auxVector[1] = surfaceBasisVector3[1]; auxVector[2] = surfaceBasisVector3[2]; auxVector.ScaleIntoThis(-nurbs.NurbsSecondDerivativeValueKsiHeta[column / 3, j]); BI3.AddIntoThis(auxVector); #endregion BI3 Bbending[0, column] = BI1[0]; Bbending[0, column + 1] = BI1[1]; Bbending[0, column + 2] = BI1[2]; Bbending[1, column] = BI2[0]; Bbending[1, column + 1] = BI2[1]; Bbending[1, column + 2] = BI2[2]; Bbending[2, column] = 2 * BI3[0]; Bbending[2, column + 1] = 2 * BI3[1]; Bbending[2, column + 2] = 2 * BI3[2]; } return(Bbending); }
private static Matrix CalculateJacobian(NurbsKirchhoffLoveShellElement shellElement, Nurbs2D nurbs, int j) { var elementControlPoints = shellElement.ControlPoints.ToArray(); Matrix jacobianMatrix = Matrix.CreateZero(2, 3); for (int k = 0; k < elementControlPoints.Length; k++) { jacobianMatrix[0, 0] += nurbs.NurbsDerivativeValuesKsi[k, j] * elementControlPoints[k].X; jacobianMatrix[0, 1] += nurbs.NurbsDerivativeValuesKsi[k, j] * elementControlPoints[k].Y; jacobianMatrix[0, 2] += nurbs.NurbsDerivativeValuesKsi[k, j] * elementControlPoints[k].Z; jacobianMatrix[1, 0] += nurbs.NurbsDerivativeValuesHeta[k, j] * elementControlPoints[k].X; jacobianMatrix[1, 1] += nurbs.NurbsDerivativeValuesHeta[k, j] * elementControlPoints[k].Y; jacobianMatrix[1, 2] += nurbs.NurbsDerivativeValuesHeta[k, j] * elementControlPoints[k].Z; } return(jacobianMatrix); }
private static Matrix CalculateHessian(NurbsKirchhoffLoveShellElement shellElement, Nurbs2D nurbs, int j) { var elementControlPoints = shellElement.ControlPoints.ToArray(); Matrix hessianMatrix = Matrix.CreateZero(3, 3); for (int k = 0; k < elementControlPoints.Length; k++) { hessianMatrix[0, 0] += nurbs.NurbsSecondDerivativeValueKsi[k, j] * elementControlPoints[k].X; hessianMatrix[0, 1] += nurbs.NurbsSecondDerivativeValueKsi[k, j] * elementControlPoints[k].Y; hessianMatrix[0, 2] += nurbs.NurbsSecondDerivativeValueKsi[k, j] * elementControlPoints[k].Z; hessianMatrix[1, 0] += nurbs.NurbsSecondDerivativeValueHeta[k, j] * elementControlPoints[k].X; hessianMatrix[1, 1] += nurbs.NurbsSecondDerivativeValueHeta[k, j] * elementControlPoints[k].Y; hessianMatrix[1, 2] += nurbs.NurbsSecondDerivativeValueHeta[k, j] * elementControlPoints[k].Z; hessianMatrix[2, 0] += nurbs.NurbsSecondDerivativeValueKsiHeta[k, j] * elementControlPoints[k].X; hessianMatrix[2, 1] += nurbs.NurbsSecondDerivativeValueKsiHeta[k, j] * elementControlPoints[k].Y; hessianMatrix[2, 2] += nurbs.NurbsSecondDerivativeValueKsiHeta[k, j] * elementControlPoints[k].Z; } return(hessianMatrix); }