ISAAR.MSolve.IGA/Elements/Continuum/ContinuumElement2D.cs
/// <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>
This method calculates the Pressure boundary condition when applied to a two-dimensional NURBS element.
This method calculates the Pressure boundary condition when applied to a two - dimensional NURBS element .
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();
			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 += _shapeFunctions.Values[k, j] * elementControlPoints[k].X;
					yGaussPoint += _shapeFunctions.Values[k, j] * elementControlPoints[k].Y;
					zGaussPoint += _shapeFunctions.Values[k, j] * elementControlPoints[k].Z;
					jacobianMatrix[0, 0] += _shapeFunctions.DerivativeValuesKsi[k, j] * elementControlPoints[k].X;
					jacobianMatrix[0, 1] += _shapeFunctions.DerivativeValuesKsi[k, j] * elementControlPoints[k].Y;
					jacobianMatrix[0, 2] += _shapeFunctions.DerivativeValuesKsi[k, j] * elementControlPoints[k].Z;
					jacobianMatrix[1, 0] += _shapeFunctions.DerivativeValuesHeta[k, j] * elementControlPoints[k].X;
					jacobianMatrix[1, 1] += _shapeFunctions.DerivativeValuesHeta[k, j] * elementControlPoints[k].Y;
					jacobianMatrix[1, 2] += _shapeFunctions.DerivativeValuesHeta[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] += _shapeFunctions.Values[k, j] * jacdet * gaussPoints[j].WeightFactor *
												   pressure.Value * surfaceBasisVector3[m];
						}
						else
						{
							pressureLoad.Add(dofID,
                                _shapeFunctions.Values[k, j] * jacdet * gaussPoints[j].WeightFactor * pressure.Value * surfaceBasisVector3[m]);
						}
					}
				}
			}
			return pressureLoad;
		}
public Dictionary < int , double > CalculateLoadingCondition ( Element element , Face face , PressureBoundaryCondition pressure ) { Contract . Requires ( element != null , " " ) ; Contract . Requires ( face != null , " " ) ; Contract . Requires ( pressure != 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 ( ) ; 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 += _shapeFunctions . Values [ k , j ] * elementControlPoints [ k ] . X ; yGaussPoint += _shapeFunctions . Values [ k , j ] * elementControlPoints [ k ] . Y ; zGaussPoint += _shapeFunctions . Values [ k , j ] * elementControlPoints [ k ] . Z ; jacobianMatrix [ 0 , 0 ] += _shapeFunctions . DerivativeValuesKsi [ k , j ] * elementControlPoints [ k ] . X ; jacobianMatrix [ 0 , 1 ] += _shapeFunctions . DerivativeValuesKsi [ k , j ] * elementControlPoints [ k ] . Y ; jacobianMatrix [ 0 , 2 ] += _shapeFunctions . DerivativeValuesKsi [ k , j ] * elementControlPoints [ k ] . Z ; jacobianMatrix [ 1 , 0 ] += _shapeFunctions . DerivativeValuesHeta [ k , j ] * elementControlPoints [ k ] . X ; jacobianMatrix [ 1 , 1 ] += _shapeFunctions . DerivativeValuesHeta [ k , j ] * elementControlPoints [ k ] . Y ; jacobianMatrix [ 1 , 2 ] += _shapeFunctions . DerivativeValuesHeta [ 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 ] += _shapeFunctions . Values [ k , j ] * jacdet * gaussPoints [ j ] . WeightFactor * pressure . Value * surfaceBasisVector3 [ m ] ; } else { pressureLoad . Add ( dofID , _shapeFunctions . Values [ k , j ] * jacdet * gaussPoints [ j ] . WeightFactor * pressure . Value * surfaceBasisVector3 [ m ] ) ; } } } } return pressureLoad ; }
This method calculates the Pressure boundary condition when applied to a two-dimensional NURBS element.
This method calculates the Pressure boundary condition when applied to a two - dimensional NURBS element .
A  where integer values denote the degree of freedom that has a value double load value due to the enforcement of the .
A where integer values denote the degree of freedom that has a value double load value due to the enforcement of the .
element
Element
An element of type .
An element of type .
face
Face
An two dimensional boundary entity. For more info see .
An two dimensional boundary entity . For more info see .
pressure
PressureBoundaryCondition
None