From: Timo Heister Date: Mon, 24 Jun 2013 13:29:59 +0000 (+0000) Subject: update test X-Git-Tag: v8.0.0~243 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87ed87484b1f6a19f4fa7cc49f7d23c9c311eeac;p=dealii.git update test git-svn-id: https://svn.dealii.org/trunk@29875 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/mpi/mesh_worker_matrix_01.cc b/tests/mpi/mesh_worker_matrix_01.cc index e95fe231a2..d46dcbcdf3 100644 --- a/tests/mpi/mesh_worker_matrix_01.cc +++ b/tests/mpi/mesh_worker_matrix_01.cc @@ -163,6 +163,13 @@ test_simple(DoFHandler& dofs, bool faces) matrix.print(deallog.get_file_stream()); } +std::string id_to_string(const CellId & id) +{ + std::ostringstream ss; + ss << id; + return ss.str(); +} + template void @@ -173,8 +180,10 @@ test(const FiniteElement& fe) parallel::distributed::Triangulation::construct_multigrid_hierarchy*/); GridGenerator::hyper_cube(tr); tr.refine_global(2); - //tr.begin_active()->set_refine_flag(); - //tr.execute_coarsening_and_refinement(); + unsigned int myid=Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); + if (myid==0) + tr.begin_active()->set_refine_flag(); + tr.execute_coarsening_and_refinement(); deallog << "Triangulation levels"; for (unsigned int l=0;l& fe) DoFHandler dofs(tr); dofs.distribute_dofs(fe); + + + + unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); + if (numprocs==1) // renumber DoFs + { + std::map > dofmap; + std::ifstream f("mesh_worker_matrix_01/ordering.2"); + while (!f.eof()) + { + CellId id; + f >> id; + if (f.eof()) + break; + std::vector & d = dofmap[id_to_string(id)]; + d.reserve(fe.dofs_per_cell); + for (unsigned int i=0;i> temp; + d.push_back(temp); + } + } + + for (typename DoFHandler::active_cell_iterator cell = dofs.begin_active(); + cell != dofs.end(); ++cell) + { + if (!cell->is_locally_owned()) + continue; + + std::vector & renumbered = dofmap[id_to_string(cell->id())]; + cell->set_dof_indices(renumbered); + cell->update_cell_dof_indices_cache(); + + } + } + + if (0) + { + unsigned int myid=Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); + unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); + + for (unsigned int i=0;i0)?std::ofstream::app:std::ofstream::out); + std::vector local_dof_indices (fe.dofs_per_cell); + for (typename DoFHandler::active_cell_iterator cell = dofs.begin_active(); + cell != dofs.end(); ++cell) + { + if (!cell->is_locally_owned()) + continue; + + f << cell->id() << ' '; + cell->get_dof_indices(local_dof_indices); + for (unsigned int i=0;i sys1(p0,1,q1,1); std::vector*> fe2; fe2.push_back(&p0); - fe2.push_back(&q1); - fe2.push_back(&sys1); + // fe2.push_back(&q1); + //fe2.push_back(&sys1); for (unsigned int i=0;i