private PathGeometry KnotenlastZeichnen(AbstraktLast knotenlast) { var pathGeometry = new PathGeometry(); var pathFigure = new PathFigure(); const int lastPfeilGroesse = 10; if (modell.Knoten.TryGetValue(knotenlast.NodeId, out var lastKnoten)) { } if (lastKnoten != null) { var endPoint = new Point(lastKnoten.Coordinates[0] * auflösung - knotenlast.Intensity[0] * lastAuflösung, (-lastKnoten.Coordinates[1] + maxY) * auflösung + knotenlast.Intensity[1] * lastAuflösung); pathFigure.StartPoint = endPoint; var startPoint = TransformKnoten(lastKnoten, auflösung, maxY); pathFigure.Segments.Add(new LineSegment(startPoint, true)); var vector = startPoint - endPoint; vector.Normalize(); vector *= lastPfeilGroesse; vector = RotateVectorScreen(vector, 30); endPoint = new Point(startPoint.X - vector.X, startPoint.Y - vector.Y); pathFigure.Segments.Add(new LineSegment(endPoint, true)); vector = RotateVectorScreen(vector, -60); endPoint = new Point(startPoint.X - vector.X, startPoint.Y - vector.Y); pathFigure.Segments.Add(new LineSegment(endPoint, false)); pathFigure.Segments.Add(new LineSegment(startPoint, true)); if (knotenlast.Intensity.Length > 2 && Math.Abs(knotenlast.Intensity[2]) > Eps) { startPoint.X += 30; pathFigure.Segments.Add(new LineSegment(startPoint, false)); startPoint.X -= 30; startPoint.Y += 30; pathFigure.Segments.Add(new ArcSegment (startPoint, new Size(30, 30), 270, true, new SweepDirection(), true)); vector = new Vector(1, 0); vector *= lastPfeilGroesse; vector = RotateVectorScreen(vector, 45); endPoint = new Point(startPoint.X - vector.X, startPoint.Y - vector.Y); pathFigure.Segments.Add(new LineSegment(endPoint, true)); vector = RotateVectorScreen(vector, -60); endPoint = new Point(startPoint.X - vector.X, startPoint.Y - vector.Y); pathFigure.Segments.Add(new LineSegment(endPoint, false)); pathFigure.Segments.Add(new LineSegment(startPoint, true)); } } pathGeometry.Figures.Add(pathFigure); return(pathGeometry); }
public double[] ComputeLoadVector(AbstraktLast ael, bool inElementCoordinateSystem) { ComputeGeometry(); for (var i = 0; i < loadVector.Length; i++) { loadVector[i] = 0.0; } switch (ael) { case LinienLast ll: { // transform GAUSS point to range [0 -> 1] by using 0.5*(1+z) var gp = new[] { 0.5 * (1 - gaussPoint), 0.5 * (1 + gaussPoint) }; foreach (var point in gp) { double xLoad; double yLoad; if (!ll.IsInElementCoordinateSystem()) { xLoad = ll.GetXIntensity(point) * cos + ll.GetYIntensity(point) * sin; yLoad = ll.GetXIntensity(point) * -sin + ll.GetYIntensity(point) * cos; } else { xLoad = ll.GetXIntensity(point); yLoad = ll.GetYIntensity(point); } GetShapeFunctionValues(point); loadVector[0] += shapeFunction[0] * (xLoad) * length / 2; loadVector[1] += shapeFunction[1] * (yLoad) * length / 2; loadVector[2] += shapeFunction[2] * (yLoad) * length / 2; loadVector[3] += shapeFunction[3] * (xLoad) * length / 2; loadVector[4] += shapeFunction[4] * (yLoad) * length / 2; loadVector[5] += shapeFunction[5] * (yLoad) * length / 2; } break; } case PunktLast pl: { var intensity = pl.Intensity; GetShapeFunctionValues(pl.Offset); double xLoad; double yLoad; if (!pl.IsInElementCoordinateSystem()) { xLoad = intensity[0] * cos + intensity[1] * sin; yLoad = intensity[0] * -sin + intensity[1] * cos; } else { xLoad = intensity[0]; yLoad = intensity[1]; } loadVector[0] = shapeFunction[0] * xLoad; loadVector[1] = shapeFunction[1] * yLoad; loadVector[2] = shapeFunction[2] * yLoad; loadVector[3] = shapeFunction[3] * xLoad; loadVector[4] = shapeFunction[4] * yLoad; loadVector[5] = shapeFunction[5] * yLoad; break; } default: throw new ModellAusnahme("Last " + ael + " wird in diesem Elementtyp nicht unterstützt "); } if (inElementCoordinateSystem) { return(loadVector); } var tmpLoadVector = new double[6]; Array.Copy(loadVector, tmpLoadVector, loadVector.Length); // transforms the loadvector to the global coordinate system. loadVector[0] = tmpLoadVector[0] * cos + tmpLoadVector[1] * -sin; loadVector[1] = tmpLoadVector[0] * sin + tmpLoadVector[1] * cos; loadVector[2] = tmpLoadVector[2]; loadVector[3] = tmpLoadVector[3] * cos + tmpLoadVector[4] * -sin; loadVector[4] = tmpLoadVector[3] * sin + tmpLoadVector[4] * cos; loadVector[5] = tmpLoadVector[5]; return(loadVector); }