/// <summary> /// Calculates knots physical coordinates for post-processing with Paraview. /// </summary> /// <param name="element">An <see cref="Element"/> of type <see cref="TSplineKirchhoffLoveShellElementMaterial"/>.</param> /// <returns>A <see cref="double"/> array calculating the coordinates 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[,] CalculatePointsForPostProcessing(TSplineKirchhoffLoveShellElementMaterial element) { var localCoordinates = new double[4, 2] { { -1, -1 }, { -1, 1 }, { 1, -1 }, { 1, 1 } }; var knotParametricCoordinatesKsi = Vector.CreateFromArray(new double[] { -1, 1 }); var knotParametricCoordinatesHeta = Vector.CreateFromArray(new double[] { -1, 1 }); var elementControlPoints = element.ControlPoints.ToArray(); var tsplines = new ShapeTSplines2DFromBezierExtraction(element, elementControlPoints, knotParametricCoordinatesKsi, knotParametricCoordinatesHeta); var knotDisplacements = new double[4, 3]; var paraviewKnotRenumbering = new int[] { 0, 3, 1, 2 }; for (int j = 0; j < localCoordinates.GetLength(0); j++) { for (int i = 0; i < elementControlPoints.Length; i++) { knotDisplacements[paraviewKnotRenumbering[j], 0] += tsplines.TSplineValues[i, j] * elementControlPoints[i].X; knotDisplacements[paraviewKnotRenumbering[j], 1] += tsplines.TSplineValues[i, j] * elementControlPoints[i].Y; knotDisplacements[paraviewKnotRenumbering[j], 2] += tsplines.TSplineValues[i, j] * elementControlPoints[i].Z; } } return(knotDisplacements); }
private IList <GaussLegendrePoint3D> CreateElementGaussPoints(TSplineKirchhoffLoveShellElementMaterial element) { GaussQuadrature gauss = new GaussQuadrature(); var medianSurfaceGp = gauss.CalculateElementGaussPoints(element.DegreeKsi, element.DegreeHeta, new List <Knot> { new Knot() { ID = 0, Ksi = -1, Heta = -1, Zeta = 0 }, new Knot() { ID = 1, Ksi = -1, Heta = 1, Zeta = 0 }, new Knot() { ID = 2, Ksi = 1, Heta = -1, Zeta = 0 }, new Knot() { ID = 3, Ksi = 1, Heta = 1, Zeta = 0 }, }); foreach (var point in medianSurfaceGp) { _thicknessIntegrationPoints.Add(point, gauss.CalculateElementGaussPoints(ThicknessIntegrationDegree, new List <Knot> { new Knot() { ID = 0, Ksi = -Thickness / 2, Heta = point.Heta }, new Knot() { ID = 1, Ksi = Thickness / 2, Heta = point.Heta }, }).Select(gp => new GaussLegendrePoint3D(point.Ksi, point.Heta, gp.Ksi, gp.WeightFactor)).ToList()); } return(medianSurfaceGp); }