const PetscInt petsc_i = row;
PetscInt *col_index_ptr;
+
PetscScalar const *col_value_ptr;
int n_columns;
* convergence has been reached.
*/
static
-#ifdef PETSC_USE_64BIT_INDICES
- PetscErrorCode
-#else
- int
-#endif
- convergence_test (KSP ksp,
- const PetscInt iteration,
- const PetscReal residual_norm,
- KSPConvergedReason *reason,
- void *solver_control);
+ PetscErrorCode convergence_test (KSP ksp,
+ const PetscInt iteration,
+ const PetscReal residual_norm,
+ KSPConvergedReason *reason,
+ void *solver_control);
/**
* A structure that contains the PETSc
* to see if convergence has been reached.
*/
static
-#ifdef PETSC_USE_64BIT_INDICES
- PetscErrorCode
-#else
- int
-#endif
- convergence_test (KSP ksp,
- const PetscInt iteration,
- const PetscReal residual_norm,
- KSPConvergedReason *reason,
- void *solver_control);
+ PetscErrorCode convergence_test (KSP ksp,
+ const PetscInt iteration,
+ const PetscReal residual_norm,
+ KSPConvergedReason *reason,
+ void *solver_control);
+
/**
* A structure that contains the
* PETSc solver and preconditioner
}
- int SparseDirectMUMPS::convergence_test (KSP /*ksp*/,
- const PetscInt iteration,
- const PetscReal residual_norm,
- KSPConvergedReason *reason,
- void *solver_control_x)
+ PetscErrorCode SparseDirectMUMPS::convergence_test (KSP /*ksp*/,
+ const PetscInt iteration,
+ const PetscReal residual_norm,
+ KSPConvergedReason *reason,
+ void *solver_control_x)
{
SolverControl &solver_control = *reinterpret_cast<SolverControl *>(solver_control_x);
// signed integers. so we have to
// convert, unless we want to play dirty
// tricks with conversions of pointers
-#ifdef PETSC_USE_64BIT_INDICES
const std::vector<PetscInt>
-#else
- const std::vector<int>
-#endif
- int_row_lengths (row_lengths.begin(), row_lengths.end());
+ int_row_lengths (row_lengths.begin(), row_lengths.end());
+
const int ierr
= MatCreateSeqAIJ(PETSC_COMM_SELF, m, n, 0,
&int_row_lengths[0], &matrix);
// class.
if (preset_nonzero_locations == true)
{
-#ifdef PETSC_USE_64BIT_INDICES
- std::vector<PetscInt>
-#else
- std::vector<int>
-#endif
- row_entries;
+ std::vector<PetscInt> row_entries;
std::vector<PetscScalar> row_values;
+
for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
{
row_entries.resize (row_lengths[i]);
for (unsigned int j=0; j<row_lengths[i]; ++j)
row_entries[j] = sparsity_pattern.column_number (i,j);
-#ifdef PETSC_USE_64BIT_INDICES
- const PetscInt
-#else
- const int
-#endif
- int_row = i;
+ const PetscInt int_row = i;
MatSetValues (matrix, 1, &int_row,
row_lengths[i], &row_entries[0],
&row_values[0], INSERT_VALUES);
}
void
- SolverBase::solve (const unsigned int n_eigenvectors, unsigned int *n_converged)
+ SolverBase::solve (const unsigned int n_eigenvectors,
+ unsigned int *n_converged)
{
int ierr;