public void SolveLinearSystems(Matrix rhs, Matrix lhs) { lhs.Clear(); //TODO: this should be avoided foreach (int s in subdomainIDs) { IFetiSubdomainMatrixManager matrixManager = matrixManagers[s]; IMappingMatrix Bpb = preconditioningBoundarySignedBooleanMatrices[s]; // inv(F) * y: Bpb * Kbb * Bpb^T * Y Matrix temp = Bpb.MultiplyRight(rhs, true); temp = matrixManager.MultiplyKbbTimes(temp); Matrix subdomainContribution = Bpb.MultiplyRight(temp); lhs.AddIntoThis(subdomainContribution); } }
public void SolveLinearSystems(Matrix rhs, Matrix lhs) { lhs.Clear(); //TODO: this should be avoided foreach (int s in subdomainIDs) { IFetiSubdomainMatrixManager matrixManager = matrixManagers[s]; IMappingMatrix Bpb = preconditioningBoundarySignedBooleanMatrices[s]; // inv(F) * Y = Bpb * S * Bpb^T * Y // S = Kbb - Kbi * inv(Dii) * Kib Matrix BY = Bpb.MultiplyRight(rhs, true); Matrix temp = matrixManager.MultiplyKibTimes(BY); temp = matrixManager.MultiplyInverseKiiDiagonalTimes(temp); temp = matrixManager.MultiplyKbiTimes(temp); temp = matrixManager.MultiplyKbbTimes(BY) - temp; Matrix subdomainContribution = Bpb.MultiplyRight(temp); lhs.AddIntoThis(subdomainContribution); } }
public void SolveLinearSystem(Vector rhs, Vector lhs) { lhs.Clear(); //TODO: this should be avoided foreach (int s in subdomainIDs) { IFetiSubdomainMatrixManager matrixManager = matrixManagers[s]; IMappingMatrix Bpb = preconditioningBoundarySignedBooleanMatrices[s]; // inv(F) * y = Bpb * S * Bpb^T * y // S = Kbb - Kbi * inv(Dii) * Kib Vector By = Bpb.Multiply(rhs, true); Vector temp = matrixManager.MultiplyKibTimes(By); temp = matrixManager.MultiplyInverseKiiDiagonalTimes(temp); temp = matrixManager.MultiplyKbiTimes(temp); temp = matrixManager.MultiplyKbbTimes(By) - temp; Vector subdomainContribution = Bpb.Multiply(temp); lhs.AddIntoThis(subdomainContribution); } }