//TODO: Use Skyline assembler private SkylineMatrix CreateGlobalKccStar(Dictionary <int, HashSet <INode> > cornerNodesOfSubdomains, FetiDPDofSeparator dofSeparator, Dictionary <int, IFetiDPSubdomainMatrixManager> matrixManagers) { int[] skylineColHeights = FindSkylineColumnHeights(cornerNodesOfSubdomains, dofSeparator); var skylineBuilder = SkylineBuilder.Create(dofSeparator.NumGlobalCornerDofs, skylineColHeights); for (int s = 0; s < subdomains.Count; ++s) { IFetiDPSubdomainMatrixManager matrices = matrixManagers[s]; // KccStar[s] = Kcc[s] - Krc[s]^T * inv(Krr[s]) * Krc[s] if (subdomains[s].StiffnessModified) { Debug.WriteLine($"{this.GetType().Name}: Calculating Schur complement of remainder dofs" + " for the stiffness of subdomain {s}"); matrices.CalcSchurComplementOfRemainderDofs(); //TODO: At this point Kcc and Krc can be cleared. Maybe Krr too. } int[] subdomainToGlobalIndices = dofSeparator.CornerBooleanMatrices[s].GetRowsToColumnsMap(); IMatrixView subdomainMatrix = matrices.SchurComplementOfRemainderDofs; skylineBuilder.AddSubmatrixSymmetric(subdomainMatrix, subdomainToGlobalIndices); } return(skylineBuilder.BuildSkylineMatrix()); }
private Matrix CreateGlobalKccStar(FetiDPDofSeparator dofSeparator, Dictionary <int, IFetiDPSubdomainMatrixManager> matrixManagers) { // Static condensation of remainder dofs (Schur complement). var globalKccStar = Matrix.CreateZero(dofSeparator.NumGlobalCornerDofs, dofSeparator.NumGlobalCornerDofs); for (int s = 0; s < subdomains.Count; ++s) { IFetiDPSubdomainMatrixManager matrices = matrixManagers[s]; // KccStar[s] = Kcc[s] - Krc[s]^T * inv(Krr[s]) * Krc[s] if (subdomains[s].StiffnessModified) { Debug.WriteLine($"{this.GetType().Name}: Calculating Schur complement of remainder dofs" + " for the stiffness of subdomain {s}"); matrices.CalcSchurComplementOfRemainderDofs(); //TODO: At this point Kcc and Krc can be cleared. Maybe Krr too. } // globalKccStar = sum_over_s(Lc[s]^T * KccStar[s] * Lc[s]) UnsignedBooleanMatrix Lc = dofSeparator.CornerBooleanMatrices[s]; globalKccStar.AddIntoThis(Lc.ThisTransposeTimesOtherTimesThis(matrices.SchurComplementOfRemainderDofs)); } return(globalKccStar); }