Ejemplo n.º 1
0
 /// <summary>
 /// Internal constructor accessed by static methods.
 /// </summary>
 public PointLoad(Geometry.FdPoint3d point, Geometry.FdVector3d force, LoadCase loadCase, string comment, ForceLoadType type)
 {
     this.EntityCreated();
     this.LoadCase  = loadCase.Guid;
     this.Comment   = comment;
     this.LoadType  = type;
     this.Direction = force.Normalize();
     this.Load      = new LoadLocationValue(point, force.Length());
 }
Ejemplo n.º 2
0
        internal void SetStartAndEndForces(Geometry.FdVector3d startForce, Geometry.FdVector3d endForce)
        {
            if (startForce.IsZero() && !endForce.IsZero())
            {
                this.Direction = endForce.Normalize();
                this.StartLoad = 0;
                this.EndLoad   = endForce.Length();
            }

            else if (!startForce.IsZero() && endForce.IsZero())
            {
                this.Direction = startForce.Normalize();
                this.StartLoad = startForce.Length();
                this.EndLoad   = 0;
            }

            else if (startForce.IsZero() && endForce.IsZero())
            {
                throw new System.ArgumentException($"Both StartForce and EndForce are zero vectors. Can't set direction of LineLoad.");
            }

            // if no zero vectors - check if vectors are parallel
            else
            {
                Geometry.FdVector3d v0 = startForce.Normalize();
                Geometry.FdVector3d v1 = endForce.Normalize();
                double q0 = startForce.Length();
                double q1 = endForce.Length();

                int par = v0.Parallel(v1);
                if (par != 0)
                {
                    this.Direction = v0;
                    this.StartLoad = q0;
                    this.EndLoad   = par * q1;
                }
                else
                {
                    throw new System.ArgumentException($"StartForce and EndForce must be parallel or antiparallel.");
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Uniform surface load
 /// </summary>
 /// <param name="region"></param>
 /// <param name="load"></param>
 /// <param name="loadCase"></param>
 /// <param name="loadProjection">False: Intensity meant along action line (eg. dead load). True: Intensity meant perpendicular to direction of load (eg. snow load).</param>
 /// <param name="comment"></param>
 public SurfaceLoad(Geometry.Region region, Geometry.FdVector3d load, LoadCase loadCase, bool loadProjection = false, string comment = "") : this(region, new List <LoadLocationValue> {
     new LoadLocationValue(region.Contours[0].Edges[0].Points[0], load.Length())
 }, load.Normalize(), loadCase, loadProjection, comment)
 {
 }