public Element1D[] GetStiffnessMatrices()
        {
            for (int elem = 0; elem < localNode1.Length; elem++)
            {
                double[] elementNodesX = { nodesX[localNode1[elem] - 1], nodesX[localNode2[elem] - 1] };
                double[] elementNodesY = { nodesY[localNode1[elem] - 1], nodesY[localNode2[elem] - 1] };

                switch (elementType[elem])
                {
                case "Beam":
                    beamElementsList[elem] = new EulerBernoulli1DElement(E[elem], A[elem], I[elem], elementNodesX, elementNodesY);
                    break;

                case "Bar":
                    beamElementsList[elem] = new Bar1DElement(E[elem], A[elem], elementNodesX, elementNodesY);
                    break;

                case "NLBeam":
                    beamElementsList[elem] = new NLEulerBernoulli1DElement(E[elem], A[elem], I[elem], elementNodesX, elementNodesY);
                    break;
                }

                beamElementsList[elem].CalculateInitialValues();
            }
            return(beamElementsList);
        }
        public double[] CreateTotalInternalForcesVector()
        {
            int totalNodes    = nodesX.Length;
            int totalElements = localNode1.Length;

            //double[] internalForcesTotalVector = new double[totalNodes*3];

            for (int element = 0; element < totalElements; element++)
            {
                int[] dof = { localNode1[element] * 3 - 2, localNode1[element] * 3 - 1, localNode1[element] * 3, localNode2[element] * 3 - 2, localNode2[element] * 3 - 1, localNode2[element] * 3 };
                NLEulerBernoulli1DElement nonLinearBeamElement = beamElementsList[element] as NLEulerBernoulli1DElement;

                for (int i = 0; i < 6; i++)
                {
                    internalForcesTotalVector[dof[i] - 1] = internalForcesTotalVector[dof[i] - 1] + nonLinearBeamElement.internalGlobalForcesVector[i];
                }
            }
            return(internalForcesTotalVector);
        }