From: Wolfgang Bangerth Date: Tue, 22 May 2001 11:54:30 +0000 (+0000) Subject: Make things more C++ conformant. X-Git-Tag: v8.0.0~19102 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87329d14dc261c6220af56d13ff375e5d6b5fb38;p=dealii.git Make things more C++ conformant. git-svn-id: https://svn.dealii.org/trunk@4692 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/fe/derivatives.cc b/tests/fe/derivatives.cc index 9ebac57729..4fd4d326bc 100644 --- a/tests/fe/derivatives.cc +++ b/tests/fe/derivatives.cc @@ -132,9 +132,9 @@ void plot_FE_DGQ_shape_functions() int main() { - ofstream logfile ("derivatives.output"); + std::ofstream logfile ("derivatives.output"); logfile.precision (2); - logfile.setf(ios::fixed); + logfile.setf(std::ios::fixed); deallog.attach(logfile); deallog.depth_console(0); diff --git a/tests/fe/internals.cc b/tests/fe/internals.cc index fe00ea48a5..04a737a368 100644 --- a/tests/fe/internals.cc +++ b/tests/fe/internals.cc @@ -20,24 +20,22 @@ template inline void -check_support (FiniteElement& finel, const char* name) +check_support (const FiniteElement& finel, const char* name) { Triangulation tr; GridGenerator::hyper_cube(tr, 0., 1.); DoFHandler dof (tr); dof.distribute_dofs (finel); - cout << name << '<' << dim << '>' << " cell support points" << std::endl; + std::cout << name << '<' << dim << '>' << " cell support points" << std::endl; - vector > cell_points (finel.dofs_per_cell); - finel.get_unit_support_points (cell_points); + const std::vector > &cell_points = finel.get_unit_support_points (); for (unsigned int k=0;k > face_points; - finel.get_unit_face_support_points (face_points); - const vector dummy_weights (face_points.size()); + const std::vector > &face_points = finel.get_unit_face_support_points (); + const std::vector dummy_weights (face_points.size()); Quadrature q(face_points, dummy_weights); QProjector qp(q, false); @@ -45,10 +43,10 @@ check_support (FiniteElement& finel, const char* name) unsigned int j=0; for (unsigned int i=0;i::faces_per_cell;++i) { - cout << name << '<' << dim << '>' << " face " << i << " support points" << std::endl; + std::cout << name << '<' << dim << '>' << " face " << i << " support points" << std::endl; for (unsigned int k=0;k inline void check_matrices (FiniteElement& fe, const char* name) { - cout << name << '<' << dim << '>' << " constraint " << std::endl; - fe.constraints().print_formatted (cout, 7, false, 10, "~"); + std::cout << name << '<' << dim << '>' << " constraint " << std::endl; + fe.constraints().print_formatted (std::cout, 7, false, 10, "~"); for (unsigned int i=0;i::children_per_cell;++i) { - cout << name << '<' << dim << '>' << " restriction " << i << std::endl; - fe.restrict(i).print_formatted (cout, 3, false, 6, "~"); - cout << name << '<' << dim << '>' << " embedding " << i << std::endl; - fe.prolongate(i).print_formatted (cout, 3, false, 6, "~"); + std::cout << name << '<' << dim << '>' << " restriction " << i << std::endl; + fe.restrict(i).print_formatted (std::cout, 3, false, 6, "~"); + std::cout << name << '<' << dim << '>' << " embedding " << i << std::endl; + fe.prolongate(i).print_formatted (std::cout, 3, false, 6, "~"); } } diff --git a/tests/fe/performance.cc b/tests/fe/performance.cc index 54b0985532..4cc3cbb3b5 100644 --- a/tests/fe/performance.cc +++ b/tests/fe/performance.cc @@ -49,22 +49,22 @@ void performance (Triangulation& tr, } template -void loop (vector *> elements, +void loop (std::vector *> elements, const Mapping& mapping, Triangulation& tr) { QGauss gauss (4); - FiniteElement** elementp = elements.begin (); - FiniteElement** end = elements.end (); + typename std::vector *>::iterator elementp = elements.begin (); + typename std::vector *>::iterator end = elements.end (); for (;elementp != end; ++elementp) { const FiniteElement& element = **elementp; char dofs[20]; - ostrstream ost (dofs, 19); - ost << element.n_dofs_per_cell() << ends; + std::ostrstream ost (dofs, 19); + ost << element.n_dofs_per_cell() << std::ends; deallog.push(dofs); @@ -104,7 +104,7 @@ void loop (vector *> elements, int main () { - ofstream of ("performance.log"); + std::ofstream of ("performance.log"); deallog.attach (of); deallog.log_execution_time(true); deallog.log_time_differences(true); @@ -116,7 +116,7 @@ int main () MappingQ1<2> mapping; MappingQ<2> mappingq1(1); MappingQ<2> mappingq2(2); - vector*> el2d; + std::vector*> el2d; el2d.push_back (new FE_Q<2> (1)); el2d.push_back (new FE_Q<2> (2)); el2d.push_back (new FE_Q<2> (3)); diff --git a/tests/fe/shapes.cc b/tests/fe/shapes.cc index 1bde5701aa..b7da61371f 100644 --- a/tests/fe/shapes.cc +++ b/tests/fe/shapes.cc @@ -44,7 +44,7 @@ plot_shape_functions(Mapping& mapping, sprintf(fname, "Shapes%dd-%s.output", dim, name); std::ofstream gnuplot(fname); - gnuplot.setf(ios::fixed); + gnuplot.setf(std::ios::fixed); gnuplot.precision (PRECISION); unsigned int k=0; @@ -99,8 +99,8 @@ plot_face_shape_functions(Mapping& mapping, | update_q_points)); sprintf(fname, "ShapesFace%dd-%s.output", dim, name); - ofstream gnuplot(fname); - gnuplot.setf(ios::fixed); + std::ofstream gnuplot(fname); + gnuplot.setf(std::ios::fixed); gnuplot.precision (PRECISION); for (unsigned int f=0; f::faces_per_cell; ++f) @@ -184,7 +184,7 @@ void test_compute_functions (const Mapping &mapping, coincide=false; if (!coincide) - deallog << "Error in fe.shape_value for " << name << endl; + deallog << "Error in fe.shape_value for " << name << std::endl; coincide=true; for (unsigned int x=0; x &mapping, } if (!coincide) - deallog << "Error in fe.shape_grad for " << name << endl; + deallog << "Error in fe.shape_grad for " << name << std::endl; coincide=true; double max_diff=0.; @@ -218,8 +218,8 @@ void test_compute_functions (const Mapping &mapping, } if (!coincide) - deallog << "Error in fe.shape_grad_grad for " << name << endl - << "max_diff=" << max_diff << endl; + deallog << "Error in fe.shape_grad_grad for " << name << std::endl + << "max_diff=" << max_diff << std::endl; } @@ -297,9 +297,9 @@ void plot_FE_DGQ_shape_functions() int main() { - ofstream logfile ("shapes.output"); + std::ofstream logfile ("shapes.output"); logfile.precision (PRECISION); - logfile.setf(ios::fixed); + logfile.setf(std::ios::fixed); deallog.attach(logfile); deallog.depth_console(0); diff --git a/tests/fe/show_transfer.cc b/tests/fe/show_transfer.cc index bfbae100e7..93b75d5719 100644 --- a/tests/fe/show_transfer.cc +++ b/tests/fe/show_transfer.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -37,7 +37,7 @@ char fname[50]; template inline void -print_matrix(ostream& of, +print_matrix(std::ostream& of, Triangulation& tr, unsigned int level, const FiniteElement& finel, @@ -75,7 +75,7 @@ main() GridGenerator::hyper_cube(tr, -1., 1.); tr.refine_global(2); - ofstream of("transfer.dat"); + std::ofstream of("transfer.dat"); TEST(1,FEQ1<2>); TEST(1,FEQ2<2>);