Ejemplo n.º 1
0
        /***************************************************/

        private bool CreateLoad(BarPrestressLoad bhLoad)
        {
            List <Bar> bars    = bhLoad.Objects.Elements.ToList();
            string     loadPat = GetAdapterId <string>(bhLoad.Loadcase);

            bool[]    targetForceBooleanByDOF = new bool[6];
            double[]  targetForceValuesByDOF  = new double[6];
            double[]  relativeDistByDOF       = new double[6];
            eItemType type = eItemType.Objects;

            // Loop through bars and set Target Force for each bar
            foreach (Bar bar in bars)
            {
                string barName = GetAdapterId <string>(bar);

                // Generic BooleanByDOF array allows for future prestressing moment to be implemented
                targetForceBooleanByDOF[0] = true;
                targetForceValuesByDOF[0]  = bhLoad.Prestress;
                relativeDistByDOF[0]       = 0.5;

                if (m_model.FrameObj.SetLoadTargetForce(barName, loadPat, ref targetForceBooleanByDOF, ref targetForceValuesByDOF, ref relativeDistByDOF, type) != 0)
                {
                    CreateElementError("BarPrestressLoad", bar.Name);
                }
                BH.Engine.Base.Compute.RecordWarning($"Target Force load case must be nonlinear static. Verify {loadPat} prior to running analysis.");
            }

            SetAdapterId(bhLoad, null);

            return(true);
        }
Ejemplo n.º 2
0
        /***************************************************/

        public static List <ICurve> Visualize(this BarPrestressLoad barPrestressLoad, double scaleFactor = 1.0, bool displayForces = true, bool displayMoments = true, bool asResultants = true)
        {
            List <ICurve> arrows = new List <ICurve>();

            double scaledForce = barPrestressLoad.Prestress * scaleFactor;

            foreach (Bar bar in barPrestressLoad.Objects.Elements)
            {
                if (displayForces)
                {
                    arrows.AddRange(ConnectedArrows(new List <ICurve> {
                        bar.Centreline()
                    }, bar.Normal() * scaledForce, true, null, 0, true));
                }
            }

            return(arrows);
        }
Ejemplo n.º 3
0
 public static LoadType LoadType(this BarPrestressLoad load)
 {
     return(oM.Structure.Loads.LoadType.Pressure);
 }