// Method to apply the worksheet to a beam model public override void ApplyWorksheet(ref List <IElement> elementList, ref List <INode> nodeList) { if (nodeList.Count == 0) { nodeList.Add(new Basic2DNode( (IEnumerable <double>) new double[] { 0.0d, 0.0d, 0.0d }, (IEnumerable <double>) new double[] { 0.0d, 0.0d, 0.0d })); nodeList[0].FixedDOF[0] = false; nodeList[0].FixedDOF[1] = false; nodeList[0].FixedDOF[2] = false; } BasicSectionInputsControl ip0 = elementInputsControl as BasicSectionInputsControl; double subElementLength = ip0.Length / (double)ip0.Subsections; double[] endNodeLocation = new double[3]; nodeList[nodeList.Count - 1].Location[2] += ip0.RelAngle; for (int i = 0; i < ip0.Subsections; i++) { endNodeLocation[0] = nodeList[nodeList.Count - 1].Location[0] + subElementLength * Math.Cos(nodeList[nodeList.Count - 1].Location[2]); endNodeLocation[1] = nodeList[nodeList.Count - 1].Location[1] + subElementLength * Math.Sin(nodeList[nodeList.Count - 1].Location[2]); endNodeLocation[2] = nodeList[nodeList.Count - 1].Location[2]; nodeList.Add(new Basic2DNode((IEnumerable <double>)endNodeLocation, (IEnumerable <double>) new double[] { 0.0d, 0.0d, 0.0d })); elementList.Add(new BasicSectionElement(nodeList[nodeList.Count - 2], nodeList[nodeList.Count - 1], ip0)); } }
// Class creation method public BasicSectionElement(INode startNode, INode endNode, BasicSectionInputsControl ip) { // should consolidate all inputs into a single BasicSectionInputsPanel class _nodes.Add(startNode); _nodes.Add(endNode); _E = ip.Modulus; _A = ip.Area; _I = ip.Inertia; _C = ip.MaxFiberDistance; double l = L; for (int i = 0; i < 4; i++) { _stiffness.Add(new SquareMatrix(3)); _stiffness.Last()[0][0] = _A * _E / l; _stiffness.Last()[0][1] = 0.0d; _stiffness.Last()[0][2] = 0.0d; _stiffness.Last()[1][0] = 0.0d; _stiffness.Last()[2][0] = 0.0d; double lcf = 2.0d * _E * _I / l; _stiffness.Last()[1][1] = lcf * 6.0d / (l * l); _stiffness.Last()[1][2] = lcf * 3.0d / l; _stiffness.Last()[2][1] = _stiffness.Last()[1][2]; _stiffness.Last()[2][2] = lcf * 2.0d; } _stiffness[1][0][0] *= -1.0d; _stiffness[1][1][1] *= -1.0d; _stiffness[1][2][1] *= -1.0d; _stiffness[1][2][2] *= 0.5d; _stiffness[2][0][0] *= -1.0d; _stiffness[2][1][1] *= -1.0d; _stiffness[2][1][2] *= -1.0d; _stiffness[2][2][2] *= 0.5d; _stiffness[3][1][2] *= -1.0d; _stiffness[3][2][1] *= -1.0d; }