コード例 #1
0
        public JSModel DoAnalysis()
        {
            var lowerSupportNode = new JSNode(new Vector2d(0, 0))
            {
                XRestrained = true, YRestrained = true
            };
            var upperSupportNode = new JSNode(new Vector2d(0, 10))
            {
                XRestrained = true, YRestrained = true
            };
            var forceNode = new JSNode(new Vector2d(5, 5));
            var nodes     = new JSNode[] { upperSupportNode, forceNode, lowerSupportNode };

            var force  = new JSPointLoad(new Vector2d(0, -1), forceNode);
            var forces = new JSPointLoad[] { force };

            var lowerBar = new JSBar(lowerSupportNode, forceNode);
            var upperBar = new JSBar(upperSupportNode, forceNode);
            var bars     = new JSBar[] { upperBar, lowerBar };

            var analyser = new JSModel();

            analyser.AddItems(bars, nodes, forces);
            analyser.Solve();
            return(analyser);
        }
コード例 #2
0
ファイル: JSBar.cs プロジェクト: NickN-Eng/JointSolver2D
 public JSBar(JSBar bar)
 {
     StartVertex = bar.StartVertex;
     EndVertex   = bar.EndVertex;
     EA          = bar.EA;
 }
コード例 #3
0
 /// <summary>
 /// Create a vertex to a node.
 /// </summary>
 public JSVertex(JSNode node, JSBar bar)
 {
     Position = node.Position;
     Node     = node;
     Bar      = bar;
 }
コード例 #4
0
 /// <summary>
 /// Create a vertex without a node.
 /// The node will be populated when it is added to the JointAnalysis model.
 /// </summary>
 public JSVertex(Vector2d position, JSBar bar)
 {
     Position = position;
     Bar      = bar;
 }