示例#1
0
        /// <summary>
        /// Creates a new force for a 2D ModelType
        /// </summary>
        /// <param name="valueOfXComponent">The component of the force along the global x-axis</param>
        /// <param name="valueOfYComponent">The component of the force along the global y-axis</param>
        /// <param name="valueOfZComponent">The component of the force along the global z-axis</param>
        /// <returns>The force vector which has been created</returns>
        public ForceVector Create(double valueOfXComponent, double valueOfYComponent, double valueOfZComponent, double valueOfXXComponent, double valueOfYYComponent, double valueOfZZComponent)
        {
            ////TODO

            ForceVector newForce = new ForceVector(valueOfXComponent, valueOfYComponent, valueOfZComponent, valueOfXXComponent, valueOfYYComponent, valueOfZZComponent);

            if (this.repository != null)
            {
                this.repository.Add(newForce);
            }

            return(newForce);
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="valueOfZComponent"></param>
        /// <param name="valueOfMomentAboutYY"></param>
        /// <returns></returns>
        public ForceVector CreateFor1DBeam(double valueOfZComponent, double valueOfMomentAboutYY)
        {
            Guard.AgainstInvalidState(() => { return(!(this.modelType == ModelType.Beam1D || this.modelType == ModelType.Frame2D)); },
                                      "Can only use the CreateFor1DBeam(double valueOfZComponent, double valueOfMomentAboutYY) method when a 1D Beam system is in use");

            ForceVector newForce = new ForceVector(0, 0, valueOfZComponent, 0, valueOfMomentAboutYY, 0);

            if (this.repository != null)
            {
                this.repository.Add(newForce);
            }

            return(newForce);
        }
示例#3
0
        /// <summary>
        /// Creates a new force for a 1D ModelType
        /// </summary>
        /// <param name="valueOfXComponent">The component of the force along the global x-axis</param>
        /// <returns>The force vector which has been created</returns>
        public ForceVector Create(double valueOfXComponent)
        {
            Guard.AgainstInvalidState(() => { return(this.modelType != ModelType.Truss1D); },
                                      "Can only use the Create(double valueOfXComponent) method to create a force along the x-axis when a 1D system is in use");

            ForceVector newForce = new ForceVector(valueOfXComponent);

            if (this.repository != null)
            {
                this.repository.Add(newForce);
            }

            return(newForce);
        }
示例#4
0
        /// <summary>
        /// Creates a new force for a 2D ModelType
        /// </summary>
        /// <param name="valueOfXComponent">The component of the force along the global x-axis</param>
        /// <param name="valueOfYComponent">The component of the force along the global y-axis</param>
        /// <returns>The force vector which has been created</returns>
        public ForceVector Create(double valueOfXComponent, double valueOfYComponent)
        {
            Guard.AgainstInvalidState(() => { return(!this.modelType.IsAllowedDegreeOfFreedomForBoundaryConditions(DegreeOfFreedom.X)); },
                                      "Cannot create a boundary condition along the x-axis for this model type.");
            Guard.AgainstInvalidState(() => { return(!this.modelType.IsAllowedDegreeOfFreedomForBoundaryConditions(DegreeOfFreedom.Y)); },
                                      "Cannot create a boundary condition along the y-axis for this model type.");

            ForceVector newForce = new ForceVector(valueOfXComponent, valueOfYComponent);

            if (this.repository != null)
            {
                this.repository.Add(newForce);
            }

            return(newForce);
        }
示例#5
0
 /// <summary>
 /// Applies an external force to a node in the model.
 /// Forces can be applied to one or more nodes by calling this method for each node you wish to apply the force to.
 /// </summary>
 /// <param name="forceToApply">The force vector to apply to a node</param>
 /// <param name="nodeToApplyTo">The node which the force will be applied to.</param>
 public void ApplyForceToNode(ForceVector forceToApply, IFiniteElementNode nodeToApplyTo)
 {
     this.forces.ApplyForceToNode(forceToApply, nodeToApplyTo);
 }