Exemplo n.º 1
0
 public Quad4NL(IFiniteElementMaterial material)
 {
     materialsAtGaussPoints = new ElasticMaterial2D[iInt2];
     for (int i = 0; i < iInt2; i++)
     {
         materialsAtGaussPoints[i] = (ElasticMaterial2D)material.Clone();
     }
 }
 public Beam2DCorotational(IList <Node> nodes, IFiniteElementMaterial material, double density,
                           BeamSection2D beamSection)
     : base(nodes, material, density, beamSection)
 {
     this.displacementsOfCurrentIncrement = new double[FREEDOM_DEGREE_COUNT];
     this.lastDisplacements    = new double[FREEDOM_DEGREE_COUNT];
     this.currentDisplacements = new double[FREEDOM_DEGREE_COUNT];
     this.InitializeElementAxes();
 }
Exemplo n.º 3
0
 protected Beam2DCorotationalAbstract(IList <Node> nodes, IFiniteElementMaterial material, double density,
                                      BeamSection2D beamSection)
 {
     this.nodes                 = nodes;
     this.material              = material;
     this.density               = density;
     this.beamSection           = beamSection;
     this.initialLength         = Math.Sqrt(Math.Pow(nodes[0].X - nodes[1].X, 2) + Math.Pow(nodes[0].Y - nodes[1].Y, 2));
     this.currentLength         = this.initialLength;
     this.currentRotationMatrix = Matrix.CreateZero(AXIS_COUNT, AXIS_COUNT);
     this.naturalDeformations   = new double[NATURAL_DEFORMATION_COUNT];
     this.beamAxisX             = new double[AXIS_COUNT];
     this.beamAxisY             = new double[AXIS_COUNT];
 }
Exemplo n.º 4
0
        public Beam3D(IFiniteElementMaterial material, Node[] rot1Nodes, Node[] rot2Nodes)
            : this(material)
        {
            if (rot1Nodes != null && rot1Nodes.Length != 4)
            {
                throw new ArgumentException("Dependent nodes quantity for rotation1 has to be four.");
            }
            if (rot2Nodes != null && rot2Nodes.Length != 4)
            {
                throw new ArgumentException("Dependent nodes quantity for rotation2 has to be four.");
            }
            rotNodes[0] = rot1Nodes;
            rotNodes[1] = rot2Nodes;

            InitializeDOFsWhenNoRotations();
        }
        /// <summary>
        /// Adds a whole mesh, which is defined by its nodes and elements, to the model.
        /// </summary>
        /// <param name="nodes">The nodes of the mesh.</param>
        /// <param name="elements">The elements of the mesh.</param>
        /// <param name="material">The common material of all elements in the mesh.</param>
        /// <param name="dynamicProperties">Optional material properties for dynamic analysis. Common for all elements in the
        ///     mesh.</param>
        public void AddMesh2D(IReadOnlyList <Node> nodes, IReadOnlyList <CellConnectivity <Node> > elements,
                              IFiniteElementMaterial material, DynamicMaterial dynamicProperties = null)
        {
            if (Dimensions == ProblemDimensions.ThreeDimensional)
            {
                throw new InvalidOperationException(
                          "This method can be used only for 2D problems (plane strain or plane stress)");
            }

            // Nodes
            int numNodesCurrent = model.NodesDictionary.Count;

            for (int i = 0; i < nodes.Count; ++i)
            {
                model.NodesDictionary.Add(numNodesCurrent + i, nodes[i]);
            }

            // Elements
            int numElementsCurrent   = model.Elements.Count;
            int numElementsSubdomain = model.Subdomains[0].Elements.Count;
            var factory = new ContinuumElement2DFactory(thickness, (ElasticMaterial2D)material, dynamicProperties); //TODO: extend the factory to other materials

            for (int i = 0; i < elements.Count; ++i)
            {
                ContinuumElement2D element = factory.CreateElement(elements[i].CellType, elements[i].Vertices);
                var elementWrapper         = new Element()
                {
                    ID = numElementsCurrent + i, ElementType = element
                };
                foreach (Node node in element.Nodes)
                {
                    elementWrapper.AddNode(node);
                }
                model.ElementsDictionary.Add(numElementsCurrent + i, elementWrapper);
                model.SubdomainsDictionary[0].Elements.Add(elementWrapper); //TODO: let the user decide which subdomain it will be added to.
            }
        }
Exemplo n.º 6
0
 public Beam2D(IFiniteElementMaterial material, IFiniteElementDOFEnumerator dofEnumerator)
     : this(material)
 {
     this.dofEnumerator = dofEnumerator;
 }
Exemplo n.º 7
0
 public Beam2D(IFiniteElementMaterial material)
 {
     this.material = material;
 }
Exemplo n.º 8
0
 public Beam3D(IFiniteElementMaterial material, Node[] rot1Nodes, Node[] rot2Nodes, IFiniteElementDOFEnumerator dofEnumerator)
     : this(material, rot1Nodes, rot2Nodes)
 {
     this.dofEnumerator = dofEnumerator;
 }
Exemplo n.º 9
0
 public Quad4NL(IFiniteElementMaterial material, IElementDOFEnumerator dofEnumerator)
     : this(material)
 {
     this.dofEnumerator = dofEnumerator;
 }