public void SetUp() { ModelType modelType = ModelType.Beam1D; nodeFactory = new NodeFactory(modelType); start = nodeFactory.Create(0); end = nodeFactory.Create(1); elementFactory = new ElementFactory(modelType); material = new GenericElasticMaterial(0, 0.1, 0, 0); section = new SolidRectangle(0.1, 1); SUT = elementFactory.CreateLinear3DBeam(start, end, material, section); }
/// <summary> /// /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <param name="material"></param> /// <param name="crossSection"></param> /// <returns></returns> public Linear3DBeam CreateLinear3DBeam(IFiniteElementNode start, IFiniteElementNode end, IMaterial material, ICrossSection crossSection) { Guard.AgainstInvalidState(() => { return(!Linear3DBeam.IsASupportedModelType(this.ModelType)); }, "Linear3DBeams are not available in a model of type {0}", this.ModelType); Linear3DBeam newBeam = new Linear3DBeam(start, end, material, crossSection); if (this.repository != null) { this.repository.Add(newBeam); } return(newBeam); }
/// <summary> /// /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <param name="material"></param> /// <param name="crossSection"></param> /// <returns></returns> public Linear3DBeam CreateLinear3DBeam(IFiniteElementNode start, IFiniteElementNode end, IMaterial material, ICrossSection crossSection) { Guard.AgainstInvalidState(() => { return !Linear3DBeam.IsASupportedModelType(this.ModelType); }, "Linear3DBeams are not available in a model of type {0}", this.ModelType); Linear3DBeam newBeam = new Linear3DBeam(start, end, material, crossSection); if (this.repository != null) { this.repository.Add(newBeam); } return newBeam; }