<commit_before>// ---------------------------------------------------------------------
//
// Copyright (C) 2004 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------

// test FEValuesBase::get_function_values()
// when used with complex vector;


#include "../tests.h"

#include <deal.II/base/logstream.h>
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/utilities.h>
#include <deal.II/base/conditional_ostream.h>
#include <deal.II/base/index_set.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/grid_tools.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>

#include <deal.II/lac/vector.h>
#include <deal.II/lac/full_matrix.h>
#include <deal.II/lac/constraint_matrix.h>

#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_parallel_sparse_matrix.h>

#include <deal.II/lac/trilinos_vector.h>

#include <deal.II/distributed/tria.h>
#include <deal.II/distributed/grid_refinement.h>

using namespace dealii;

static const unsigned int dim = 2;

void test ()
{

  MPI_Comm mpi_communicator (MPI_COMM_WORLD);
  const unsigned int n_mpi_processes (Utilities::MPI::n_mpi_processes(mpi_communicator));
  const unsigned int this_mpi_process (Utilities::MPI::this_mpi_process(mpi_communicator));

  ConditionalOStream pcout (std::cout,
                            (Utilities::MPI::this_mpi_process(mpi_communicator)
                             == 0));

  parallel::distributed::Triangulation<dim> tria(mpi_communicator,
                                                 typename Triangulation<dim>::MeshSmoothing
                                                 (Triangulation<dim>::smoothing_on_refinement |
                                                  Triangulation<dim>::smoothing_on_coarsening));


  GridGenerator::hyper_cube (tria, -1,0);
  tria.refine_global (2);


  const unsigned int poly_degree = 1;
  FE_Q<dim> fe(poly_degree);

  DoFHandler<dim> dof_handler(tria);
  dof_handler.distribute_dofs(fe);

  IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs ();
  IndexSet locally_relevant_dofs;
  DoFTools::extract_locally_relevant_dofs (dof_handler,locally_relevant_dofs);

  PETScWrappers::MPI::Vector vector, vector_locally_relevant;
  TrilinosWrappers::MPI::Vector vector_Re, vector_Re_locally_relevant,
                   vector_Im, vector_Im_locally_relevant;
  vector.reinit(locally_owned_dofs, mpi_communicator);
  vector_locally_relevant.reinit (locally_owned_dofs,
                                  locally_relevant_dofs,mpi_communicator);

  vector_Re.reinit(locally_owned_dofs, mpi_communicator);
  vector_Re_locally_relevant.reinit (locally_owned_dofs,
                                     locally_relevant_dofs,mpi_communicator);

  vector_Im.reinit(locally_owned_dofs, mpi_communicator);
  vector_Im_locally_relevant.reinit (locally_owned_dofs,
                                     locally_relevant_dofs,mpi_communicator);

  const types::global_dof_index n_local_dofs = locally_owned_dofs.n_elements();
<commit_msg>do not use Trilinos inside petsc_compelx tests<commit_after>// ---------------------------------------------------------------------
//
// Copyright (C) 2004 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------

// test FEValuesBase::get_function_values()
// when used with complex vector;


#include "../tests.h"

#include <deal.II/base/logstream.h>
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/utilities.h>
#include <deal.II/base/conditional_ostream.h>
#include <deal.II/base/index_set.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/grid_tools.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>

#include <deal.II/lac/vector.h>
#include <deal.II/lac/full_matrix.h>
#include <deal.II/lac/constraint_matrix.h>

#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_parallel_sparse_matrix.h>

#include <deal.II/lac/parallel_vector.h>

#include <deal.II/distributed/tria.h>
#include <deal.II/distributed/grid_refinement.h>

using namespace dealii;

static const unsigned int dim = 2;

void test ()
{

  MPI_Comm mpi_communicator (MPI_COMM_WORLD);
  const unsigned int n_mpi_processes (Utilities::MPI::n_mpi_processes(mpi_communicator));
  const unsigned int this_mpi_process (Utilities::MPI::this_mpi_process(mpi_communicator));

  ConditionalOStream pcout (std::cout,
                            (Utilities::MPI::this_mpi_process(mpi_communicator)
                             == 0));

  parallel::distributed::Triangulation<dim> tria(mpi_communicator,
                                                 typename Triangulation<dim>::MeshSmoothing
                                                 (Triangulation<dim>::smoothing_on_refinement |
                                                  Triangulation<dim>::smoothing_on_coarsening));


  GridGenerator::hyper_cube (tria, -1,0);
  tria.refine_global (2);


  const unsigned int poly_degree = 1;
  FE_Q<dim> fe(poly_degree);

  DoFHandler<dim> dof_handler(tria);
  dof_handler.distribute_dofs(fe);

  IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs ();
  IndexSet locally_relevant_dofs;
  DoFTools::extract_locally_relevant_dofs (dof_handler,locally_relevant_dofs);

  PETScWrappers::MPI::Vector vector, vector_locally_relevant;
  parallel::distributed::Vector< double > vector_Re, vector_Re_locally_relevant,
           vector_Im, vector_Im_locally_relevant;
  vector.reinit(locally_owned_dofs, mpi_communicator);
  vector_locally_relevant.reinit (locally_owned_dofs,
                                  locally_relevant_dofs,mpi_communicator);

  vector_Re.reinit(locally_owned_dofs, mpi_communicator);
  vector_Re_locally_relevant.reinit (locally_owned_dofs,
                                     locally_relevant_dofs,mpi_communicator);

  vector_Im.reinit(locally_owned_dofs, mpi_communicator);
  vector_Im_locally_relevant.reinit (locally_owned_dofs,
                                     locally_relevant_dofs,mpi_communicator);

  const types::global_dof_index n_local_dofs = locally_owned_dofs.n_elements();

{'fraction_non_alphanumeric': 0.14095639573178764, 'fraction_numerical': 0.0042155183770254245, 'mean_word_length': 3.019057702488089, 'pattern_counts': {'":': 0, '<': 64, '<?xml version=': 0, '>': 64, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5620053', 'n_tokens_mistral': 2622, 'n_tokens_neox': 2428, 'n_words': 455}