#include "../tests.h"
-using namespace std;
-
template <int dim>
void
plot(const PolynomialsBDM<dim> &poly)
#include "../tests.h"
-using namespace std;
-
template <int dim>
void
plot(const PolynomialsBDM<dim> &poly)
#include "../tests.h"
-using namespace std;
-
template <int dim>
void
plot(const PolynomialsRaviartThomas<dim> &poly)
#include "../tests.h"
-using namespace std;
-
template <int dim, class PolynomialType>
void
check_point(const Point<dim> &x, const PolynomialType &p)
// for the hp-case
-using namespace std;
-
template <int dim>
void
test()
// collection has more than one element
-using namespace std;
-
template <int dim>
void
test()
// for the hp-case
-using namespace std;
-
template <int dim>
void
test()
// on different cells.
-using namespace std;
-
template <int dim>
void
test()
#include <iostream>
#include <string>
-using namespace std;
-
-ofstream logfile("output");
+std::ofstream logfile("output");
template <int dim>
void
compute_SD_integral_on_cell(
- vector<double> & dst,
+ std::vector<double> & dst,
typename DoFHandler<dim, dim + 1>::active_cell_iterator &cell,
const Point<dim + 1> & point);
template <>
LaplaceKernelIntegration<2>::LaplaceKernelIntegration()
{
- static FE_DGP<2, 3> fe(0);
- vector<Point<2>> qps(5);
+ static FE_DGP<2, 3> fe(0);
+ std::vector<Point<2>> qps(5);
qps[0] = Point<2>(0, 0);
qps[1] = Point<2>(0, 1);
qps[2] = Point<2>(1, 0);
qps[3] = Point<2>(1, 1);
qps[4] = Point<2>(.5, .5);
- vector<double> ws(5, 1.);
+ std::vector<double> ws(5, 1.);
static Quadrature<2> quadrature(qps, ws);
fe_values = new FEValues<2, 3>(
fe, quadrature, update_values | update_jacobians | update_normal_vectors);
template <>
void
LaplaceKernelIntegration<2>::compute_SD_integral_on_cell(
- vector<double> & dst,
+ std::vector<double> & dst,
DoFHandler<2, 3>::active_cell_iterator &cell,
const Point<3> & point)
{
Assert(dst.size() == 2, ExcDimensionMismatch(dst.size(), 2));
fe_values->reinit(cell);
- vector<DerivativeForm<1, 2, 3>> jacobians = fe_values->get_jacobians();
- vector<Tensor<1, 3>> normals = fe_values->get_normal_vectors();
+ std::vector<DerivativeForm<1, 2, 3>> jacobians = fe_values->get_jacobians();
+ std::vector<Tensor<1, 3>> normals = fe_values->get_normal_vectors();
Tensor<1, 3> n, n_c;
Tensor<1, 3> r_c = point - cell->center();
n_c = normals[4];
- double rn_c = r_c * n_c;
- vector<double> i_S(4);
- vector<double> i_D(4);
+ double rn_c = r_c * n_c;
+ std::vector<double> i_S(4);
+ std::vector<double> i_D(4);
for (unsigned int q_point = 0; q_point < 4; ++q_point)
{
const Tensor<1, 3> r = point - cell->vertex(q_point);
DoFHandler<2, 3>::active_cell_iterator cell = dof_handler.begin_active();
LaplaceKernelIntegration<2> laplace;
- vector<double> integrals(2);
+ std::vector<double> integrals(2);
laplace.compute_SD_integral_on_cell(integrals, cell, point);
return integrals[0];
}
Point<3> point(.5, .5, 0);
double true_result = -3.163145629 / numbers::PI;
deallog << "Error on " << point << " : " << integration(point) - true_result
- << endl;
+ << std::endl;
point = Point<3>(3, 3, 0);
true_result = -.2306783616;
deallog << "Error on " << point << " : " << integration(point) - true_result
- << endl;
+ << std::endl;
point = Point<3>(1.5, .5, 0);
true_result = -1.006860525;
deallog << "Error on " << point << " : " << integration(point) - true_result
- << endl;
+ << std::endl;
return 0;
}
#include "../tests.h"
-using namespace std;
-
template <int dim, int spacedim>
// Extract the boundary of 3/4 of a sphere
{
const int dim = 3;
- deallog << "Testing hyper_cube in dim: " << dim << "..." << endl;
+ deallog << "Testing hyper_cube in dim: " << dim << "..." << std::endl;
const SphericalManifold<dim> boundary_description;
Triangulation<dim> volume_mesh;
#include "../tests.h"
-using namespace std;
-
void
test()
#include "../tests.h"
-using namespace std;
-
void
test()
#include "../tests.h"
-using namespace std;
-
template <int dim>
void
#include "../tests.h"
-using namespace std;
-
template <int dim, int spacedim>
void
// Extract the whole boundary of a hyper-cube
const int dim = 2;
- deallog << "Testing hyper_cube in dim: " << dim << "..." << endl;
- map<Triangulation<dim - 1, dim>::cell_iterator,
- Triangulation<dim, dim>::face_iterator>
+ deallog << "Testing hyper_cube in dim: " << dim << "..." << std::endl;
+ std::map<Triangulation<dim - 1, dim>::cell_iterator,
+ Triangulation<dim, dim>::face_iterator>
surface_to_volume_mapping;
Triangulation<dim> volume_mesh;
// Extract the whole boundary of a hyper-cube
const int dim = 3;
- deallog << "Testing hyper_cube in dim: " << dim << "..." << endl;
- map<Triangulation<dim - 1, dim>::cell_iterator,
- Triangulation<dim, dim>::face_iterator>
+ deallog << "Testing hyper_cube in dim: " << dim << "..." << std::endl;
+ std::map<Triangulation<dim - 1, dim>::cell_iterator,
+ Triangulation<dim, dim>::face_iterator>
surface_to_volume_mapping;
Triangulation<dim> volume_mesh;
// Extract a piece of the boundary of a hyper-cube
const int dim = 3;
- deallog << "Testing hyper_cube in dim: " << dim << "..." << endl;
+ deallog << "Testing hyper_cube in dim: " << dim << "..." << std::endl;
- map<Triangulation<dim - 1, dim>::cell_iterator,
- Triangulation<dim, dim>::face_iterator>
+ std::map<Triangulation<dim - 1, dim>::cell_iterator,
+ Triangulation<dim, dim>::face_iterator>
surface_to_volume_mapping;
Triangulation<dim> volume_mesh;
save_mesh(volume_mesh);
- Triangulation<dim - 1, dim> boundary_mesh;
- const set<types::boundary_id> boundary_ids = {0};
+ Triangulation<dim - 1, dim> boundary_mesh;
+ const std::set<types::boundary_id> boundary_ids = {0};
surface_to_volume_mapping =
GridGenerator::extract_boundary_mesh(volume_mesh,
#include "../tests.h"
-using namespace std;
-
template <int s_dim, int spacedim>
bool
test_vertices_orientation(
const Triangulation<s_dim, spacedim> &boundary_mesh,
- map<typename Triangulation<s_dim, spacedim>::cell_iterator,
- typename Triangulation<s_dim + 1, spacedim>::face_iterator>
+ std::map<typename Triangulation<s_dim, spacedim>::cell_iterator,
+ typename Triangulation<s_dim + 1, spacedim>::face_iterator>
& surface_to_volume_mapping,
const int verbosity = 1)
{
if (verbosity > 1)
{
- deallog << "The last column should be 0" << endl;
+ deallog << "The last column should be 0" << std::endl;
deallog << "Vol faces"
<< "\t\t"
<< "Surf cell"
<< "\t\t"
- << "Distance" << endl
- << endl;
+ << "Distance" << std::endl
+ << std::endl;
}
for (; cell != endc; ++cell)
if (verbosity > 1)
{
deallog << face->center() << "\t\t";
- deallog << cell->center() << "\t\t\t" << diff.square() << endl;
+ deallog << cell->center() << "\t\t\t" << diff.square() << std::endl;
}
if (diff.square() > 0)
{
break;
}
if (verbosity > 1)
- deallog << endl;
+ deallog << std::endl;
}
return success;
}
// Extract the boundary of a hyper-sphere
const int dim = 3;
- deallog << "Testing hyper_ball in dim: " << dim << "..." << endl;
+ deallog << "Testing hyper_ball in dim: " << dim << "..." << std::endl;
- map<Triangulation<dim - 1, dim>::cell_iterator,
- Triangulation<dim, dim>::face_iterator>
+ std::map<Triangulation<dim - 1, dim>::cell_iterator,
+ Triangulation<dim, dim>::face_iterator>
surface_to_volume_mapping;
Triangulation<dim> volume_mesh;
GridGenerator::hyper_ball(volume_mesh);
#include "../tests.h"
-using namespace std;
-
template <int s_dim, int spacedim>
void
test_vertices_orientation(
const Triangulation<s_dim, spacedim> &boundary_mesh,
- map<typename Triangulation<s_dim, spacedim>::cell_iterator,
- typename Triangulation<s_dim + 1, spacedim>::face_iterator>
+ std::map<typename Triangulation<s_dim, spacedim>::cell_iterator,
+ typename Triangulation<s_dim + 1, spacedim>::face_iterator>
&surface_to_volume_mapping)
{
typename Triangulation<s_dim, spacedim>::active_cell_iterator
// Extract the boundary of a hyper-sphere
const int dim = 3;
- deallog << "Testing hyper_cube in dim: " << dim << "..." << endl;
+ deallog << "Testing hyper_cube in dim: " << dim << "..." << std::endl;
- map<Triangulation<dim - 1, dim>::cell_iterator,
- Triangulation<dim, dim>::face_iterator>
+ std::map<Triangulation<dim - 1, dim>::cell_iterator,
+ Triangulation<dim, dim>::face_iterator>
surface_to_volume_mapping;
const SphericalManifold<dim> boundary_description;
Triangulation<dim> volume_mesh;
#include "../tests.h"
-using namespace std;
-
template <int s_dim, int spacedim>
void
test_vertices_orientation(
const Triangulation<s_dim, spacedim> &boundary_mesh,
- map<typename Triangulation<s_dim, spacedim>::cell_iterator,
- typename Triangulation<s_dim + 1, spacedim>::face_iterator>
+ std::map<typename Triangulation<s_dim, spacedim>::cell_iterator,
+ typename Triangulation<s_dim + 1, spacedim>::face_iterator>
&surface_to_volume_mapping)
{
typename Triangulation<s_dim, spacedim>::active_cell_iterator
// Extract the boundary of a hyper-sphere
const int dim = 3;
- deallog << "Testing hyper_ball in dim: " << dim << "..." << endl;
+ deallog << "Testing hyper_ball in dim: " << dim << "..." << std::endl;
- map<Triangulation<dim - 1, dim>::cell_iterator,
- Triangulation<dim, dim>::face_iterator>
+ std::map<Triangulation<dim - 1, dim>::cell_iterator,
+ Triangulation<dim, dim>::face_iterator>
surface_to_volume_mapping;
const SphericalManifold<dim> boundary_description;
Triangulation<dim> volume_mesh;
#include "../tests.h"
-using namespace std;
-
template <int s_dim, int spacedim>
void
test_vertices_orientation(
const Triangulation<s_dim, spacedim> &boundary_mesh,
- map<typename Triangulation<s_dim, spacedim>::cell_iterator,
- typename Triangulation<s_dim + 1, spacedim>::face_iterator>
+ std::map<typename Triangulation<s_dim, spacedim>::cell_iterator,
+ typename Triangulation<s_dim + 1, spacedim>::face_iterator>
&surface_to_volume_mapping)
{
typename Triangulation<s_dim, spacedim>::active_cell_iterator
// Extract the boundary of a hyper-sphere
const int dim = 3;
- deallog << "Testing hyper_cube in dim: " << dim << "..." << endl;
+ deallog << "Testing hyper_cube in dim: " << dim << "..." << std::endl;
- map<Triangulation<dim - 1, dim>::cell_iterator,
- Triangulation<dim, dim>::face_iterator>
+ std::map<Triangulation<dim - 1, dim>::cell_iterator,
+ Triangulation<dim, dim>::face_iterator>
surface_to_volume_mapping;
const SphericalManifold<dim> boundary_description;
Triangulation<dim> volume_mesh;
boundary_mesh.set_manifold(1, surface_description);
boundary_mesh.set_manifold(0, surface_description);
- set<types::boundary_id> boundary_ids;
+ std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(1);
surface_to_volume_mapping =
#include "../tests.h"
-using namespace std;
-
void
test()
const unsigned int dim = 2;
Triangulation<dim - 1, dim> boundary_mesh;
- map<Triangulation<dim - 1, dim>::cell_iterator,
- Triangulation<dim, dim>::face_iterator>
+ std::map<Triangulation<dim - 1, dim>::cell_iterator,
+ Triangulation<dim, dim>::face_iterator>
surface_to_volume_mapping;
Triangulation<dim> volume_mesh;
GridGenerator::hyper_cube(volume_mesh);
#include "../tests.h"
-using namespace std;
-
void
test()
const unsigned int dim = spacedim - 1;
Triangulation<dim, spacedim> boundary_mesh;
- map<Triangulation<dim, spacedim>::cell_iterator,
- Triangulation<spacedim, spacedim>::face_iterator>
+ std::map<Triangulation<dim, spacedim>::cell_iterator,
+ Triangulation<spacedim, spacedim>::face_iterator>
surface_to_volume_mapping;
Triangulation<spacedim> volume_mesh;
GridGenerator::hyper_cube(volume_mesh);
#include <string>
-using namespace std;
-
// Returns the following integral: /int_0^1 x^N * ln(|x-point|/alpha) dx
double
log_integral(const unsigned int N, const double point, const double alpha);
deallog << std::setprecision(10);
- vector<Point<1>> origins;
+ std::vector<Point<1>> origins;
origins.push_back(Point<1>());
origins.push_back(Point<1>(1.));
origins.push_back(Point<1>(1. / 3.));
origins.push_back(Point<1>(1. / 5.));
origins.push_back(Point<1>(3. / 5.));
- vector<double> alphas;
+ std::vector<double> alphas;
alphas.push_back(1.);
alphas.push_back(1. / 3.);
alphas.push_back(3. / 2.);
exact_integral =
log_integral(power, origins[nos][0], alphas[nas]);
deallog << "=================================================="
- << endl;
+ << std::endl;
deallog << "int_0^1 x^" << power << " ln(|x-" << origins[nos]
<< "|/" << alphas[nas] << ") = " << exact_integral
- << endl;
+ << std::endl;
for (unsigned int nq = 2; nq < 13; ++nq)
{
QGaussLogR<1> quad(nq, origins[nos], alphas[nas]);
deallog
<< ", difference between factored and unfactored: "
<< std::abs(approx_integral - approx_integral_factored);
- deallog << endl;
+ deallog << std::endl;
}
}
deallog << "=================================================="
- << endl;
+ << std::endl;
}
}
}
#include "../base/simplex.h"
-using namespace std;
-
-ofstream logfile("output");
+std::ofstream logfile("output");
int
main()
deallog.attach(logfile);
deallog << std::fixed;
- deallog << endl
- << "Calculation of the integral of f(x,y)*1/R on [0,1]x[0,1]" << endl
+ deallog << std::endl
+ << "Calculation of the integral of f(x,y)*1/R on [0,1]x[0,1]"
+ << std::endl
<< "for f(x,y) = x^i y^j, with i,j ranging from 0 to 5, and R being"
- << endl
- << "the distance from (x,y) to four vertices of the square." << endl
- << endl;
+ << std::endl
+ << "the distance from (x,y) to four vertices of the square."
+ << std::endl
+ << std::endl;
double eps = 1e-10;
for (unsigned int m = 1; m < 7; ++m)
{
deallog << " =========Quadrature Order: " << m
- << " =============================== " << endl;
+ << " =============================== " << std::endl;
deallog
<< " ============================================================ "
- << endl;
+ << std::endl;
for (unsigned int index = 0; index < 4; ++index)
{
deallog << " ===============Vertex Index: " << index
- << " ============================= " << endl;
+ << " ============================= " << std::endl;
QGaussOneOverR<2> quad(m, index);
QGaussOneOverR<2> quad_de(m, index, true);
for (unsigned int i = 0; i < 6; ++i)
deallog << "f(x,y) = x^" << i << " y^" << j
<< ", Error = " << approx_integral - exact_integral;
if (std::abs(approx_integral - approx_integral_2) < eps)
- deallog << endl;
+ deallog << std::endl;
else
deallog
<< ", desing: " << approx_integral_2 - exact_integral
- << endl;
+ << std::endl;
}
}
}
#include "../base/simplex.h"
-using namespace std;
-
int
main()
{
initlog();
deallog << std::fixed;
- deallog << endl
- << "Calculation of the integral of f(x,y)*1/R on [0,1]x[0,1]" << endl
+ deallog << std::endl
+ << "Calculation of the integral of f(x,y)*1/R on [0,1]x[0,1]"
+ << std::endl
<< "for f(x,y) = x^i y^j, with i,j ranging from 0 to 5, and R being"
- << endl
- << "the distance from (x,y) to four vertices of the square." << endl
- << endl;
+ << std::endl
+ << "the distance from (x,y) to four vertices of the square."
+ << std::endl
+ << std::endl;
std::vector<Point<2>> vertices = FE_Q<2>(1).get_unit_support_points();
for (unsigned int m = 1; m < 7; ++m)
{
deallog << " =========Quadrature Order: " << m
- << " =============================== " << endl;
+ << " =============================== " << std::endl;
deallog
<< " ============================================================ "
- << endl;
+ << std::endl;
unsigned int index = 0;
{
deallog << " ===============Vertex: " << vertices[index]
- << " ============================= " << endl;
+ << " ============================= " << std::endl;
QTelles<2> quad(m, vertices[index]);
QGaussOneOverR<2> quad2(m, vertices[index]);
#include "../base/simplex.h"
-using namespace std;
-
// We test the integration of singular kernels with a singularity of kind 1/R
// We multiply this function with a polynomial up to degree 6.
initlog();
deallog << std::fixed;
- deallog << endl
- << "Calculation of the integral of f(x,y)*1/R on [0,1]x[0,1]" << endl
+ deallog << std::endl
+ << "Calculation of the integral of f(x,y)*1/R on [0,1]x[0,1]"
+ << std::endl
<< "for f(x,y) = x^i y^j, with i,j ranging from 0 to 5, and R being"
- << endl
- << "the distance from (x,y) to [0.5,0.5]." << endl
- << endl;
+ << std::endl
+ << "the distance from (x,y) to [0.5,0.5]." << std::endl
+ << std::endl;
Point<2> center(0.5, 0.5);
for (unsigned int m = 1; m < 6; ++m)
{
deallog << " =========Quadrature Order: " << m
- << " =============================== " << endl;
+ << " =============================== " << std::endl;
deallog
<< " ============================================================ "
- << endl;
+ << std::endl;
deallog << " ===============Vertex: " << center
- << " ============================= " << endl;
+ << " ============================= " << std::endl;
QTelles<2> quad(4 * m, center);
QGaussOneOverR<2> quad_2(m, center, true);
#include "../tests.h"
-using namespace std;
-
template <int dim>
class F : public Function<dim>
{
#include "../grid/mesh_3d.h"
-using namespace std;
-
template <int dim>
class F : public Function<dim>
{
#include "../tests.h"
-using namespace std;
-
template <int dim>
class F : public Function<dim>
{
#include "../tests.h"
-using namespace std;
+
void
log_vector(const std::vector<std::set<types::global_dof_index>> &count)
#include "../tests.h"
-using namespace std;
+
template <int dim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim>
void
#include "../tests.h"
-using namespace std;
+
void
log_vector(const std::vector<std::vector<types::global_dof_index>> &count)
#include "../tests.h"
-using namespace std;
template <int dim>
#include "../tests.h"
-using namespace std;
template <int dim>
#include "../tests.h"
-using namespace std;
template <class T>
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim>
void
check<2>();
check<3>();
- deallog << "OK" << endl;
+ deallog << "OK" << std::endl;
}
#include "../tests.h"
-using namespace std;
+
template <int dim>
void
mg_dof_handler.distribute_mg_dofs();
for (unsigned int level = 0; level < tria.n_levels(); ++level)
{
- const types::global_dof_index n_dofs = mg_dof_handler.n_dofs(level);
- vector<types::global_dof_index> new_numbers(n_dofs);
+ const types::global_dof_index n_dofs = mg_dof_handler.n_dofs(level);
+ std::vector<types::global_dof_index> new_numbers(n_dofs);
for (unsigned int i = 0; i < n_dofs; ++i)
new_numbers[i] = n_dofs - 1 - i;
check<2>();
check<3>();
- deallog << "OK" << endl;
+ deallog << "OK" << std::endl;
}
#include "../tests.h"
-using namespace std;
+
template <int dim>
void
check<3>(fe);
}
- deallog << "OK" << endl;
+ deallog << "OK" << std::endl;
}
#include "../tests.h"
-using namespace std;
template <int dim>
#include "../tests.h"
-using namespace std;
template <int dim>
#include "../tests.h"
-using namespace std;
template <int dim>
#include "../tests.h"
-using namespace std;
template <int dim>
#include "../tests.h"
-using namespace std;
-
int
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim>
void
#include "../tests.h"
-using namespace std;
template <int dim, typename Number>
#include "../tests.h"
-using namespace std;
template <int dim, typename Number>
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
template <int dim>
void
-check_block(const FiniteElement<dim> &fe,
- const vector<bool> & selected,
- const vector<double> & factors)
+check_block(const FiniteElement<dim> & fe,
+ const std::vector<bool> & selected,
+ const std::vector<double> &factors)
{
deallog << fe.get_name() << std::endl << "selected ";
for (unsigned int i = 0; i < selected.size(); ++i)
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
DoFRenumbering::component_wise(mgdof);
- const vector<types::global_dof_index> ndofs =
+ const std::vector<types::global_dof_index> ndofs =
DoFTools::count_dofs_per_fe_block(mgdof);
Assert(ndofs.size() == fe.n_blocks(), ExcInternalError());
deallog << std::endl;
// Check copy to mg and back
- // Fill a global vector by counting
+ // Fill a global std::vector by counting
// from one up
BlockVector<double> v;
v.reinit(ndofs);
deallog << std::endl;
// Now do the opposite: fill a
- // multigrid vector counting the
+ // multigrid std::vector counting the
// dofs and see where the numbers go
for (unsigned int i = 0; i < u[2].size(); ++i)
u[2](i) = i + 1;
FESystem<2> fe0(rt1, 1, q1, 1);
FESystem<2> fe1(rt0, 2, q0, 2);
- vector<bool> s1(2, true);
+ std::vector<bool> s1(2, true);
deallog << "All" << std::endl;
check_block(fe0, s1, factors);
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
DoFRenumbering::component_wise(mgdof);
- const vector<types::global_dof_index> ndofs =
+ const std::vector<types::global_dof_index> ndofs =
DoFTools::count_dofs_per_fe_block(mgdof);
for (unsigned int l = 0; l < tr.n_levels(); ++l)
deallog << "u0\t" << (int)(u[0] * u[0] + .4) << std::endl
<< "u1\t" << (int)(u[1] * u[1] + .4) << std::endl
<< "u2\t" << (int)(u[2] * u[2] + .4) << std::endl;
- // Now restrict the same vectors.
+ // Now restrict the same std::vectors.
u[1] = 0.;
u[0] = 0.;
transfer.restrict_and_add(2, u[1], u[2]);
<< "u0\t" << (int)(u[0] * u[0] + .5) << std::endl;
// Check copy to mg and back
- // Fill a global vector by counting
+ // Fill a global std::vector by counting
// from one up
BlockVector<double> v;
v.reinit(ndofs);
deallog << std::endl;
// Now do the opposite: fill a
- // multigrid vector counting the
+ // multigrid std::vector counting the
// dofs and see where the numbers go
for (unsigned int i = 0; i < u[2].size(); ++i)
u[2](i) = i + 1;
#include "../tests.h"
-using namespace std;
template <int dim, typename number, int spacedim>
}
// Store sizes
- const vector<types::global_dof_index> ndofs =
+ const std::vector<types::global_dof_index> ndofs =
DoFTools::count_dofs_per_fe_block(mgdof);
std::vector<std::vector<types::global_dof_index>> mg_ndofs(
mgdof.get_triangulation().n_levels(),
}
deallog << std::endl << "copy from mg ";
// Now do the opposite: fill a
- // multigrid vector counting the
+ // multigrid std::vector counting the
// dofs and see where the numbers go
u = 0.;
for (unsigned int i = 0; i < v[2].size(); ++i)
#include "../tests.h"
-using namespace std;
+
template <int dim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim>
void
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
DoFRenumbering::component_wise(mgdof, target_component);
- const vector<types::global_dof_index> ndofs =
+ const std::vector<types::global_dof_index> ndofs =
DoFTools::count_dofs_per_fe_component(mgdof, true, target_component);
Assert(ndofs.size() ==
*std::max_element(target_component.begin(), target_component.end()) +
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
template <int dim>
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
+
template <int dim, typename number, int spacedim>
void
#include "../tests.h"
-using namespace std;
template <int dim>
#include <vector>
#include "../tests.h"
-using namespace std;
+
const double a = 4, b = 5;
double ex_normthird = DerivativeApproximation::derivative_norm(ex_third);
// output of all values for comparison
- deallog << "cell " << cell << endl;
- deallog << "approx. gradient: " << grad << " , norm: " << normgrad << endl
+ deallog << "cell " << cell << std::endl;
+ deallog << "approx. gradient: " << grad << " , norm: " << normgrad
+ << std::endl
<< " exact gradient: " << ex_grad << " , norm: " << ex_normgrad
- << endl;
+ << std::endl;
deallog << "approx. second derivative (hessian): " << second
- << " , norm: " << normsecond << endl
+ << " , norm: " << normsecond << std::endl
<< " exact second derivative (hessian): " << ex_second
- << " , norm: " << ex_normsecond << endl;
+ << " , norm: " << ex_normsecond << std::endl;
deallog << "approx. third derivative: " << third
- << " , norm: " << normthird << endl
+ << " , norm: " << normthird << std::endl
<< " exact third derivative: " << ex_third
- << " , norm: " << ex_normthird << endl
- << endl;
+ << " , norm: " << ex_normthird << std::endl
+ << std::endl;
}
}
{
initlog();
- deallog << "------------ 2D ------------" << endl << endl;
+ deallog << "------------ 2D ------------" << std::endl << std::endl;
derivatives<2>();
- deallog << endl << "------------ 3D ------------" << endl << endl;
+ deallog << std::endl
+ << "------------ 3D ------------" << std::endl
+ << std::endl;
derivatives<3>();
}
#include <vector>
#include "../tests.h"
-using namespace std;
+
const double a = 4, b = 5;
double ex_normthird = DerivativeApproximation::derivative_norm(ex_third);
// output of all values for comparison
- deallog << "cell " << cell << endl;
- deallog << "approx. gradient: " << grad << " , norm: " << normgrad << endl
+ deallog << "cell " << cell << std::endl;
+ deallog << "approx. gradient: " << grad << " , norm: " << normgrad
+ << std::endl
<< " exact gradient: " << ex_grad << " , norm: " << ex_normgrad
- << endl;
+ << std::endl;
deallog << "approx. second derivative (hessian): " << second
- << " , norm: " << normsecond << endl
+ << " , norm: " << normsecond << std::endl
<< " exact second derivative (hessian): " << ex_second
- << " , norm: " << ex_normsecond << endl;
+ << " , norm: " << ex_normsecond << std::endl;
deallog << "approx. third derivative: " << third
- << " , norm: " << normthird << endl
+ << " , norm: " << normthird << std::endl
<< " exact third derivative: " << ex_third
- << " , norm: " << ex_normthird << endl
- << endl;
+ << " , norm: " << ex_normthird << std::endl
+ << std::endl;
}
}
{
initlog();
- deallog << "------------ 2D ------------" << endl << endl;
+ deallog << "------------ 2D ------------" << std::endl << std::endl;
derivatives<2>();
- deallog << endl << "------------ 3D ------------" << endl << endl;
+ deallog << std::endl
+ << "------------ 3D ------------" << std::endl
+ << std::endl;
derivatives<3>();
}
#include "../tests.h"
-using namespace std;
+
template <int spacedim>
class F1 : public Function<spacedim>
dof_handler_2,
u_2);
- Point<spacedim> support_point, unit_support_point;
- vector<types::global_dof_index> local_dof_indices(fe.n_dofs_per_cell());
- deallog << "dof values of dof_handler_1:" << endl;
+ Point<spacedim> support_point, unit_support_point;
+ std::vector<types::global_dof_index> local_dof_indices(fe.n_dofs_per_cell());
+ deallog << "dof values of dof_handler_1:" << std::endl;
for (const auto &cell : dof_handler_1.active_cell_iterators())
{
cell->get_dof_indices(local_dof_indices);
support_point =
mapping.transform_unit_to_real_cell(cell, unit_support_point);
deallog << ' ' << support_point << ":\n "
- << u_1[local_dof_indices[shapefun]] << endl
- << endl;
+ << u_1[local_dof_indices[shapefun]] << std::endl
+ << std::endl;
}
}
- deallog << endl << "dof values of dof_handler_2:" << endl;
+ deallog << std::endl << "dof values of dof_handler_2:" << std::endl;
for (const auto &cell : dof_handler_2.active_cell_iterators())
{
support_point =
mapping.transform_unit_to_real_cell(cell, unit_support_point);
deallog << ' ' << support_point << ":\n "
- << u_2[local_dof_indices[shapefun]] << endl
- << endl;
+ << u_2[local_dof_indices[shapefun]] << std::endl
+ << std::endl;
}
}
}
deallog
<< "### 2D-Case, first cell refined once, second cell unrefined###\n\n";
check<2>(1, 0);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 2D-Case, first cell unrefined, second cell refined once###\n\n";
check<2>(0, 1);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 2D-Case, first cell refined once, second cell refined once###\n\n";
check<2>(1, 1);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 3D-Case, first cell refined once, second cell unrefined###\n\n";
check<3>(1, 0);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 3D-Case, first cell unrefined, second cell refined once###\n\n";
check<3>(0, 1);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 3D-Case, first cell refined once, second cell refined once###\n\n";
check<3>(1, 1);
- deallog << endl;
+ deallog << std::endl;
}
#include "../tests.h"
-using namespace std;
+
template <int spacedim>
class F1 : public Function<spacedim>
dof_handler_2,
u_2);
- Point<spacedim> support_point, unit_support_point;
- vector<types::global_dof_index> local_dof_indices_1(
+ Point<spacedim> support_point, unit_support_point;
+ std::vector<types::global_dof_index> local_dof_indices_1(
fe_collection[0].n_dofs_per_cell());
- vector<types::global_dof_index> local_dof_indices_2(
+ std::vector<types::global_dof_index> local_dof_indices_2(
fe_collection[1].n_dofs_per_cell());
- deallog << "dof values of dof_handler_1:" << endl;
+ deallog << "dof values of dof_handler_1:" << std::endl;
for (const auto &cell : dof_handler_1.active_cell_iterators())
{
cell->get_dof_indices(local_dof_indices_1);
support_point =
mapping.transform_unit_to_real_cell(cell, unit_support_point);
deallog << ' ' << support_point << ":\n "
- << u_1[local_dof_indices_1[shapefun]] << endl
- << endl;
+ << u_1[local_dof_indices_1[shapefun]] << std::endl
+ << std::endl;
}
}
- deallog << endl << "dof values of dof_handler_2:" << endl;
+ deallog << std::endl << "dof values of dof_handler_2:" << std::endl;
for (const auto &cell : dof_handler_2.active_cell_iterators())
{
cell->get_dof_indices(local_dof_indices_2);
support_point =
mapping.transform_unit_to_real_cell(cell, unit_support_point);
deallog << ' ' << support_point << ":\n "
- << u_2[local_dof_indices_2[shapefun]] << endl
- << endl;
+ << u_2[local_dof_indices_2[shapefun]] << std::endl
+ << std::endl;
}
}
}
deallog
<< "### 2D-Case, first cell refined once, second cell unrefined###\n\n";
check<2>(1, 0);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 2D-Case, first cell unrefined, second cell refined once###\n\n";
check<2>(0, 1);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 2D-Case, first cell refined once, second cell refined once###\n\n";
check<2>(1, 1);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 3D-Case, first cell refined once, second cell unrefined###\n\n";
check<3>(1, 0);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 3D-Case, first cell unrefined, second cell refined once###\n\n";
check<3>(0, 1);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 3D-Case, first cell refined once, second cell refined once###\n\n";
check<3>(1, 1);
- deallog << endl;
+ deallog << std::endl;
}
#include "../tests.h"
-using namespace std;
+
template <unsigned int spacedim>
void
d = u_1;
d.sadd(-1.0, u_1_back);
- deallog << "distance=" << d.l2_norm() << endl;
+ deallog << "distance=" << d.l2_norm() << std::endl;
}
int
deallog
<< "### 2D-Case, first cell unrefined, second cell refined once###\n\n";
check<2>(0, 1);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 2D-Case, first cell refined once, second cell refined three times###\n\n";
check<2>(1, 3);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 3D-Case, first cell unrefined, second cell refined once###\n\n";
check<3>(0, 1);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 3D-Case, first cell refined once, second cell refined three times###\n\n";
check<3>(1, 3);
- deallog << endl;
+ deallog << std::endl;
}
#include "../tests.h"
-using namespace std;
+
template <unsigned int spacedim>
void
d = u_1;
d.sadd(-1.0, u_1_back);
- deallog << "distance=" << d.l2_norm() << endl;
+ deallog << "distance=" << d.l2_norm() << std::endl;
}
int
deallog
<< "### 2D-Case, first cell unrefined, second cell refined once###\n\n";
check<2>(0, 1);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 2D-Case, first cell refined once, second cell refined three times###\n\n";
check<2>(1, 3);
- deallog << endl;
+ deallog << std::endl;
// this should still be an identity operation although interpolation is from
// fine to coarse mesh because second mesh uses quadratic elements
deallog
<< "### 2D-Case, first cell refined twice, second cell refined once###\n\n";
check<2>(2, 1);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 3D-Case, first cell unrefined, second cell refined once###\n\n";
check<3>(0, 1);
- deallog << endl;
+ deallog << std::endl;
deallog
<< "### 3D-Case, first cell refined once, second cell refined three times###\n\n";
check<3>(1, 3);
- deallog << endl;
+ deallog << std::endl;
// this should still be an identity operation although interpolation is from
// fine to coarse mesh because second mesh uses quadratic elements
deallog
<< "### 3D-Case, first cell refined twice, second cell refined once###\n\n";
check<3>(2, 1);
- deallog << endl;
+ deallog << std::endl;
}
#include "../tests.h"
-using namespace std;
+
template <int dim, int spacedim>
void