private void InitializeMatrices() { ImplicitIntegrationCoefficients coeffs = new ImplicitIntegrationCoefficients { Mass = a0, Damping = a1, Stiffness = 1 }; foreach (ISolverSubdomain subdomain in subdomains.Values) { provider.CalculateEffectiveMatrix(subdomain, coeffs); } var m = (SkylineMatrix2D <double>)subdomains[1].Matrix; var x = new HashSet <double>(); int nonZeroCount = 0; for (int i = 0; i < m.Data.Length; i++) { nonZeroCount += m.Data[i] != 0 ? 1 : 0; if (x.Contains(m.Data[i]) == false) { x.Add(m.Data[i]); } } nonZeroCount += 0; }
private void InitializeRHSs() { ImplicitIntegrationCoefficients coeffs = new ImplicitIntegrationCoefficients { Mass = a0, Damping = a1, Stiffness = 1 }; foreach (ISolverSubdomain subdomain in subdomains.Values) { provider.ProcessRHS(subdomain, coeffs); int dofs = subdomain.RHS.Length; for (int i = 0; i < dofs; i++) { rhs[subdomain.ID][i] = subdomain.RHS[i]; } } }