From 8b1c7ace88955ac253b4dd3d9ccde80a60668aee Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 14 Jul 2014 22:59:39 +0000 Subject: [PATCH] Reindent files according to our usual style. git-svn-id: https://svn.dealii.org/trunk@33176 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/manifold/manifold_id_01.cc | 32 +++++----- tests/manifold/manifold_id_02.cc | 38 ++++++------ tests/manifold/manifold_id_03.cc | 74 +++++++++++----------- tests/manifold/manifold_id_04.cc | 78 +++++++++++------------ tests/manifold/manifold_id_05.cc | 95 ++++++++++++++-------------- tests/manifold/manifold_id_06.cc | 97 +++++++++++++++-------------- tests/manifold/manifold_id_07.cc | 103 ++++++++++++++++--------------- 7 files changed, 264 insertions(+), 253 deletions(-) diff --git a/tests/manifold/manifold_id_01.cc b/tests/manifold/manifold_id_01.cc index 12b4fb9a05..257f7ef064 100644 --- a/tests/manifold/manifold_id_01.cc +++ b/tests/manifold/manifold_id_01.cc @@ -27,34 +27,36 @@ // Helper function template -void test(unsigned int ref=1){ +void test(unsigned int ref=1) +{ deallog << "Testing dim=" << dim - << ", spacedim="<< spacedim << std::endl; - + << ", spacedim="<< spacedim << std::endl; + Triangulation tria; GridGenerator::hyper_cube (tria); typename Triangulation::active_cell_iterator cell; - + tria.refine_global(ref); - for(cell = tria.begin_active(); cell != tria.end(); ++cell) { - deallog << "C: " << cell - << ", mid: " << (int)cell->manifold_id() << std::endl; - for(unsigned int f=0; f::faces_per_cell; ++f) - deallog << "f: " << cell->face(f) - << ", mid: " << (int)cell->face(f)->manifold_id() << std::endl; - - } + for (cell = tria.begin_active(); cell != tria.end(); ++cell) + { + deallog << "C: " << cell + << ", mid: " << (int)cell->manifold_id() << std::endl; + for (unsigned int f=0; f::faces_per_cell; ++f) + deallog << "f: " << cell->face(f) + << ", mid: " << (int)cell->face(f)->manifold_id() << std::endl; + + } } -int main () +int main () { std::ofstream logfile("output"); deallog.attach(logfile); deallog.depth_console(0); deallog.threshold_double(1.e-10); - + test<1,1>(); test<1,2>(); test<2,2>(); @@ -63,4 +65,4 @@ int main () return 0; } - + diff --git a/tests/manifold/manifold_id_02.cc b/tests/manifold/manifold_id_02.cc index 71fe3d375a..77fbdccdec 100644 --- a/tests/manifold/manifold_id_02.cc +++ b/tests/manifold/manifold_id_02.cc @@ -28,41 +28,43 @@ // Helper function template -void test(unsigned int ref=1){ +void test(unsigned int ref=1) +{ deallog << "Testing dim=" << dim - << ", spacedim="<< spacedim << std::endl; - + << ", spacedim="<< spacedim << std::endl; + Triangulation tria; GridGenerator::hyper_cube (tria); Point center; - for(unsigned int i=0;i boundary(center,center.norm()); - // triangulation.set_boundary (0, boundary_description); + // const HyperBallBoundary boundary(center,center.norm()); + // triangulation.set_boundary (0, boundary_description); typename Triangulation::active_cell_iterator cell; - + tria.begin_active()->set_all_manifold_ids(1); tria.refine_global(ref); - for(cell = tria.begin_active(); cell != tria.end(); ++cell) { - deallog << "C: " << cell - << ", mid: " << (int)cell->manifold_id() << std::endl; - for(unsigned int f=0; f::faces_per_cell; ++f) - deallog << "f: " << cell->face(f) - << ", mid: " << (int)cell->face(f)->manifold_id() << std::endl; - } - + for (cell = tria.begin_active(); cell != tria.end(); ++cell) + { + deallog << "C: " << cell + << ", mid: " << (int)cell->manifold_id() << std::endl; + for (unsigned int f=0; f::faces_per_cell; ++f) + deallog << "f: " << cell->face(f) + << ", mid: " << (int)cell->face(f)->manifold_id() << std::endl; + } + } -int main () +int main () { std::ofstream logfile("output"); deallog.attach(logfile); deallog.depth_console(0); deallog.threshold_double(1.e-10); - + test<1,1>(); test<1,2>(); test<2,2>(); @@ -71,4 +73,4 @@ int main () return 0; } - + diff --git a/tests/manifold/manifold_id_03.cc b/tests/manifold/manifold_id_03.cc index e5109da065..e0384602bb 100644 --- a/tests/manifold/manifold_id_03.cc +++ b/tests/manifold/manifold_id_03.cc @@ -30,44 +30,46 @@ // Helper function template -void test(unsigned int ref=1){ - deallog << "Testing dim=" << dim - << ", spacedim="<< spacedim << std::endl; - - Triangulation tria; - GridGenerator::hyper_cube (tria); - Point center; - - typename Triangulation::active_cell_iterator cell; - - - tria.begin_active()->set_manifold_id(1); - - tria.refine_global(1); - - for(cell = tria.begin_active(); cell != tria.end(); ++cell) { - deallog << "C: " << cell - << ", mid: " << (int)cell->manifold_id() << std::endl; - for(unsigned int f=0; f::faces_per_cell; ++f) - deallog << "f: " << cell->face(f) - << ", mid: " << (int)cell->face(f)->manifold_id() << std::endl; - } - +void test(unsigned int ref=1) +{ + deallog << "Testing dim=" << dim + << ", spacedim="<< spacedim << std::endl; + + Triangulation tria; + GridGenerator::hyper_cube (tria); + Point center; + + typename Triangulation::active_cell_iterator cell; + + + tria.begin_active()->set_manifold_id(1); + + tria.refine_global(1); + + for (cell = tria.begin_active(); cell != tria.end(); ++cell) + { + deallog << "C: " << cell + << ", mid: " << (int)cell->manifold_id() << std::endl; + for (unsigned int f=0; f::faces_per_cell; ++f) + deallog << "f: " << cell->face(f) + << ", mid: " << (int)cell->face(f)->manifold_id() << std::endl; + } + } -int main () +int main () { - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.depth_console(0); - deallog.threshold_double(1.e-10); - - test<1,1>(); - test<1,2>(); - test<2,2>(); - test<2,3>(); - test<3,3>(); - - return 0; + std::ofstream logfile("output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test<1,1>(); + test<1,2>(); + test<2,2>(); + test<2,3>(); + test<3,3>(); + + return 0; } diff --git a/tests/manifold/manifold_id_04.cc b/tests/manifold/manifold_id_04.cc index 57583a33d6..608421ecaf 100644 --- a/tests/manifold/manifold_id_04.cc +++ b/tests/manifold/manifold_id_04.cc @@ -27,46 +27,48 @@ // Helper function template -void test(unsigned int ref=1){ - deallog << "Testing dim=" << dim - << ", spacedim="<< spacedim << std::endl; - - Triangulation tria; - GridGenerator::hyper_cube (tria); - Point center; - - typename Triangulation::active_cell_iterator cell; - - - tria.begin_active()->set_manifold_id(3); - for(unsigned int f=0; f::faces_per_cell; ++f) - tria.begin_active()->face(f)->set_manifold_id(2); - - tria.refine_global(1); - - for(cell = tria.begin_active(); cell != tria.end(); ++cell) { - deallog << "C: " << cell - << ", mid: " << (int)cell->manifold_id() << std::endl; - for(unsigned int f=0; f::faces_per_cell; ++f) - deallog << "f: " << cell->face(f) - << ", mid: " << (int)cell->face(f)->manifold_id() << std::endl; - } - +void test(unsigned int ref=1) +{ + deallog << "Testing dim=" << dim + << ", spacedim="<< spacedim << std::endl; + + Triangulation tria; + GridGenerator::hyper_cube (tria); + Point center; + + typename Triangulation::active_cell_iterator cell; + + + tria.begin_active()->set_manifold_id(3); + for (unsigned int f=0; f::faces_per_cell; ++f) + tria.begin_active()->face(f)->set_manifold_id(2); + + tria.refine_global(1); + + for (cell = tria.begin_active(); cell != tria.end(); ++cell) + { + deallog << "C: " << cell + << ", mid: " << (int)cell->manifold_id() << std::endl; + for (unsigned int f=0; f::faces_per_cell; ++f) + deallog << "f: " << cell->face(f) + << ", mid: " << (int)cell->face(f)->manifold_id() << std::endl; + } + } -int main () +int main () { - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.depth_console(1); - deallog.threshold_double(1.e-10); - - test<1,1>(); - test<1,2>(); - test<2,2>(); - test<2,3>(); - test<3,3>(); - - return 0; + std::ofstream logfile("output"); + deallog.attach(logfile); + deallog.depth_console(1); + deallog.threshold_double(1.e-10); + + test<1,1>(); + test<1,2>(); + test<2,2>(); + test<2,3>(); + test<3,3>(); + + return 0; } diff --git a/tests/manifold/manifold_id_05.cc b/tests/manifold/manifold_id_05.cc index 5a4ca3e063..b191e64673 100644 --- a/tests/manifold/manifold_id_05.cc +++ b/tests/manifold/manifold_id_05.cc @@ -27,55 +27,56 @@ // Helper function template -void test(unsigned int ref=1){ - deallog << "Testing dim=" << dim - << ", spacedim="<< spacedim << std::endl; - - Point center; - for(unsigned int i=0; i boundary(center, .5*std::sqrt((double)dim)); - Triangulation tria; - GridGenerator::hyper_cube (tria); - typename Triangulation::active_cell_iterator cell; - - tria.begin_active()->face(0)->set_manifold_id(1); - tria.set_manifold(1,boundary); - - tria.refine_global(2); - - for(cell=tria.begin_active(); cell!=tria.end(); ++cell) - { - deallog << "C: " << cell << std::endl; - for(unsigned int f=0; f::faces_per_cell;++f) - deallog << "F: " << cell->face(f) << ", mid: " - << (int) cell->face(f)->manifold_id() << std::endl; - } - - - GridOut gridout; - gridout.write_msh(tria, deallog.get_file_stream()); - char fname[30]; - sprintf(fname, "/tmp/id_5_mesh_%d_%d.msh", - dim, spacedim); - std::ofstream ofile(fname); - gridout.write_msh(tria,ofile); +void test(unsigned int ref=1) +{ + deallog << "Testing dim=" << dim + << ", spacedim="<< spacedim << std::endl; + + Point center; + for (unsigned int i=0; i boundary(center, .5*std::sqrt((double)dim)); + Triangulation tria; + GridGenerator::hyper_cube (tria); + typename Triangulation::active_cell_iterator cell; + + tria.begin_active()->face(0)->set_manifold_id(1); + tria.set_manifold(1,boundary); + + tria.refine_global(2); + + for (cell=tria.begin_active(); cell!=tria.end(); ++cell) + { + deallog << "C: " << cell << std::endl; + for (unsigned int f=0; f::faces_per_cell; ++f) + deallog << "F: " << cell->face(f) << ", mid: " + << (int) cell->face(f)->manifold_id() << std::endl; + } + + + GridOut gridout; + gridout.write_msh(tria, deallog.get_file_stream()); + char fname[30]; + sprintf(fname, "/tmp/id_5_mesh_%d_%d.msh", + dim, spacedim); + std::ofstream ofile(fname); + gridout.write_msh(tria,ofile); } -int main () +int main () { - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.depth_console(0); - deallog.threshold_double(1.e-10); - - test<1,1>(); - test<1,2>(); - test<2,2>(); - test<2,3>(); - test<3,3>(); - - return 0; + std::ofstream logfile("output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test<1,1>(); + test<1,2>(); + test<2,2>(); + test<2,3>(); + test<3,3>(); + + return 0; } diff --git a/tests/manifold/manifold_id_06.cc b/tests/manifold/manifold_id_06.cc index 442a291da0..e6d7c70af4 100644 --- a/tests/manifold/manifold_id_06.cc +++ b/tests/manifold/manifold_id_06.cc @@ -27,56 +27,57 @@ // Helper function template -void test(unsigned int ref=1){ - deallog << "Testing dim=" << dim - << ", spacedim="<< spacedim << std::endl; - - Point center; - for(unsigned int i=0; i boundary(center, .25*std::sqrt((double)spacedim)); - Triangulation tria; - GridGenerator::hyper_cube (tria); - typename Triangulation::active_cell_iterator cell; - - tria.refine_global(1); - - for(cell=tria.begin_active(); cell!=tria.end(); ++cell) - if(dimcenter().distance(center)set_all_manifold_ids(1); - else - for(unsigned int f=0; f::faces_per_cell;++f) - if(cell->face(f)->center().distance(center)< radius) - cell->face(f)->set_all_manifold_ids(1); - - tria.set_manifold(1,boundary); - tria.refine_global(2); - - GridOut gridout; - gridout.write_msh(tria, deallog.get_file_stream()); - char fname[30]; - sprintf(fname, "/tmp/id_6_mesh_%d_%d.msh", - dim, spacedim); - std::ofstream ofile(fname); - gridout.write_msh(tria,ofile); +void test(unsigned int ref=1) +{ + deallog << "Testing dim=" << dim + << ", spacedim="<< spacedim << std::endl; + + Point center; + for (unsigned int i=0; i boundary(center, .25*std::sqrt((double)spacedim)); + Triangulation tria; + GridGenerator::hyper_cube (tria); + typename Triangulation::active_cell_iterator cell; + + tria.refine_global(1); + + for (cell=tria.begin_active(); cell!=tria.end(); ++cell) + if (dimcenter().distance(center)set_all_manifold_ids(1); + else + for (unsigned int f=0; f::faces_per_cell; ++f) + if (cell->face(f)->center().distance(center)< radius) + cell->face(f)->set_all_manifold_ids(1); + + tria.set_manifold(1,boundary); + tria.refine_global(2); + + GridOut gridout; + gridout.write_msh(tria, deallog.get_file_stream()); + char fname[30]; + sprintf(fname, "/tmp/id_6_mesh_%d_%d.msh", + dim, spacedim); + std::ofstream ofile(fname); + gridout.write_msh(tria,ofile); } -int main () +int main () { - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.depth_console(0); - deallog.threshold_double(1.e-10); - - test<1,1>(); - test<1,2>(); - test<2,2>(); - test<2,3>(); - test<3,3>(); - - return 0; + std::ofstream logfile("output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test<1,1>(); + test<1,2>(); + test<2,2>(); + test<2,3>(); + test<3,3>(); + + return 0; } diff --git a/tests/manifold/manifold_id_07.cc b/tests/manifold/manifold_id_07.cc index 204f66e0e2..96635f1862 100644 --- a/tests/manifold/manifold_id_07.cc +++ b/tests/manifold/manifold_id_07.cc @@ -10,9 +10,9 @@ // Set a manifold id on one of the boundary face, and attach the -// boundary description to it. Refine globally twice and output the mesh. -// Do this building first the Tria, then the manifold, and setting the -// manifold at the end as well, to check proper destruction of the classes. +// boundary description to it. Refine globally twice and output the mesh. +// Do this building first the Tria, then the manifold, and setting the +// manifold at the end as well, to check proper destruction of the classes. #include "../tests.h" #include @@ -29,56 +29,57 @@ // Helper function template -void test(unsigned int ref=1){ - deallog << "Testing dim=" << dim - << ", spacedim="<< spacedim << std::endl; - - Point center; - for(unsigned int i=0; i tria; - HyperBallBoundary boundary(center,.5*std::sqrt((double)dim)); - GridGenerator::hyper_cube (tria); - typename Triangulation::active_cell_iterator cell; - - tria.begin_active()->face(0)->set_manifold_id(1); - tria.set_manifold(1,boundary); - - tria.refine_global(2); - - for(cell=tria.begin_active(); cell!=tria.end(); ++cell) - { - deallog << "C: " << cell << std::endl; - for(unsigned int f=0; f::faces_per_cell;++f) - deallog << "F: " << cell->face(f) << ", mid: " - << (int) cell->face(f)->manifold_id() << std::endl; - } - - - GridOut gridout; - gridout.write_msh(tria, deallog.get_file_stream()); - char fname[30]; - sprintf(fname, "/tmp/id_7_mesh_%d_%d.msh", - dim, spacedim); - std::ofstream ofile(fname); - gridout.write_msh(tria,ofile); - tria.set_manifold(1); +void test(unsigned int ref=1) +{ + deallog << "Testing dim=" << dim + << ", spacedim="<< spacedim << std::endl; + + Point center; + for (unsigned int i=0; i tria; + HyperBallBoundary boundary(center,.5*std::sqrt((double)dim)); + GridGenerator::hyper_cube (tria); + typename Triangulation::active_cell_iterator cell; + + tria.begin_active()->face(0)->set_manifold_id(1); + tria.set_manifold(1,boundary); + + tria.refine_global(2); + + for (cell=tria.begin_active(); cell!=tria.end(); ++cell) + { + deallog << "C: " << cell << std::endl; + for (unsigned int f=0; f::faces_per_cell; ++f) + deallog << "F: " << cell->face(f) << ", mid: " + << (int) cell->face(f)->manifold_id() << std::endl; + } + + + GridOut gridout; + gridout.write_msh(tria, deallog.get_file_stream()); + char fname[30]; + sprintf(fname, "/tmp/id_7_mesh_%d_%d.msh", + dim, spacedim); + std::ofstream ofile(fname); + gridout.write_msh(tria,ofile); + tria.set_manifold(1); } -int main () +int main () { - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.depth_console(0); - deallog.threshold_double(1.e-10); - - test<1,1>(); - test<1,2>(); - test<2,2>(); - test<2,3>(); - test<3,3>(); - - return 0; + std::ofstream logfile("output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test<1,1>(); + test<1,2>(); + test<2,2>(); + test<2,3>(); + test<3,3>(); + + return 0; } -- 2.39.5