Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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 }
            });
        }
Ejemplo n.º 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 }
            });
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 7
0
 public static JSPointLoad PointLoad(double Fx, double Fy, js.JSNode node) => new JSPointLoad(new Vector2d(Fx, Fy), node);
Ejemplo n.º 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);
Ejemplo n.º 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);
Ejemplo n.º 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);
Ejemplo n.º 11
0
 public JSNode(JSNode jSNode)
 {
     Position    = jSNode.Position;
     XRestrained = jSNode.XRestrained;
     YRestrained = jSNode.YRestrained;
 }