From: Daniel Arndt Date: Mon, 22 Jul 2019 22:06:38 +0000 (-0400) Subject: Fix CellDataTransfer tests for complex Petsc complex scalar type X-Git-Tag: v9.2.0-rc1~1365^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb66c5d297014808d3a6f9d87f052086e2ddaa4e;p=dealii.git Fix CellDataTransfer tests for complex Petsc complex scalar type --- diff --git a/tests/sharedtria/cell_data_transfer_01.cc b/tests/sharedtria/cell_data_transfer_01.cc index caf10a8549..bd973d32d3 100644 --- a/tests/sharedtria/cell_data_transfer_01.cc +++ b/tests/sharedtria/cell_data_transfer_01.cc @@ -61,7 +61,7 @@ test() // ----- gather ----- // store parent id of all locally owned cells - Vector cell_ids_pre(tria.n_active_cells()); + Vector cell_ids_pre(tria.n_active_cells()); for (const auto &cell : tria.active_cell_iterators()) if (cell->is_locally_owned()) { @@ -88,8 +88,8 @@ test() // output initial situation for (const auto &cell : tria.active_cell_iterators()) { - deallog << "cellid=" << cell->id() - << " parentid=" << cell_ids_pre(cell->active_cell_index()); + deallog << "cellid=" << cell->id() << " parentid=" + << std::real(cell_ids_pre(cell->active_cell_index())); if (cell->coarsen_flag_set()) deallog << " coarsening"; else if (cell->refine_flag_set()) @@ -98,22 +98,20 @@ test() } // ----- transfer ----- - CellDataTransfer> cell_data_transfer( - tria); + CellDataTransfer> cell_data_transfer(tria); cell_data_transfer.prepare_for_coarsening_and_refinement(); tria.execute_coarsening_and_refinement(); deallog << "cells after: " << tria.n_global_active_cells() << std::endl; - Vector cell_ids_post(tria.n_active_cells()); + Vector cell_ids_post(tria.n_active_cells()); cell_data_transfer.unpack(cell_ids_pre, cell_ids_post); // ------ verify ------ // check if all children adopted the correct id for (auto &cell : tria.active_cell_iterators()) - deallog << "cellid=" << cell->id() - << " parentid=" << cell_ids_post(cell->active_cell_index()) - << std::endl; + deallog << "cellid=" << cell->id() << " parentid=" + << std::real(cell_ids_post(cell->active_cell_index())) << std::endl; deallog << "OK" << std::endl; } diff --git a/tests/sharedtria/cell_data_transfer_02.cc b/tests/sharedtria/cell_data_transfer_02.cc index e49db83365..e777475a4f 100644 --- a/tests/sharedtria/cell_data_transfer_02.cc +++ b/tests/sharedtria/cell_data_transfer_02.cc @@ -61,7 +61,7 @@ test() // ----- gather ----- // store parent id of all locally owned cells - Vector cell_ids_pre(tria.n_active_cells()); + Vector cell_ids_pre(tria.n_active_cells()); for (const auto &cell : tria.active_cell_iterators()) if (cell->is_locally_owned()) { @@ -88,8 +88,8 @@ test() // output initial situation for (const auto &cell : tria.active_cell_iterators()) { - deallog << "cellid=" << cell->id() - << " parentid=" << cell_ids_pre(cell->active_cell_index()); + deallog << "cellid=" << cell->id() << " parentid=" + << std::real(cell_ids_pre(cell->active_cell_index())); if (cell->coarsen_flag_set()) deallog << " coarsening"; else if (cell->refine_flag_set()) @@ -98,22 +98,20 @@ test() } // ----- transfer ----- - CellDataTransfer> cell_data_transfer( - tria); + CellDataTransfer> cell_data_transfer(tria); cell_data_transfer.prepare_for_coarsening_and_refinement(); tria.execute_coarsening_and_refinement(); deallog << "cells after: " << tria.n_global_active_cells() << std::endl; - Vector cell_ids_post(tria.n_active_cells()); + Vector cell_ids_post(tria.n_active_cells()); cell_data_transfer.unpack(cell_ids_pre, cell_ids_post); // ------ verify ------ // check if all children adopted the correct id for (auto &cell : tria.active_cell_iterators()) - deallog << "cellid=" << cell->id() - << " parentid=" << cell_ids_post(cell->active_cell_index()) - << std::endl; + deallog << "cellid=" << cell->id() << " parentid=" + << std::real(cell_ids_post(cell->active_cell_index())) << std::endl; deallog << "OK" << std::endl; }