Commit c795cc66 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Work on faster petsc assembling.

parent 64eb5987
......@@ -306,14 +306,11 @@ namespace AMDiS {
clock_t first = clock();
// MatCreate(PETSC_COMM_WORLD, &petscMatrix);
// MatSetSizes(petscMatrix, nRankRows, nRankRows, nOverallRows, nOverallRows);
//MatSetType(petscMatrix, MATAIJ);
using mtl::tag::major; using mtl::tag::nz; using mtl::begin; using mtl::end;
namespace traits= mtl::traits;
typedef DOFMatrix::base_matrix_type Matrix;
int nnz = 0;
int d_nnz[nRankRows];
for (int i = 0; i < nRankRows; i++)
d_nnz[i] = 0;
......@@ -344,10 +341,12 @@ namespace AMDiS {
}
}
INFO(info, 8)("t1 petsc matrix needed %.5f seconds\n", TIME_USED(first, clock()));
for (int i = 0; i < nRankRows; i++)
if (d_nnz[i] > nnz)
nnz = d_nnz[i];
MatCreateMPIAIJ(PETSC_COMM_WORLD, nRankRows, nRankRows, nOverallRows, nOverallRows,
0, d_nnz, 0, NULL, &petscMatrix);
nnz, NULL, nnz / 10, NULL, &petscMatrix);
using mtl::tag::major; using mtl::tag::nz; using mtl::begin; using mtl::end;
namespace traits= mtl::traits;
......@@ -453,7 +452,7 @@ namespace AMDiS {
KSPSetOperators(ksp, petscMatrix, petscMatrix, DIFFERENT_NONZERO_PATTERN);
KSPGetPC(ksp, &pc);
// PCSetType(pc, PCNONE);
PCSetType(pc, PCJACOBI);
PCSetType(pc, PCSOR);
KSPSetTolerances(ksp, 1.e-7, PETSC_DEFAULT, PETSC_DEFAULT, PETSC_DEFAULT);
KSPSetType(ksp, KSPBCGS);
//KSPSetType(ksp, KSPCG);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment