コード例 #1
0
ファイル: Node.cs プロジェクト: saegeoff/BFE.Net
        /// <summary>
        /// Gets the nodal displacement regarding Default load case (default load case means a load case where <see cref="LoadCase.LoadType" /> is equal to <see cref="LoadType.Default" /> and <see cref="LoadCase.CaseName" /> is equal to null)
        /// </summary>
        /// <returns></returns>
        public Displacement GetNodalDisplacement()
        {
            var cmb = new LoadCombination();

            cmb[new LoadCase()] = 1;
            return(GetNodalDisplacement(cmb));
        }
コード例 #2
0
        /// <summary>
        /// Gets the internal force at.
        /// </summary>
        /// <param name="x">The x.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        /// <remarks>
        /// Will calculate the internal forces of member regarding Default load case (default load case means a load case where <see cref="LoadCase.LoadType" /> is equal to <see cref="LoadType.Default" /> and <see cref="LoadCase.CaseName" /> is equal to null)
        /// </remarks>
        public override Force GetInternalForceAt(double x)
        {
            var cmb = new LoadCombination();

            cmb[new LoadCase()] = 1.0;

            return(GetInternalForceAt(x, cmb));
        }
コード例 #3
0
ファイル: Node.cs プロジェクト: saegeoff/BFE.Net
        /// <summary>
        /// Gets the supports reaction that are from load combination of <see cref="cmb"/>, which are applying to this <see cref="Node"/> from supports.
        /// </summary>
        /// <param name="cmb">The CMB.</param>
        /// <returns></returns>
        public Force GetSupportReaction(LoadCombination cmb)
        {
            var buf = new Force();

            foreach (var kv in cmb)
            {
                buf += kv.Value * GetSupportReaction(kv.Key);
            }

            return(buf);
        }
コード例 #4
0
        public Force GetTotalExternalForces(LoadCombination loadCombination)
        {
            var buf = new Force();

            foreach (var tuple in loadCombination)
            {
                buf += GetTotalExternalForces(tuple.Key) * tuple.Value;
            }

            return(buf);
        }
コード例 #5
0
        public LoadCombination Clone()
        {
            var buf = new LoadCombination();

            foreach (var pair in this)
            {
                buf[pair.Key] = pair.Value;
            }

            return(buf);
        }
コード例 #6
0
        /// <summary>
        /// Gets the total displacements with specified <see cref="loadCombination"/>
        /// </summary>
        /// <param name="loadCase">the load case</param>
        /// <returns></returns>
        public Displacement GetTotalSettlementAmount(LoadCombination loadCombination)
        {
            var buf = new Displacement();

            foreach (var st in settlements)
            {
                if (loadCombination.ContainsKey(st.LoadCase))
                {
                    buf += loadCombination[st.LoadCase] * st.Displacement;
                }
            }

            return(buf);
        }
コード例 #7
0
        /// <summary>
        /// Gets the nodal displacement regarding specified <see cref="LoadCombination"/> <see cref="cmb"/>.
        /// </summary>
        /// <param name="cmb">The Load Combination.</param>
        /// <returns></returns>
        public Displacement GetNodalDisplacement(LoadCombination cmb)
        {
            var buf = new Displacement();

            foreach (var pair in cmb)
            {
                var cf = pair.Value;

                var disp = GetNodalDisplacement(pair.Key);

                buf += cf * disp;
            }

            return(buf);
        }
コード例 #8
0
ファイル: Node.cs プロジェクト: saegeoff/BFE.Net
        /*
         * /// <summary>
         * /// Gets or sets the member loads.
         * /// </summary>
         * /// <value>
         * /// The concentrated loads who come from distributed loads from members.
         * /// </value>
         * /// <remarks>
         * /// For creating forces load, distributed loads should convert to nodal load, the <see cref="MembersLoads"/> is the nodal loads resulting from <see cref="Load"/>s applied to members.
         * /// These loads are in global coordination system</remarks>
         * [Obsolete("See comments in StaticLinearAnalysisResult.GetTotalForceVector()")]
         * internal List<NodalLoad> MembersLoads
         * {
         *  get { return memberLoads; }
         *  private set { memberLoads = value; }
         * }
         */

        /// <summary>
        /// Gets the nodal displacement regarding specified <see cref="LoadCombination"/> <see cref="cmb"/>.
        /// </summary>
        /// <param name="cmb">The Load Combination.</param>
        /// <returns></returns>
        public Displacement GetNodalDisplacement(LoadCombination cmb)
        {
            var buf = new Displacement();

            foreach (var pair in cmb)
            {
                var cf = pair.Value;

                parent.LastResult.AddAnalysisResultIfNotExists(pair.Key);

                var disps = parent.LastResult.Displacements[pair.Key];

                buf += cf * Displacement.FromVector(disps, this.Index * 6);
            }

            return(buf);
        }
コード例 #9
0
        /// <summary>
        /// Gets the internal force at <see cref="x" /> position.
        /// </summary>
        /// <param name="x">The position (from start point).</param>
        /// <param name="cmb">The <see cref="LoadCombination" />.</param>
        /// <returns></returns>
        /// <remarks>
        /// Will calculate the internal forces of member regarding the <see cref="cmb" /> <see cref="LoadCombination" />
        /// </remarks>
        public override Force GetInternalForceAt(double x, LoadCombination cmb)
        {
            var gStartDisp = StartNode.GetNodalDisplacement(cmb);
            var gEndDisp   = EndNode.GetNodalDisplacement(cmb);

            var lStartDisp = new Displacement(
                TransformGlobalToLocal(gStartDisp.Displacements),
                TransformGlobalToLocal(gStartDisp.Rotations));

            var lEndDisp = new Displacement(
                TransformGlobalToLocal(gEndDisp.Displacements),
                TransformGlobalToLocal(gEndDisp.Rotations));

            var displVector = new double[]
            {
                lStartDisp.DX, lStartDisp.DY, lStartDisp.DZ,
                lStartDisp.RX, lStartDisp.RY, lStartDisp.RZ,
                lEndDisp.DX, lEndDisp.DY, lEndDisp.DZ,
                lEndDisp.RX, lEndDisp.RY, lEndDisp.RZ
            };

            var lStartForces = Matrix.Multiply(GetLocalStiffnessMatrix(), displVector);

            var startForce = Force.FromVector(lStartForces, 0);

            var forceAtX = -startForce.Move(new Vector(x, 0, 0));

            foreach (var ld in loads)
            {
                if (!cmb.ContainsKey(ld.Case))
                {
                    continue;
                }

                var frc = ((Load1D)ld).GetInternalForceAt(this, x);

                forceAtX += cmb[ld.Case] * frc;
            }

            return(forceAtX);
        }
コード例 #10
0
ファイル: Node.cs プロジェクト: saegeoff/BFE.Net
        /// <summary>
        /// Gets the total external force.
        /// </summary>
        /// <param name="combination">The combination.</param>
        /// <remarks>
        /// This will return all loads which are applying to this node from anywhere other than connected elements!
        /// </remarks>
        /// <returns></returns>
        public Force GetTotalExternalForce(LoadCombination combination)
        {
            var buf = new Force();

            foreach (var kv in combination)
            {
                var cse = kv.Key;

                if (!parent.LastResult.Forces.ContainsKey(cse))
                {
                    parent.LastResult.AddAnalysisResultIfNotExists(cse);
                }

                var totForceVector = parent.LastResult.Forces[cse];

                var fc = Force.FromVector(totForceVector, this.Index * 6);

                buf += fc * combination[cse];
            }

            return(buf);
        }
コード例 #11
0
ファイル: Element1D.cs プロジェクト: mluksevics/BFE.Net
 /// <summary>
 /// Gets the internal force at <see cref="x"/> position.
 /// </summary>
 /// <param name="x">The position (from start point).</param>
 /// <param name="cmb">The <see cref="LoadCombination"/>.</param>
 /// <remarks>Will calculate the internal forces of member regarding the <see cref="cmb"/> <see cref="LoadCombination"/>
 /// </remarks>
 /// <returns></returns>
 public abstract Force GetInternalForceAt(double x, LoadCombination cmb);
コード例 #12
0
ファイル: Node.cs プロジェクト: saegeoff/BFE.Net
        internal Force GetSupportReaction2(LoadCombination cmb)
        {
            //TODO: this methods not works correctly!

            var f1 = new Force();
            var f  = new Force();

            foreach (var cse in cmb.Keys)
            {
                parent.LastResult.AddAnalysisResultIfNotExists(cse);
            }



            #region From Connected Elements

            foreach (var elm in ConnectedElements)
            {
                var ind = elm.Nodes.IndexOfReference(this);

                foreach (var cse in cmb.Keys)
                {
                    foreach (var lde in elm.Loads)
                    {
                        if (lde.Case != cse)
                        {
                            continue;
                        }

                        var loads = lde.GetGlobalEquivalentNodalLoads(elm);

                        f1 += cmb[cse] * loads[ind];
                    }
                }
            }

            #endregion

            #region From Loads on this node

            foreach (var load in this.loads)
            {
                if (!cmb.ContainsKey(load.Case))
                {
                    continue;
                }

                f1 += cmb[load.Case] * load.Force;
            }

            #endregion


            foreach (var cse in cmb.Keys)//
            {
                f += cmb[cse] * Force.FromVector(parent.LastResult.Forces[cse], 6 * this.Index);
            }

            var buf = f + -f1;


            if (constraints.DX == DofConstraint.Released)
            {
                buf.Fx = 0;
            }
            if (constraints.DY == DofConstraint.Released)
            {
                buf.Fy = 0;
            }
            if (constraints.DZ == DofConstraint.Released)
            {
                buf.Fz = 0;
            }

            if (constraints.RX == DofConstraint.Released)
            {
                buf.Mx = 0;
            }
            if (constraints.RY == DofConstraint.Released)
            {
                buf.My = 0;
            }
            if (constraints.RZ == DofConstraint.Released)
            {
                buf.Mz = 0;
            }


            return(buf);

            throw new NotImplementedException();
        }