9 IAlgebraicMng *alg_mng = createAlgebraicMng(m_parallel_mng);
12 IndexedSpace space = alg_mng->createSpace(
"Nom",
13 index_manager->global_size());
17 Matrix m_a(space,space);
23 IParallelMng* areaU_pm = m_parallel_mng->
24 createSubParallelMng(owners(areaU));
25 IParallelMng* areaU_pm = m_parallel_mng->
26 createSubParallelMng(owners(areaP));
28 MatrixEditor edit_aU(m_a, index_manager, areaU_pm);
29 MatrixEditor edit_aP(m_a, index_manager, areaP_pm);
34 if (areaU_pm->commRank() >= 0) {
36 edit_aU(icell,icell) = fij(icell, icell);
38 edit_aU(icell, isubcell) += fij(icell, isubcell);
42 if (areaP_pm->commRank() >= 0) {
45 edit_aP(inode, isubcell) += fij(inode, isubcell);
51 m_a.add_contrib(edit_aU);
52 m_a.add_contrib(edit_aP);
57 VectorEditor ve_b (v_b, index_manager);
60 ve_b(icell) = var_cell[icell];
63 ve_b(inode) = var_node[inode];
68 Solver solver = solverMng->createSolver(alg_mng, options);
69 v_x = solver.solve(m_a, v_b);
71 if (!solver.failed()) {
72 Fatal(
"Unable to solve Ax=b");
76 Vector v_residual = v_b - m_a*v_x;
78 info() <<
"Residual norm_2 = " << norm2(v_residual);