예제 #1
0
        private double[] GetVirtualVectorB_FromVirtualForceFy(JSNode node)
        {
            var result = new double[NumberOfEquations];

            result[node.EquationNo_Fy]  = -1;
            result[EquationNo_GlobalFy] = -1;
            result[EquationNo_GlobalM]  = -node.Position.X * 1;
            return(result);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        /// <param name="virtualVectorB"></param>
        /// <param name="LoverAE">L/AE. A vector with a value for every bar.</param>
        /// <returns></returns>
        private double CalculateDeflection(JSNode node, double[] virtualVectorB, double[] LoverAE)
        {
            var virtualX = SolveXForGivenB(virtualVectorB);
            var realX    = X_Array;

            double workDone = 0;

            for (int i = 0; i < LoverAE.Length; i++)
            {
                workDone += virtualX[i] * realX[i] * LoverAE[i];
            }
            //deflection = workDone / virtual load (1)
            return(workDone);
        }
예제 #3
0
        public Dictionary <string, double> GetNodeDeflection(js.JSNode node)
        {
            if (model.Nodes.Contains(node))
            {
                return new Dictionary <string, double>()
                       {
                           { "dx", node.Deflection.X },
                           { "dy", node.Deflection.Y }
                       }
            }
            ;

            return(new Dictionary <string, double>()
            {
                { "dx", double.NaN },
                { "dy", double.NaN }
            });
        }
예제 #4
0
        public Dictionary <string, double> GetNodeReaction(js.JSNode node)
        {
            if (model.Nodes.Contains(node))
            {
                return new Dictionary <string, double>()
                       {
                           { "Fx", node.ReactionResult.X },
                           { "Fy", node.ReactionResult.Y }
                       }
            }
            ;

            return(new Dictionary <string, double>()
            {
                { "Fx", double.NaN },
                { "Fy", double.NaN }
            });
        }
예제 #5
0
        private void FindOrCreateNodeForVertex(JSVertex vertex, HashSet <JSNode> nodesSet)
        {
            var pos = vertex.Position;

            foreach (var node in nodesSet)
            {
                if (PointsAreClose(node.Position, pos))
                {
                    vertex.Node = node;
                    node.Vertices.Add(vertex);
                    return;
                }
            }
            var newNode = new JSNode(vertex.Position);

            newNode.Vertices.Add(vertex);
            nodesSet.Add(newNode);
            return;
        }
예제 #6
0
        private void AddNodeYEquilibrium(JSNode node, int equationRowNo)
        {
            if (equationRowNo != node.EquationNo_Fy)
            {
                throw new Exception("Check why these numbers are not equal!!");
            }

            foreach (var vert in node.Vertices)
            {
                var otherNode = vert.GetOtherVertex().Node;
                var bar       = vert.Bar;
                var constant  = (otherNode.Position.Y - node.Position.Y) / bar.Length;
                AddToMatrixA(equationRowNo, bar.Number, constant);
            }

            if (node.YRestrained)
            {
                AddToMatrixA(equationRowNo, node.VariableNumber_Ry, 1);
            }

            AddToVectorB(equationRowNo, -node.AppliedForces.Y);
        }
예제 #7
0
 public static JSPointLoad PointLoad(double Fx, double Fy, js.JSNode node) => new JSPointLoad(new Vector2d(Fx, Fy), node);
예제 #8
0
 /// <summary>
 /// Create a bar between a node and a point positions (unconnected to nodes).
 /// The unconnected vertex position will be connected to a node when this bar is added to a JointAnalysis model.
 /// </summary>
 public static js.JSBar ByStartPtEndNode(Vector2d startPoint, js.JSNode endNode) => new js.JSBar(startPoint, endNode);
예제 #9
0
 /// <summary>
 /// Create a bar between a node and a point positions (unconnected to nodes).
 /// The unconnected vertex position will be connected to a node when this bar is added to a JointAnalysis model.
 /// </summary>
 public static js.JSBar ByStartNodeEndPt(js.JSNode startNode, Vector2d endPoint) => new js.JSBar(startNode, endPoint);
예제 #10
0
 /// <summary>
 /// Create a bar between 2 nodes.
 /// </summary>
 public static js.JSBar ByStartNodeEndNode(js.JSNode startNode, js.JSNode endNode) => new js.JSBar(startNode, endNode);
예제 #11
0
 public JSNode(JSNode jSNode)
 {
     Position    = jSNode.Position;
     XRestrained = jSNode.XRestrained;
     YRestrained = jSNode.YRestrained;
 }