Esempio n. 1
0
 /// <summary>
 /// Calculate and return reaction matrix.
 /// </summary>
 /// <returns></returns>
 private double[,] CalculateMatrixReactions()
 {
     double[,] doubleMatrix;
     doubleMatrix = MatrixTransformation.Multiply(DoubleMatrixStiffnessGlobal, DoubleMatrixDisplacements);
     doubleMatrix = MatrixTransformation.Substract(doubleMatrix, SolverModel.Load.Matrix);
     return(doubleMatrix);
 }
Esempio n. 2
0
        private double[,] CalculateReactions()
        {
            double[,] currentMatrix = new double[model.LQ * model.ln, 1];

            currentMatrix = MatrixTransformation.Multiply <double, double>(K, U);
            currentMatrix = MatrixTransformation.Substract(currentMatrix, model.Load.Matrix);

            return(currentMatrix);
        }
Esempio n. 3
0
        /*** Private methods ***************************************************************************************************/

        private static double GetAlongTheMemberResult(IScheme scheme, IModel model, Dictionary <int, double[, ]> elementBoundaryDisplacements, double x, int startNodeNumber, int elementNumber)
        {
            IBeamProperty beamProperty = model.Beam.Properties.Where(beam => beam.Number == elementNumber).FirstOrDefault();
            double        L            = beamProperty.Lb;
            double        s            = ResultHelper.GetScalingParameter(scheme, x, startNodeNumber, L);

            double[,] currentShapeFunctionsVector = GetShapeFunctionsVector(s, L);
            double[,] result = MatrixTransformation.Multiply(currentShapeFunctionsVector, elementBoundaryDisplacements[elementNumber]);
            return(result[0, 0]);
        }
Esempio n. 4
0
        private void ApplyBCs()
        {
            DoubleMatrixBoundaryGlobal = new double[SolverModel.IntDOFPerNode * SolverModel.IntModelNodes, SolverModel.IntDOFPerNode *SolverModel.IntModelNodes];

            DoubleMatrixBoundaryGlobal = MatrixTransformation.Multiply(SolverModel.Identity.Ip, DoubleMatrixStiffnessGlobal);
            DoubleMatrixBoundaryGlobal = MatrixTransformation.Multiply(DoubleMatrixBoundaryGlobal, SolverModel.Identity.Ip);
            DoubleMatrixBoundaryGlobal = MatrixTransformation.Sum(DoubleMatrixBoundaryGlobal, MatrixTransformation.ToDouble(SolverModel.Identity.Id));

            DoubleMatrixLoads = new double[SolverModel.IntDOFPerNode * SolverModel.IntModelNodes, 1];
            DoubleMatrixLoads = MatrixTransformation.Multiply(SolverModel.Identity.Ip, SolverModel.Load.Matrix);
        }
Esempio n. 5
0
        private void ApplyBCs()
        {
            KK = new double[model.LQ * model.ln, model.LQ *model.ln];

            KK = MatrixTransformation.Multiply <int, double>(model.Identity.Ip, K);
            KK = MatrixTransformation.Multiply <double, int>(KK, model.Identity.Ip);
            KK = MatrixTransformation.Sum(KK, MatrixTransformation.ToDouble <int>(model.Identity.Id));

            F = new double[model.LQ * model.ln, 1];
            F = MatrixTransformation.Multiply <int, double>(model.Identity.Ip, model.Load.Matrix);
        }
Esempio n. 6
0
        private void AggregateGlobalStiffnessMatrix()
        {
            DoubleMatrixStiffnessGlobal = new double[SolverModel.IntDOFPerNode * SolverModel.IntModelNodes, SolverModel.IntDOFPerNode *SolverModel.IntModelNodes];
            double[,] k;

            // Debug.WriteLine($"Solver.cs AggregateGlobalStiffnessMatrix(): Total number of elements in model = SolverModel.IntModelElements={SolverModel.IntModelElements}");
            for (int i = 0; i < SolverModel.IntModelElements; i++)
            {
                k = MatrixTransformation.Multiply(SolverModel.Boolean.MatrixTransposed[i], SolverModel.Beam.Matrix[i]);
                k = MatrixTransformation.Multiply(k, SolverModel.Boolean.Matrix[i]);
                DoubleMatrixStiffnessGlobal = MatrixTransformation.Sum(DoubleMatrixStiffnessGlobal, k);
            }
        }
Esempio n. 7
0
        private void AggregateGlobalStiffnessMatrix()
        {
            K = new double[model.LQ * model.ln, model.LQ *model.ln];

            for (int i = 0; i < model.le; i++)
            {
                double[,] k = new double[4, 4];
                k           = MatrixTransformation.Multiply <int, double>(model.Boolean.TransposedMatrix[i], model.Beam.Matrix[i]);
                k           = MatrixTransformation.Multiply <double, int>(k, model.Boolean.Matrix[i]);

                K = MatrixTransformation.Sum(K, k);
            }
        }
Esempio n. 8
0
        private static double GetAlongTheMemberResult(IModel model, Dictionary <int, double[, ]> elementBoundaryDisplacements, int elementNumber)
        {
            IBeamProperty beamProperty = model.Beam.Properties.Where(beam => beam.Number == elementNumber).FirstOrDefault();
            double        L            = beamProperty.Lb;

            double[,] currentShapeFunctionsVector = GetShapeFunctionsVector(L);
            double[,] result;
            result = MatrixTransformation.Multiply(currentShapeFunctionsVector, elementBoundaryDisplacements[elementNumber]);
            double resultFactor = beamProperty.Ey * beamProperty.Iy / Math.Pow(beamProperty.Lb, 3);

            result = MatrixTransformation.Multiply(result, resultFactor);
            return(result[0, 0]);
        }
Esempio n. 9
0
        private Dictionary <int, double[, ]> CalculateElementBoundaryDisplacements()
        {
            Dictionary <int, double[, ]> elementDisplacements = new Dictionary <int, double[, ]>();

            for (int i = 0; i < model.le; i++)
            {
                double[,] currentElementDisplacements = new double[4, 1];

                currentElementDisplacements = MatrixTransformation.Multiply(model.Boolean.Matrix[i], solver.U);

                elementDisplacements.Add(i + 1, currentElementDisplacements);
            }

            return(elementDisplacements);
        }
Esempio n. 10
0
        private Dictionary <int, double[, ]> CalculateElementBoundaryForces()
        {
            Dictionary <int, double[, ]> elementForces = new Dictionary <int, double[, ]>();

            for (int i = 0; i < model.le; i++)
            {
                double[,] nodalForces = new double[4, 1];
                nodalForces           = MatrixTransformation.Multiply(model.Beam.Matrix[i], model.Boolean.Matrix[i]);
                nodalForces           = MatrixTransformation.Multiply(nodalForces, solver.U);

                elementForces.Add(i + 1, nodalForces);
            }

            return(elementForces);
        }