ISAAR.MSolve.IGA/Elements/TSplineKirchhoffLoveShellElementMaterial.cs
/// <summary>
/// This method calculates the internal forces of the element.
/// </summary>
/// <param name="element">An element of type <see cref="TSplineKirchhoffLoveShellElementMaterial"/>.</param>
/// <param name="localDisplacements">A <see cref="double"/> array containing the displacements for the degrees of freedom of the element.</param>
/// <param name="localdDisplacements">A <see cref="double"/> array containing the displacements change for the degrees of freedom of the element.</param>
/// <returns>A <see cref="double"/> array containing the forces all degrees of freedom.</returns>
This method calculates the internal forces of the element.
This method calculates the internal forces of the element .
public double[] CalculateForces(IElement element, double[] localDisplacements, double[] localdDisplacements)
		{
			var shellElement = (TSplineKirchhoffLoveShellElementMaterial)element;
			var gaussPoints = CreateElementGaussPoints(shellElement);
			var ElementNodalForces = new double[shellElement.ControlPointsDictionary.Count * 3];
			var elementControlPoints = shellElement.ControlPoints.ToArray();
			for (var j = 0; j < gaussPoints.Count; j++)
			{
				var jacobianMatrix = CalculateJacobian(elementControlPoints, _tsplines, j);
				var hessianMatrix = CalculateHessian(elementControlPoints, _tsplines, j);
				var surfaceBasisVector1 = CalculateSurfaceBasisVector1(jacobianMatrix, 0);
				var surfaceBasisVector2 = CalculateSurfaceBasisVector1(jacobianMatrix, 1);
				var surfaceBasisVector3 = new[]
				{
					surfaceBasisVector1[1] * surfaceBasisVector2[2] - surfaceBasisVector1[2] * surfaceBasisVector2[1],
					surfaceBasisVector1[2] * surfaceBasisVector2[0] - surfaceBasisVector1[0] * surfaceBasisVector2[2],
					surfaceBasisVector1[0] * surfaceBasisVector2[1] - surfaceBasisVector1[1] * surfaceBasisVector2[0]
				};
				var norm = surfaceBasisVector3.Sum(t => t * t);
				var J1 = Math.Sqrt(norm);
				for (int i = 0; i < surfaceBasisVector3.Length; i++)
					surfaceBasisVector3[i] = surfaceBasisVector3[i] / J1;
				var surfaceBasisVectorDerivative1 = CalculateSurfaceBasisVector1(hessianMatrix, 0);
				var surfaceBasisVectorDerivative2 = CalculateSurfaceBasisVector1(hessianMatrix, 1);
				var surfaceBasisVectorDerivative12 = CalculateSurfaceBasisVector1(hessianMatrix, 2);
				var Bmembrane = CalculateMembraneDeformationMatrix(_tsplines, j, surfaceBasisVector1,
					surfaceBasisVector2, elementControlPoints);
				var Bbending = CalculateBendingDeformationMatrix(surfaceBasisVector3, _tsplines, j, surfaceBasisVector2,
					surfaceBasisVectorDerivative1, surfaceBasisVector1, J1, surfaceBasisVectorDerivative2,
					surfaceBasisVectorDerivative12, elementControlPoints);
				var (MembraneForces, BendingMoments) =
					IntegratedStressesOverThickness(gaussPoints, j);
				var wfactor = J1 * gaussPoints[j].WeightFactor;
				for (var i = 0; i < Bmembrane.GetLength(1); i++)
				{
					for (var k = 0; k < Bmembrane.GetLength(0); k++)
					{
						ElementNodalForces[i] += Bmembrane[k, i] * MembraneForces[k] * wfactor +
												 Bbending[k, i] * BendingMoments[k] * wfactor;
					}
				}
			}
			return ElementNodalForces;
		}
public double [ ] CalculateForces ( IElement element , double [ ] localDisplacements , double [ ] localdDisplacements ) { var shellElement = ( TSplineKirchhoffLoveShellElementMaterial ) element ; var gaussPoints = CreateElementGaussPoints ( shellElement ) ; var ElementNodalForces = new double [ shellElement . ControlPointsDictionary . Count * 3 ] ; var elementControlPoints = shellElement . ControlPoints . ToArray ( ) ; for ( var j = 0 ; j < gaussPoints . Count ; j ++ ) { var jacobianMatrix = CalculateJacobian ( elementControlPoints , _tsplines , j ) ; var hessianMatrix = CalculateHessian ( elementControlPoints , _tsplines , j ) ; var surfaceBasisVector1 = CalculateSurfaceBasisVector1 ( jacobianMatrix , 0 ) ; var surfaceBasisVector2 = CalculateSurfaceBasisVector1 ( jacobianMatrix , 1 ) ; var surfaceBasisVector3 = new [ ] { surfaceBasisVector1 [ 1 ] * surfaceBasisVector2 [ 2 ] - surfaceBasisVector1 [ 2 ] * surfaceBasisVector2 [ 1 ] , surfaceBasisVector1 [ 2 ] * surfaceBasisVector2 [ 0 ] - surfaceBasisVector1 [ 0 ] * surfaceBasisVector2 [ 2 ] , surfaceBasisVector1 [ 0 ] * surfaceBasisVector2 [ 1 ] - surfaceBasisVector1 [ 1 ] * surfaceBasisVector2 [ 0 ] } ; var norm = surfaceBasisVector3 . Sum ( t => t * t ) ; var J1 = Math . Sqrt ( norm ) ; for ( int i = 0 ; i < surfaceBasisVector3 . Length ; i ++ ) surfaceBasisVector3 [ i ] = surfaceBasisVector3 [ i ] / J1 ; var surfaceBasisVectorDerivative1 = CalculateSurfaceBasisVector1 ( hessianMatrix , 0 ) ; var surfaceBasisVectorDerivative2 = CalculateSurfaceBasisVector1 ( hessianMatrix , 1 ) ; var surfaceBasisVectorDerivative12 = CalculateSurfaceBasisVector1 ( hessianMatrix , 2 ) ; var Bmembrane = CalculateMembraneDeformationMatrix ( _tsplines , j , surfaceBasisVector1 , surfaceBasisVector2 , elementControlPoints ) ; var Bbending = CalculateBendingDeformationMatrix ( surfaceBasisVector3 , _tsplines , j , surfaceBasisVector2 , surfaceBasisVectorDerivative1 , surfaceBasisVector1 , J1 , surfaceBasisVectorDerivative2 , surfaceBasisVectorDerivative12 , elementControlPoints ) ; var ( MembraneForces , BendingMoments ) = IntegratedStressesOverThickness ( gaussPoints , j ) ; var wfactor = J1 * gaussPoints [ j ] . WeightFactor ; for ( var i = 0 ; i < Bmembrane . GetLength ( 1 ) ; i ++ ) { for ( var k = 0 ; k < Bmembrane . GetLength ( 0 ) ; k ++ ) { ElementNodalForces [ i ] += Bmembrane [ k , i ] * MembraneForces [ k ] * wfactor + Bbending [ k , i ] * BendingMoments [ k ] * wfactor ; } } } return ElementNodalForces ; }
This method calculates the internal forces of the element.
This method calculates the internal forces of the element .
A  array containing the forces all degrees of freedom.
A array containing the forces all degrees of freedom .
element
IElement
An element of type .
An element of type .
localDisplacements
double[]
A  array containing the displacements for the degrees of freedom of the element.
A array containing the displacements for the degrees of freedom of the element .
localdDisplacements
double[]
A  array containing the displacements change for the degrees of freedom of the element.
A array containing the displacements change for the degrees of freedom of the element .