double AutoSinExp<dim>::value (const Point<dim> &p,
const unsigned int) const
{
- return sin(2*p(0))*exp(3*p(1));
+ return std::sin(2*p(0))*std::exp(3*p(1));
}
const unsigned int) const
{
Tensor<1,dim> grad;
- grad[0]=2*cos(2*p(0))*exp(3*p(1));
- grad[1]=3*sin(2*p(0))*exp(3*p(1));
+ grad[0]=2*std::cos(2*p(0))*std::exp(3*p(1));
+ grad[1]=3*std::sin(2*p(0))*std::exp(3*p(1));
return grad;
}
}
-int main(int, char)
+int main()
{
std::ofstream logfile("auto_derivative_function.output");
logfile.precision(4);
// Test of gradient function
Tensor<1,dim> a_grad=auto_function.gradient(p);
a_grad-=u_grad;
- double value=sqrt(a_grad*a_grad);
+ double value=std::sqrt(a_grad*a_grad);
history.add_value("grad", value);
history.set_scientific("grad", true);
history.set_precision("grad", 2);
std::vector<Tensor<1,dim> > a_grads(1);
auto_function.gradient_list(ps, a_grads);
a_grads[0]-=u_grad;
- value=sqrt(a_grads[0]*a_grads[0]);
+ value=std::sqrt(a_grads[0]*a_grads[0]);
history.add_value("grads[0]", value);
history.set_scientific("grads[0]", true);
history.set_precision("grads[0]", 2);
std::vector<Tensor<1,dim> > a_vgrad(2);
auto_function.vector_gradient(p, a_vgrad);
a_vgrad[1]-=u_grad;
- value=sqrt(a_vgrad[1]*a_vgrad[1]);
+ value=std::sqrt(a_vgrad[1]*a_vgrad[1]);
history.add_value("vgrad[1]", value);
history.set_scientific("vgrad[1]", true);
history.set_precision("vgrad[1]", 2);
a_vgrads(1, std::vector<Tensor<1,dim> > (2));
auto_function.vector_gradient_list(ps, a_vgrads);
a_vgrads[0][1]-=u_grad;
- value=sqrt(a_vgrads[0][1]*a_vgrads[0][1]);
+ value=std::sqrt(a_vgrads[0][1]*a_vgrads[0][1]);
history.add_value("vgrads[1]", value);
history.set_scientific("vgrads[1]", true);
history.set_precision("vgrads[1]", 2);
switch (dim)
{
case 3:
- f *= pow(points[x](2), i);
+ f *= std::pow(static_cast<double>(points[x](2)), i*1.0);
case 2:
- f *= pow(points[x](1), i);
+ f *= std::pow(static_cast<double>(points[x](1)), i*1.0);
case 1:
- f *= pow(points[x](0), i);
+ f *= std::pow(static_cast<double>(points[x](0)), i*1.0);
}
quadrature_int+=f*weights[x];
}
// the exact integral is 1/(i+1)
- exact_int=1./pow(i+1,dim);
- err = fabs(quadrature_int-exact_int);
+ exact_int=1./std::pow(static_cast<double>(i+1),dim);
+ err = std::fabs(quadrature_int-exact_int);
}
while (err<1e-15);
// Uncomment here for testing
switch (dim)
{
case 3:
- f *= pow(points[x](2), i);
+ f *= std::pow(points[x](2), i*1.0);
case 2:
- f *= pow(points[x](1), i);
+ f *= std::pow(points[x](1), i*1.0);
case 1:
- f *= pow(points[x](0), i);
+ f *= std::pow(points[x](0), i*1.0);
}
quadrature_int+=f*weights[x];
}
break;
}
- err = fabs(quadrature_int-exact_int);
+ err = std::fabs(quadrature_int-exact_int);
}
while (err<5e-15);
// Uncomment here for testing
deallog.pop();
}
-int main(int,char)
+int main()
{
std::ofstream logfile("quadrature_test.output");
deallog.attach(logfile);
deallog.push("2d");
check_cells(q2);
- check_faces(q1,false);
- check_faces(q1,true);
+ check_faces<2>(q1,false);
+ check_faces<2>(q1,true);
deallog.pop();
deallog.push("3d");
check_cells(q3);
- check_faces(q2,false);
- check_faces(q2,true);
+ check_faces<3>(q2,false);
+ check_faces<3>(q2,true);
deallog.pop();
// delete objects again to avoid