コード例 #1
0
ファイル: Beam2D.cs プロジェクト: odyred/versionOld
        public double[] CalculateAccelerationForces(Element element, IList <MassAccelerationLoad> loads)
        {
            Vector <double>    accelerations = new Vector <double>(6);
            IMatrix2D <double> massMatrix    = MassMatrix(element);

            int index = 0;

            foreach (MassAccelerationLoad load in loads)
            {
                foreach (DOFType[] nodalDOFTypes in dofs)
                {
                    foreach (DOFType dofType in nodalDOFTypes)
                    {
                        if (dofType == load.DOF)
                        {
                            accelerations[index] += load.Amount;
                        }
                        index++;
                    }
                }
            }

            double[] forces = new double[6];
            massMatrix.Multiply(accelerations, forces);
            return(forces);
        }
コード例 #2
0
ファイル: SpringDamper3D.cs プロジェクト: stjordanis/MSolve
        public double[] CalculateForces(Element element, double[] localDisplacements, double[] localdDisplacements)
        {
            IMatrix2D <double> stiffnessMatrix = StiffnessMatrix(element);
            Vector <double>    disps           = new Vector <double>(localDisplacements);

            double[] forces = new double[localDisplacements.Length];
            stiffnessMatrix.Multiply(disps, forces);
            return(forces);
        }
コード例 #3
0
        public double[] CalculateForcesForLogging(Element element, double[] localDisplacements)
        {
            CalculateRotTranformation(element);
            IMatrix2D <double> stiffnessMatrix = StiffnessMatrixPure(element);
            var disps = rotTransformation * new Vector <double>(localDisplacements);

            double[] forces = new double[disps.Length];
            stiffnessMatrix.Multiply(disps, forces);
            return(forces);
        }
コード例 #4
0
        public double[] CalculateForces(Element element, double[] localDisplacements, double[] localdDisplacements)
        {
            IMatrix2D <double> stiffnessMatrix = StiffnessMatrix(element);
            Vector <double>    disps           = new Vector <double>(localDisplacements.Length);

            double[] forces = new double[localDisplacements.Length];
            for (int i = 0; i < localDisplacements.Length; i++)
            {
                //disps[i] = localDisplacements[i] + localdDisplacements[i];
                disps[i] = localDisplacements[i];
            }
            stiffnessMatrix.Multiply(disps, forces);
            return(forces);
        }