int main(int, char)
{
- ofstream logfile("auto_derivative_function.output");
+ std::ofstream logfile("auto_derivative_function.output");
logfile.precision(4);
deallog.attach(logfile);
deallog.depth_console(0);
{
formula=AutoDerivativeFunction<dim>::get_formula_of_order(order);
auto_function.set_formula(formula);
- deallog << "order=" << order << ", formula=" << formula << endl;
+ deallog << "order=" << order << ", formula=" << formula << std::endl;
ConvergenceTable history;
unsigned int factor=1;
// $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
#include <base/logstream.h>
#include <fstream>
+
int main()
{
- ofstream logfile("logtest.output");
+ std::ofstream logfile("logtest.output");
deallog.attach(logfile);
deallog.depth_console(0);
#include <iostream>
#include <fstream>
+#include <cmath>
#include <base/logstream.h>
#include <base/tensor_product_polynomials.h>
bool equals_delta_ij(double value, unsigned int i, unsigned int j)
{
double eps=1e-14;
- if ((i==j && fabs(value-1)<eps) || (i!=j && fabs(value)<eps))
+ if ((i==j && std::fabs(value-1)<eps) || (i!=j && std::fabs(value)<eps))
return true;
else
return false;
int main(int, char)
{
- ofstream logfile("polynomial_test.output");
+ std::ofstream logfile("polynomial_test.output");
logfile.precision(4);
deallog.attach(logfile);
deallog.depth_console(0);
- vector<double> values(1);
+ std::vector<double> values(1);
deallog << "LagrangeEquidistant polynoms:" << std::endl;
for (unsigned int order=1; order<=4; ++order)
{
deallog << std::endl << "Test derivatives computed by the Horner scheme:" << std::endl;
LagrangeEquidistant pol(4, 2);
- vector<double> v_horner(6);
+ std::vector<double> v_horner(6);
for (unsigned int i=0; i<=10; ++i)
{
double xi=i*0.1;
deallog << "x=" << xi << ", all derivatives: ";
- vector<double> v_exact(6);
+ std::vector<double> v_exact(6);
v_exact[0]=64.0*xi*xi*xi*xi-128.0*xi*xi*xi+76.0*xi*xi-12.0*xi;
v_exact[1]=256.0*xi*xi*xi-384.0*xi*xi+152.0*xi-12.0;
{
// deallog << "v_horner[i]=" << v_horner[i]
// << " v_exact[i]=" << v_exact[i] << std::endl;
- if (fabs(v_horner[i]-v_exact[i])>1e-12)
+ if (std::fabs(v_horner[i]-v_exact[i])>1e-12)
ok=false;
}
if (true)
{
deallog << std::endl << "Derivatives of a polynomial of degree 0 (a constant function)." << std::endl;
- vector<double> a_const(1,1.);
+ std::vector<double> a_const(1,1.);
const Polynomial<double> pol_const(a_const);
- vector<double> exact_values(5,0.);
+ std::vector<double> exact_values(5,0.);
exact_values[0]=1.;
- vector<double> computed_values(5);
+ std::vector<double> computed_values(5);
pol_const.value(0.24, computed_values);
bool ok=true;
for (unsigned int i=0; i<exact_values.size(); ++i)
{
- if (fabs(computed_values[i]-exact_values[i])>1e-15)
+ if (std::fabs(computed_values[i]-exact_values[i])>1e-15)
ok=false;
}
deallog << "2D Example:" << std::endl;
unsigned int p=3,
n_tensor_pols=(p+1)*(p+1);
- vector<Polynomial<double> > pols;
+ std::vector<Polynomial<double> > pols;
for (unsigned int i=0; i<=p; ++i)
pols.push_back(LagrangeEquidistant(p, i));
Tensor<1,2> grad=tp_pol.compute_grad(i, point);
Tensor<2,2> grad_grad=tp_pol.compute_grad_grad(i, point);
- vector<double> vs(n_tensor_pols);
- vector<Tensor<1,2> > grads(n_tensor_pols);
- vector<Tensor<2,2> > grad_grads(n_tensor_pols);
+ std::vector<double> vs(n_tensor_pols);
+ std::vector<Tensor<1,2> > grads(n_tensor_pols);
+ std::vector<Tensor<2,2> > grad_grads(n_tensor_pols);
tp_pol.compute(point, vs, grads, grad_grads);
template <int dim>
void
-fill_vector (vector<Quadrature<dim> *>& quadratures)
+fill_vector (std::vector<Quadrature<dim> *>& quadratures)
{
quadratures.push_back (new QGauss2<dim>());
quadratures.push_back (new QGauss3<dim>());
template <int dim>
void
-check_cells (vector<Quadrature<dim>*>& quadratures)
+check_cells (std::vector<Quadrature<dim>*>& quadratures)
{
for (unsigned int n=0; n<quadratures.size(); ++n)
{
Quadrature<dim>& quadrature = *quadratures[n];
- const vector<Point<dim> > &points=quadrature.get_points();
- const vector<double> &weights=quadrature.get_weights();
+ const std::vector<Point<dim> > &points=quadrature.get_points();
+ const std::vector<double> &weights=quadrature.get_weights();
deallog << "Quadrature no." << n
<< " (" << typeid(*quadratures[n]).name() << ")";
template <int dim>
void
-check_faces (vector<Quadrature<dim-1>*>& quadratures, bool sub)
+check_faces (const std::vector<Quadrature<dim-1>*>& quadratures, const bool sub)
{
if (sub)
deallog.push("subfaces");
int main(int,char)
{
- ofstream logfile("quadrature_test.output");
+ std::ofstream logfile("quadrature_test.output");
deallog.attach(logfile);
deallog.depth_console(0);
- vector<Quadrature<1> *> q1;
- vector<Quadrature<2> *> q2;
- vector<Quadrature<3> *> q3;
+ std::vector<Quadrature<1> *> q1;
+ std::vector<Quadrature<2> *> q2;
+ std::vector<Quadrature<3> *> q3;
fill_vector (q1);
fill_vector (q2);
fill_vector (q3);
int main()
{
- ofstream logfile("reference.output");
+ std::ofstream logfile("reference.output");
deallog.attach(logfile);
deallog.depth_console(0);
- cerr = logfile;
+ std::cerr = logfile;
Test a("A");
const Test b("B");
SmartPointer<Test> r=&a;
int main ()
{
- ofstream logfile("tensor.output");
+ std::ofstream logfile("tensor.output");
logfile.precision(3);
deallog.attach(logfile);
deallog.depth_console(0);
// $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
#include <base/timer.h>
#include <base/logstream.h>
#include <fstream>
+#include <cmath>
// compute the ratio of two measurements and compare to
// the expected value.
void compare (double t1, double t2, double ratio)
{
double r = t2/t1;
- double d = fabs(r-ratio) / ratio;
+ double d = std::fabs(r-ratio) / ratio;
// relative error < 10%?
if (d <= .1)
int main ()
{
- ofstream logfile("timer.output");
+ std::ofstream logfile("timer.output");
deallog.attach(logfile);
deallog.depth_console(0);