Canguro.Commands.Model.SplitCmd.RelocateDistributedLoads C# (CSharp) Метод

RelocateDistributedLoads() приватный статический Метод

Distributes a DistributedSpanLoad between the line element where it is and a new adjacent line element.
private static RelocateDistributedLoads ( AssignedLoads newLineLoads, LoadCase lc, float x, DistributedSpanLoad load ) : bool
newLineLoads AssignedLoads The AssignedLoads object of the new Line Element
lc Canguro.Model.Load.LoadCase The Load Case to which the load belongs.
x float The dividing point of the two line elements [0, 1]
load Canguro.Model.Load.DistributedSpanLoad The Load to distribute in two elements
Результат bool
        private static bool RelocateDistributedLoads(AssignedLoads newLineLoads, LoadCase lc, float x, DistributedSpanLoad load)
        {
            if (load.Da < x && load.Db < x)
            {
                load.Da = load.Da / x;
                load.Db = load.Db / x;
                return false;
            }
            if (load.Da >= x && load.Db >= x)
            {
                load = (DistributedSpanLoad)load.Clone();
                load.Id = 0;
                load.Da = (load.Da - x) / (1 - x);
                load.Db = (load.Db - x) / (1 - x);
                newLineLoads.Add(load, lc);
                return true;
            }
            if (load.Da > load.Db)
            {
                float tmp = load.Db;
                load.Db = load.Da;
                load.Da = tmp;
                tmp = load.Lb;
                load.Lb = load.La;
                load.La = tmp;
            }
            DistributedSpanLoad nLoad = (DistributedSpanLoad)load.Clone();
            nLoad.Id = 0;
            load.Da = load.Da / x;
            load.Db = 1f;
            load.Lb = (load.La) + (x - load.Da) * (load.Lb - load.La) / (load.Db - load.Da);

            nLoad.Da = 0;
            nLoad.Db = (nLoad.Db - x) / (1 - x);
            nLoad.La = load.Lb;
            newLineLoads.Add(nLoad, lc);
            return false;
        }