private static CantileverBeam BuildCantileverBenchmark()
        {
            var benchmarkBuilder = new CantileverBeam.Builder();

            //benchmarkBuilder.Length = 5.0;
            return(benchmarkBuilder.BuildWithQuad4Elements(200, 10));
        }
Example #2
0
        public static void SuiteSparseMemoryConsumptionDebugging()
        {
            for (int rep = 0; rep < 10; ++rep)
            {
                var benchmarkBuilder = new CantileverBeam.Builder();
                //benchmarkBuilder.Length = 5.0;
                CantileverBeam benchmark = benchmarkBuilder.BuildWithQuad4Elements(2000, 100);

                // Solver
                var solverBuilder = new SuiteSparseSolver.Builder();
                using (SuiteSparseSolver solver = solverBuilder.BuildSolver(benchmark.Model))
                {
                    // Structural problem provider
                    var provider = new ProblemStructural(benchmark.Model, solver);

                    // Linear static analysis
                    var childAnalyzer  = new LinearAnalyzer(benchmark.Model, solver, provider);
                    var parentAnalyzer = new StaticAnalyzer(benchmark.Model, solver, provider, childAnalyzer);

                    // Run the analysis
                    parentAnalyzer.Initialize();
                    parentAnalyzer.Solve();
                }
            }
        }
        private static Model CreateModel()
        {
            int numElementsX = 2, numElementsY = 4; // for the hardcoded stiffness matrices

            var cantileverBuilder = new CantileverBeam.Builder();

            cantileverBuilder.Length       = numElementsX;
            cantileverBuilder.Height       = numElementsY;
            cantileverBuilder.Width        = 1.0;
            cantileverBuilder.YoungModulus = 1.0;
            cantileverBuilder.PoissonRatio = 0.3;
            CantileverBeam cantilever = cantileverBuilder.BuildWithQuad4Elements(numElementsX, numElementsY);

            return(cantilever.Model);
        }