<commit_before>//---------------------------------------------------------------------------
//    $Id$
//    Version: $Name$
//
//    Copyright (C) 2004, 2006, 2008, 2009, 2010 by the deal.II authors
//
//    This file is subject to QPL and may not be  distributed
//    without copyright and license information. Please refer
//    to the file deal.II/doc/license.html for the  text  and
//    further information on this license.
//
//---------------------------------------------------------------------------


#include <lac/petsc_solver.h>

#ifdef DEAL_II_USE_PETSC

#  include <lac/petsc_matrix_base.h>
#  include <lac/petsc_vector_base.h>
#  include <lac/petsc_precondition.h>
#  include <cmath>

#if (PETSC_VERSION_MAJOR == 2) && (PETSC_VERSION_MINOR < 2)
#  include <petscsles.h>
#endif
#include <petscversion.h>

DEAL_II_NAMESPACE_OPEN

namespace PETScWrappers
{

  SolverBase::SolverData::~SolverData ()
  {
                                     // destroy the solver object
    int ierr = KSPDestroy (ksp);
    AssertThrow (ierr == 0, ExcPETScError(ierr));

                                     // and destroy the solver object if we
                                     // are in old PETSc mode
#if (PETSC_VERSION_MAJOR == 2) && (PETSC_VERSION_MINOR < 2)
    ierr = SLESDestroy (sles);
    AssertThrow (ierr == 0, ExcPETScError(ierr));
#endif
  }



  SolverBase::SolverBase (SolverControl  &cn,
                          const MPI_Comm &mpi_communicator)
                  :
                  solver_control (cn),
                  mpi_communicator (mpi_communicator)
  {}



  SolverBase::~SolverBase ()
  {}



  void
  SolverBase::solve (const MatrixBase         &A,
                     VectorBase               &x,
                     const VectorBase         &b,
                     const PreconditionerBase &preconditioner)
  {
    int ierr;<commit_msg>Use new macro to simplify things.<commit_after>//---------------------------------------------------------------------------
//    $Id$
//    Version: $Name$
//
//    Copyright (C) 2004, 2006, 2008, 2009, 2010 by the deal.II authors
//
//    This file is subject to QPL and may not be  distributed
//    without copyright and license information. Please refer
//    to the file deal.II/doc/license.html for the  text  and
//    further information on this license.
//
//---------------------------------------------------------------------------


#include <lac/petsc_solver.h>

#ifdef DEAL_II_USE_PETSC

#  include <lac/petsc_matrix_base.h>
#  include <lac/petsc_vector_base.h>
#  include <lac/petsc_precondition.h>
#  include <cmath>

#if (PETSC_VERSION_MAJOR == 2) && (PETSC_VERSION_MINOR < 2)
#  include <petscsles.h>
#endif
#include <petscversion.h>

DEAL_II_NAMESPACE_OPEN

namespace PETScWrappers
{

  SolverBase::SolverData::~SolverData ()
  {
                                     // destroy the solver object
    int ierr = KSPDestroy (ksp);
    AssertThrow (ierr == 0, ExcPETScError(ierr));

                                     // and destroy the solver object if we
                                     // are in old PETSc mode
#if DEAL_II_PETSC_VERSION_LT(2,2,0)
    ierr = SLESDestroy (sles);
    AssertThrow (ierr == 0, ExcPETScError(ierr));
#endif
  }



  SolverBase::SolverBase (SolverControl  &cn,
                          const MPI_Comm &mpi_communicator)
                  :
                  solver_control (cn),
                  mpi_communicator (mpi_communicator)
  {}



  SolverBase::~SolverBase ()
  {}



  void
  SolverBase::solve (const MatrixBase         &A,
                     VectorBase               &x,
                     const VectorBase         &b,
                     const PreconditionerBase &preconditioner)
  {
    int ierr;
{'fraction_non_alphanumeric': 0.1718249733191035, 'fraction_numerical': 0.014140875133404483, 'mean_word_length': 1.5279838165879973, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5917378', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1079, 'n_words': 271}