From: Bruno Turcksin Date: Fri, 6 Sep 2013 19:20:50 +0000 (+0000) Subject: Merge from mailine. X-Git-Tag: v8.1.0~570^2~362 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=971df0be5dcb550f1952088b8e58feb8f932ce7a;p=dealii.git Merge from mailine. git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30635 0785d39b-7218-0410-832d-ea1e28bc413d --- 971df0be5dcb550f1952088b8e58feb8f932ce7a diff --cc tests/deal.II/no_flux_11.cc index 0000000000,fe01490fdb..09f7aa43e1 mode 000000,100644..100644 --- a/tests/deal.II/no_flux_11.cc +++ b/tests/deal.II/no_flux_11.cc @@@ -1,0 -1,151 +1,151 @@@ + // --------------------------------------------------------------------- + // $Id$ + // + // Copyright (C) 2012 - 2013 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. + // + // --------------------------------------------------------------------- + + + + // we were computing normal vectors through the boundary object, but the + // boundary object doesn't know about orientation. this leads to trouble if we + // get normal vectors pointing in opposite directions on neighboring cells + + + #include "../tests.h" + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + + + + template + void run() + { + Triangulation triangulation; + + GridIn gridin; + gridin.attach_triangulation(triangulation); - std::ifstream f("no_flux_11.msh"); ++ std::ifstream f(SOURCE_DIR "/no_flux_11.msh"); + Assert (f, ExcIO()); + gridin.read_msh(f); + + { + typename Triangulation::active_cell_iterator + cell = triangulation.begin_active(), + endc = triangulation.end(); + for (; cell!=endc; ++cell) + { + if (cell->is_locally_owned()) + { + for (unsigned int face=0; + face::faces_per_cell; + ++face) + { + if (cell->face(face)->at_boundary()) + { + if ( (std::fabs(cell->face(face)->center()(0)) < 0.1) + && (std::fabs(cell->face(face)->center()(dim-1)) < 1e-12) ) + { + cell->face(face)->set_boundary_indicator (1); + } + + if ( (std::fabs(cell->face(face)->center()(0)) < 1e-12) + && (std::fabs(cell->face(face)->center()(dim-1)) < 0.1) ) + { + cell->face(face)->set_boundary_indicator (1); + } + + if ( (std::fabs(1.0-cell->face(face)->center()(0)) < 0.1) + && (std::fabs(1.0-cell->face(face)->center()(dim-1)) < 1e-12) ) + { + cell->face(face)->set_boundary_indicator (2); + } + + if ( (std::fabs(1.0-cell->face(face)->center()(0)) < 1e-12) + && (std::fabs(1.0-cell->face(face)->center()(dim-1)) < 0.1) ) + { + cell->face(face)->set_boundary_indicator (2); + } + + // no normal flux boundary + + if ( (std::fabs(cell->face(face)->center()(0)) >= 0.1 && std::fabs(cell->face(face)->center()(0)) <= 1.0) + && (std::fabs(cell->face(face)->center()(dim-1)) < 1e-12) ) + { + cell->face(face)->set_boundary_indicator (3); + } + + if ( (std::fabs(cell->face(face)->center()(0)) >= 0.0 && std::fabs(cell->face(face)->center()(0)) <= 0.9) + && (std::fabs(1.0-cell->face(face)->center()(dim-1)) < 1e-12) ) + { + cell->face(face)->set_boundary_indicator (5); + } + + if ( (std::fabs(1.0-cell->face(face)->center()(0)) < 1e-12) + && (std::fabs(cell->face(face)->center()(dim-1)) >= 0.0 && std::fabs(cell->face(face)->center()(dim-1)) <= 0.9) ) + { + cell->face(face)->set_boundary_indicator (4); + } + + if ( (std::fabs(cell->face(face)->center()(0)) < 1e-12) + && (std::fabs(cell->face(face)->center()(dim-1)) >= 0.1 && std::fabs(cell->face(face)->center()(dim-1)) <= 1.0) ) + { + cell->face(face)->set_boundary_indicator (6); + } + } + } + } + } + } + + FESystem fe(FE_Q(1), dim); + DoFHandler dof_handler (triangulation); + dof_handler.distribute_dofs (fe); + + ConstraintMatrix constraints; + std::set no_normal_flux_boundaries; + no_normal_flux_boundaries.insert (6); + VectorTools::compute_no_normal_flux_constraints + (dof_handler, 0, + no_normal_flux_boundaries, + constraints); + + constraints.print(deallog.get_file_stream()); + + deallog.get_file_stream() << std::flush; + constraints.close(); + + deallog << "OK" << std::endl; + } + + + int main () + { - std::ofstream logfile ("no_flux_11/output"); ++ std::ofstream logfile ("output"); + logfile.precision (4); + logfile.setf(std::ios::fixed); + deallog.attach(logfile); + deallog.depth_console (0); + + run<2> (); + } diff --cc tests/deal.II/no_flux_11.output index 0000000000,543e413fad..543e413fad mode 000000,100644..100644 --- a/tests/deal.II/no_flux_11.output +++ b/tests/deal.II/no_flux_11.output diff --cc tests/hp/copy_tria_bug.cc index 0000000000,7a7183be2b..51213515f4 mode 000000,100644..100644 --- a/tests/hp/copy_tria_bug.cc +++ b/tests/hp/copy_tria_bug.cc @@@ -1,0 -1,60 +1,60 @@@ + // --------------------------------------------------------------------- + // $Id$ + // + // Copyright (C) 2013 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. + // + // --------------------------------------------------------------------- + + // document a bug in hp::DoFHandler and copy_triangulation + + #include "../tests.h" + + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include + #include + + using namespace dealii; + + + + template + void test1() + { + Triangulation tr1; + hp::DoFHandler dofh(tr1); + + Triangulation tr2; + GridGenerator::hyper_ball(tr2); + tr2.refine_global(2); + tr1.copy_triangulation(tr2); + + dofh.begin_active()->set_active_fe_index(0); + + + } + + int main() + { - initlog(__FILE__); ++ initlog(); + + test1<2>(); + return 0; + } diff --cc tests/hp/copy_tria_bug.output index 0000000000,8b13789179..8b13789179 mode 000000,100644..100644 --- a/tests/hp/copy_tria_bug.output +++ b/tests/hp/copy_tria_bug.output