예제 #1
0
        public static void SolveExample()
        {
            double[,] M = new double[, ]
            {
                { 2.0, 0.0 },
                { 0.0, 1.0 }
            };

            double[,] K = new double[, ]
            {
                { 6.0, -2.0 },
                { -2.0, 4.0 }
            };

            double[] F = new double[] { 0.0, 10.0 };

            InitialConditions initialValues = new InitialConditions();

            initialValues.InitialAccelerationVector = new double[] { 0.0, 10.0 };
            initialValues.InitialDisplacementVector = new double[] { 0.0, 0.0 };
            initialValues.InitialVelocityVector     = new double[] { 0.0, 0.0 };
            initialValues.InitialTime = 0.0;

            ILinearSolution    linearSolver  = new LUFactorization();
            CentralDifferences dynamicSolver = new CentralDifferences(linearSolver, initialValues, 2.8, 10, K, M, F);

            dynamicSolver.SolveExplicit();
        }
예제 #2
0
파일: Dynamic.cs 프로젝트: malmenth/GFEC
 public void Solve(double[] rhsVector)
 {
     if (ActivateNonLinearSolver == true)
     {
         dynamicSolutionVector = NonLinearScheme.Solve(AssemblyData, LinearScheme, rhsVector);
     }
     else
     {
         if (CustomStiffnessMatrix == null)
         {
             double[,] coefMatrix  = AssemblyData.CreateTotalStiffnessMatrix();
             dynamicSolutionVector = LinearScheme.Solve(coefMatrix, rhsVector);
         }
         //double[,] coefMatrix = AssemblyData.CreateTotalStiffnessMatrix();
         //staticSolutionVector = LinearScheme.Solve(coefMatrix, rhsVector);
         else
         {
             CentralDifferences dynamicScheme = new CentralDifferences(LinearScheme, InitialConditionValues, TotalSimulationTime, TotalTimeSteps, CustomStiffnessMatrix, CustomMassMatrix, rhsVector);
             dynamicSolutionVector = dynamicScheme.GetExplicitSolution;
         }
     }
 }