Beispiel #1
0
            //TODO: perhaps this should be done in Initialize(). Nope, Initialize is not called when using PCPG.
            private (IMatrixView globalStiffness, IVectorView globalForces) BuildGlobalLinearSystem()
            {
                // PcgSolver uses CSR matrices which are efficient for calculating f-K*u
                var pcgBuilder = new PcgAlgorithm.Builder();

                pcgBuilder.MaxIterationsProvider = new FixedMaxIterationsProvider(1); // No need to solve though.
                var solverBuilder = new PcgSolver.Builder();

                solverBuilder.DofOrderer   = originalDofOrderer;
                solverBuilder.PcgAlgorithm = pcgBuilder.Build();
                PcgSolver solver = solverBuilder.BuildSolver(singleSubdomainModel);

                // Let MSolve follow the usual analysis routine, to create all necessary data structures.
                IStaticProvider problemProvider = createProblemProvider(singleSubdomainModel, solver);
                var             linearAnalyzer  = new LinearAnalyzer(singleSubdomainModel, solver, problemProvider);
                var             staticAnalyzer  = new StaticAnalyzer(singleSubdomainModel, solver, problemProvider, linearAnalyzer);

                staticAnalyzer.Initialize();
                try
                {
                    staticAnalyzer.Solve();
                }
                catch (IterativeSolverNotConvergedException)
                { }

                // Extract the global matrix and rhs
                ILinearSystem linearSystem = solver.LinearSystems.First().Value;

                return(linearSystem.Matrix, linearSystem.RhsVector);
            }
Beispiel #2
0
 public StaticAnalyzer(IStaticProvider provider, IAnalyzer embeddedAnalyzer, IDictionary <int, ISolverSubdomain> subdomains)
 {
     this.provider      = provider;
     this.childAnalyzer = embeddedAnalyzer;
     this.subdomains    = subdomains;
     this.childAnalyzer.ParentAnalyzer = this;
 }
Beispiel #3
0
 public HomogenizationAnalyzer(IStructuralModel model, ISolver solver, IStaticProvider provider,
                               IReferenceVolumeElement rve)
 {
     this.model         = model;
     this.linearSystems = solver.LinearSystems;
     this.solver        = solver;
     this.provider      = provider;
     this.rve           = rve;
 }
 public StaticAnalyzer(IStructuralModel model, ISolver solver, IStaticProvider provider,
                       IChildAnalyzer childAnalyzer)
 {
     this.model         = model;
     this.linearSystems = solver.LinearSystems;
     this.solver        = solver;
     this.provider      = provider;
     this.ChildAnalyzer = childAnalyzer;
     this.ChildAnalyzer.ParentAnalyzer = this;
 }