ISAAR.MSolve.IGA/Postprocessing/ParaviewTsplineShells.cs
/// <summary>
/// Creates Paraview File of the T-Splines shells geometry.
/// </summary>
Creates Paraview File of the T-Splines shells geometry.
Creates Paraview File of the T - Splines shells geometry .
public void CreateParaviewFile(TSplineShellType shellType = TSplineShellType.Linear)
		{
			var projectiveControlPoints = CalculateProjectiveControlPoints();
			var numberOfPointsPerElement = 4;
			var nodes = new double[_model.Elements.Count * numberOfPointsPerElement, 3];
			var pointIndex = 0;
			foreach (var element in _model.Elements)
			{
				var tsplineElement = element as TSplineKirchhoffLoveShellElement;
				var elementPoints = tsplineElement.CalculatePointsForPostProcessing(tsplineElement);
				for (int i = 0; i < elementPoints.GetLength(0); i++)
				{
					nodes[pointIndex, 0] = elementPoints[i, 0];
					nodes[pointIndex, 1] = elementPoints[i, 1];
					nodes[pointIndex++, 2] = elementPoints[i, 2];
				}
			}
			var elementConnectivity = CreateTsplineConnectivity();
			var pointDisplacements = new double[nodes.GetLength(0), 3];
			foreach (var element in _model.Elements)
			{
				var localDisplacements = Matrix.CreateZero(element.ControlPointsDictionary.Count, 3);
				var counterCP = 0;
				foreach (var controlPoint in element.ControlPoints)
				{
					localDisplacements[counterCP, 0] =
						(!_model.GlobalDofOrdering.GlobalFreeDofs.Contains(controlPoint, StructuralDof.TranslationX))
							? 0.0
							: _solution[_model.GlobalDofOrdering.GlobalFreeDofs[controlPoint, StructuralDof.TranslationX]];
					localDisplacements[counterCP, 1] =
						(!_model.GlobalDofOrdering.GlobalFreeDofs.Contains(controlPoint, StructuralDof.TranslationY))
							? 0.0
							: _solution[_model.GlobalDofOrdering.GlobalFreeDofs[controlPoint, StructuralDof.TranslationY]];
					localDisplacements[counterCP++, 2] =
						(!_model.GlobalDofOrdering.GlobalFreeDofs.Contains(controlPoint, StructuralDof.TranslationZ))
							? 0.0
							: _solution[_model.GlobalDofOrdering.GlobalFreeDofs[controlPoint, StructuralDof.TranslationZ]];
				}
				var elementKnotDisplacements = element.ElementType.CalculateDisplacementsForPostProcessing(element, localDisplacements);
				for (int i = 0; i < elementConnectivity.GetLength(1); i++)
				{
					var knotConnectivity = elementConnectivity[element.ID, i];
					pointDisplacements[knotConnectivity, 0] = elementKnotDisplacements[i, 0];
					pointDisplacements[knotConnectivity, 1] = elementKnotDisplacements[i, 1];
					pointDisplacements[knotConnectivity, 2] = elementKnotDisplacements[i, 2];
				}
			}
			WriteTSplineShellsFile(nodes, elementConnectivity, pointDisplacements);
		}
public void CreateParaviewFile ( TSplineShellType shellType = TSplineShellType . Linear ) { var projectiveControlPoints = CalculateProjectiveControlPoints ( ) ; var numberOfPointsPerElement = 4 ; var nodes = new double [ _model . Elements . Count * numberOfPointsPerElement , 3 ] ; var pointIndex = 0 ; foreach ( var element in _model . Elements ) { var tsplineElement = element as TSplineKirchhoffLoveShellElement ; var elementPoints = tsplineElement . CalculatePointsForPostProcessing ( tsplineElement ) ; for ( int i = 0 ; i < elementPoints . GetLength ( 0 ) ; i ++ ) { nodes [ pointIndex , 0 ] = elementPoints [ i , 0 ] ; nodes [ pointIndex , 1 ] = elementPoints [ i , 1 ] ; nodes [ pointIndex ++ , 2 ] = elementPoints [ i , 2 ] ; } } var elementConnectivity = CreateTsplineConnectivity ( ) ; var pointDisplacements = new double [ nodes . GetLength ( 0 ) , 3 ] ; foreach ( var element in _model . Elements ) { var localDisplacements = Matrix . CreateZero ( element . ControlPointsDictionary . Count , 3 ) ; var counterCP = 0 ; foreach ( var controlPoint in element . ControlPoints ) { localDisplacements [ counterCP , 0 ] = ( ! _model . GlobalDofOrdering . GlobalFreeDofs . Contains ( controlPoint , StructuralDof . TranslationX ) ) ? 0.0 : _solution [ _model . GlobalDofOrdering . GlobalFreeDofs [ controlPoint , StructuralDof . TranslationX ] ] ; localDisplacements [ counterCP , 1 ] = ( ! _model . GlobalDofOrdering . GlobalFreeDofs . Contains ( controlPoint , StructuralDof . TranslationY ) ) ? 0.0 : _solution [ _model . GlobalDofOrdering . GlobalFreeDofs [ controlPoint , StructuralDof . TranslationY ] ] ; localDisplacements [ counterCP ++ , 2 ] = ( ! _model . GlobalDofOrdering . GlobalFreeDofs . Contains ( controlPoint , StructuralDof . TranslationZ ) ) ? 0.0 : _solution [ _model . GlobalDofOrdering . GlobalFreeDofs [ controlPoint , StructuralDof . TranslationZ ] ] ; } var elementKnotDisplacements = element . ElementType . CalculateDisplacementsForPostProcessing ( element , localDisplacements ) ; for ( int i = 0 ; i < elementConnectivity . GetLength ( 1 ) ; i ++ ) { var knotConnectivity = elementConnectivity [ element . ID , i ] ; pointDisplacements [ knotConnectivity , 0 ] = elementKnotDisplacements [ i , 0 ] ; pointDisplacements [ knotConnectivity , 1 ] = elementKnotDisplacements [ i , 1 ] ; pointDisplacements [ knotConnectivity , 2 ] = elementKnotDisplacements [ i , 2 ] ; } } WriteTSplineShellsFile ( nodes , elementConnectivity , pointDisplacements ) ; }
Creates Paraview File of the T-Splines shells geometry.
Creates Paraview File of the T - Splines shells geometry .
shellType
TSplineShellType