From eb66c5d297014808d3a6f9d87f052086e2ddaa4e Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 22 Jul 2019 18:06:38 -0400 Subject: [PATCH] Fix CellDataTransfer tests for complex Petsc complex scalar type --- tests/sharedtria/cell_data_transfer_01.cc | 16 +++++++--------- tests/sharedtria/cell_data_transfer_02.cc | 16 +++++++--------- 2 files changed, 14 insertions(+), 18 deletions(-) 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; } -- 2.39.5