From f712f06b970c330e9928d491f6ee25965100964c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 26 Nov 2014 23:44:02 -0600 Subject: [PATCH] Add the corresponding testcase for hp::DoFHandler as well, just to be on the safe side. --- tests/bits/serialize_hp_dof_handler.cc | 61 ++++++++++++++++++++++ tests/bits/serialize_hp_dof_handler.output | 2 + 2 files changed, 63 insertions(+) create mode 100644 tests/bits/serialize_hp_dof_handler.cc create mode 100644 tests/bits/serialize_hp_dof_handler.output diff --git a/tests/bits/serialize_hp_dof_handler.cc b/tests/bits/serialize_hp_dof_handler.cc new file mode 100644 index 0000000000..28fe6c8f8b --- /dev/null +++ b/tests/bits/serialize_hp_dof_handler.cc @@ -0,0 +1,61 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2014 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 an issue reported by David Wells: serializing a DoFHandler object did +// not work right out of the box without manually including additional header +// files + +#include "../tests.h" +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + + +int main () +{ + std::ofstream logfile("output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + Triangulation<2> triangulation; + GridGenerator::hyper_cube (triangulation); + triangulation.refine_global (4); + hp::DoFHandler<2> dof_handler (triangulation); + FE_Q<2> finite_element (1); + hp::FECollection<2> fe; + fe.push_back (finite_element); + dof_handler.distribute_dofs (fe); + + std::ostringstream out_stream; + boost::archive::text_oarchive archive(out_stream); + + archive << dof_handler; + dof_handler.clear (); + + deallog << "OK" << std::endl; +} diff --git a/tests/bits/serialize_hp_dof_handler.output b/tests/bits/serialize_hp_dof_handler.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/bits/serialize_hp_dof_handler.output @@ -0,0 +1,2 @@ + +DEAL::OK -- 2.39.5