public override IFetiPreconditioner CreatePreconditioner(IStructuralModel model,
                                                                     IStiffnessDistribution stiffnessDistribution, IDofSeparator dofSeparator,
                                                                     ILagrangeMultipliersEnumerator lagrangeEnumerator, Dictionary <int, IFetiSubdomainMatrixManager> matrixManagers)
            {
                IReadOnlyList <ISubdomain> subdomains = model.Subdomains;

                int[] subdomainIDs = dofSeparator.BoundaryDofIndices.Keys.ToArray();
                Dictionary <int, IMappingMatrix> boundaryBooleans = CalcBoundaryPreconditioningBooleanMatrices(
                    stiffnessDistribution, dofSeparator, lagrangeEnumerator);

                foreach (int s in subdomainIDs)
                {
                    if (!subdomains[s].StiffnessModified)
                    {
                        continue;
                    }
                    Debug.WriteLine($"{typeof(DiagonalDirichletPreconditioner).Name}.{this.GetType().Name}:"
                                    + $" Extracting boundary/internal submatrices of subdomain {s} for preconditioning");
                    IFetiSubdomainMatrixManager matrixManager = matrixManagers[s];
                    int[] boundaryDofs = dofSeparator.BoundaryDofIndices[s];
                    int[] internalDofs = dofSeparator.InternalDofIndices[s];
                    matrixManager.ExtractKbb(boundaryDofs);
                    matrixManager.ExtractKbiKib(boundaryDofs, internalDofs);
                    matrixManager.ExtractAndInvertKiiDiagonal(internalDofs);
                }
                return(new DiagonalDirichletPreconditioner(subdomainIDs, matrixManagers, boundaryBooleans));
            }
Example #2
0
        protected Dictionary <int, IMappingMatrix> CalcBoundaryPreconditioningBooleanMatrices(IStiffnessDistribution stiffnessDistribution,
                                                                                              IDofSeparator dofSeparator, ILagrangeMultipliersEnumerator lagrangeEnumerator)
        {
            int numContinuityEquations = lagrangeEnumerator.NumLagrangeMultipliers;
            var matricesBb             = new Dictionary <int, SignedBooleanMatrixColMajor>();

            foreach (int s in dofSeparator.BoundaryDofIndices.Keys)
            {
                SignedBooleanMatrixColMajor B  = lagrangeEnumerator.BooleanMatrices[s];
                SignedBooleanMatrixColMajor Bb = B.GetColumns(dofSeparator.BoundaryDofIndices[s], false);
                matricesBb[s] = Bb;
            }
            Dictionary <int, IMappingMatrix> matricesBpb = stiffnessDistribution.CalcBoundaryPreconditioningSignedBooleanMatrices(
                lagrangeEnumerator, matricesBb);

            return(matricesBpb);
        }
Example #3
0
 public Dictionary <int, IMappingMatrix> CalcBoundaryPreconditioningSignedBooleanMatrices(
     ILagrangeMultipliersEnumerator lagrangeEnumerator,
     Dictionary <int, SignedBooleanMatrixColMajor> boundarySignedBooleanMatrices)
 {
     return(ScalingBooleanMatrixImplicit.CreateBpbOfSubdomains(this, lagrangeEnumerator, boundarySignedBooleanMatrices));
 }
Example #4
0
 public abstract IFetiPreconditioner CreatePreconditioner(IModel model,
                                                          IStiffnessDistribution stiffnessDistribution, IDofSeparator dofSeparator,
                                                          ILagrangeMultipliersEnumerator lagrangeEnumerator, Dictionary <int, IFetiSubdomainMatrixManager> matrixManagers);