Beispiel #1
0
 public Feti1SubdomainGlobalMapping(IStructuralModel model, Feti1DofSeparator dofSeparator,
                                    IStiffnessDistribution distribution)
 {
     this.model        = model;
     this.dofSeparator = dofSeparator;
     this.distribution = distribution;
 }
Beispiel #2
0
        private Feti1Solver(IStructuralModel model, IFeti1SubdomainMatrixManagerFactory matrixManagerFactory,
                            IDofOrderer dofOrderer, Dictionary <int, double> factorPivotTolerances,
                            IFetiPreconditionerFactory preconditionerFactory, IFeti1InterfaceProblemSolver interfaceProblemSolver,
                            bool problemIsHomogeneous, bool projectionMatrixQIsIdentity)
        {
            // Model
            if (model.Subdomains.Count == 1)
            {
                throw new InvalidSolverException(
                          $"{name} cannot be used if there is only 1 subdomain");
            }
            this.model = model;

            // Subdomains
            subdomains = new Dictionary <int, ISubdomain>();
            foreach (ISubdomain subdomain in model.Subdomains)
            {
                subdomains[subdomain.ID] = subdomain;
            }

            // Matrix managers and linear systems
            matrixManagers        = new Dictionary <int, IFeti1SubdomainMatrixManager>();
            matrixManagersGeneral = new Dictionary <int, IFetiSubdomainMatrixManager>();
            this.linearSystems    = new Dictionary <int, ISingleSubdomainLinearSystem>();
            var externalLinearSystems = new Dictionary <int, ILinearSystem>();

            foreach (ISubdomain subdomain in model.Subdomains)
            {
                int s             = subdomain.ID;
                var matrixManager = matrixManagerFactory.CreateMatricesManager(subdomain);
                matrixManagers[s]        = matrixManager;
                matrixManagersGeneral[s] = matrixManager;
                this.linearSystems[s]    = matrixManager.LinearSystem;
                externalLinearSystems[s] = matrixManager.LinearSystem;

                //TODO: This will call HandleMatrixWillBeSet() once for each subdomain. For now I will clear the data when
                //      BuildMatrices() is called. Redesign this.
                //matrixManager.LinearSystem.MatrixObservers.Add(this);
            }
            LinearSystems = externalLinearSystems;

            this.dofOrderer            = dofOrderer;
            this.dofSeparator          = new Feti1DofSeparator();
            this.factorPivotTolerances = factorPivotTolerances;
            this.preconditionerFactory = preconditionerFactory;

            // Interface problem
            this.interfaceProblemSolver = interfaceProblemSolver;

            // Homogeneous/heterogeneous problems
            this.problemIsHomogeneous        = problemIsHomogeneous;
            this.projectionMatrixQIsIdentity = projectionMatrixQIsIdentity;
            if (problemIsHomogeneous)
            {
                this.stiffnessDistribution = new HomogeneousStiffnessDistribution(model, dofSeparator);
            }
            else
            {
                this.stiffnessDistribution = new HeterogeneousStiffnessDistribution(model, dofSeparator);
            }
        }
Beispiel #3
0
 internal Feti1LagrangeMultipliersEnumerator(ICrosspointStrategy crosspointStrategy, Feti1DofSeparator dofSeparator)
     : base(crosspointStrategy, dofSeparator)
 {
 }