internal Feti1FlexibilityMatrix(Dictionary <int, IFeti1SubdomainMatrixManager> matrixManagers,
                                 Feti1LagrangeMultipliersEnumerator lagrangeEnumerator)
 {
     this.lagrangeEnumerator = lagrangeEnumerator;
     this.matrixManagers     = matrixManagers;
     this.Order = lagrangeEnumerator.NumLagrangeMultipliers;
 }
示例#2
0
        public void Initialize()
        {
            var watch = new Stopwatch();

            watch.Start();

            // Define boundary / internal dofs
            dofSeparator.DefineGlobalBoundaryDofs(model);
            foreach (ISubdomain subdomain in model.Subdomains)
            {
                if (!subdomain.ConnectivityModified)
                {
                    continue;
                }
                Debug.WriteLine($"{this.GetType().Name}: Separating boundary-internal dofs of subdomain {subdomain.ID}");
                dofSeparator.SeparateBoundaryInternalDofs(subdomain);
            }

            //TODO: B matrices could also be reused in some cases
            // Define lagrange multipliers and boolean matrices
            this.lagrangeEnumerator = new Feti1LagrangeMultipliersEnumerator(crosspointStrategy, dofSeparator);
            if (problemIsHomogeneous)
            {
                lagrangeEnumerator.DefineBooleanMatrices(model);                       // optimization in this case
            }
            else
            {
                lagrangeEnumerator.DefineLagrangesAndBooleanMatrices(model);
            }

            // Log dof statistics
            watch.Stop();
            Logger.LogTaskDuration("Dof ordering", watch.ElapsedMilliseconds);
            int numExpandedDomainFreeDofs = 0;

            foreach (ISubdomain subdomain in model.Subdomains)
            {
                numExpandedDomainFreeDofs += subdomain.FreeDofOrdering.NumFreeDofs;
            }
            Logger.LogNumDofs("Expanded domain dofs", numExpandedDomainFreeDofs);
            Logger.LogNumDofs("Lagrange multipliers", lagrangeEnumerator.NumLagrangeMultipliers);

            // Use the newly created stiffnesses to determine the stiffness distribution between subdomains.
            //TODO: Should this be done here or before factorizing by checking that isMatrixModified?
            var Kff = new Dictionary <int, IMatrixView>();

            foreach (int s in linearSystems.Keys)
            {
                Kff[s] = linearSystems[s].Matrix;
            }
            stiffnessDistribution.Update(Kff);
            subdomainGlobalMapping = new Feti1SubdomainGlobalMapping(model, dofSeparator, stiffnessDistribution);

            //Leftover code from Model.ConnectDataStructures().
            //EnumerateSubdomainLagranges();
            //EnumerateDOFMultiplicity();
        }