Пример #1
0
        /// <summary>
        /// Defines an 1D NURBS shape function for an edge element.
        /// </summary>
        /// <param name="element">An <see cref="Element"/> of type <see cref="NurbsElement1D"/>.</param>
        /// <param name="controlPoints">A <see cref="List{T}"/> containing the control points of the element.</param>
        /// <param name="edge">The one-dimensional boundary entity that contains the <paramref name="element"/>.</param>
        public Nurbs1D(Element element, IList <ControlPoint> controlPoints, Edge edge)
        {
            GaussQuadrature gauss = new GaussQuadrature();
            IList <GaussLegendrePoint3D> gaussPoints = gauss.CalculateElementGaussPoints(edge.Degree, element.Knots.ToArray());

            var parametricGaussPointKsi = Vector.CreateZero(edge.Degree + 1);

            for (int i = 0; i < edge.Degree + 1; i++)
            {
                parametricGaussPointKsi[i] = gaussPoints[i].Ksi;
            }
            var bsplinesKsi = new BSPLines1D(edge.Degree, edge.KnotValueVector, parametricGaussPointKsi);

            bsplinesKsi.calculateBSPLinesAndDerivatives();

            int supportKsi = edge.Degree + 1;
            int numberOfElementControlPoints = supportKsi;

            NurbsValues = Matrix.CreateZero(numberOfElementControlPoints, gaussPoints.Count);
            NurbsDerivativeValuesKsi = Matrix.CreateZero(numberOfElementControlPoints, gaussPoints.Count);

            for (int i = 0; i < supportKsi; i++)
            {
                double sumKsi  = 0;
                double sumdKsi = 0;

                for (int j = 0; j < numberOfElementControlPoints; j++)
                {
                    int index = controlPoints[j].ID;
                    sumKsi  += bsplinesKsi.BSPLineValues[index, i] * controlPoints[j].WeightFactor;
                    sumdKsi += bsplinesKsi.BSPLineDerivativeValues[index, i] * controlPoints[j].WeightFactor;
                }
                for (int j = 0; j < numberOfElementControlPoints; j++)
                {
                    int indexKsi = controlPoints[j].ID;
                    NurbsValues[j, i] = bsplinesKsi.BSPLineValues[indexKsi, i] * controlPoints[j].WeightFactor / sumKsi;
                    NurbsDerivativeValuesKsi[j, i] = controlPoints[j].WeightFactor * (bsplinesKsi.BSPLineDerivativeValues[indexKsi, i] * sumKsi -
                                                                                      bsplinesKsi.BSPLineValues[indexKsi, i] * sumdKsi) / Math.Pow(sumKsi, 2);
                }
            }
        }
        /// <summary>
        /// Two-dimensional T-spline shape functions from Bezier extraction for <see cref="TSplineKirchhoffLoveShellElementMaterial"/>.
        /// </summary>
        /// <param name="element">An <see cref="Element"/> of type <see cref="TSplineKirchhoffLoveShellElementMaterial"/>.</param>
        /// <param name="controlPoints">A <see cref="List{T}"/> containing the control points of the element.</param>
        public ShapeTSplines2DFromBezierExtraction(TSplineKirchhoffLoveShellElementMaterial element, ControlPoint[] controlPoints)
        {
            GaussQuadrature gauss = new GaussQuadrature();
            IList <GaussLegendrePoint3D> gaussPoints = 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
                }
            });

            var parametricGaussPointKsi = Vector.CreateZero(element.DegreeKsi + 1);

            for (int i = 0; i < element.DegreeKsi + 1; i++)
            {
                parametricGaussPointKsi[i] = gaussPoints[i * (element.DegreeHeta + 1)].Ksi;
            }

            var parametricGaussPointHeta = Vector.CreateZero(element.DegreeHeta + 1);

            for (int i = 0; i < element.DegreeHeta + 1; i++)
            {
                parametricGaussPointHeta[i] = gaussPoints[i].Heta;
            }

            Vector knotValueVectorKsi  = Vector.CreateZero((element.DegreeKsi + 1) * 2);
            Vector knotValueVectorHeta = Vector.CreateZero((element.DegreeHeta + 1) * 2);

            for (int i = 0; i < element.DegreeKsi + 1; i++)
            {
                knotValueVectorKsi[i] = -1;
                knotValueVectorKsi[element.DegreeKsi + 1 + i] = 1;
            }
            for (int i = 0; i < element.DegreeHeta + 1; i++)
            {
                knotValueVectorHeta[i] = -1;
                knotValueVectorHeta[element.DegreeHeta + 1 + i] = 1;
            }

            BSPLines1D bernsteinKsi  = new BSPLines1D(element.DegreeKsi, knotValueVectorKsi, parametricGaussPointKsi);
            BSPLines1D bernsteinHeta = new BSPLines1D(element.DegreeHeta, knotValueVectorHeta, parametricGaussPointHeta);

            bernsteinKsi.calculateBSPLinesAndDerivatives();
            bernsteinHeta.calculateBSPLinesAndDerivatives();

            int supportKsi  = element.DegreeKsi + 1;
            int supportHeta = element.DegreeHeta + 1;

            var bKsi   = MatrixPart(supportKsi, bernsteinKsi.BSPLineValues);
            var bdKsi  = MatrixPart(supportKsi, bernsteinKsi.BSPLineDerivativeValues);
            var bddKsi = MatrixPart(supportKsi, bernsteinKsi.BSPLineSecondDerivativeValues);

            var bheta   = MatrixPart(supportHeta, bernsteinHeta.BSPLineValues);
            var bdheta  = MatrixPart(supportHeta, bernsteinHeta.BSPLineDerivativeValues);
            var bddheta = MatrixPart(supportHeta, bernsteinHeta.BSPLineSecondDerivativeValues);

            var    bernsteinShapeFunctions = KroneckerProduct(bKsi, bheta);
            Matrix bernsteinShapeFunctionDerivativesKsi           = KroneckerProduct(bheta, bdKsi);
            Matrix bernsteinShapeFunctionDerivativesHeta          = KroneckerProduct(bdheta, bKsi);
            Matrix bernsteinShapeFunctionSecondDerivativesKsi     = KroneckerProduct(bheta, bddKsi);
            Matrix bernsteinShapeFunctionSecondDerivativesHeta    = KroneckerProduct(bddheta, bKsi);
            Matrix bernsteinShapeFunctionSecondDerivativesKsiHeta = KroneckerProduct(bdheta, bdKsi);

            Matrix rationalTSplines = element.ExtractionOperator * bernsteinShapeFunctions;
            Matrix rationalTSplineDerivativesKsi           = element.ExtractionOperator * bernsteinShapeFunctionDerivativesKsi;
            Matrix rationalTSplineDerivativesHeta          = element.ExtractionOperator * bernsteinShapeFunctionDerivativesHeta;
            Matrix rationalTSplineSecondDerivativesKsi     = element.ExtractionOperator * bernsteinShapeFunctionSecondDerivativesKsi;
            Matrix rationalTSplineSecondDerivativesHeta    = element.ExtractionOperator * bernsteinShapeFunctionSecondDerivativesHeta;
            Matrix rationalTSplineSecondDerivativesKsiHeta = element.ExtractionOperator * bernsteinShapeFunctionSecondDerivativesKsiHeta;

            TSplineValues = Matrix.CreateZero(controlPoints.Length, supportKsi * supportHeta);
            TSplineDerivativeValuesKsi           = Matrix.CreateZero(controlPoints.Length, supportKsi * supportHeta);
            TSplineDerivativeValuesHeta          = Matrix.CreateZero(controlPoints.Length, supportKsi * supportHeta);
            TSplineSecondDerivativesValueKsi     = Matrix.CreateZero(controlPoints.Length, supportKsi * supportHeta);
            TSplineSecondDerivativesValueHeta    = Matrix.CreateZero(controlPoints.Length, supportKsi * supportHeta);
            TSplineSecondDerivativesValueKsiHeta = Matrix.CreateZero(controlPoints.Length, supportKsi * supportHeta);

            for (int i = 0; i < supportKsi; i++)
            {
                for (int j = 0; j < supportHeta; j++)
                {
                    double sumKsiHeta    = 0;
                    double sumdKsiHeta   = 0;
                    double sumKsidHeta   = 0;
                    double sumdKsidKsi   = 0;
                    double sumdHetadHeta = 0;
                    double sumdKsidHeta  = 0;

                    var index = i * supportHeta + j;

                    for (int k = 0; k < controlPoints.Length; k++)
                    {
                        sumKsiHeta    += rationalTSplines[k, index] * controlPoints[k].WeightFactor;
                        sumdKsiHeta   += rationalTSplineDerivativesKsi[k, index] * controlPoints[k].WeightFactor;
                        sumKsidHeta   += rationalTSplineDerivativesHeta[k, index] * controlPoints[k].WeightFactor;
                        sumdKsidKsi   += rationalTSplineSecondDerivativesKsi[k, index] * controlPoints[k].WeightFactor;
                        sumdHetadHeta += rationalTSplineSecondDerivativesHeta[k, index] * controlPoints[k].WeightFactor;
                        sumdKsidHeta  += rationalTSplineSecondDerivativesKsiHeta[k, index] * controlPoints[k].WeightFactor;
                    }

                    for (int k = 0; k < controlPoints.Length; k++)
                    {
                        TSplineValues[k, index] = rationalTSplines[k, index] * controlPoints[k].WeightFactor / sumKsiHeta;
                        TSplineDerivativeValuesKsi[k, index] = (rationalTSplineDerivativesKsi[k, index] * sumKsiHeta -
                                                                rationalTSplines[k, index] * sumdKsiHeta) /
                                                               Math.Pow(sumKsiHeta, 2) * controlPoints[k].WeightFactor;
                        TSplineDerivativeValuesHeta[k, index] = (rationalTSplineDerivativesHeta[k, index] * sumKsiHeta -
                                                                 rationalTSplines[k, index] * sumKsidHeta) /
                                                                Math.Pow(sumKsiHeta, 2) * controlPoints[k].WeightFactor;
                        TSplineSecondDerivativesValueKsi[k, index] = (rationalTSplineSecondDerivativesKsi[k, index] / sumKsiHeta -
                                                                      2 * rationalTSplineDerivativesKsi[k, index] * sumdKsiHeta /
                                                                      Math.Pow(sumKsiHeta, 2) -
                                                                      rationalTSplines[k, index] * sumdKsidKsi / Math.Pow(sumKsiHeta, 2) +
                                                                      2 * rationalTSplines[k, index] * Math.Pow(sumdKsiHeta, 2) /
                                                                      Math.Pow(sumKsiHeta, 3)) * controlPoints[k].WeightFactor;
                        TSplineSecondDerivativesValueHeta[k, index] = (rationalTSplineSecondDerivativesHeta[k, index] / sumKsiHeta -
                                                                       2 * rationalTSplineDerivativesHeta[k, index] * sumKsidHeta /
                                                                       Math.Pow(sumKsiHeta, 2) -
                                                                       rationalTSplines[k, index] * sumdHetadHeta /
                                                                       Math.Pow(sumKsiHeta, 2) +
                                                                       2 * rationalTSplines[k, index] * Math.Pow(sumKsidHeta, 2) /
                                                                       Math.Pow(sumKsiHeta, 3)) * controlPoints[k].WeightFactor;
                        TSplineSecondDerivativesValueKsiHeta[k, index] = (rationalTSplineSecondDerivativesKsiHeta[k, index] / sumKsiHeta -
                                                                          rationalTSplineDerivativesKsi[k, index] * sumKsidHeta /
                                                                          Math.Pow(sumKsiHeta, 2) -
                                                                          rationalTSplineDerivativesHeta[k, index] * sumdKsiHeta /
                                                                          Math.Pow(sumKsiHeta, 2) -
                                                                          rationalTSplines[k, index] * sumdKsidHeta /
                                                                          Math.Pow(sumKsiHeta, 2) +
                                                                          2 * rationalTSplines[k, index] * sumdKsiHeta * sumKsidHeta /
                                                                          Math.Pow(sumKsiHeta, 3)) *
                                                                         controlPoints[k].WeightFactor;
                    }
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Defines 3D NURBS shape functions given the control points.
        /// </summary>
        /// <param name="element">An <see cref="Element"/> of type <see cref="NurbsElement3D"/>.</param>
        /// <param name="controlPoints">A <see cref="List{T}"/> containing the control points of the element.</param>
        public Nurbs3D(Element element, ControlPoint[] controlPoints)
        {
            GaussQuadrature gauss = new GaussQuadrature();
            IList <GaussLegendrePoint3D> gaussPoints = gauss.CalculateElementGaussPoints(element.Patch.DegreeKsi, element.Patch.DegreeHeta, element.Patch.DegreeZeta, element.Knots.ToArray());

            var parametricGaussPointKsi = Vector.CreateZero(element.Patch.DegreeKsi + 1);

            for (int i = 0; i < element.Patch.DegreeKsi + 1; i++)
            {
                parametricGaussPointKsi[i] = gaussPoints[i * (element.Patch.DegreeZeta + 1) * (element.Patch.DegreeHeta + 1)].Ksi;
            }

            var parametricGaussPointHeta = Vector.CreateZero(element.Patch.DegreeHeta + 1);

            for (int i = 0; i < element.Patch.DegreeHeta + 1; i++)
            {
                parametricGaussPointHeta[i] = gaussPoints[i * (element.Patch.DegreeZeta + 1)].Heta;
            }

            var parametricGaussPointZeta = Vector.CreateZero(element.Patch.DegreeZeta + 1);

            for (int i = 0; i < element.Patch.DegreeZeta + 1; i++)
            {
                parametricGaussPointZeta[i] = gaussPoints[i].Zeta;
            }

            BSPLines1D bsplinesKsi  = new BSPLines1D(element.Patch.DegreeKsi, element.Patch.KnotValueVectorKsi, parametricGaussPointKsi);
            BSPLines1D bsplinesHeta = new BSPLines1D(element.Patch.DegreeHeta, element.Patch.KnotValueVectorHeta, parametricGaussPointHeta);
            BSPLines1D bsplinesZeta = new BSPLines1D(element.Patch.DegreeZeta, element.Patch.KnotValueVectorZeta, parametricGaussPointZeta);

            bsplinesKsi.calculateBSPLinesAndDerivatives();
            bsplinesHeta.calculateBSPLinesAndDerivatives();
            bsplinesZeta.calculateBSPLinesAndDerivatives();

            int supportKsi  = element.Patch.DegreeKsi + 1;
            int supportHeta = element.Patch.DegreeHeta + 1;
            int supportZeta = element.Patch.DegreeZeta + 1;
            int numberOfElementControlPoints = supportKsi * supportHeta * supportZeta;

            NurbsValues = Matrix.CreateZero(numberOfElementControlPoints, gaussPoints.Count);
            NurbsDerivativeValuesKsi  = Matrix.CreateZero(numberOfElementControlPoints, gaussPoints.Count);
            NurbsDerivativeValuesHeta = Matrix.CreateZero(numberOfElementControlPoints, gaussPoints.Count);
            NurbsDerivativeValuesZeta = Matrix.CreateZero(numberOfElementControlPoints, gaussPoints.Count);

            for (int i = 0; i < supportKsi; i++)
            {
                for (int j = 0; j < supportHeta; j++)
                {
                    for (int k = 0; k < supportZeta; k++)
                    {
                        double sumKsiHetaZeta  = 0;
                        double sumdKsiHetaZeta = 0;
                        double sumKsidHetaZeta = 0;
                        double sumKsiHetadZeta = 0;

                        for (int m = 0; m < numberOfElementControlPoints; m++)
                        {
                            int indexKsi  = controlPoints[m].ID / (element.Patch.NumberOfControlPointsHeta * element.Patch.NumberOfControlPointsZeta);
                            int indexHeta = controlPoints[m].ID % (element.Patch.NumberOfControlPointsHeta * element.Patch.NumberOfControlPointsZeta) / element.Patch.NumberOfControlPointsZeta;
                            int indexZeta = controlPoints[m].ID % (element.Patch.NumberOfControlPointsHeta * element.Patch.NumberOfControlPointsZeta) % element.Patch.NumberOfControlPointsZeta;

                            sumKsiHetaZeta += bsplinesKsi.BSPLineValues[indexKsi, i] *
                                              bsplinesHeta.BSPLineValues[indexHeta, j] *
                                              bsplinesZeta.BSPLineValues[indexZeta, k] *
                                              controlPoints[m].WeightFactor;

                            sumdKsiHetaZeta += bsplinesKsi.BSPLineDerivativeValues[indexKsi, i] *
                                               bsplinesHeta.BSPLineValues[indexHeta, j] *
                                               bsplinesZeta.BSPLineValues[indexZeta, k] *
                                               controlPoints[m].WeightFactor;

                            sumKsidHetaZeta += bsplinesKsi.BSPLineValues[indexKsi, i] *
                                               bsplinesHeta.BSPLineDerivativeValues[indexHeta, j] *
                                               bsplinesZeta.BSPLineValues[indexZeta, k] *
                                               controlPoints[m].WeightFactor;

                            sumKsiHetadZeta += bsplinesKsi.BSPLineValues[indexKsi, i] *
                                               bsplinesHeta.BSPLineValues[indexHeta, j] *
                                               bsplinesZeta.BSPLineDerivativeValues[indexZeta, k] *
                                               controlPoints[m].WeightFactor;
                        }
                        for (int m = 0; m < numberOfElementControlPoints; m++)
                        {
                            int indexKsi  = controlPoints[m].ID / (element.Patch.NumberOfControlPointsHeta * element.Patch.NumberOfControlPointsZeta);
                            int indexHeta = controlPoints[m].ID % (element.Patch.NumberOfControlPointsHeta * element.Patch.NumberOfControlPointsZeta) / element.Patch.NumberOfControlPointsZeta;
                            int indexZeta = controlPoints[m].ID % (element.Patch.NumberOfControlPointsHeta * element.Patch.NumberOfControlPointsZeta) % element.Patch.NumberOfControlPointsZeta;

                            NurbsValues[m, i *supportHeta *supportZeta + j * supportZeta + k] =
                                bsplinesKsi.BSPLineValues[indexKsi, i] *
                                bsplinesHeta.BSPLineValues[indexHeta, j] *
                                bsplinesZeta.BSPLineValues[indexZeta, k] *
                                controlPoints[m].WeightFactor / sumKsiHetaZeta;

                            NurbsDerivativeValuesKsi[m, i *supportHeta *supportZeta + j * supportZeta + k] =
                                (bsplinesKsi.BSPLineDerivativeValues[indexKsi, i] * sumKsiHetaZeta -
                                 bsplinesKsi.BSPLineValues[indexKsi, i] * sumdKsiHetaZeta) *
                                bsplinesHeta.BSPLineValues[indexHeta, j] *
                                bsplinesZeta.BSPLineValues[indexZeta, k] *
                                controlPoints[m].WeightFactor / Math.Pow(sumKsiHetaZeta, 2);

                            NurbsDerivativeValuesHeta[m, i *supportHeta *supportZeta + j * supportZeta + k] =
                                bsplinesKsi.BSPLineValues[indexKsi, i] *
                                (bsplinesHeta.BSPLineDerivativeValues[indexHeta, j] * sumKsiHetaZeta -
                                 bsplinesHeta.BSPLineValues[indexHeta, j] * sumKsidHetaZeta) *
                                bsplinesZeta.BSPLineValues[indexZeta, k] *
                                controlPoints[m].WeightFactor / Math.Pow(sumKsiHetaZeta, 2);

                            NurbsDerivativeValuesZeta[m, i *supportHeta *supportZeta + j * supportZeta + k] =
                                bsplinesKsi.BSPLineValues[indexKsi, i] *
                                bsplinesHeta.BSPLineValues[indexHeta, j] *
                                (bsplinesZeta.BSPLineDerivativeValues[indexZeta, k] * sumKsiHetaZeta -
                                 bsplinesZeta.BSPLineValues[indexZeta, k] * sumKsiHetadZeta) *
                                controlPoints[m].WeightFactor / Math.Pow(sumKsiHetaZeta, 2);
                        }
                    }
                }
            }
        }
Пример #4
0
        /// <summary>
        /// Defines n 2D NURBS shape function for a face element.
        /// </summary>
        /// <param name="element">An <see cref="Element"/> of type <see cref="NurbsElement2D"/>.</param>
        /// <param name="controlPoints">A <see cref="List{T}"/> containing the control points of the element.</param>
        /// <param name="face">The two-dimensional boundary entities where the <paramref name="element"/> shape functions will be evaluated.</param>
        public Nurbs2D(Element element, ControlPoint[] controlPoints, Face face)
        {
            var degreeKsi                 = face.Degrees[0];
            var degreeHeta                = face.Degrees[1];
            var knotValueVectorKsi        = face.KnotValueVectors[0];
            var knotValueVectorHeta       = face.KnotValueVectors[1];
            var numberOfControlPointsHeta = knotValueVectorHeta.Length - degreeHeta - 1;

            GaussQuadrature gauss = new GaussQuadrature();
            IList <GaussLegendrePoint3D> gaussPoints =
                gauss.CalculateElementGaussPoints(degreeKsi, degreeHeta, element.Knots.ToArray());

            var parametricGaussPointKsi = Vector.CreateZero(degreeKsi + 1);

            for (int i = 0; i < degreeKsi + 1; i++)
            {
                parametricGaussPointKsi[i] = gaussPoints[i * (degreeHeta + 1)].Ksi;
            }

            var parametricGaussPointHeta = Vector.CreateZero(degreeHeta + 1);

            for (int i = 0; i < degreeHeta + 1; i++)
            {
                parametricGaussPointHeta[i] = gaussPoints[i].Heta;
            }

            BSPLines1D bsplinesKsi  = new BSPLines1D(degreeKsi, knotValueVectorKsi, parametricGaussPointKsi);
            BSPLines1D bsplinesHeta = new BSPLines1D(degreeHeta, knotValueVectorHeta, parametricGaussPointHeta);

            bsplinesKsi.calculateBSPLinesAndDerivatives();
            bsplinesHeta.calculateBSPLinesAndDerivatives();

            int supportKsi  = degreeKsi + 1;
            int supportHeta = degreeHeta + 1;
            int numberOfElementControlPoints = supportKsi * supportHeta;

            NurbsValues = Matrix.CreateZero(numberOfElementControlPoints, gaussPoints.Count);
            NurbsDerivativeValuesKsi          = Matrix.CreateZero(numberOfElementControlPoints, gaussPoints.Count);
            NurbsDerivativeValuesHeta         = Matrix.CreateZero(numberOfElementControlPoints, gaussPoints.Count);
            NurbsSecondDerivativeValueKsi     = Matrix.CreateZero(numberOfElementControlPoints, gaussPoints.Count);
            NurbsSecondDerivativeValueHeta    = Matrix.CreateZero(numberOfElementControlPoints, gaussPoints.Count);
            NurbsSecondDerivativeValueKsiHeta = Matrix.CreateZero(numberOfElementControlPoints, gaussPoints.Count);

            for (int i = 0; i < supportKsi; i++)
            {
                for (int j = 0; j < supportHeta; j++)
                {
                    double sumKsiHeta    = 0;
                    double sumdKsiHeta   = 0;
                    double sumKsidHeta   = 0;
                    double sumdKsidKsi   = 0;
                    double sumdHetadHeta = 0;
                    double sumdKsidHeta  = 0;

                    for (int k = 0; k < numberOfElementControlPoints; k++)
                    {
                        int indexKsi =
                            face.ControlPointsDictionary.First(cp => cp.Value.ID == controlPoints[k].ID).Key /
                            numberOfControlPointsHeta;
                        int indexHeta =
                            face.ControlPointsDictionary.First(cp => cp.Value.ID == controlPoints[k].ID).Key %
                            numberOfControlPointsHeta;
                        sumKsiHeta += bsplinesKsi.BSPLineValues[indexKsi, i] *
                                      bsplinesHeta.BSPLineValues[indexHeta, j] *
                                      controlPoints[k].WeightFactor;
                        sumdKsiHeta += bsplinesKsi.BSPLineDerivativeValues[indexKsi, i] *
                                       bsplinesHeta.BSPLineValues[indexHeta, j] *
                                       controlPoints[k].WeightFactor;
                        sumKsidHeta += bsplinesKsi.BSPLineValues[indexKsi, i] *
                                       bsplinesHeta.BSPLineDerivativeValues[indexHeta, j] *
                                       controlPoints[k].WeightFactor;
                        sumdKsidKsi += bsplinesKsi.BSPLineSecondDerivativeValues[indexKsi, i] *
                                       bsplinesHeta.BSPLineValues[indexHeta, j] *
                                       controlPoints[k].WeightFactor;
                        sumdHetadHeta += bsplinesKsi.BSPLineValues[indexKsi, i] *
                                         bsplinesHeta.BSPLineSecondDerivativeValues[indexHeta, j] *
                                         controlPoints[k].WeightFactor;
                        sumdKsidHeta += bsplinesKsi.BSPLineDerivativeValues[indexKsi, i] *
                                        bsplinesHeta.BSPLineDerivativeValues[indexHeta, j] *
                                        controlPoints[k].WeightFactor;
                    }

                    for (int k = 0; k < numberOfElementControlPoints; k++)
                    {
                        int indexKsi =
                            face.ControlPointsDictionary.First(cp => cp.Value.ID == controlPoints[k].ID).Key /
                            numberOfControlPointsHeta;
                        int indexHeta =
                            face.ControlPointsDictionary.First(cp => cp.Value.ID == controlPoints[k].ID).Key %
                            numberOfControlPointsHeta;

                        NurbsValues[k, i *supportHeta + j] =
                            bsplinesKsi.BSPLineValues[indexKsi, i] *
                            bsplinesHeta.BSPLineValues[indexHeta, j] *
                            controlPoints[k].WeightFactor / sumKsiHeta;

                        NurbsDerivativeValuesKsi[k, i *supportHeta + j] =
                            bsplinesHeta.BSPLineValues[indexHeta, j] * controlPoints[k].WeightFactor *
                            (bsplinesKsi.BSPLineDerivativeValues[indexKsi, i] * sumKsiHeta -
                             bsplinesKsi.BSPLineValues[indexKsi, i] * sumdKsiHeta) / Math.Pow(sumKsiHeta, 2);

                        NurbsDerivativeValuesHeta[k, i *supportHeta + j] =
                            bsplinesKsi.BSPLineValues[indexKsi, i] * controlPoints[k].WeightFactor *
                            (bsplinesHeta.BSPLineDerivativeValues[indexHeta, j] * sumKsiHeta -
                             bsplinesHeta.BSPLineValues[indexHeta, j] * sumKsidHeta) / Math.Pow(sumKsiHeta, 2);

                        NurbsSecondDerivativeValueKsi[k, i *supportHeta + j] =
                            bsplinesHeta.BSPLineValues[indexHeta, j] * controlPoints[k].WeightFactor *
                            (bsplinesKsi.BSPLineSecondDerivativeValues[indexKsi, i] / sumKsiHeta -
                             2 * bsplinesKsi.BSPLineDerivativeValues[indexKsi, i] * sumdKsiHeta /
                             Math.Pow(sumKsiHeta, 2) -
                             bsplinesKsi.BSPLineValues[indexKsi, i] * sumdKsidKsi / Math.Pow(sumKsiHeta, 2) +
                             2 * bsplinesKsi.BSPLineValues[indexKsi, i] * Math.Pow(sumdKsiHeta, 2) /
                             Math.Pow(sumKsiHeta, 3));

                        NurbsSecondDerivativeValueHeta[k, i *supportHeta + j] =
                            bsplinesKsi.BSPLineValues[indexKsi, i] * controlPoints[k].WeightFactor *
                            (bsplinesHeta.BSPLineSecondDerivativeValues[indexHeta, j] / sumKsiHeta -
                             2 * bsplinesHeta.BSPLineDerivativeValues[indexHeta, j] * sumKsidHeta /
                             Math.Pow(sumKsiHeta, 2) -
                             bsplinesHeta.BSPLineValues[indexHeta, j] * sumdHetadHeta / Math.Pow(sumKsiHeta, 2) +
                             2 * bsplinesHeta.BSPLineValues[indexHeta, j] * Math.Pow(sumKsidHeta, 2) /
                             Math.Pow(sumKsiHeta, 3));

                        NurbsSecondDerivativeValueKsiHeta[k, i *supportHeta + j] =
                            controlPoints[k].WeightFactor *
                            (bsplinesKsi.BSPLineDerivativeValues[indexKsi, i] *
                             bsplinesHeta.BSPLineDerivativeValues[indexHeta, j] / sumKsiHeta -
                             bsplinesKsi.BSPLineDerivativeValues[indexKsi, i] *
                             bsplinesHeta.BSPLineValues[indexHeta, j] *
                             sumKsidHeta / Math.Pow(sumKsiHeta, 2) -
                             bsplinesKsi.BSPLineValues[indexKsi, i] *
                             bsplinesHeta.BSPLineDerivativeValues[indexHeta, j] *
                             sumdKsiHeta / Math.Pow(sumKsiHeta, 2) -
                             bsplinesKsi.BSPLineValues[indexKsi, i] * bsplinesHeta.BSPLineValues[indexHeta, j] *
                             sumdKsidHeta / Math.Pow(sumKsiHeta, 2) +
                             2 * bsplinesKsi.BSPLineValues[indexKsi, i] * bsplinesHeta.BSPLineValues[indexHeta, j] *
                             sumdKsiHeta * sumKsidHeta / Math.Pow(sumKsiHeta, 3));
                    }
                }
            }
        }