예제 #1
0
        private static void SolveBuildingInNoSoilSmall()
        {
            VectorExtensions.AssignTotalAffinityCount();
            Model model = new Model();

            model.SubdomainsDictionary.Add(1, new Subdomain()
            {
                ID = 1
            });
            BeamBuildingBuilder.MakeBeamBuilding(model, 20, 20, 20, 5, 4, model.NodesDictionary.Count + 1,
                                                 model.ElementsDictionary.Count + 1, 1, 4, false, false);
            model.Loads.Add(new Load()
            {
                Amount = -100, Node = model.Nodes[21], DOF = DOFType.X
            });
            model.ConnectDataStructures();

            SolverSkyline     solver         = new SolverSkyline(model);
            ProblemStructural provider       = new ProblemStructural(model, solver.SubdomainsDictionary);
            LinearAnalyzer    analyzer       = new LinearAnalyzer(solver, solver.SubdomainsDictionary);
            StaticAnalyzer    parentAnalyzer = new StaticAnalyzer(provider, analyzer, solver.SubdomainsDictionary);

            analyzer.LogFactories[1] = new LinearAnalyzerLogFactory(new int[] { 420 });

            parentAnalyzer.BuildMatrices();
            parentAnalyzer.Initialize();
            parentAnalyzer.Solve();
        }
예제 #2
0
        private static void SolveBuildingInNoSoilSmallVRFStochastic()
        {
            VectorExtensions.AssignTotalAffinityCount();
            Model model = new Model();

            model.SubdomainsDictionary.Add(1, new Subdomain()
            {
                ID = 1
            });
            BeamBuildingBuilder.MakeBeamBuilding(model, 20, 20, 20, 5, 4, model.NodesDictionary.Count + 1,
                                                 model.ElementsDictionary.Count + 1, 1, 4, false, false);
            model.Loads.Add(new Load()
            {
                Amount = -100, Node = model.Nodes[21], DOF = DOFType.X
            });
            model.ConnectDataStructures();

            PowerSpectrumTargetEvaluatorCoefficientsProvider stochasticProvider = new PowerSpectrumTargetEvaluatorCoefficientsProvider(10, 0.1, 1.2, 20, 200, DOFType.X,
                                                                                                                                       0.1, 200, 1e-10);


            SolverSkyline     solver        = new SolverSkyline(model);
            ProblemStructural provider      = new ProblemStructural(model, solver.SubdomainsDictionary);
            LinearAnalyzer    analyzer      = new LinearAnalyzer(solver, solver.SubdomainsDictionary);
            StaticAnalyzer    childAnalyzer = new StaticAnalyzer(provider, analyzer, solver.SubdomainsDictionary);
            VRFMonteCarloAnalyzerWithStochasticMaterial stochasticAnalyzer = new VRFMonteCarloAnalyzerWithStochasticMaterial(model, provider, childAnalyzer, solver.SubdomainsDictionary,
                                                                                                                             stochasticProvider, stochasticProvider, 1, 20, "monteCarlo");


            analyzer.LogFactories[1] = new LinearAnalyzerLogFactory(new int[] { 420 });

            //stochasticAnalyzer.BuildMatrices();
            //childAnalyzer.Initialize();
            stochasticAnalyzer.Solve();
        }
예제 #3
0
        private static void SolveBuildingInNoSoilSmallDynamic()
        {
            var model = new Model();

            model.SubdomainsDictionary.Add(subdomainID, new Subdomain(subdomainID));
            BeamBuildingBuilder.MakeBeamBuilding(model, 20, 20, 20, 5, 4, model.NodesDictionary.Count + 1,
                                                 model.ElementsDictionary.Count + 1, subdomainID, 4, false, false);

            // Solver
            var     solverBuilder = new SkylineSolver.Builder();
            ISolver solver        = solverBuilder.BuildSolver(model);

            // Structural problem provider
            var provider = new ProblemStructural(model, solver);

            // Linear static analysis
            var childAnalyzer         = new LinearAnalyzer(model, solver, provider);
            var parentAnalyzerBuilder = new NewmarkDynamicAnalyzer.Builder(model, solver, provider, childAnalyzer, 0.01, 0.1);

            parentAnalyzerBuilder.SetNewmarkParametersForConstantAcceleration(); // Not necessary. This is the default
            NewmarkDynamicAnalyzer parentAnalyzer = parentAnalyzerBuilder.Build();

            // Request output
            int monitorDof = 420;

            childAnalyzer.LogFactories[subdomainID] = new LinearAnalyzerLogFactory(new int[] { monitorDof });

            // Run the analysis
            parentAnalyzer.Initialize();
            parentAnalyzer.Solve();

            // Write output
            DOFSLog log = (DOFSLog)childAnalyzer.Logs[subdomainID][0]; //There is a list of logs for each subdomain and we want the first one

            Console.WriteLine($"dof = {monitorDof}, u = {log.DOFValues[monitorDof]}");

            //TODO: No loads have been defined so the result is bound to be 0.
        }
예제 #4
0
        private static void SolveBuildingInNoSoilSmall()
        {
            var model = new Model();

            model.SubdomainsDictionary.Add(subdomainID, new Subdomain(subdomainID));
            BeamBuildingBuilder.MakeBeamBuilding(model, 20, 20, 20, 5, 4, model.NodesDictionary.Count + 1,
                                                 model.ElementsDictionary.Count + 1, subdomainID, 4, false, false);
            model.Loads.Add(new Load()
            {
                Amount = -100, Node = model.Nodes[21], DOF = StructuralDof.TranslationX
            });

            // Solver
            var     solverBuilder = new SkylineSolver.Builder();
            ISolver solver        = solverBuilder.BuildSolver(model);

            // Structural problem provider
            var provider = new ProblemStructural(model, solver);

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

            // Request output
            int monitorDof = 420;

            childAnalyzer.LogFactories[subdomainID] = new LinearAnalyzerLogFactory(new int[] { monitorDof });

            // Run the analysis
            parentAnalyzer.Initialize();
            parentAnalyzer.Solve();

            // Write output
            DOFSLog log = (DOFSLog)childAnalyzer.Logs[subdomainID][0]; //There is a list of logs for each subdomain and we want the first one

            Console.WriteLine($"dof = {monitorDof}, u = {log.DOFValues[monitorDof]}");
        }