for (unsigned int q=0; q<quadrature.size(); ++q)
{
- Assert ((fe_face_values1.quadrature_point(q)-
- fe_face_values2.quadrature_point(q)).norm_square()
- < 1e-20,
- ExcInternalError());
-
- Assert (std::fabs(fe_face_values1.JxW(q)-
- fe_face_values2.JxW(q)) < 1e-14,
- ExcInternalError());
- Assert ((fe_face_values1.normal_vector(q) +
- fe_face_values2.normal_vector(q)).square()
- < 1e-20,
- ExcInternalError());
+ AssertThrow ((fe_face_values1.quadrature_point(q)-
+ fe_face_values2.quadrature_point(q)).norm_square()
+ < 1e-20,
+ ExcInternalError());
+
+ AssertThrow (std::fabs(fe_face_values1.JxW(q)-
+ fe_face_values2.JxW(q)) < 1e-14,
+ ExcInternalError());
+ AssertThrow ((fe_face_values1.normal_vector(q) +
+ fe_face_values2.normal_vector(q)).square()
+ < 1e-20,
+ ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 1998 - 2014 by the deal.II authors
+// Copyright (C) 1998 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
p(1)*(1+p(0))*(1+p(2)),
p(2)*(1+p(0))*(1+p(1)));
default:
- Assert (false, ExcNotImplemented());
+ AssertThrow (false, ExcNotImplemented());
return Point<dim>();
};
}
// to be active, not only
// some of them
for (unsigned int c=0; c<cell->n_children(); ++c)
- Assert (cell->child(c)->active(), ExcInternalError());
+ AssertThrow (cell->child(c)->active(), ExcInternalError());
// then restrict and prolongate
cell->get_interpolated_dof_values (tmp, v);
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
t[1][0] = 4;
// make sure transposition doesn't change
// anything
- Assert (t == transpose(t), ExcInternalError());
+ AssertThrow (t == transpose(t), ExcInternalError());
// check norm of tensor
- Assert (std::fabs(t.norm() - std::sqrt(1.*1+2*2+2*4*4)) < 1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs(t.norm() - std::sqrt(1.*1+2*2+2*4*4)) < 1e-14,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
t[1][2] = 6;
t[2][1] = 6;
- Assert (t[0][1] == t[1][0], ExcInternalError());
+ AssertThrow (t[0][1] == t[1][0], ExcInternalError());
// make sure transposition doesn't change
// anything
- Assert (t == transpose(t), ExcInternalError());
+ AssertThrow (t == transpose(t), ExcInternalError());
// check norm of tensor
- Assert (std::fabs(t.norm() - std::sqrt(1.*1+2*2+3*3+2*4*4+2*5*5+2*6*6))
- < 1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs(t.norm() - std::sqrt(1.*1+2*2+3*3+2*4*4+2*5*5+2*6*6))
+ < 1e-14,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
t[0][1][0][1] = 3;
t[1][0][1][0] = 3;
- Assert (t[0][1][0][1] == t[1][0][1][0], ExcInternalError());
+ AssertThrow (t[0][1][0][1] == t[1][0][1][0], ExcInternalError());
// check norm of tensor
deallog << t.norm() << std::endl;
for (unsigned int l=0; l<2; ++l)
norm_sqr += t[i][j][k][l] * t[i][j][k][l];
- Assert (std::fabs (t.norm()*t.norm() - norm_sqr) < 1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs (t.norm()*t.norm() - norm_sqr) < 1e-14,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
t[0][1][0][1] = 3;
t[1][0][1][0] = 3;
- Assert (t[0][1][0][1] == t[1][0][1][0], ExcInternalError());
+ AssertThrow (t[0][1][0][1] == t[1][0][1][0], ExcInternalError());
// check norm of tensor
deallog << t.norm() << std::endl;
for (unsigned int k=0; k<2; ++k)
for (unsigned int l=0; l<2; ++l)
norm_sqr += t[i][j][k][l] * t[i][j][k][l];
- Assert (std::fabs (t.norm()*t.norm() - norm_sqr) < 1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs (t.norm()*t.norm() - norm_sqr) < 1e-14,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
b[i][j] = tmp_ij;
}
- Assert (a == b, ExcInternalError());
+ AssertThrow (a == b, ExcInternalError());
// try the same thing with scaled
// tensors etc
b[i][j] = tmp_ij;
}
- Assert (a == b/2, ExcInternalError());
+ AssertThrow (a == b/2, ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int i=0; i<dim; ++i)
for (unsigned int j=0; j<dim; ++j)
{
- Assert (as[i][j] == aa[i][j], ExcInternalError());
- Assert (bs[i][j] == ba[i][j], ExcInternalError());
+ AssertThrow (as[i][j] == aa[i][j], ExcInternalError());
+ AssertThrow (bs[i][j] == ba[i][j], ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2007 - 2014 by the deal.II authors
+// Copyright (C) 2007 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
p[d] = i+d;
- Assert (object.value(p) == p.norm(),
- ExcInternalError());
+ AssertThrow (object.value(p) == p.norm(),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
for (unsigned int d=0; d<dim; ++d)
p[d] = i+d;
- Assert (object.value(p) == q.distance (p),
- ExcInternalError());
+ AssertThrow (object.value(p) == q.distance (p),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2007 - 2014 by the deal.II authors
+// Copyright (C) 2007 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
p[d] = i+d;
for (unsigned int c=0; c<3; ++c)
- Assert (object.value(p,c) == (c==1 ? p.norm() : 0),
- ExcInternalError());
+ AssertThrow (object.value(p,c) == (c==1 ? p.norm() : 0),
+ ExcInternalError());
Vector<double> v(3);
object.vector_value (p, v);
for (unsigned int c=0; c<3; ++c)
- Assert (v(c) == (c==1 ? p.norm() : 0),
- ExcInternalError());
+ AssertThrow (v(c) == (c==1 ? p.norm() : 0),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
for (unsigned int d=0; d<dim; ++d)
p[d] = i+d;
- Assert (object.value(p) == q.distance (p),
- ExcInternalError());
+ AssertThrow (object.value(p) == q.distance (p),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2007 - 2014 by the deal.II authors
+// Copyright (C) 2007 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
f.laplacian_list (points, laplacians);
for (unsigned int i=0; i<10; ++i)
- Assert (points[i].norm() == laplacians[i],
- ExcInternalError());
+ AssertThrow (points[i].norm() == laplacians[i],
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2007 - 2014 by the deal.II authors
+// Copyright (C) 2007 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
VectorFunctionFromTensorFunction<dim>
object (x, 1, dim+2);
- Assert (object.n_components == dim+2, ExcInternalError());
+ AssertThrow (object.n_components == dim+2, ExcInternalError());
for (unsigned int i=0; i<10; ++i)
{
for (unsigned int c=0; c<dim+2; ++c)
if (c==0 || c==dim+1)
- Assert (object.value(p,c) == 0,
- ExcInternalError())
+ AssertThrow (object.value(p,c) == 0,
+ ExcInternalError())
else
- Assert (object.value(p,c) == p[c-1],
- ExcInternalError());
+ AssertThrow (object.value(p,c) == p[c-1],
+ ExcInternalError());
Vector<double> v(dim+2);
object.vector_value (p, v);
for (unsigned int c=0; c<dim+2; ++c)
if (c==0 || c==dim+1)
- Assert (v(c) == 0,
- ExcInternalError())
+ AssertThrow (v(c) == 0,
+ ExcInternalError())
else
- Assert (v(c) == p[c-1],
- ExcInternalError());
+ AssertThrow (v(c) == p[c-1],
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2014 by the deal.II authors
+// Copyright (C) 2013 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
Table<2,double> fill (const std_cxx11::array<std::vector<double>,2> &coordinates)
{
Table<2,double> data(coordinates[0].size(),
- coordinates[1].size());
+ coordinates[1].size());
for (unsigned int i=0; i<coordinates[0].size(); ++i)
for (unsigned int j=0; j<coordinates[1].size(); ++j)
data[i][j] = coordinates[0][i] * coordinates[1][j];
Table<3,double> fill (const std_cxx11::array<std::vector<double>,3> &coordinates)
{
Table<3,double> data(coordinates[0].size(),
- coordinates[1].size(),
- coordinates[2].size());
+ coordinates[1].size(),
+ coordinates[2].size());
for (unsigned int i=0; i<coordinates[0].size(); ++i)
for (unsigned int j=0; j<coordinates[1].size(); ++j)
for (unsigned int k=0; k<coordinates[2].size(); ++k)
- data[i][j][k] = coordinates[0][i] *
- coordinates[1][j] *
- coordinates[2][k];
+ data[i][j][k] = coordinates[0][i] *
+ coordinates[1][j] *
+ coordinates[2][k];
return data;
}
{
Point<dim> p;
for (unsigned int d=0; d<dim; ++d)
- p[d] = coordinates[d][0] +
- (1. * Testing::rand() / RAND_MAX) * (coordinates[d].back() -
- coordinates[d][0]);
+ p[d] = coordinates[d][0] +
+ (1. * Testing::rand() / RAND_MAX) * (coordinates[d].back() -
+ coordinates[d][0]);
double exact_value = 1;
for (unsigned int d=0; d<dim; ++d)
- exact_value *= p[d];
-
- Assert (std::fabs (exact_value - f.value(p)) < 1e-12,
- ExcInternalError());
+ exact_value *= p[d];
+
+ AssertThrow (std::fabs (exact_value - f.value(p)) < 1e-12,
+ ExcInternalError());
}
// now also verify that it computes values outside the box correctly, as
double value_at_bottom_left = 1;
for (unsigned int d=0; d<dim; ++d)
value_at_bottom_left *= coordinates[d][0];
-
- Assert (std::fabs(f.value(Point<dim>()) - value_at_bottom_left) < 1e-12,
- ExcInternalError());
+
+ AssertThrow (std::fabs(f.value(Point<dim>()) - value_at_bottom_left) < 1e-12,
+ ExcInternalError());
Point<dim> top_right;
double value_at_top_right = 1;
top_right[d] = 1000;
value_at_top_right *= coordinates[d].back();
}
- Assert (std::fabs(f.value(top_right) - value_at_top_right) < 1e-12,
- ExcInternalError());
-
+ AssertThrow (std::fabs(f.value(top_right) - value_at_top_right) < 1e-12,
+ ExcInternalError());
+
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2014 by the deal.II authors
+// Copyright (C) 2013 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
Table<2,double> fill (const std_cxx11::array<std::vector<double>,2> &coordinates)
{
Table<2,double> data(coordinates[0].size(),
- coordinates[1].size());
+ coordinates[1].size());
for (unsigned int i=0; i<coordinates[0].size(); ++i)
for (unsigned int j=0; j<coordinates[1].size(); ++j)
data[i][j] = coordinates[0][i] * coordinates[1][j];
Table<3,double> fill (const std_cxx11::array<std::vector<double>,3> &coordinates)
{
Table<3,double> data(coordinates[0].size(),
- coordinates[1].size(),
- coordinates[2].size());
+ coordinates[1].size(),
+ coordinates[2].size());
for (unsigned int i=0; i<coordinates[0].size(); ++i)
for (unsigned int j=0; j<coordinates[1].size(); ++j)
for (unsigned int k=0; k<coordinates[2].size(); ++k)
- data[i][j][k] = coordinates[0][i] *
- coordinates[1][j] *
- coordinates[2][k];
+ data[i][j][k] = coordinates[0][i] *
+ coordinates[1][j] *
+ coordinates[2][k];
return data;
}
{
const double x = intervals[d].first;
const double dx = (intervals[d].second-intervals[d].first)/n_subintervals[d];
-
+
for (unsigned int i=0; i<n_subintervals[d]+1; ++i)
- coordinates[d].push_back (x+dx*i);
+ coordinates[d].push_back (x+dx*i);
}
-
+
const Table<dim,double> data = fill(coordinates);
Functions::InterpolatedUniformGridData<dim> f(intervals, n_subintervals, data);
{
Point<dim> p;
for (unsigned int d=0; d<dim; ++d)
- p[d] = coordinates[d][0] +
- (1. * Testing::rand() / RAND_MAX) * (coordinates[d].back() -
- coordinates[d][0]);
+ p[d] = coordinates[d][0] +
+ (1. * Testing::rand() / RAND_MAX) * (coordinates[d].back() -
+ coordinates[d][0]);
double exact_value = 1;
for (unsigned int d=0; d<dim; ++d)
- exact_value *= p[d];
-
- Assert (std::fabs (exact_value - f.value(p)) < 1e-12,
- ExcInternalError());
+ exact_value *= p[d];
+
+ AssertThrow (std::fabs (exact_value - f.value(p)) < 1e-12,
+ ExcInternalError());
}
// now also verify that it computes values outside the box correctly, as
double value_at_bottom_left = 1;
for (unsigned int d=0; d<dim; ++d)
value_at_bottom_left *= coordinates[d][0];
-
- Assert (std::fabs(f.value(Point<dim>()) - value_at_bottom_left) < 1e-12,
- ExcInternalError());
+
+ AssertThrow (std::fabs(f.value(Point<dim>()) - value_at_bottom_left) < 1e-12,
+ ExcInternalError());
Point<dim> top_right;
double value_at_top_right = 1;
top_right[d] = 1000;
value_at_top_right *= coordinates[d].back();
}
- Assert (std::fabs(f.value(top_right) - value_at_top_right) < 1e-12,
- ExcInternalError());
-
+ AssertThrow (std::fabs(f.value(top_right) - value_at_top_right) < 1e-12,
+ ExcInternalError());
+
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 1998 - 2014 by the deal.II authors
+// Copyright (C) 1998 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
double p = 0;
for (unsigned int i=0; i<q.size(); ++i)
p += (q.point(i)[0] - 0.5);
- Assert (std::fabs(p) < 1e-12, ExcInternalError());
+ AssertThrow (std::fabs(p) < 1e-12, ExcInternalError());
// the sum of weights must be one
double w = 0;
for (unsigned int i=0; i<q.size(); ++i)
w += q.weight(i);
- Assert (std::fabs(w-1) < 1e-12, ExcInternalError());
+ AssertThrow (std::fabs(w-1) < 1e-12, ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2015 by the deal.II authors
+// Copyright (C) 2003 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
deallog << " " << c << " [" << q << "] [" << pp << ']'
<< std::endl;
- Assert ((p-pp).norm_square() < 1e-15*1e-15, ExcInternalError());
- Assert (GeometryInfo<dim>::is_inside_unit_cell (p) ==
- GeometryInfo<dim>::is_inside_unit_cell (pp),
- ExcInternalError());
+ AssertThrow ((p-pp).norm_square() < 1e-15*1e-15, ExcInternalError());
+ AssertThrow (GeometryInfo<dim>::is_inside_unit_cell (p) ==
+ GeometryInfo<dim>::is_inside_unit_cell (pp),
+ ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
phi_i = GeometryInfo<dim>::d_linear_shape_function(GeometryInfo<dim>::unit_cell_vertex(v),i);
deallog << phi_i << std::endl;
- Assert (phi_i == (i==v ? 1 : 0),
- ExcInternalError());
+ AssertThrow (phi_i == (i==v ? 1 : 0),
+ ExcInternalError());
}
// check that
double s = 0;
for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
s += GeometryInfo<dim>::d_linear_shape_function(GeometryInfo<dim>::unit_cell_vertex(v),i);
- Assert (s == 1, ExcInternalError());
+ AssertThrow (s == 1, ExcInternalError());
deallog << "Sum of shape functions: " << s << std::endl;
}
double s = 0;
for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
s += GeometryInfo<dim>::d_linear_shape_function(center,i);
- Assert (s == 1, ExcInternalError());
+ AssertThrow (s == 1, ExcInternalError());
deallog << "Sum of shape functions: " << s << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
Tensor<1,dim> s;
for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
s += GeometryInfo<dim>::d_linear_shape_function_gradient(GeometryInfo<dim>::unit_cell_vertex(v),i);
- Assert (s.norm() == 0, ExcInternalError());
+ AssertThrow (s.norm() == 0, ExcInternalError());
deallog << "Sum of shape functions: " << s << std::endl;
}
Tensor<1,dim> s;
for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
s += GeometryInfo<dim>::d_linear_shape_function_gradient(center,i);
- Assert (s.norm() == 0, ExcInternalError());
+ AssertThrow (s.norm() == 0, ExcInternalError());
deallog << "Sum of shape functions: " << s << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
deallog << "Reference cell: " << determinants[v]
<< std::endl;
- Assert (static_cast<double>(determinants[v]) == 1, ExcInternalError());
+ AssertThrow (static_cast<double>(determinants[v]) == 1, ExcInternalError());
}
}
{
deallog << "Squashed cell: " << determinants[v]
<< std::endl;
- Assert (static_cast<double>(determinants[v]) == 0.1, ExcInternalError());
+ AssertThrow (static_cast<double>(determinants[v]) == 0.1, ExcInternalError());
}
}
{
deallog << "Squashed+rotated cell: " << determinants[v]
<< std::endl;
- Assert (static_cast<double>(determinants[v]) == 0.1, ExcInternalError());
+ AssertThrow (static_cast<double>(determinants[v]) == 0.1, ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
deallog << "Reference cell: face " << f << ": " << alternating_forms[v]
<< std::endl;
- Assert (alternating_forms[v].norm() == 1, ExcInternalError());
+ AssertThrow (alternating_forms[v].norm() == 1, ExcInternalError());
}
}
}
// other faces are
// squashed
if (f < 2)
- Assert (alternating_forms[v].norm() == 1, ExcInternalError())
+ AssertThrow (alternating_forms[v].norm() == 1, ExcInternalError())
else
- Assert (alternating_forms[v].norm() == 0.1, ExcInternalError());
+ AssertThrow (alternating_forms[v].norm() == 0.1, ExcInternalError());
}
}
}
// vector would have
// rotated along)
if (f<2)
- Assert (alternating_forms[v].norm() == 1, ExcInternalError())
+ AssertThrow (alternating_forms[v].norm() == 1, ExcInternalError())
else
- Assert (alternating_forms[v].norm() == 0.1, ExcInternalError());
+ AssertThrow (alternating_forms[v].norm() == 0.1, ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
template <int dim>
std::vector<types::global_dof_index> get_conflict_indices_cfem(
- typename DoFHandler<dim>::active_cell_iterator const &it)
+ typename DoFHandler<dim>::active_cell_iterator const &it)
{
std::vector<types::global_dof_index> local_dof_indices(it->get_fe().dofs_per_cell);
it->get_dof_indices(local_dof_indices);
typename DoFHandler<dim>::active_cell_iterator
cell = dof_handler.begin_active();
for (; cell<dof_handler.end(); ++cell)
- {
- if ((cell->center()[0]==0.625)
- &&
- ((dim < 2) || (cell->center()[1]==0.625))
- &&
- ((dim < 3) || (cell->center()[2]==0.625)))
- cell->set_refine_flag();
- }
+ {
+ if ((cell->center()[0]==0.625)
+ &&
+ ((dim < 2) || (cell->center()[1]==0.625))
+ &&
+ ((dim < 3) || (cell->center()[2]==0.625)))
+ cell->set_refine_flag();
+ }
triangulation.execute_coarsening_and_refinement();
dof_handler.distribute_dofs(fe);
// Create the coloring
std::vector<std::vector<typename DoFHandler<dim>::active_cell_iterator> > coloring(
- GraphColoring::make_graph_coloring(dof_handler.begin_active(),dof_handler.end(),
- std_cxx11::function<std::vector<types::global_dof_index> (typename
- DoFHandler<dim>::active_cell_iterator const &)> (&get_conflict_indices_cfem<dim>)));
+ GraphColoring::make_graph_coloring(dof_handler.begin_active(),dof_handler.end(),
+ std_cxx11::function<std::vector<types::global_dof_index> (typename
+ DoFHandler<dim>::active_cell_iterator const &)> (&get_conflict_indices_cfem<dim>)));
// verify that within each color, there is no conflict
for (unsigned int color=0; color<coloring.size(); ++color)
for (unsigned int i=0; i<coloring[color].size(); ++i)
{
- std::vector<types::global_dof_index>
- conflicts_i = get_conflict_indices_cfem<dim> (coloring[color][i]);
- std::sort (conflicts_i.begin(), conflicts_i.end());
-
- for (unsigned int j=i+1; j<coloring[color].size(); ++j)
- {
- std::vector<types::global_dof_index>
- conflicts_j = get_conflict_indices_cfem<dim> (coloring[color][j]);
- std::sort (conflicts_j.begin(), conflicts_j.end());
-
- // compute intersection of index sets
- std::vector<types::global_dof_index>
- intersection (std::max (conflicts_i.size(), conflicts_j.size()));
- std::vector<types::global_dof_index>::iterator
- p = std::set_intersection (conflicts_i.begin(), conflicts_i.end(),
- conflicts_j.begin(), conflicts_j.end(),
- intersection.begin());
- // verify that there is no intersection
- Assert (p == intersection.begin(),
- ExcInternalError());
- }
+ std::vector<types::global_dof_index>
+ conflicts_i = get_conflict_indices_cfem<dim> (coloring[color][i]);
+ std::sort (conflicts_i.begin(), conflicts_i.end());
+
+ for (unsigned int j=i+1; j<coloring[color].size(); ++j)
+ {
+ std::vector<types::global_dof_index>
+ conflicts_j = get_conflict_indices_cfem<dim> (coloring[color][j]);
+ std::sort (conflicts_j.begin(), conflicts_j.end());
+
+ // compute intersection of index sets
+ std::vector<types::global_dof_index>
+ intersection (std::max (conflicts_i.size(), conflicts_j.size()));
+ std::vector<types::global_dof_index>::iterator
+ p = std::set_intersection (conflicts_i.begin(), conflicts_i.end(),
+ conflicts_j.begin(), conflicts_j.end(),
+ intersection.begin());
+ // verify that there is no intersection
+ AssertThrow (p == intersection.begin(),
+ ExcInternalError());
+ }
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
template <int dim>
std::vector<types::global_dof_index> get_conflict_indices(
- const typename DoFHandler<dim>::active_cell_iterator &it)
+ const typename DoFHandler<dim>::active_cell_iterator &it)
{
std::vector<types::global_dof_index> local_dof_indices(it->get_fe().dofs_per_cell);
it->get_dof_indices(local_dof_indices);
{
Triangulation<dim> triangulation;
GridGenerator::hyper_shell (triangulation,
- Point<dim>(),
- 1, 2,
- (dim==3) ? 96 : 12,
- true);
+ Point<dim>(),
+ 1, 2,
+ (dim==3) ? 96 : 12,
+ true);
triangulation.refine_global (3);
for (unsigned int i=0; i<3; ++i)
- {
- Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
- for (unsigned int i=0; i< estimated_error_per_cell.size(); ++i)
- estimated_error_per_cell(i) = i;
- GridRefinement::
+ {
+ Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
+ for (unsigned int i=0; i< estimated_error_per_cell.size(); ++i)
+ estimated_error_per_cell(i) = i;
+ GridRefinement::
refine_and_coarsen_fixed_fraction (triangulation,
- estimated_error_per_cell,
- 0.3, 0.1);
- triangulation.execute_coarsening_and_refinement();
- }
-
+ estimated_error_per_cell,
+ 0.3, 0.1);
+ triangulation.execute_coarsening_and_refinement();
+ }
+
FE_Q<dim> fe(1);
DoFHandler<dim> stokes_dof_handler (triangulation);
stokes_dof_handler.distribute_dofs (fe);
for (typename DoFHandler<dim>::active_cell_iterator cell=stokes_dof_handler.begin_active();
- cell != stokes_dof_handler.end(); ++cell)
+ cell != stokes_dof_handler.end(); ++cell)
cell->clear_user_flag ();
- std::vector<std::vector<typename DoFHandler<dim>::active_cell_iterator> > coloring
+ std::vector<std::vector<typename DoFHandler<dim>::active_cell_iterator> > coloring
= GraphColoring::make_graph_coloring(stokes_dof_handler.begin_active(),
- stokes_dof_handler.end(),
- std_cxx11::function<std::vector<types::global_dof_index> (
- const typename DoFHandler<dim>::active_cell_iterator &)>(&get_conflict_indices<dim>));
+ stokes_dof_handler.end(),
+ std_cxx11::function<std::vector<types::global_dof_index> (
+ const typename DoFHandler<dim>::active_cell_iterator &)>(&get_conflict_indices<dim>));
for (unsigned int c=0; c<coloring.size(); ++c)
for (unsigned int i=0; i<coloring[c].size(); ++i)
coloring[c][i]->set_user_flag();
for (typename DoFHandler<dim>::active_cell_iterator cell=stokes_dof_handler.begin_active();
- cell != stokes_dof_handler.end(); ++cell)
- Assert (cell->user_flag_set () == true, ExcInternalError());
+ cell != stokes_dof_handler.end(); ++cell)
+ AssertThrow (cell->user_flag_set () == true, ExcInternalError());
deallog<<"OK"<<std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
index_set.add_index (4);
deallog << (index_set.is_contiguous() ? "true" : "false")
<< std::endl;
- Assert (index_set.is_contiguous() == true, ExcInternalError());
+ AssertThrow (index_set.is_contiguous() == true, ExcInternalError());
for (unsigned int i=0; i<index_set.size(); ++i)
deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
index_set.add_index (6);
deallog << (index_set.is_contiguous() ? "true" : "false")
<< std::endl;
- Assert (index_set.is_contiguous() == false, ExcInternalError());
+ AssertThrow (index_set.is_contiguous() == false, ExcInternalError());
for (unsigned int i=0; i<index_set.size(); ++i)
deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
deallog << (index_set.is_contiguous() ? "true" : "false")
<< std::endl;
- Assert (index_set.is_contiguous() == false, ExcInternalError());
+ AssertThrow (index_set.is_contiguous() == false, ExcInternalError());
for (unsigned int i=0; i<index_set.size(); ++i)
deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
deallog << index_set.nth_index_in_set(i)
<< std::endl;
- Assert (index_set.index_within_set(index_set.nth_index_in_set(i)) == i,
- ExcInternalError());
+ AssertThrow (index_set.index_within_set(index_set.nth_index_in_set(i)) == i,
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
deallog << i << ' ' << (is3.is_element(i) ? "true" : "false")
<< std::endl;
- Assert ((is1.is_element(i) && is2.is_element(i))
- ==
- is3.is_element(i),
- ExcInternalError());
+ AssertThrow ((is1.is_element(i) && is2.is_element(i))
+ ==
+ is3.is_element(i),
+ ExcInternalError());
}
// some sanity tests
- Assert ((is1 & is2) == (is2 & is1), ExcInternalError());
- Assert ((is1 & is3) == (is2 & is3), ExcInternalError());
- Assert ((is1 & is3) == is3, ExcInternalError());
- Assert ((is3 & is1) == is3, ExcInternalError());
- Assert ((is3 & is3) == is3, ExcInternalError());
+ AssertThrow ((is1 & is2) == (is2 & is1), ExcInternalError());
+ AssertThrow ((is1 & is3) == (is2 & is3), ExcInternalError());
+ AssertThrow ((is1 & is3) == is3, ExcInternalError());
+ AssertThrow ((is3 & is1) == is3, ExcInternalError());
+ AssertThrow ((is3 & is3) == is3, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
deallog << i << ' ' << (is3.is_element(i) ? "true" : "false")
<< std::endl;
- Assert ((is1.is_element(i) && is2.is_element(i))
- ==
- is3.is_element(i),
- ExcInternalError());
+ AssertThrow ((is1.is_element(i) && is2.is_element(i))
+ ==
+ is3.is_element(i),
+ ExcInternalError());
}
// some sanity tests
- Assert ((is1 & is2) == (is2 & is1), ExcInternalError());
- Assert ((is1 & is3) == (is2 & is3), ExcInternalError());
- Assert ((is1 & is3) == is3, ExcInternalError());
- Assert ((is3 & is1) == is3, ExcInternalError());
- Assert ((is3 & is3) == is3, ExcInternalError());
+ AssertThrow ((is1 & is2) == (is2 & is1), ExcInternalError());
+ AssertThrow ((is1 & is3) == (is2 & is3), ExcInternalError());
+ AssertThrow ((is1 & is3) == is3, ExcInternalError());
+ AssertThrow ((is3 & is1) == is3, ExcInternalError());
+ AssertThrow ((is3 & is3) == is3, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int i=0; i<is3.size(); ++i)
{
- Assert ((is1.is_element(i) && !is2.is_element(i))
- ==
- is3.is_element(i),
- ExcInternalError());
+ AssertThrow ((is1.is_element(i) && !is2.is_element(i))
+ ==
+ is3.is_element(i),
+ ExcInternalError());
}
IndexSet empty(100);
is3 = is1;
is3.subtract_set(empty);
- Assert (is3 == is1, ExcInternalError());
+ AssertThrow (is3 == is1, ExcInternalError());
is3.subtract_set(is1);
- Assert (is3 == empty, ExcInternalError());
+ AssertThrow (is3 == empty, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int i=0; i<is3.size(); ++i)
{
- Assert ((is1.is_element(i) && !is2.is_element(i))
- ==
- is3.is_element(i),
- ExcInternalError());
+ AssertThrow ((is1.is_element(i) && !is2.is_element(i))
+ ==
+ is3.is_element(i),
+ ExcInternalError());
}
deallog << is3.index_within_set(51) << std::endl;
- Assert(is3.index_within_set(51)==1, ExcInternalError());
+ AssertThrow(is3.index_within_set(51)==1, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
y -= x;
y -= x;
- Assert (y.l2_norm() == 0, ExcInternalError());
+ AssertThrow (y.l2_norm() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
(boost::lambda::_1 + boost::lambda::_2 - boost::lambda::_3),
10);
- Assert (a.l2_norm() == 0, ExcInternalError());
+ AssertThrow (a.l2_norm() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// started out with
Patterns::Integer *pattern2 = Patterns::Integer::create (desc);
- Assert (pattern2 != 0, ExcInternalError());
- Assert (desc == pattern2->description(), ExcInternalError());
+ AssertThrow (pattern2 != 0, ExcInternalError());
+ AssertThrow (desc == pattern2->description(), ExcInternalError());
deallog << desc << std::endl;
template <typename T, typename U, typename CompareType>
void check()
{
- Assert (typeid(typename ProductType<T,U>::type) == typeid(CompareType),
- ExcInternalError());
- Assert (typeid(typename ProductType<T,U>::type) == typeid(T() * U()),
- ExcInternalError());
+ AssertThrow (typeid(typename ProductType<T,U>::type) == typeid(CompareType),
+ ExcInternalError());
+ AssertThrow (typeid(typename ProductType<T,U>::type) == typeid(T() * U()),
+ ExcInternalError());
}
template <typename T, typename U, typename CompareType>
void check()
{
- Assert (typeid(typename ProductType<T,U>::type) == typeid(CompareType),
- ExcInternalError());
- Assert (typeid(typename ProductType<T,U>::type) == typeid(T() * U()),
- ExcInternalError());
+ AssertThrow (typeid(typename ProductType<T,U>::type) == typeid(CompareType),
+ ExcInternalError());
+ AssertThrow (typeid(typename ProductType<T,U>::type) == typeid(T() * U()),
+ ExcInternalError());
}
template <typename T, typename U, typename CompareType>
void check()
{
- Assert (typeid(T() * U()) == typeid(CompareType),
- ExcInternalError());
- Assert (typeid(T() * U()) == typeid(CompareType),
- ExcInternalError());
+ AssertThrow (typeid(T() * U()) == typeid(CompareType),
+ ExcInternalError());
+ AssertThrow (typeid(T() * U()) == typeid(CompareType),
+ ExcInternalError());
}
check<Tensor<1,1,float>,std::complex<float>,Tensor<1,1,std::complex<float> > >();
check<std::complex<float>,Tensor<1,1,float>,Tensor<1,1,std::complex<float> > >();
-
+
deallog << "OK" << std::endl;
}
template <typename T, typename U, typename CompareType>
void check()
{
- Assert (typeid(T() * U()) == typeid(CompareType),
- ExcInternalError());
- Assert (typeid(T() * U()) == typeid(CompareType),
- ExcInternalError());
+ AssertThrow (typeid(T() * U()) == typeid(CompareType),
+ ExcInternalError());
+ AssertThrow (typeid(T() * U()) == typeid(CompareType),
+ ExcInternalError());
}
check<Tensor<2,1,float>,std::complex<float>,Tensor<2,1,std::complex<float> > >();
check<std::complex<float>,Tensor<2,1,float>,Tensor<2,1,std::complex<float> > >();
-
+
deallog << "OK" << std::endl;
}
template <typename T, typename U, typename CompareType>
void check()
{
- Assert (typeid(T() * U()) == typeid(CompareType),
- ExcInternalError());
- Assert (typeid(T() * U()) == typeid(CompareType),
- ExcInternalError());
+ AssertThrow (typeid(T() * U()) == typeid(CompareType),
+ ExcInternalError());
+ AssertThrow (typeid(T() * U()) == typeid(CompareType),
+ ExcInternalError());
}
check<SymmetricTensor<2,1,float>,std::complex<float>,SymmetricTensor<2,1,std::complex<float> > >();
check<std::complex<float>,SymmetricTensor<2,1,float>,SymmetricTensor<2,1,std::complex<float> > >();
-
+
deallog << "OK" << std::endl;
}
t[0] = 1.23456;
t[1] = 2.46802;
t[2] = 3.69258;
- Assert (7*t == 7.0 * t, ExcInternalError());
- Assert (t*7 == t * 7.0, ExcInternalError());
- Assert (t*7 == 7*t , ExcInternalError());
- Assert ((t*7 - (t+t+t+t+t+t+t)).norm() < 1e-12, ExcInternalError());
+ AssertThrow (7*t == 7.0 * t, ExcInternalError());
+ AssertThrow (t*7 == t * 7.0, ExcInternalError());
+ AssertThrow (t*7 == 7*t , ExcInternalError());
+ AssertThrow ((t*7 - (t+t+t+t+t+t+t)).norm() < 1e-12, ExcInternalError());
}
// now also try it for a rank-2 tensor (higher rank tensors are
t[0][1] = 7.87965;
t[1][0] = 2.64686;
t[1][1] = 3.35792;
- Assert (7*t == 7.0 * t, ExcInternalError());
- Assert (t*7 == t * 7.0, ExcInternalError());
- Assert (t*7 == 7*t , ExcInternalError());
- Assert ((t*7 - (t+t+t+t+t+t+t)).norm() < 1e-12, ExcInternalError());
+ AssertThrow (7*t == 7.0 * t, ExcInternalError());
+ AssertThrow (t*7 == t * 7.0, ExcInternalError());
+ AssertThrow (t*7 == 7*t , ExcInternalError());
+ AssertThrow ((t*7 - (t+t+t+t+t+t+t)).norm() < 1e-12, ExcInternalError());
}
-
+
deallog << "OK" << std::endl;
}
t[0][0] = 1.23456;
t[0][1] = 7.87965;
t[1][1] = 3.35792;
- Assert (7*t == 7.0 * t, ExcInternalError());
- Assert (t*7 == t * 7.0, ExcInternalError());
- Assert (t*7 == 7*t , ExcInternalError());
- Assert ((t*7 - (t+t+t+t+t+t+t)).norm() < 1e-12, ExcInternalError());
+ AssertThrow (7*t == 7.0 * t, ExcInternalError());
+ AssertThrow (t*7 == t * 7.0, ExcInternalError());
+ AssertThrow (t*7 == 7*t , ExcInternalError());
+ AssertThrow ((t*7 - (t+t+t+t+t+t+t)).norm() < 1e-12, ExcInternalError());
}
-
+
deallog << "OK" << std::endl;
}
template <typename T, typename U, typename CompareType>
void check()
{
- Assert (typeid(typename ProductType<T,U>::type) == typeid(CompareType),
- ExcInternalError());
- Assert (typeid(typename ProductType<T,U>::type) == typeid(T() * U()),
- ExcInternalError());
+ AssertThrow (typeid(typename ProductType<T,U>::type) == typeid(CompareType),
+ ExcInternalError());
+ AssertThrow (typeid(typename ProductType<T,U>::type) == typeid(T() * U()),
+ ExcInternalError());
}
check<double,double,double>();
deallog << typename ProductType<double,double>::type(2.345)*typename ProductType<double,double>::type(3.456)
- << ' '
- << typename ProductType<double,double>::type(2.345*3.456)
- << std::endl;
-
+ << ' '
+ << typename ProductType<double,double>::type(2.345*3.456)
+ << std::endl;
+
check<std::complex<double>,std::complex<double>,std::complex<double> >();
deallog << (typename ProductType<std::complex<double>,std::complex<double> >::type(2.345, 1.23) *
- typename ProductType<std::complex<double>,std::complex<double> >::type(3.456, 2.45))
- << ' '
- << (typename ProductType<std::complex<double>,std::complex<double> >::type
- (std::complex<double>(2.345, 1.23) *
- std::complex<double>(3.456, 2.45)))
- << std::endl;
-
+ typename ProductType<std::complex<double>,std::complex<double> >::type(3.456, 2.45))
+ << ' '
+ << (typename ProductType<std::complex<double>,std::complex<double> >::type
+ (std::complex<double>(2.345, 1.23) *
+ std::complex<double>(3.456, 2.45)))
+ << std::endl;
+
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
template <typename U, typename V>
void compare (const U &u, const V &v)
{
- Assert (static_cast<double>(u)==static_cast<double>(v), ExcInternalError());
+ AssertThrow (static_cast<double>(u)==static_cast<double>(v), ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
t[1][1] = 2;
t[0][1] = 3;
- Assert (t[0][1] == t[1][0], ExcInternalError());
+ AssertThrow (t[0][1] == t[1][0], ExcInternalError());
// check that if a single element is
// accessed, its transpose element gets the
// same value
t[1][0] = 4;
- Assert (t[0][1] == 4, ExcInternalError());
+ AssertThrow (t[0][1] == 4, ExcInternalError());
// make sure transposition doesn't change
// anything
- Assert (t == transpose(t), ExcInternalError());
+ AssertThrow (t == transpose(t), ExcInternalError());
// check norm of tensor
- Assert (std::fabs(t.norm() - std::sqrt(1.*1+2*2+2*4*4)) < 1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs(t.norm() - std::sqrt(1.*1+2*2+2*4*4)) < 1e-14,
+ ExcInternalError());
// make sure norm is induced by scalar
// product
- Assert (std::fabs (t.norm()*t.norm() - t*t) < 1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs (t.norm()*t.norm() - t*t) < 1e-14,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
t[0][2] = 5;
t[1][2] = 6;
- Assert (t[0][1] == t[1][0], ExcInternalError());
+ AssertThrow (t[0][1] == t[1][0], ExcInternalError());
// check that if a single element is
// accessed, its transpose element gets the
// same value
t[1][0] = 14;
- Assert (t[0][1] == 14, ExcInternalError());
+ AssertThrow (t[0][1] == 14, ExcInternalError());
// make sure transposition doesn't change
// anything
- Assert (t == transpose(t), ExcInternalError());
+ AssertThrow (t == transpose(t), ExcInternalError());
// check norm of tensor
- Assert (std::fabs(t.norm() - std::sqrt(1.*1+2*2+3*3+2*14*14+2*5*5+2*6*6))
- < 1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs(t.norm() - std::sqrt(1.*1+2*2+3*3+2*14*14+2*5*5+2*6*6))
+ < 1e-14,
+ ExcInternalError());
// make sure norm is induced by scalar
// product
- Assert (std::fabs (t.norm()*t.norm() - t*t) < 1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs (t.norm()*t.norm() - t*t) < 1e-14,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
t[1][1][1][1] = 2;
t[0][1][0][1] = 3;
- Assert (t[0][1][0][1] == t[1][0][1][0], ExcInternalError());
+ AssertThrow (t[0][1][0][1] == t[1][0][1][0], ExcInternalError());
// check that if a single element is
// accessed, its transpose element gets the
// same value
t[1][0][0][1] = 4;
- Assert (t[0][1][1][0] == 4, ExcInternalError());
+ AssertThrow (t[0][1][1][0] == 4, ExcInternalError());
// make sure transposition doesn't change
// anything
- Assert (t == transpose(t), ExcInternalError());
+ AssertThrow (t == transpose(t), ExcInternalError());
// check norm of tensor
deallog << t.norm() << std::endl;
for (unsigned int l=0; l<2; ++l)
norm_sqr += t[i][j][k][l] * t[i][j][k][l];
- Assert (std::fabs (t.norm()*t.norm() - norm_sqr) < 1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs (t.norm()*t.norm() - norm_sqr) < 1e-14,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
t[1][1][1][1] = 2;
t[0][1][0][1] = 3;
- Assert (t[0][1][0][1] == t[1][0][1][0], ExcInternalError());
+ AssertThrow (t[0][1][0][1] == t[1][0][1][0], ExcInternalError());
// check that if a single element is
// accessed, its transpose element gets the
// same value
t[1][0][0][1] = 4;
- Assert (t[0][1][1][0] == 4, ExcInternalError());
+ AssertThrow (t[0][1][1][0] == 4, ExcInternalError());
// make sure transposition doesn't change
// anything
- Assert (t == transpose(t), ExcInternalError());
+ AssertThrow (t == transpose(t), ExcInternalError());
// check norm of tensor
deallog << t.norm() << std::endl;
for (unsigned int k=0; k<2; ++k)
for (unsigned int l=0; l<2; ++l)
norm_sqr += t[i][j][k][l] * t[i][j][k][l];
- Assert (std::fabs (t.norm()*t.norm() - norm_sqr) < 1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs (t.norm()*t.norm() - norm_sqr) < 1e-14,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
b[i][j] = tmp_ij;
}
- Assert (a == b/2, ExcInternalError());
+ AssertThrow (a == b/2, ExcInternalError());
// try the same thing with scaled
// tensors etc
b[i][j] = tmp_ij;
}
- Assert (a == b/4, ExcInternalError());
+ AssertThrow (a == b/4, ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int i=0; i<dim; ++i)
for (unsigned int j=0; j<dim; ++j)
{
- Assert (as[i][j] == aa[i][j], ExcInternalError());
- Assert (bs[i][j] == ba[i][j], ExcInternalError());
+ AssertThrow (as[i][j] == aa[i][j], ExcInternalError());
+ AssertThrow (bs[i][j] == ba[i][j], ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int i=0; i<dim; ++i)
for (unsigned int j=0; j<dim; ++j)
{
- Assert (as[i][j] == aa[i][j], ExcInternalError());
- Assert (bs[i][j] == ba[i][j], ExcInternalError());
+ AssertThrow (as[i][j] == aa[i][j], ExcInternalError());
+ AssertThrow (bs[i][j] == ba[i][j], ExcInternalError());
deallog << as[i][j] << ' ' << bs[i][j] << std::endl;
}
// test distributivity of
// multiplication
- Assert ((as*ts)*as == as*(ts*as), ExcInternalError());
+ AssertThrow ((as*ts)*as == as*(ts*as), ExcInternalError());
// also test that the elasticity
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
t[i][j] = (1.+(i+1)*(j*2));
SymmetricTensor<2,dim> x = deviator_tensor<dim>() * t;
- Assert ((x-deviator(t)).norm() < 1e-15*t.norm(), ExcInternalError());
+ AssertThrow ((x-deviator(t)).norm() < 1e-15*t.norm(), ExcInternalError());
deallog << "x=" << std::endl;
for (unsigned int i=0; i<dim; ++i)
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=i; j<dim; ++j)
t[i][j] = (1.+(i+1)*(j*2));
- Assert (trace(deviator(t)) < 1e-15*t.norm(),
- ExcInternalError());
+ AssertThrow (trace(deviator(t)) < 1e-15*t.norm(),
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=i; j<dim; ++j)
t[i][j] = (1.+(i+1)*(j*2));
- Assert (trace(deviator_tensor<dim>()*t) < 1e-15*t.norm(),
- ExcInternalError());
+ AssertThrow (trace(deviator_tensor<dim>()*t) < 1e-15*t.norm(),
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
t[i][j] = (1.+(i+1)*(j*2));
SymmetricTensor<2,dim> x = identity_tensor<dim>() * t;
- Assert ((x-t).norm() < 1e-15*t.norm(), ExcInternalError());
+ AssertThrow ((x-t).norm() < 1e-15*t.norm(), ExcInternalError());
deallog << "x=" << std::endl;
for (unsigned int i=0; i<dim; ++i)
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// where the diagonal elements are the
// traces of t
SymmetricTensor<2,dim> x = T * t;
- Assert ((x-trace(t)*unit_symmetric_tensor<dim>()).norm()
- < 1e-15*t.norm(), ExcInternalError());
+ AssertThrow ((x-trace(t)*unit_symmetric_tensor<dim>()).norm()
+ < 1e-15*t.norm(), ExcInternalError());
deallog << "x=" << std::endl;
for (unsigned int i=0; i<dim; ++i)
// T*t should yield norm(t)^2*t
SymmetricTensor<2,dim> x = T * t;
- Assert ((x-(t*t)*t).norm()
- < 1e-15*t.norm(), ExcInternalError());
+ AssertThrow ((x-(t*t)*t).norm()
+ < 1e-15*t.norm(), ExcInternalError());
deallog << "x=" << std::endl;
for (unsigned int i=0; i<dim; ++i)
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
- 1./dim * outer_product(unit_symmetric_tensor<dim>(),
unit_symmetric_tensor<dim>()));
- Assert ((T-deviator_tensor<dim>()).norm()
- <= 1e-15*T.norm(), ExcInternalError());
+ AssertThrow ((T-deviator_tensor<dim>()).norm()
+ <= 1e-15*T.norm(), ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// t_times_1 should be a multiple of the
// unit tensor, given the structure we have
// given to it
- Assert ((t_times_1 - (dim*10000 + 2*100)*unit_symmetric_tensor<dim>()).norm()
- < 1e-14*t_times_1.norm(),
- ExcInternalError());
+ AssertThrow ((t_times_1 - (dim*10000 + 2*100)*unit_symmetric_tensor<dim>()).norm()
+ < 1e-14*t_times_1.norm(),
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int b=0; b<dim; ++b)
tmp += A[i][j][a][b] * B[a][b][k][l];
- Assert (std::fabs(T[i][j][k][l] - tmp) < 1e-14*tmp,
- ExcInternalError());
+ AssertThrow (std::fabs(T[i][j][k][l] - tmp) < 1e-14*tmp,
+ ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
<< B[i][j][k][l] << ' '
<< T_left[i][j][k][l] << std::endl;
- Assert (std::fabs(T_left[i][j][k][l] -
- identity_tensor<dim>()[i][j][k][l])
- < 1e-10,
- ExcInternalError());
+ AssertThrow (std::fabs(T_left[i][j][k][l] -
+ identity_tensor<dim>()[i][j][k][l])
+ < 1e-10,
+ ExcInternalError());
}
// check left inverse
<< B[i][j][k][l] << ' '
<< T_right[i][j][k][l] << std::endl;
- Assert (std::fabs(T_right[i][j][k][l] -
- identity_tensor<dim>()[i][j][k][l])
- < 1e-10,
- ExcInternalError());
+ AssertThrow (std::fabs(T_right[i][j][k][l] -
+ identity_tensor<dim>()[i][j][k][l])
+ < 1e-10,
+ ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
t = 0;
deallog << t.norm() << std::endl;
- Assert (t.norm() == 0, ExcInternalError());
+ AssertThrow (t.norm() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
t[0][0] = 1;
double x[1] = { 1 };
- Assert ((t == SymmetricTensor<2,1>(x)),
- ExcInternalError());
+ AssertThrow ((t == SymmetricTensor<2,1>(x)),
+ ExcInternalError());
}
{
t[0][1] = 3;
double x[3] = { 1, 2, 3 };
- Assert ((t == SymmetricTensor<2,2>(x)),
- ExcInternalError());
+ AssertThrow ((t == SymmetricTensor<2,2>(x)),
+ ExcInternalError());
}
{
t[1][2] = 6;
double x[6] = { 1, 2, 3, 4, 5, 6 };
- Assert ((t == SymmetricTensor<2,3>(x)),
- ExcInternalError());
+ AssertThrow ((t == SymmetricTensor<2,3>(x)),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
deallog << i << " -- "
<< S::unrolled_to_component_indices (i)
<< std::endl;
- Assert (S::component_to_unrolled_index
- (S::unrolled_to_component_indices (i))
- ==
- i,
- ExcInternalError());
+ AssertThrow (S::component_to_unrolled_index
+ (S::unrolled_to_component_indices (i))
+ ==
+ i,
+ ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
- third_invariant(S) * unit_symmetric_tensor<dim> ();
deallog << R << std::endl;
- Assert (R.norm() < 1e-10, ExcInternalError());
+ AssertThrow (R.norm() < 1e-10, ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
t[i][j] = (1.+(i+1)*(j*2));
deallog << scalar_product(s,s) << std::endl;
- Assert (scalar_product(s,s) == s*s, ExcInternalError());
-
+ AssertThrow (scalar_product(s,s) == s*s, ExcInternalError());
+
deallog << scalar_product(s,t) << std::endl;
- Assert (scalar_product(s,t) == s*symmetrize(t), ExcInternalError());
- Assert (scalar_product(s,t) == symmetrize(t)*s, ExcInternalError());
-
+ AssertThrow (scalar_product(s,t) == s*symmetrize(t), ExcInternalError());
+ AssertThrow (scalar_product(s,t) == symmetrize(t)*s, ExcInternalError());
+
deallog << scalar_product(t,s) << std::endl;
- Assert (scalar_product(t,s) == s*symmetrize(t), ExcInternalError());
- Assert (scalar_product(t,s) == symmetrize(t)*s, ExcInternalError());
+ AssertThrow (scalar_product(t,s) == s*symmetrize(t), ExcInternalError());
+ AssertThrow (scalar_product(t,s) == symmetrize(t)*s, ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 1998 - 2014 by the deal.II authors
+// Copyright (C) 1998 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int i=0; i<3; ++i)
for (unsigned int j=0; j<3; ++j)
{
- Assert (Td[i][j] == Td(i,j), ExcInternalError());
- Assert (Ti[i][j] == Ti(i,j), ExcInternalError());
- Assert (Ti[i][j] == Td(i,j), ExcInternalError());
+ AssertThrow (Td[i][j] == Td(i,j), ExcInternalError());
+ AssertThrow (Ti[i][j] == Ti(i,j), ExcInternalError());
+ AssertThrow (Ti[i][j] == Td(i,j), ExcInternalError());
- Assert (*(Td[i].begin()+j) == Td(i,j), ExcInternalError());
- Assert (*(Ti[i].begin()+j) == Ti(i,j), ExcInternalError());
- Assert (*(Ti[i].begin()+j) == Td(i,j), ExcInternalError());
+ AssertThrow (*(Td[i].begin()+j) == Td(i,j), ExcInternalError());
+ AssertThrow (*(Ti[i].begin()+j) == Ti(i,j), ExcInternalError());
+ AssertThrow (*(Ti[i].begin()+j) == Td(i,j), ExcInternalError());
- Assert (&*(Td[i].begin()+j) == &Td(i,j), ExcInternalError());
- Assert (&*(Ti[i].begin()+j) == &Ti(i,j), ExcInternalError());
+ AssertThrow (&*(Td[i].begin()+j) == &Td(i,j), ExcInternalError());
+ AssertThrow (&*(Ti[i].begin()+j) == &Ti(i,j), ExcInternalError());
deallog << i << " " << j << " " << Td[i][j] << " ok" << std::endl;
};
for (unsigned int i=0; i<4; ++i)
for (unsigned int j=0; j<3; ++j)
{
- Assert (Td[i][j] == Td(i,j), ExcInternalError());
- Assert (Ti[i][j] == Ti(i,j), ExcInternalError());
- Assert (Ti[i][j] == Td(i,j), ExcInternalError());
+ AssertThrow (Td[i][j] == Td(i,j), ExcInternalError());
+ AssertThrow (Ti[i][j] == Ti(i,j), ExcInternalError());
+ AssertThrow (Ti[i][j] == Td(i,j), ExcInternalError());
- Assert (*(Td[i].begin()+j) == Td(i,j), ExcInternalError());
- Assert (*(Ti[i].begin()+j) == Ti(i,j), ExcInternalError());
- Assert (*(Ti[i].begin()+j) == Td(i,j), ExcInternalError());
+ AssertThrow (*(Td[i].begin()+j) == Td(i,j), ExcInternalError());
+ AssertThrow (*(Ti[i].begin()+j) == Ti(i,j), ExcInternalError());
+ AssertThrow (*(Ti[i].begin()+j) == Td(i,j), ExcInternalError());
- Assert (&*(Td[i].begin()+j) == &Td(i,j), ExcInternalError());
- Assert (&*(Ti[i].begin()+j) == &Ti(i,j), ExcInternalError());
+ AssertThrow (&*(Td[i].begin()+j) == &Td(i,j), ExcInternalError());
+ AssertThrow (&*(Ti[i].begin()+j) == &Ti(i,j), ExcInternalError());
deallog << i << " " << j << " " << Td[i][j] << " ok" << std::endl;
};
for (unsigned int i=0; i<4; ++i)
- Assert (Td[i].end() - Td[i].begin() == 3,
- ExcInternalError());
+ AssertThrow (Td[i].end() - Td[i].begin() == 3,
+ ExcInternalError());
};
for (unsigned int i=0; i<N; ++i)
{
- Assert (Td[i] == Td(i), ExcInternalError());
- Assert (Ti[i] == Ti(i), ExcInternalError());
- Assert (Ti[i] == Td(i), ExcInternalError());
+ AssertThrow (Td[i] == Td(i), ExcInternalError());
+ AssertThrow (Ti[i] == Ti(i), ExcInternalError());
+ AssertThrow (Ti[i] == Td(i), ExcInternalError());
deallog << i << " " << Td[i] << " ok" << std::endl;
};
for (unsigned int j=0; j<J; ++j)
for (unsigned int k=0; k<K; ++k)
{
- Assert (Td[i][j][k] == Td(i,j,k), ExcInternalError());
- Assert (Ti[i][j][k] == Ti(i,j,k), ExcInternalError());
- Assert (Ti[i][j][k] == Td(i,j,k), ExcInternalError());
+ AssertThrow (Td[i][j][k] == Td(i,j,k), ExcInternalError());
+ AssertThrow (Ti[i][j][k] == Ti(i,j,k), ExcInternalError());
+ AssertThrow (Ti[i][j][k] == Td(i,j,k), ExcInternalError());
- Assert (*(Td[i][j].begin()+k) == Td(i,j,k), ExcInternalError());
- Assert (*(Ti[i][j].begin()+k) == Ti(i,j,k), ExcInternalError());
- Assert (*(Ti[i][j].begin()+k) == Td(i,j,k), ExcInternalError());
+ AssertThrow (*(Td[i][j].begin()+k) == Td(i,j,k), ExcInternalError());
+ AssertThrow (*(Ti[i][j].begin()+k) == Ti(i,j,k), ExcInternalError());
+ AssertThrow (*(Ti[i][j].begin()+k) == Td(i,j,k), ExcInternalError());
- Assert (&*(Td[i][j].begin()+k) == &Td(i,j,k), ExcInternalError());
- Assert (&*(Ti[i][j].begin()+k) == &Ti(i,j,k), ExcInternalError());
+ AssertThrow (&*(Td[i][j].begin()+k) == &Td(i,j,k), ExcInternalError());
+ AssertThrow (&*(Ti[i][j].begin()+k) == &Ti(i,j,k), ExcInternalError());
deallog << i << " " << j << " " << k << " "
<< Td[i][j][k] << " ok" << std::endl;
for (unsigned int i=0; i<I; ++i)
for (unsigned int j=0; j<J; ++j)
- Assert (Td[i][j].end() - Td[i][j].begin() ==
- static_cast<signed int>(K),
- ExcInternalError());
+ AssertThrow (Td[i][j].end() - Td[i][j].begin() ==
+ static_cast<signed int>(K),
+ ExcInternalError());
};
// a 4d-table
for (unsigned int k=0; k<K; ++k)
for (unsigned int l=0; l<L; ++l)
{
- Assert (Td[i][j][k][l] == Td(i,j,k,l), ExcInternalError());
- Assert (Ti[i][j][k][l] == Ti(i,j,k,l), ExcInternalError());
- Assert (Ti[i][j][k][l] == Td(i,j,k,l), ExcInternalError());
+ AssertThrow (Td[i][j][k][l] == Td(i,j,k,l), ExcInternalError());
+ AssertThrow (Ti[i][j][k][l] == Ti(i,j,k,l), ExcInternalError());
+ AssertThrow (Ti[i][j][k][l] == Td(i,j,k,l), ExcInternalError());
- Assert (*(Td[i][j][k].begin()+l) == Td(i,j,k,l), ExcInternalError());
- Assert (*(Ti[i][j][k].begin()+l) == Ti(i,j,k,l), ExcInternalError());
- Assert (*(Ti[i][j][k].begin()+l) == Td(i,j,k,l), ExcInternalError());
+ AssertThrow (*(Td[i][j][k].begin()+l) == Td(i,j,k,l), ExcInternalError());
+ AssertThrow (*(Ti[i][j][k].begin()+l) == Ti(i,j,k,l), ExcInternalError());
+ AssertThrow (*(Ti[i][j][k].begin()+l) == Td(i,j,k,l), ExcInternalError());
- Assert (&*(Td[i][j][k].begin()+l) == &Td(i,j,k,l), ExcInternalError());
- Assert (&*(Ti[i][j][k].begin()+l) == &Ti(i,j,k,l), ExcInternalError());
+ AssertThrow (&*(Td[i][j][k].begin()+l) == &Td(i,j,k,l), ExcInternalError());
+ AssertThrow (&*(Ti[i][j][k].begin()+l) == &Ti(i,j,k,l), ExcInternalError());
deallog << i << " " << j << " " << k << " " << l << " "
<< Td[i][j][k][l] << " ok" << std::endl;
for (unsigned int i=0; i<I; ++i)
for (unsigned int j=0; j<J; ++j)
for (unsigned int k=0; k<K; ++k)
- Assert (Td[i][j][k].end() - Td[i][j][k].begin() ==
- static_cast<signed int>(L),
- ExcDimensionMismatch(Td[i][j][k].end() - Td[i][j][k].begin(),
- static_cast<signed int>(L)));
+ AssertThrow (Td[i][j][k].end() - Td[i][j][k].begin() ==
+ static_cast<signed int>(L),
+ ExcDimensionMismatch(Td[i][j][k].end() - Td[i][j][k].begin(),
+ static_cast<signed int>(L)));
};
// 5d-table
for (unsigned int l=0; l<L; ++l)
for (unsigned int m=0; m<M; ++m)
{
- Assert (Td[i][j][k][l][m] == Td(i,j,k,l,m), ExcInternalError());
- Assert (Ti[i][j][k][l][m] == Ti(i,j,k,l,m), ExcInternalError());
- Assert (Ti[i][j][k][l][m] == Td(i,j,k,l,m), ExcInternalError());
+ AssertThrow (Td[i][j][k][l][m] == Td(i,j,k,l,m), ExcInternalError());
+ AssertThrow (Ti[i][j][k][l][m] == Ti(i,j,k,l,m), ExcInternalError());
+ AssertThrow (Ti[i][j][k][l][m] == Td(i,j,k,l,m), ExcInternalError());
- Assert (*(Td[i][j][k][l].begin()+m) == Td(i,j,k,l,m), ExcInternalError());
- Assert (*(Ti[i][j][k][l].begin()+m) == Ti(i,j,k,l,m), ExcInternalError());
- Assert (*(Ti[i][j][k][l].begin()+m) == Td(i,j,k,l,m), ExcInternalError());
+ AssertThrow (*(Td[i][j][k][l].begin()+m) == Td(i,j,k,l,m), ExcInternalError());
+ AssertThrow (*(Ti[i][j][k][l].begin()+m) == Ti(i,j,k,l,m), ExcInternalError());
+ AssertThrow (*(Ti[i][j][k][l].begin()+m) == Td(i,j,k,l,m), ExcInternalError());
- Assert (&*(Td[i][j][k][l].begin()+m) == &Td(i,j,k,l,m), ExcInternalError());
- Assert (&*(Ti[i][j][k][l].begin()+m) == &Ti(i,j,k,l,m), ExcInternalError());
+ AssertThrow (&*(Td[i][j][k][l].begin()+m) == &Td(i,j,k,l,m), ExcInternalError());
+ AssertThrow (&*(Ti[i][j][k][l].begin()+m) == &Ti(i,j,k,l,m), ExcInternalError());
deallog << i << " " << j << " " << k << " " << l << " " << m << " "
<< Td[i][j][k][l][m] << " ok" << std::endl;
for (unsigned int j=0; j<J; ++j)
for (unsigned int k=0; k<K; ++k)
for (unsigned int l=0; l<L; ++l)
- Assert (Td[i][j][k][l].end() - Td[i][j][k][l].begin() ==
- static_cast<signed int>(M),
- ExcDimensionMismatch(Td[i][j][k][l].end() - Td[i][j][k][l].begin(),
- static_cast<signed int>(M)));
+ AssertThrow (Td[i][j][k][l].end() - Td[i][j][k][l].begin() ==
+ static_cast<signed int>(M),
+ ExcDimensionMismatch(Td[i][j][k][l].end() - Td[i][j][k][l].begin(),
+ static_cast<signed int>(M)));
};
// a 6d-table
for (unsigned int m=0; m<M; ++m)
for (unsigned int n=0; n<N; ++n)
{
- Assert (Td[i][j][k][l][m][n] == Td(i,j,k,l,m,n), ExcInternalError());
- Assert (Ti[i][j][k][l][m][n] == Ti(i,j,k,l,m,n), ExcInternalError());
- Assert (Ti[i][j][k][l][m][n] == Td(i,j,k,l,m,n), ExcInternalError());
+ AssertThrow (Td[i][j][k][l][m][n] == Td(i,j,k,l,m,n), ExcInternalError());
+ AssertThrow (Ti[i][j][k][l][m][n] == Ti(i,j,k,l,m,n), ExcInternalError());
+ AssertThrow (Ti[i][j][k][l][m][n] == Td(i,j,k,l,m,n), ExcInternalError());
- Assert (*(Td[i][j][k][l][m].begin()+n) == Td(i,j,k,l,m,n), ExcInternalError());
- Assert (*(Ti[i][j][k][l][m].begin()+n) == Ti(i,j,k,l,m,n), ExcInternalError());
- Assert (*(Ti[i][j][k][l][m].begin()+n) == Td(i,j,k,l,m,n), ExcInternalError());
+ AssertThrow (*(Td[i][j][k][l][m].begin()+n) == Td(i,j,k,l,m,n), ExcInternalError());
+ AssertThrow (*(Ti[i][j][k][l][m].begin()+n) == Ti(i,j,k,l,m,n), ExcInternalError());
+ AssertThrow (*(Ti[i][j][k][l][m].begin()+n) == Td(i,j,k,l,m,n), ExcInternalError());
- Assert (&*(Td[i][j][k][l][m].begin()+n) == &Td(i,j,k,l,m,n), ExcInternalError());
- Assert (&*(Ti[i][j][k][l][m].begin()+n) == &Ti(i,j,k,l,m,n), ExcInternalError());
+ AssertThrow (&*(Td[i][j][k][l][m].begin()+n) == &Td(i,j,k,l,m,n), ExcInternalError());
+ AssertThrow (&*(Ti[i][j][k][l][m].begin()+n) == &Ti(i,j,k,l,m,n), ExcInternalError());
deallog << i << " " << j << " " << k << " " << l << " " << m << " " << n << " "
<< Td[i][j][k][l][m][n] << " ok" << std::endl;
for (unsigned int k=0; k<K; ++k)
for (unsigned int l=0; l<L; ++l)
for (unsigned int m=0; m<M; ++m)
- Assert (Td[i][j][k][l][m].end() - Td[i][j][k][l][m].begin() ==
- static_cast<signed int>(N),
- ExcDimensionMismatch(Td[i][j][k][l][m].end() - Td[i][j][k][l][m].begin(),
- static_cast<signed int>(N)));
+ AssertThrow (Td[i][j][k][l][m].end() - Td[i][j][k][l][m].begin() ==
+ static_cast<signed int>(N),
+ ExcDimensionMismatch(Td[i][j][k][l][m].end() - Td[i][j][k][l][m].begin(),
+ static_cast<signed int>(N)));
};
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
t2[0] = 84;
t2[1] = 42;
- Assert (t1 == t2, ExcInternalError());
- Assert (t1[0] == t2[0], ExcInternalError());
- Assert (t1[1] == t2[1], ExcInternalError());
+ AssertThrow (t1 == t2, ExcInternalError());
+ AssertThrow (t1[0] == t2[0], ExcInternalError());
+ AssertThrow (t1[1] == t2[1], ExcInternalError());
- Assert (! (t1 != t2), ExcInternalError());
+ AssertThrow (! (t1 != t2), ExcInternalError());
t2.sort();
- Assert (t1 != t2, ExcInternalError());
- Assert (t1[0] == t2[1], ExcInternalError());
- Assert (t1[1] == t2[0], ExcInternalError());
+ AssertThrow (t1 != t2, ExcInternalError());
+ AssertThrow (t1[0] == t2[1], ExcInternalError());
+ AssertThrow (t1[1] == t2[0], ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
deallog.threshold_double(1.e-10);
Threads::Task<int> t = Threads::new_task (test);
- Assert (t.return_value() == 42, ExcInternalError());
+ AssertThrow (t.return_value() == 42, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
deallog.threshold_double(1.e-10);
Threads::Task<> t;
- Assert (t.joinable() == false, ExcInternalError());
-
+ AssertThrow (t.joinable() == false, ExcInternalError());
+
t = Threads::new_task (test);
- Assert (t.joinable() == true, ExcInternalError());
+ AssertThrow (t.joinable() == true, ExcInternalError());
t.join ();
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 1998 - 2014 by the deal.II authors
+// Copyright (C) 1998 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
Tensor<2,dim> t(a);
Tensor<2,dim> tt;
Tensor<2,dim> result(b);
- Assert (transpose(transpose(t)) == t, ExcInternalError());
- Assert (transpose(transpose(result)) == result, ExcInternalError());
+ AssertThrow (transpose(transpose(t)) == t, ExcInternalError());
+ AssertThrow (transpose(transpose(result)) == result, ExcInternalError());
Vector<double> unrolled(9);
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<dim; ++j)
for (unsigned int k=0; k<dim; ++k)
{
- Assert (TableIndices<3>(i,j,k)
- ==
- T::unrolled_to_component_indices (i*dim*dim+j*dim+k),
- ExcInternalError());
- Assert (T::component_to_unrolled_index(TableIndices<3>(i,j,k))
- ==
- i*dim*dim+j*dim+k,
- ExcInternalError());
- Assert (t[TableIndices<3>(i,j,k)] == t[i][j][k],
- ExcInternalError());
+ AssertThrow (TableIndices<3>(i,j,k)
+ ==
+ T::unrolled_to_component_indices (i*dim*dim+j*dim+k),
+ ExcInternalError());
+ AssertThrow (T::component_to_unrolled_index(TableIndices<3>(i,j,k))
+ ==
+ i*dim*dim+j*dim+k,
+ ExcInternalError());
+ AssertThrow (t[TableIndices<3>(i,j,k)] == t[i][j][k],
+ ExcInternalError());
}
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 1998 - 2014 by the deal.II authors
+// Copyright (C) 1998 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
Tensor<2,dim,std::complex<double> > t(a);
Tensor<2,dim,std::complex<double> > tt;
Tensor<2,dim,std::complex<double> > result(b);
- Assert (transpose(transpose(t)) == t, ExcInternalError());
- Assert (transpose(transpose(result)) == result, ExcInternalError());
+ AssertThrow (transpose(transpose(t)) == t, ExcInternalError());
+ AssertThrow (transpose(transpose(result)) == result, ExcInternalError());
Vector<std::complex<double> > unrolled(9);
// ---------------------------------------------------------------------
//
-// Copyright (C) 1998 - 2014 by the deal.II authors
+// Copyright (C) 1998 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
Tensor<2,dim,float> t(a);
Tensor<2,dim,float> tt;
Tensor<2,dim,float> result(b);
- Assert (transpose(transpose(t)) == t, ExcInternalError());
- Assert (transpose(transpose(result)) == result, ExcInternalError());
+ AssertThrow (transpose(transpose(t)) == t, ExcInternalError());
+ AssertThrow (transpose(transpose(result)) == result, ExcInternalError());
Vector<float> unrolled(9);
float b[3] = {25,31,37};
const unsigned int dim=3;
-
+
// rank 2
{
Tensor<2,dim,float> t(a);
Tensor<2,dim,double> dt(t), dt2;
dt2 = t;
- Assert (dt2 == dt, ExcInternalError());
- Assert (dt == dt2, ExcInternalError());
-
+ AssertThrow (dt2 == dt, ExcInternalError());
+ AssertThrow (dt == dt2, ExcInternalError());
+
Tensor<2,dim,float> ft(dt), ft2;
ft2 = dt;
- Assert (ft2 == ft, ExcInternalError());
- Assert (ft == ft2, ExcInternalError());
-
+ AssertThrow (ft2 == ft, ExcInternalError());
+ AssertThrow (ft == ft2, ExcInternalError());
+
Tensor<2,dim,std::complex<double> > ct(dt), ct2;
ct2 = dt;
- Assert (ct2 == ct, ExcInternalError());
- Assert (ct == ct2, ExcInternalError());
+ AssertThrow (ct2 == ct, ExcInternalError());
+ AssertThrow (ct == ct2, ExcInternalError());
}
-
+
// rank 1
{
Tensor<1,dim,float> t(b);
Tensor<1,dim,double> dt(t), dt2;
dt2 = t;
- Assert (dt2 == dt, ExcInternalError());
- Assert (dt == dt2, ExcInternalError());
-
+ AssertThrow (dt2 == dt, ExcInternalError());
+ AssertThrow (dt == dt2, ExcInternalError());
+
Tensor<1,dim,float> ft(dt),ft2;
ft2 = dt;
- Assert (ft2 == ft, ExcInternalError());
- Assert (ft == ft2, ExcInternalError());
-
+ AssertThrow (ft2 == ft, ExcInternalError());
+ AssertThrow (ft == ft2, ExcInternalError());
+
Tensor<1,dim,std::complex<double> > ct(dt), ct2;
ct2 = dt;
- Assert (ct2 == ct, ExcInternalError());
- Assert (ct == ct2, ExcInternalError());
+ AssertThrow (ct2 == ct, ExcInternalError());
+ AssertThrow (ct == ct2, ExcInternalError());
}
-
+
deallog << "OK." << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
struct X
{
X ()
- :
- i(1)
+ :
+ i(1)
{};
int i;
// check correct default initialization
bool exists;
int i = tls_data.get(exists).i;
- Assert (i == 1, ExcInternalError());
- Assert (exists == false, ExcInternalError());
+ AssertThrow (i == 1, ExcInternalError());
+ AssertThrow (exists == false, ExcInternalError());
// set value
tls_data.get(exists).i = 2;
// try again. should have existed this time around
i = tls_data.get(exists).i;
- Assert (i == 2, ExcInternalError());
- Assert (exists == true, ExcInternalError());
+ AssertThrow (i == 2, ExcInternalError());
+ AssertThrow (exists == true, ExcInternalError());
// wait for the barrier to clear
m.acquire ();
// at this point, the tls object should have been cleared and should
// be back at its original value
i = tls_data.get(exists).i;
- Assert (i == 1, ExcInternalError());
- Assert (exists == false, ExcInternalError());
+ AssertThrow (i == 1, ExcInternalError());
+ AssertThrow (exists == false, ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
struct X
{
X ()
- :
- i(1)
+ :
+ i(1)
{};
int i;
// check correct default initialization
bool exists;
int i = tls_data.get(exists).i;
- Assert (i == 42, ExcInternalError());
- Assert (exists == false, ExcInternalError());
+ AssertThrow (i == 42, ExcInternalError());
+ AssertThrow (exists == false, ExcInternalError());
// set value
tls_data.get(exists).i = 2;
// try again. should have existed this time around
i = tls_data.get(exists).i;
- Assert (i == 2, ExcInternalError());
- Assert (exists == true, ExcInternalError());
+ AssertThrow (i == 2, ExcInternalError());
+ AssertThrow (exists == true, ExcInternalError());
// wait for the barrier to clear
m.acquire ();
// at this point, the tls object should have been cleared and should
// be back at its original value
i = tls_data.get(exists).i;
- Assert (i == 42, ExcInternalError());
- Assert (exists == false, ExcInternalError());
+ AssertThrow (i == 42, ExcInternalError());
+ AssertThrow (exists == false, ExcInternalError());
}
void execute (const X &x)
{
- Assert (x.i == 42, ExcInternalError());
+ AssertThrow (x.i == 42, ExcInternalError());
deallog << "OK" << std::endl;
}
void execute (const X &x)
{
- Assert (x.i == 42, ExcInternalError());
+ AssertThrow (x.i == 42, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
;
for (unsigned int i=0; i<sz; ++i)
- Assert (p[i] == 0, ExcInternalError());
+ AssertThrow (p[i] == 0, ExcInternalError());
}
struct X
{
- X ()
- {
- ++counter;
- }
+ X ()
+ {
+ ++counter;
+ }
X (const X &)
- {
- ++counter;
- }
+ {
+ ++counter;
+ }
~X ()
- {
- --counter;
- }
+ {
+ --counter;
+ }
};
// test with plain new/delete
{
- Assert (counter == 0, ExcInternalError());
+ AssertThrow (counter == 0, ExcInternalError());
{
X *p = new X;
- Assert (counter == 1, ExcInternalError());
+ AssertThrow (counter == 1, ExcInternalError());
delete p;
}
- Assert (counter == 0, ExcInternalError());
+ AssertThrow (counter == 0, ExcInternalError());
}
-
+
// test with plain unique_ptr
{
- Assert (counter == 0, ExcInternalError());
+ AssertThrow (counter == 0, ExcInternalError());
{
std_cxx11::unique_ptr<X> p (new X);
- Assert (counter == 1, ExcInternalError());
+ AssertThrow (counter == 1, ExcInternalError());
}
- Assert (counter == 0, ExcInternalError());
+ AssertThrow (counter == 0, ExcInternalError());
}
// test with plain unique_ptr, but also copy stuff. this only works
// with move constructors, so test only in C++11 mode
#ifdef DEAL_II_WITH_CXX11
{
- Assert (counter == 0, ExcInternalError());
+ AssertThrow (counter == 0, ExcInternalError());
{
std_cxx11::unique_ptr<X> p (new X);
- Assert (counter == 1, ExcInternalError());
+ AssertThrow (counter == 1, ExcInternalError());
std_cxx11::unique_ptr<X> q = std::move(p);
- Assert (counter == 1, ExcInternalError());
+ AssertThrow (counter == 1, ExcInternalError());
}
- Assert (counter == 0, ExcInternalError());
+ AssertThrow (counter == 0, ExcInternalError());
}
#endif
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.push_back ("1");
v.push_back (" -12");
v.push_back ("+125 ");
- Assert (Utilities::string_to_int (v).size() == 3, ExcInternalError());
+ AssertThrow (Utilities::string_to_int (v).size() == 3, ExcInternalError());
deallog << Utilities::string_to_int (v)[0] << std::endl;
deallog << Utilities::string_to_int (v)[1] << std::endl;
deallog << Utilities::string_to_int (v)[2] << std::endl;
{
const char *p = "alpha, beta, gamma ";
- Assert (Utilities::split_string_list (p).size() == 3,
- ExcInternalError());
- Assert (Utilities::split_string_list (p)[0] == "alpha",
- ExcInternalError());
- Assert (Utilities::split_string_list (p)[1] == "beta",
- ExcInternalError());
- Assert (Utilities::split_string_list (p)[2] == "gamma",
- ExcInternalError());
+ AssertThrow (Utilities::split_string_list (p).size() == 3,
+ ExcInternalError());
+ AssertThrow (Utilities::split_string_list (p)[0] == "alpha",
+ ExcInternalError());
+ AssertThrow (Utilities::split_string_list (p)[1] == "beta",
+ ExcInternalError());
+ AssertThrow (Utilities::split_string_list (p)[2] == "gamma",
+ ExcInternalError());
}
{
const char *p = "alpha; beta; gamma ";
- Assert (Utilities::split_string_list (p, ';').size() == 3,
- ExcInternalError());
- Assert (Utilities::split_string_list (p, ';')[0] == "alpha",
- ExcInternalError());
- Assert (Utilities::split_string_list (p, ';')[1] == "beta",
- ExcInternalError());
- Assert (Utilities::split_string_list (p, ';')[2] == "gamma",
- ExcInternalError());
+ AssertThrow (Utilities::split_string_list (p, ';').size() == 3,
+ ExcInternalError());
+ AssertThrow (Utilities::split_string_list (p, ';')[0] == "alpha",
+ ExcInternalError());
+ AssertThrow (Utilities::split_string_list (p, ';')[1] == "beta",
+ ExcInternalError());
+ AssertThrow (Utilities::split_string_list (p, ';')[2] == "gamma",
+ ExcInternalError());
}
deallog << Utilities::generate_normal_random_number (13, 44) << ' ';
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.push_back ("1.5");
v.push_back (" -12.5");
v.push_back ("+125.5 ");
- Assert (Utilities::string_to_double (v).size() == 3, ExcInternalError());
+ AssertThrow (Utilities::string_to_double (v).size() == 3, ExcInternalError());
deallog << Utilities::string_to_double (v)[0] << std::endl;
deallog << Utilities::string_to_double (v)[1] << std::endl;
deallog << Utilities::string_to_double (v)[2] << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
std::ostringstream s;
s << "test test" << number << "test test";
- Assert (Utilities::get_integer_at_position (s.str(),
- 9).first
- == number,
- ExcInternalError());
- Assert (Utilities::get_integer_at_position (s.str(),
- 9).second
- == i+1,
- ExcInternalError());
+ AssertThrow (Utilities::get_integer_at_position (s.str(),
+ 9).first
+ == number,
+ ExcInternalError());
+ AssertThrow (Utilities::get_integer_at_position (s.str(),
+ 9).second
+ == i+1,
+ ExcInternalError());
deallog << i << ' ' << Utilities::get_integer_at_position (s.str(),
9).first
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
std_cxx11::bind(&zero_subrange, std_cxx11::_1, std_cxx11::_2,
std_cxx11::ref(copy_data.cell_rhs)), 1);
- Assert(q == data.x_fe_values.quadrature_point(0),
- ExcInternalError());
+ AssertThrow(q == data.x_fe_values.quadrature_point(0),
+ ExcInternalError());
copy_data.cell_rhs[0] = value(data.x_fe_values.quadrature_point(0));
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
std_cxx11::bind(&zero_subrange, std_cxx11::_1, std_cxx11::_2,
std_cxx11::ref(copy_data.cell_rhs)), 1);
- Assert(q == data.x_fe_values.quadrature_point(0),
- ExcInternalError());
+ AssertThrow(q == data.x_fe_values.quadrature_point(0),
+ ExcInternalError());
copy_data.cell_rhs[0] = value(data.x_fe_values.quadrature_point(0));
}
CopyData copy_data;
copy_data.cell_rhs.resize(8);
WorkStream::run(GraphColoring::make_graph_coloring (triangulation.begin_active(),
- triangulation.end(),
- std_cxx11::function<std::vector<types::global_dof_index>
- (const Triangulation<dim>::active_cell_iterator &)>
- (&conflictor<dim>)),
+ triangulation.end(),
+ std_cxx11::function<std::vector<types::global_dof_index>
+ (const Triangulation<dim>::active_cell_iterator &)>
+ (&conflictor<dim>)),
&mass_assembler<dim>,
std_cxx11::bind(©_local_to_global, std_cxx11::_1, &sum),
assembler_data, copy_data, 8, 1);
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void worker (const std::vector<unsigned int>::iterator &i,
- ScratchData &,
- CopyData &ad)
+ ScratchData &,
+ CopyData &ad)
{
ad.computed = *i * 2;
}
{
const unsigned int ad_computed = v[i] * 2;
for (unsigned int j=0; j<5; ++j)
- comp((ad_computed+j) % result.size()) += ad_computed;
+ comp((ad_computed+j) % result.size()) += ad_computed;
}
// and compare
for (unsigned int i=0; i<result.size(); ++i)
- Assert (result(i) == comp(i), ExcInternalError());
+ AssertThrow (result(i) == comp(i), ExcInternalError());
for (unsigned int i=0; i<result.size(); ++i)
deallog << result(i) << std::endl;
void worker (const std::vector<unsigned int>::iterator &i,
- ScratchData &,
- CopyData &ad)
+ ScratchData &,
+ CopyData &ad)
{
ad.computed = *i * 2;
}
v.push_back (i);
WorkStream::run (GraphColoring::make_graph_coloring (v.begin(), v.end(),
- std_cxx11::function<std::vector<types::global_dof_index>
- (const std::vector<unsigned int>::iterator &)>
- (&conflictor)),
- &worker, &copier,
+ std_cxx11::function<std::vector<types::global_dof_index>
+ (const std::vector<unsigned int>::iterator &)>
+ (&conflictor)),
+ &worker, &copier,
ScratchData(),
CopyData());
{
const unsigned int ad_computed = v[i] * 2;
for (unsigned int j=0; j<5; ++j)
- comp((ad_computed+j) % result.size()) += ad_computed;
+ comp((ad_computed+j) % result.size()) += ad_computed;
}
// and compare
for (unsigned int i=0; i<result.size(); ++i)
- Assert (result(i) == comp(i), ExcInternalError());
+ AssertThrow (result(i) == comp(i), ExcInternalError());
for (unsigned int i=0; i<result.size(); ++i)
deallog << result(i) << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
const typename Triangulation<dim>::active_cell_iterator
cell = tria.begin_active();
- Assert (cell == cell, ExcInternalError());
- Assert (! (cell != cell), ExcInternalError());
- Assert (! (cell < cell), ExcInternalError());
+ AssertThrow (cell == cell, ExcInternalError());
+ AssertThrow (! (cell != cell), ExcInternalError());
+ AssertThrow (! (cell < cell), ExcInternalError());
}
// same with non-active iterators
{
const typename Triangulation<dim>::cell_iterator
cell = tria.begin();
- Assert (cell == cell, ExcInternalError());
- Assert (! (cell != cell), ExcInternalError());
- Assert (! (cell < cell), ExcInternalError());
+ AssertThrow (cell == cell, ExcInternalError());
+ AssertThrow (! (cell != cell), ExcInternalError());
+ AssertThrow (! (cell < cell), ExcInternalError());
}
FE_Q<dim> fe (1);
{
const typename DoFHandler<dim>::active_cell_iterator
cell = dof_handler.begin_active();
- Assert (cell == cell, ExcInternalError());
- Assert (! (cell != cell), ExcInternalError());
- Assert (! (cell < cell), ExcInternalError());
+ AssertThrow (cell == cell, ExcInternalError());
+ AssertThrow (! (cell != cell), ExcInternalError());
+ AssertThrow (! (cell < cell), ExcInternalError());
}
{
const typename DoFHandler<dim>::cell_iterator
cell = dof_handler.begin();
- Assert (cell == cell, ExcInternalError());
- Assert (! (cell != cell), ExcInternalError());
- Assert (! (cell < cell), ExcInternalError());
+ AssertThrow (cell == cell, ExcInternalError());
+ AssertThrow (! (cell != cell), ExcInternalError());
+ AssertThrow (! (cell < cell), ExcInternalError());
}
// finally check that two iterators
// ---------------------------------------------------------------------
//
-// Copyright (C) 2002 - 2014 by the deal.II authors
+// Copyright (C) 2002 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
if (fixed_dofs[i] == true)
{
- Assert (dirichlet_dofs[i] == 0, ExcInternalError());
+ AssertThrow (dirichlet_dofs[i] == 0, ExcInternalError());
}
else
{
- Assert (dirichlet_dofs[i] == 1, ExcInternalError());
+ AssertThrow (dirichlet_dofs[i] == 1, ExcInternalError());
};
};
// ---------------------------------------------------------------------
//
-// Copyright (C) 2002 - 2014 by the deal.II authors
+// Copyright (C) 2002 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// nedelec boundary DoF i has
// wrongly been set to some
// value
- Assert ((p_boundary_dofs[i] && boundary_values[i] == 1.)
- ||
- (!(p_boundary_dofs[i]) && boundary_values[i] != 1.),
- ExcInternalError());
+ AssertThrow ((p_boundary_dofs[i] && boundary_values[i] == 1.)
+ ||
+ (!(p_boundary_dofs[i]) && boundary_values[i] != 1.),
+ ExcInternalError());
deallog << boundary_values[i] << ' ';
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2002 - 2014 by the deal.II authors
+// Copyright (C) 2002 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
B.reinit (sparsity_pattern);
// check some sizes
- Assert (B.m() == B.block(0,0).m() + B.block(1,1).m(),
- ExcInternalError());
- Assert (B.n() == B.block(0,0).n() + B.block(1,1).n(),
- ExcInternalError());
- Assert (B.n_block_rows() == 2, ExcInternalError());
- Assert (B.n_block_cols() == 2, ExcInternalError());
+ AssertThrow (B.m() == B.block(0,0).m() + B.block(1,1).m(),
+ ExcInternalError());
+ AssertThrow (B.n() == B.block(0,0).n() + B.block(1,1).n(),
+ ExcInternalError());
+ AssertThrow (B.n_block_rows() == 2, ExcInternalError());
+ AssertThrow (B.n_block_cols() == 2, ExcInternalError());
// then clear, and check again
B.clear ();
- Assert (B.m() == 0, ExcInternalError());
- Assert (B.n() == 0, ExcInternalError());
- Assert (B.n_block_rows() == 0, ExcInternalError());
- Assert (B.n_block_cols() == 0, ExcInternalError());
+ AssertThrow (B.m() == 0, ExcInternalError());
+ AssertThrow (B.n() == 0, ExcInternalError());
+ AssertThrow (B.n_block_rows() == 0, ExcInternalError());
+ AssertThrow (B.n_block_cols() == 0, ExcInternalError());
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
BlockSparseMatrix<double>::const_iterator it2 = m.end();
// make sure that the two of them match
- Assert (it == it2, ExcInternalError());
+ AssertThrow (it == it2, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// iterator
{
BlockVector<double>::const_iterator i=v.begin();
- Assert (*i == 1, ExcInternalError());
+ AssertThrow (*i == 1, ExcInternalError());
++i;
- Assert (*i == 2, ExcInternalError());
+ AssertThrow (*i == 2, ExcInternalError());
}
// same, but create iterator in a different
{
BlockVector<double>::const_iterator
i=const_cast<const BlockVector<double>&>(v).begin();
- Assert (*i == 1, ExcInternalError());
+ AssertThrow (*i == 1, ExcInternalError());
++i;
- Assert (*i == 2, ExcInternalError());
+ AssertThrow (*i == 2, ExcInternalError());
}
// read through a read-write iterator
{
BlockVector<double>::iterator i = v.begin();
- Assert (*i == 1, ExcInternalError());
+ AssertThrow (*i == 1, ExcInternalError());
++i;
- Assert (*i == 2, ExcInternalError());
+ AssertThrow (*i == 2, ExcInternalError());
}
// write through a read-write iterator
// and read again
{
BlockVector<double>::iterator i = v.begin();
- Assert (*i == 2, ExcInternalError());
+ AssertThrow (*i == 2, ExcInternalError());
++i;
- Assert (*i == 3, ExcInternalError());
+ AssertThrow (*i == 3, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// iterator
{
BlockVector<double>::const_iterator i=v.begin();
- Assert (i[0] == 1, ExcInternalError());
- Assert (i[1] == 2, ExcInternalError());
+ AssertThrow (i[0] == 1, ExcInternalError());
+ AssertThrow (i[1] == 2, ExcInternalError());
}
// same, but create iterator in a different
{
BlockVector<double>::const_iterator
i=const_cast<const BlockVector<double>&>(v).begin();
- Assert (i[0] == 1, ExcInternalError());
- Assert (i[1] == 2, ExcInternalError());
+ AssertThrow (i[0] == 1, ExcInternalError());
+ AssertThrow (i[1] == 2, ExcInternalError());
}
// read through a read-write iterator
{
BlockVector<double>::iterator i = v.begin();
- Assert (i[0] == 1, ExcInternalError());
- Assert (i[1] == 2, ExcInternalError());
+ AssertThrow (i[0] == 1, ExcInternalError());
+ AssertThrow (i[1] == 2, ExcInternalError());
}
// write through a read-write iterator
// and read again
{
BlockVector<double>::iterator i = v.begin();
- Assert (i[0] == 2, ExcInternalError());
- Assert (i[1] == 3, ExcInternalError());
+ AssertThrow (i[0] == 2, ExcInternalError());
+ AssertThrow (i[1] == 3, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v(i) = i+1.;
Vector<float> w(v);
- Assert (w==v, ExcInternalError());
+ AssertThrow (w==v, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == 2*(i*j*.5+.5), ExcInternalError());
- Assert (m.el(i,j) == 2*(i*j*.5+.5), ExcInternalError());
+ AssertThrow (m(i,j) == 2*(i*j*.5+.5), ExcInternalError());
+ AssertThrow (m.el(i,j) == 2*(i*j*.5+.5), ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == 2*(i*j*.5+.5), ExcInternalError());
- Assert (m.el(i,j) == 2*(i*j*.5+.5), ExcInternalError());
+ AssertThrow (m(i,j) == 2*(i*j*.5+.5), ExcInternalError());
+ AssertThrow (m.el(i,j) == 2*(i*j*.5+.5), ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
ChunkSparseMatrix<double> m(sp);
- Assert (m.m() == 5, ExcInternalError());
- Assert (m.n() == 5, ExcInternalError());
+ AssertThrow (m.m() == 5, ExcInternalError());
+ AssertThrow (m.n() == 5, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
deallog << m.n_nonzero_elements() << std::endl;
if (chunk_size == 1)
- Assert (m.n_nonzero_elements() == counter,
- ExcInternalError())
- else
+ {
+ Assert (m.n_nonzero_elements() == counter,
+ ExcInternalError());
+ }
+ else
+ {
Assert (m.n_nonzero_elements() >= counter,
ExcInternalError());
+ }
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
deallog << m.n_nonzero_elements() << std::endl;
if (chunk_size == 1)
- Assert (m.n_nonzero_elements() == counter,
- ExcInternalError())
- else
- Assert (m.n_nonzero_elements() >= counter,
- ExcInternalError());
+ {
+ AssertThrow (m.n_nonzero_elements() == counter,
+ ExcInternalError());
+ }
+ else
+ {
+ AssertThrow (m.n_nonzero_elements() >= counter,
+ ExcInternalError());
+ }
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
- Assert (m.el(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
+ AssertThrow (m(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
+ AssertThrow (m.el(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
- Assert (m.el(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
+ AssertThrow (m(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
+ AssertThrow (m.el(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
||
(i->row()==i->column()))
{
- Assert (std::fabs(i->value() - i->row()*i->column()) < 1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs(i->value() - i->row()*i->column()) < 1e-14,
+ ExcInternalError());
}
else
- Assert (i->value() == 0, ExcInternalError());
+ AssertThrow (i->value() == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
||
(i->row()==i->column()))
{
- Assert (std::fabs(i->value() - i->row()*i->column()) < 1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs(i->value() - i->row()*i->column()) < 1e-14,
+ ExcInternalError());
}
else
- Assert (i->value() == 0, ExcInternalError());
+ AssertThrow (i->value() == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
ChunkSparseMatrix<double>::iterator k = A.begin(),
j = ++A.begin();
- Assert (k < j, ExcInternalError());
- Assert (j > k, ExcInternalError());
+ AssertThrow (k < j, ExcInternalError());
+ AssertThrow (j > k, ExcInternalError());
- Assert (!(j < k), ExcInternalError());
- Assert (!(k > j), ExcInternalError());
+ AssertThrow (!(j < k), ExcInternalError());
+ AssertThrow (!(k > j), ExcInternalError());
- Assert (k != j, ExcInternalError());
- Assert (!(k == j), ExcInternalError());
+ AssertThrow (k != j, ExcInternalError());
+ AssertThrow (!(k == j), ExcInternalError());
- Assert (k == k, ExcInternalError());
- Assert (!(k != k), ExcInternalError());
+ AssertThrow (k == k, ExcInternalError());
+ AssertThrow (!(k != k), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
ChunkSparseMatrix<double>::const_iterator k = A.begin(),
j = ++A.begin();
- Assert (k < j, ExcInternalError());
- Assert (j > k, ExcInternalError());
+ AssertThrow (k < j, ExcInternalError());
+ AssertThrow (j > k, ExcInternalError());
- Assert (!(j < k), ExcInternalError());
- Assert (!(k > j), ExcInternalError());
+ AssertThrow (!(j < k), ExcInternalError());
+ AssertThrow (!(k > j), ExcInternalError());
- Assert (k != j, ExcInternalError());
- Assert (!(k == j), ExcInternalError());
+ AssertThrow (k != j, ExcInternalError());
+ AssertThrow (!(k == j), ExcInternalError());
- Assert (k == k, ExcInternalError());
- Assert (!(k != k), ExcInternalError());
+ AssertThrow (k == k, ExcInternalError());
+ AssertThrow (!(k != k), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
ChunkSparseMatrix<double> m(sp);
for (unsigned int row=0; row<sp.n_rows(); ++row)
- Assert (m.begin(row)-m.begin(row) == 0,
- ExcInternalError());
+ AssertThrow (m.begin(row)-m.begin(row) == 0,
+ ExcInternalError());
for (unsigned int row=0; row<sp.n_rows(); ++row)
- Assert (m.end(row)-m.begin(row) == (int)sp.row_length(row),
- ExcInternalError());
+ AssertThrow (m.end(row)-m.begin(row) == (int)sp.row_length(row),
+ ExcInternalError());
for (unsigned int row=0; row<sp.n_rows(); ++row)
- Assert (m.begin(row)-m.end(row) == -(int)sp.row_length(row),
- ExcInternalError());
+ AssertThrow (m.begin(row)-m.end(row) == -(int)sp.row_length(row),
+ ExcInternalError());
{
unsigned int counter = 0;
for (unsigned int row=0; row<sp.n_rows(); ++row)
{
- Assert (m.begin(row)-m.begin(0) == (int)counter,
- ExcInternalError());
- Assert (m.begin(0)-m.begin(row) == -(int)counter,
- ExcInternalError());
+ AssertThrow (m.begin(row)-m.begin(0) == (int)counter,
+ ExcInternalError());
+ AssertThrow (m.begin(0)-m.begin(row) == -(int)counter,
+ ExcInternalError());
counter += sp.row_length(row);
}
}
- Assert (m.begin() - m.begin(0) == 0, ExcInternalError());
- Assert (m.begin(0) - m.begin() == 0, ExcInternalError());
- Assert (m.end(sp.n_rows()-1) - m.end() == 0, ExcInternalError());
- Assert (m.end() - m.end(sp.n_rows()-1) == 0, ExcInternalError());
- Assert (m.end() - m.begin() == (int)sp.n_nonzero_elements(),
- ExcInternalError());
- Assert (m.begin() - m.end() == -(int)sp.n_nonzero_elements(),
- ExcInternalError());
+ AssertThrow (m.begin() - m.begin(0) == 0, ExcInternalError());
+ AssertThrow (m.begin(0) - m.begin() == 0, ExcInternalError());
+ AssertThrow (m.end(sp.n_rows()-1) - m.end() == 0, ExcInternalError());
+ AssertThrow (m.end() - m.end(sp.n_rows()-1) == 0, ExcInternalError());
+ AssertThrow (m.end() - m.begin() == (int)sp.n_nonzero_elements(),
+ ExcInternalError());
+ AssertThrow (m.begin() - m.end() == -(int)sp.n_nonzero_elements(),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == i+result, ExcInternalError());
+ AssertThrow (w(i) == i+result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == i+result, ExcInternalError());
+ AssertThrow (w(i) == i+result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
- Assert (w(i) == i+1, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i+1, ExcInternalError());
}
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*j*(i+1);
- Assert (s == result, ExcInternalError());
+ AssertThrow (s == result, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int i=0; i<m.m(); ++i)
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*j*i;
- Assert (s == result, ExcInternalError());
+ AssertThrow (s == result, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
- Assert (w(i) == i+1, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i+1, ExcInternalError());
double result = i+1;
for (unsigned int j=0; j<m.n(); ++j)
result -= (i+2*j)*j;
- Assert (x(i) == result, ExcInternalError());
+ AssertThrow (x(i) == result, ExcInternalError());
}
- Assert (std::fabs((s - x.l2_norm())/s) < 1e-14, ExcInternalError());
+ AssertThrow (std::fabs((s - x.l2_norm())/s) < 1e-14, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
- ||
- ((pattern[i] == false) && (v(i) == std::complex<double> (0)))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double> (0)))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
- ||
- ((pattern[i] == false) && (v(i) == std::complex<double> (0)))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double> (0)))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
- ||
- ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
- ExcInternalError());
+ AssertThrow (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert (((pattern[i] == true) && (v(i) == 2.*std::complex<double> (i+1., i+2.)))
- ||
- ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
- ExcInternalError());
+ AssertThrow (((pattern[i] == true) && (v(i) == 2.*std::complex<double> (i+1., i+2.)))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
- ||
- ((pattern[i] == false) && (v(i) == std::complex<double> (0))),
- ExcInternalError());
+ AssertThrow (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double> (0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress ();
// then check the norm
- Assert (v.l1_norm() == norm, ExcInternalError());
+ AssertThrow (v.l1_norm() == norm, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress ();
// then check the norm
- Assert (std::fabs((v.l2_norm() - std::sqrt(norm))/std::sqrt(norm)) < 1e-14, ExcInternalError());
+ AssertThrow (std::fabs((v.l2_norm() - std::sqrt(norm))/std::sqrt(norm)) < 1e-14, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress ();
// then check the norm
- Assert (v.linfty_norm() == norm, ExcInternalError());
+ AssertThrow (v.linfty_norm() == norm, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that the entries are ok
for (unsigned int i=0; i<v.size(); ++i)
- Assert (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)*5./4.))
- ||
- ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
- ExcInternalError());
+ AssertThrow (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)*5./4.))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that the entries are ok
for (unsigned int i=0; i<v.size(); ++i)
- Assert (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)*3./4.))
- ||
- ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
- ExcInternalError());
+ AssertThrow (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)*3./4.))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that the entries are ok
for (unsigned int i=0; i<v.size(); ++i)
- Assert (((pattern[i] == true) && (v(i)-(-1.*i*std::complex<double> (i+1., i+2.)*3./4.) == std::complex<double>(0)))
- ||
- ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
- ExcInternalError());
+ AssertThrow (((pattern[i] == true) && (v(i)-(-1.*i*std::complex<double> (i+1., i+2.)*3./4.) == std::complex<double>(0)))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w.compress ();
// make sure the scalar product is zero
- Assert (v*w == std::complex<double>(0), ExcInternalError());
+ AssertThrow (v*w == std::complex<double>(0), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
deallog << v *w << ' ' << w *v << ' '
<< product << ' ' << std::conj(product) << std::endl;
- Assert (v*w == product, ExcInternalError());
+ AssertThrow (v*w == product, ExcInternalError());
// also make sure that v*w=conj(w*v)
- Assert (w*v == std::conj(product), ExcInternalError());
+ AssertThrow (w*v == std::conj(product), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// vector is really empty
const unsigned int sz = v.size();
v = 0;
- Assert (v.size() == sz, ExcInternalError());
- Assert (v.l2_norm() == 0, ExcInternalError());
+ AssertThrow (v.size() == sz, ExcInternalError());
+ AssertThrow (v.l2_norm() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
const unsigned int sz = v.size();
v = 2;
- Assert (v.size() == sz, ExcInternalError());
- Assert (v.l2_norm() == std::sqrt(4.*sz), ExcInternalError());
+ AssertThrow (v.size() == sz, ExcInternalError());
+ AssertThrow (v.l2_norm() == std::sqrt(4.*sz), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// then resize with setting to zero
v.reinit (13, false);
- Assert (v.size() == 13, ExcInternalError());
- Assert (v.l2_norm() == 0, ExcInternalError());
+ AssertThrow (v.size() == 13, ExcInternalError());
+ AssertThrow (v.l2_norm() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress ();
// then check the norm
- Assert (std::abs(v.norm_sqr() - norm) < 1e-14*std::abs(norm),
- ExcInternalError());
+ AssertThrow (std::abs(v.norm_sqr() - norm) < 1e-14*std::abs(norm),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress ();
// then check the norm
- Assert (std::abs(v.mean_value() - sum/(1.*v.size())) <
- 1e-14*std::abs(sum)/v.size(),
- ExcInternalError());
+ AssertThrow (std::abs(v.mean_value() - sum/(1.*v.size())) <
+ 1e-14*std::abs(sum)/v.size(),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress ();
// then check the norm
- Assert (std::abs(v.lp_norm(3) - std::pow(sum, 1./3.)) <
- 1e-14*std::abs(std::pow(sum, 1./3.)),
- ExcInternalError());
+ AssertThrow (std::abs(v.lp_norm(3) - std::pow(sum, 1./3.)) <
+ 1e-14*std::abs(std::pow(sum, 1./3.)),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v = 0;
// then check all_zero
- Assert (v.all_zero() == true, ExcInternalError());
+ AssertThrow (v.all_zero() == true, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
if (i%3 == 0)
{
- Assert (w(i) == std::complex<double> (i+1., i+2.),
- ExcInternalError());
- Assert (v(i) == std::complex<double> (i+1., i+2.)+1.*i,
- ExcInternalError());
+ AssertThrow (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ AssertThrow (v(i) == std::complex<double> (i+1., i+2.)+1.*i,
+ ExcInternalError());
}
else
{
- Assert (w(i) == 0., ExcInternalError());
- Assert (v(i) == 1.*i, ExcInternalError());
+ AssertThrow (w(i) == 0., ExcInternalError());
+ AssertThrow (v(i) == 1.*i, ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
if (i%3 == 0)
{
- Assert (w(i) == std::complex<double> (i+1., i+2.),
- ExcInternalError());
- Assert (v(i) == std::complex<double> (-1., -(i+2.)),
- ExcInternalError());
+ AssertThrow (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ AssertThrow (v(i) == std::complex<double> (-1., -(i+2.)),
+ ExcInternalError());
}
else
{
- Assert (w(i) == 0., ExcInternalError());
- Assert (v(i) == 1.*i, ExcInternalError());
+ AssertThrow (w(i) == 0., ExcInternalError());
+ AssertThrow (v(i) == 1.*i, ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
- Assert (v(i) == std::complex<double> (i+2., i+2.),
- ExcInternalError());
+ AssertThrow (v(i) == std::complex<double> (i+2., i+2.),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == std::complex<double> (i+1., i+2.),
- ExcInternalError());
- Assert (v(i) == 1.*i+std::complex<double> (i+1., i+2.),
- ExcInternalError());
+ AssertThrow (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ AssertThrow (v(i) == 1.*i+std::complex<double> (i+1., i+2.),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == std::complex<double> (i+1., i+2.),
- ExcInternalError());
- Assert (v(i) == 1.*i+2.*std::complex<double> (i+1., i+2.),
- ExcInternalError());
+ AssertThrow (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ AssertThrow (v(i) == 1.*i+2.*std::complex<double> (i+1., i+2.),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == std::complex<double> (i+1., i+2.), ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (v(i) == 1.*i+2.*std::complex<double> (i+1., i+2.)+3*(i+2.),
- ExcInternalError());
+ AssertThrow (w(i) == std::complex<double> (i+1., i+2.), ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (v(i) == 1.*i+2.*std::complex<double> (i+1., i+2.)+3*(i+2.),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == std::complex<double> (i+1., i+2.),
- ExcInternalError());
- Assert (v(i) == 2.*i+std::complex<double> (i+1., i+2.),
- ExcInternalError());
+ AssertThrow (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ AssertThrow (v(i) == 2.*i+std::complex<double> (i+1., i+2.),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == std::complex<double> (i+1., i+2.),
- ExcInternalError());
- Assert (v(i) == 3.*i+2.*std::complex<double> (i+1., i+2.),
- ExcInternalError());
+ AssertThrow (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ AssertThrow (v(i) == 3.*i+2.*std::complex<double> (i+1., i+2.),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == std::complex<double> (i+1., i+2.), ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (v(i) == 1.5*i+2.*std::complex<double> (i+1., i+2.)+3*(i+2.),
- ExcInternalError());
+ AssertThrow (w(i) == std::complex<double> (i+1., i+2.), ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (v(i) == 1.5*i+2.*std::complex<double> (i+1., i+2.)+3*(i+2.),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == std::complex<double> (i+1., i+2.),
- ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (y(i) == std::complex<double> (i+3., i+4.),
- ExcInternalError());
- Assert (v(i) ==
- 1.5*i+2.*std::complex<double> (i+1., i+2.)+
- 3.*(i+2.)+4.*std::complex<double> (i+3., i+4.),
- ExcInternalError());
+ AssertThrow (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (y(i) == std::complex<double> (i+3., i+4.),
+ ExcInternalError());
+ AssertThrow (v(i) ==
+ 1.5*i+2.*std::complex<double> (i+1., i+2.)+
+ 3.*(i+2.)+4.*std::complex<double> (i+3., i+4.),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == std::complex<double> (i+1., i+2.), ExcInternalError());
- Assert (v(i) == 1.*i*std::complex<double> (i+1., i+2.), ExcInternalError());
+ AssertThrow (w(i) == std::complex<double> (i+1., i+2.), ExcInternalError());
+ AssertThrow (v(i) == 1.*i*std::complex<double> (i+1., i+2.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == std::complex<double> (i+1., i+2.),
- ExcInternalError());
- Assert (v(i) == 2.*std::complex<double> (i+1., i+2.),
- ExcInternalError());
+ AssertThrow (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ AssertThrow (v(i) == 2.*std::complex<double> (i+1., i+2.),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == std::complex<double> (i+1., i+2.),
- ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (v(i) == 2.*std::complex<double> (i+1., i+2.)+3.*(i+2.),
- ExcInternalError());
+ AssertThrow (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (v(i) == 2.*std::complex<double> (i+1., i+2.)+3.*(i+2.),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == std::complex<double> (i+2., i+3.),
- ExcInternalError());
- Assert (x(i) == std::complex<double> (i+3., i+4.),
- ExcInternalError());
- Assert (std::abs(v(i) -
- std::complex<double> (i+2., i+3.) /
- std::complex<double> (i+3., i+4.)) < 1e-14*std::abs(v(i)),
- ExcInternalError());
+ AssertThrow (w(i) == std::complex<double> (i+2., i+3.),
+ ExcInternalError());
+ AssertThrow (x(i) == std::complex<double> (i+3., i+4.),
+ ExcInternalError());
+ AssertThrow (std::abs(v(i) -
+ std::complex<double> (i+2., i+3.) /
+ std::complex<double> (i+3., i+4.)) < 1e-14*std::abs(v(i)),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w(i) = std::complex<double> (i+1., i+2.);
}
- Assert (!(v==w), ExcInternalError());
+ AssertThrow (!(v==w), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// but then copy elements and make sure the
// vectors are actually equal
v = w;
- Assert (v==w, ExcInternalError());
+ AssertThrow (v==w, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w(i) = std::complex<double> (i+1., i+2.);
}
- Assert (v.operator != (w), ExcInternalError());
+ AssertThrow (v.operator != (w), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// but then copy elements and make sure the
// vectors are actually equal
v = w;
- Assert (! (v.operator != (w)), ExcInternalError());
+ AssertThrow (! (v.operator != (w)), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w(i) = std::complex<double> (i+1., i+2.);
}
- Assert (!(v==w), ExcInternalError());
- Assert (!(w==v), ExcInternalError());
+ AssertThrow (!(v==w), ExcInternalError());
+ AssertThrow (!(w==v), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// but then copy elements and make sure the
// vectors are actually equal
v = w;
- Assert (v==w, ExcInternalError());
- Assert (w==v, ExcInternalError());
+ AssertThrow (v==w, ExcInternalError());
+ AssertThrow (w==v, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w(i) = std::complex<double> (i+1., i+2.);
}
- Assert (v!=w, ExcInternalError());
- Assert (w!=v, ExcInternalError());
+ AssertThrow (v!=w, ExcInternalError());
+ AssertThrow (w!=v, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// but then copy elements and make sure the
// vectors are actually equal
v = w;
- Assert (! (v!=w), ExcInternalError());
- Assert (! (w!=v), ExcInternalError());
+ AssertThrow (! (v!=w), ExcInternalError());
+ AssertThrow (! (w!=v), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v(i) = std::complex<double> (i+1., i+2.);
Vector<std::complex<float> > w(v);
- Assert (w==v, ExcInternalError());
+ AssertThrow (w==v, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
const unsigned int N = 1000;
CompressedSetSparsityPattern csp;
- Assert (csp.empty() == true, ExcInternalError());
+ AssertThrow (csp.empty() == true, ExcInternalError());
csp.reinit (N, N);
- Assert (csp.empty() == false, ExcInternalError());
+ AssertThrow (csp.empty() == false, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
const unsigned int N = 1000;
CompressedSparsityPattern csp;
- Assert (csp.empty() == true, ExcInternalError());
+ AssertThrow (csp.empty() == true, ExcInternalError());
csp.reinit (N, N);
- Assert (csp.empty() == false, ExcInternalError());
+ AssertThrow (csp.empty() == false, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// finally make sure that we have
// read everything back in
// correctly
- Assert (data_out.get_dataset_names() == reader.get_dataset_names(),
- ExcInternalError());
+ AssertThrow (data_out.get_dataset_names() == reader.get_dataset_names(),
+ ExcInternalError());
- Assert (data_out.get_patches().size() == reader.get_patches().size(),
- ExcInternalError());
+ AssertThrow (data_out.get_patches().size() == reader.get_patches().size(),
+ ExcInternalError());
for (unsigned int i=0; i<reader.get_patches().size(); ++i)
- Assert (data_out.get_patches()[i] == reader.get_patches()[i],
- ExcInternalError());
+ AssertThrow (data_out.get_patches()[i] == reader.get_patches()[i],
+ ExcInternalError());
// for good measure, delete tmp file
remove ("data_out_03.tmp");
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// finally make sure that we have
// read everything back in
// correctly
- Assert (data_out.get_dataset_names() == reader.get_dataset_names(),
- ExcInternalError());
+ AssertThrow (data_out.get_dataset_names() == reader.get_dataset_names(),
+ ExcInternalError());
- Assert (data_out.get_patches().size() == reader.get_patches().size(),
- ExcInternalError());
+ AssertThrow (data_out.get_patches().size() == reader.get_patches().size(),
+ ExcInternalError());
for (unsigned int i=0; i<reader.get_patches().size(); ++i)
- Assert (data_out.get_patches()[i] == reader.get_patches()[i],
- ExcInternalError());
+ AssertThrow (data_out.get_patches()[i] == reader.get_patches()[i],
+ ExcInternalError());
// for good measure, delete tmp file
remove ("data_out_faces_03.tmp");
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// finally make sure that we have
// read everything back in
// correctly
- Assert (data_out.get_dataset_names() == reader.get_dataset_names(),
- ExcInternalError());
+ AssertThrow (data_out.get_dataset_names() == reader.get_dataset_names(),
+ ExcInternalError());
- Assert (data_out.get_patches().size() == reader.get_patches().size(),
- ExcInternalError());
+ AssertThrow (data_out.get_patches().size() == reader.get_patches().size(),
+ ExcInternalError());
for (unsigned int i=0; i<reader.get_patches().size(); ++i)
- Assert (data_out.get_patches()[i] == reader.get_patches()[i],
- ExcInternalError());
+ AssertThrow (data_out.get_patches()[i] == reader.get_patches()[i],
+ ExcInternalError());
deallog << data_out.get_vector_data_ranges().size()
<< std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// finally make sure that we have
// read everything back in
// correctly
- Assert (data_out.get_dataset_names() == reader.get_dataset_names(),
- ExcInternalError());
+ AssertThrow (data_out.get_dataset_names() == reader.get_dataset_names(),
+ ExcInternalError());
- Assert (data_out.get_patches().size() == reader.get_patches().size(),
- ExcInternalError());
+ AssertThrow (data_out.get_patches().size() == reader.get_patches().size(),
+ ExcInternalError());
for (unsigned int i=0; i<reader.get_patches().size(); ++i)
- Assert (data_out.get_patches()[i] == reader.get_patches()[i],
- ExcInternalError());
+ AssertThrow (data_out.get_patches()[i] == reader.get_patches()[i],
+ ExcInternalError());
// for good measure, delete tmp file
remove ("data_out_rotation_03.tmp");
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// finally make sure that we have
// read everything back in
// correctly
- Assert (data_out.get_dataset_names() == reader.get_dataset_names(),
- ExcInternalError());
+ AssertThrow (data_out.get_dataset_names() == reader.get_dataset_names(),
+ ExcInternalError());
- Assert (data_out.get_patches().size() == reader.get_patches().size(),
- ExcInternalError());
+ AssertThrow (data_out.get_patches().size() == reader.get_patches().size(),
+ ExcInternalError());
for (unsigned int i=0; i<reader.get_patches().size(); ++i)
- Assert (data_out.get_patches()[i] == reader.get_patches()[i],
- ExcInternalError());
+ AssertThrow (data_out.get_patches()[i] == reader.get_patches()[i],
+ ExcInternalError());
deallog << data_out.get_vector_data_ranges().size()
<< std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// constrained rows are zero
for (unsigned int i=0; i<b.size(); ++i)
if (constraints.is_constrained(i))
- Assert (b(i) == 0, ExcInternalError());
+ AssertThrow (b(i) == 0, ExcInternalError());
}
// constrained rows are zero, and that all
// the other elements are unchanged
for (unsigned int i=0; i<b.size(); ++i)
- if (constraints.is_constrained(i))
- Assert (b(i) == 0, ExcInternalError())
+ {
+ if (constraints.is_constrained(i))
+ {
+ AssertThrow (b(i) == 0, ExcInternalError());
+ }
else
- Assert (std::fabs(b(i) - (1.+1.*i*i)/3) < 1e-14*std::fabs(b(i)),
- ExcInternalError());
+ {
+ AssertThrow (std::fabs(b(i) - (1.+1.*i*i)/3) < 1e-14*std::fabs(b(i)),
+ ExcInternalError());
+ }
+ }
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// constrained rows are zero, and that all
// the other elements are unchanged
for (unsigned int i=0; i<b.size(); ++i)
- if (constraints.is_constrained(i))
- Assert (b(i) == 0, ExcInternalError())
+ {
+ if (constraints.is_constrained(i))
+ {
+ AssertThrow (b(i) == 0, ExcInternalError());
+ }
else
- Assert (std::fabs(b(i) - (1.+1.*i*i)/3) < 1e-14*std::fabs(b(i)),
- ExcInternalError());
+ {
+ AssertThrow (std::fabs(b(i) - (1.+1.*i*i)/3) < 1e-14*std::fabs(b(i)),
+ ExcInternalError());
+ }
+ }
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// constrained rows are zero
for (unsigned int i=0; i<b.size(); ++i)
if (constraints.is_constrained(i))
- Assert (b(i) == 0, ExcInternalError());
+ AssertThrow (b(i) == 0, ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// set
for (unsigned int i=0; i<dof_data.size(); ++i)
if (component_dofs[i] == false)
- Assert (dof_data(i) == 0,
- ExcInternalError());
+ AssertThrow (dof_data(i) == 0,
+ ExcInternalError());
// distribute to last component. by
// set
for (unsigned int i=0; i<dof_data.size(); ++i)
if (component_dofs[i] == false)
- Assert (dof_data(i) == 0,
- ExcInternalError());
+ AssertThrow (dof_data(i) == 0,
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
if (cell->center()(d) > 0)
subdomain |= (1<<d);
- Assert (subdomain < (1<<dim), ExcInternalError());
+ AssertThrow (subdomain < (1<<dim), ExcInternalError());
cell->set_subdomain_id (subdomain);
}
// now compare the results of the two
// computations
- Assert (error1 == error2, ExcInternalError());
+ AssertThrow (error1 == error2, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
if (cell->center()(d) > 0)
material |= (1<<d);
- Assert (material < (1<<dim), ExcInternalError());
+ AssertThrow (material < (1<<dim), ExcInternalError());
cell->set_material_id (material);
}
{
deallog << i << ' ' << this_error(i) << std::endl;
- Assert ((this_error(i)==0) || (error2(i)==0),
- ExcInternalError());
+ AssertThrow ((this_error(i)==0) || (error2(i)==0),
+ ExcInternalError());
if (this_error(i) != 0)
error2(i) = this_error(i);
}
// now compare the results of the two
// computations
- Assert (error1 == error2, ExcInternalError());
+ AssertThrow (error1 == error2, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
<< std::endl;
if (q<=p-order_difference)
- Assert (error.l2_norm() <= 1e-10*projection.l2_norm(),
- ExcFailedProjection(error.l2_norm() / projection.l2_norm()));
+ AssertThrow (error.l2_norm() <= 1e-10*projection.l2_norm(),
+ ExcFailedProjection(error.l2_norm() / projection.l2_norm()));
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
<< std::endl;
if (q<=p-order_difference)
- Assert (error.l2_norm() <= 1e-10*projection.l2_norm(),
- ExcFailedProjection(error.l2_norm() / projection.l2_norm()));
+ AssertThrow (error.l2_norm() <= 1e-10*projection.l2_norm(),
+ ExcFailedProjection(error.l2_norm() / projection.l2_norm()));
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
<< std::endl;
if (q<=p-order_difference)
- Assert (error.l2_norm() <= 1e-10*projection.l2_norm(),
- ExcFailedProjection(error.l2_norm() / projection.l2_norm()));
+ AssertThrow (error.l2_norm() <= 1e-10*projection.l2_norm(),
+ ExcFailedProjection(error.l2_norm() / projection.l2_norm()));
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
fe_function.value_list (points, m);
for (unsigned int i=0; i<m.size(); ++i)
- Assert (std::fabs(m[i] - points[i].square())
- <
- 1e-10 * std::fabs(m[i] + points[i].square()),
- ExcInternalError());
+ AssertThrow (std::fabs(m[i] - points[i].square())
+ <
+ 1e-10 * std::fabs(m[i] + points[i].square()),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
fe_function.value_list (points, m);
for (unsigned int i=0; i<m.size(); ++i)
- Assert (std::fabs(m[i] - points[i].square())
- <
- 1e-10 * std::fabs(m[i] + points[i].square()),
- ExcInternalError());
+ AssertThrow (std::fabs(m[i] - points[i].square())
+ <
+ 1e-10 * std::fabs(m[i] + points[i].square()),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
fe_function.vector_value (point, m);
{
- Assert (std::fabs(m(0) - point.square())
- <
- 1e-10 * std::fabs(m(0) + point.square()),
- ExcInternalError());
-
- Assert (std::fabs(m(1))
- <
- 1e-10,
- ExcInternalError());
+ AssertThrow (std::fabs(m(0) - point.square())
+ <
+ 1e-10 * std::fabs(m(0) + point.square()),
+ ExcInternalError());
+
+ AssertThrow (std::fabs(m(1))
+ <
+ 1e-10,
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
std::vector<Tensor<1,dim> > m(2);
fe_function.vector_gradient (point, m);
- Assert (std::fabs(m[0][0] - 1)
- <
- 1e-10 * std::fabs(m[0][0] + 1),
- ExcInternalError());
- Assert (std::fabs(m[0][1])
- <
- 1e-10,
- ExcInternalError());
- Assert (m[1].norm()
- <
- 1e-10,
- ExcInternalError());
+ AssertThrow (std::fabs(m[0][0] - 1)
+ <
+ 1e-10 * std::fabs(m[0][0] + 1),
+ ExcInternalError());
+ AssertThrow (std::fabs(m[0][1])
+ <
+ 1e-10,
+ ExcInternalError());
+ AssertThrow (m[1].norm()
+ <
+ 1e-10,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
fe_function.vector_laplacian (point, m);
{
- Assert (std::fabs(m(0) - point.square()*4*3)
- <
- 1e-8 * std::fabs(m(0) + point.square()*4*3),
- ExcInternalError());
-
- Assert (std::fabs(m(1))
- <
- 1e-10,
- ExcInternalError());
+ AssertThrow (std::fabs(m(0) - point.square()*4*3)
+ <
+ 1e-8 * std::fabs(m(0) + point.square()*4*3),
+ ExcInternalError());
+
+ AssertThrow (std::fabs(m(1))
+ <
+ 1e-10,
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// two FEs are actually the same
deallog << fe1.get_name();
p1 = FETools::get_fe_from_name<dim> (fe1.get_name());
- Assert (fe1.get_name() == p1->get_name(),
- ExcInternalError());
+ AssertThrow (fe1.get_name() == p1->get_name(),
+ ExcInternalError());
deallog << " ok" << std::endl;
delete p1;
// same for fe2
deallog << fe2.get_name();
p2 = FETools::get_fe_from_name<dim> (fe2.get_name());
- Assert (fe2.get_name() == p2->get_name(),
- ExcInternalError());
+ AssertThrow (fe2.get_name() == p2->get_name(),
+ ExcInternalError());
deallog << " ok" << std::endl;
delete p2;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// two FEs are actually the same
deallog << modify_name<dim> (fe1.get_name());
p1 = FETools::get_fe_from_name<dim> (modify_name<dim> (fe1.get_name()));
- Assert (fe1.get_name() == p1->get_name(),
- ExcInternalError());
+ AssertThrow (fe1.get_name() == p1->get_name(),
+ ExcInternalError());
deallog << " ok" << std::endl;
delete p1;
// same for fe2
deallog << modify_name<dim> (fe2.get_name());
p2 = FETools::get_fe_from_name<dim> (modify_name<dim> (fe2.get_name()));
- Assert (fe2.get_name() == p2->get_name(),
- ExcInternalError());
+ AssertThrow (fe2.get_name() == p2->get_name(),
+ ExcInternalError());
deallog << " ok" << std::endl;
delete p2;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// two FEs are actually the same
deallog << modify_name<dim> (fe1.get_name());
p1 = FETools::get_fe_from_name<dim> (modify_name<dim> (fe1.get_name()));
- Assert (fe1.get_name() == p1->get_name(),
- ExcInternalError());
+ AssertThrow (fe1.get_name() == p1->get_name(),
+ ExcInternalError());
deallog << " ok" << std::endl;
delete p1;
// same for fe2
deallog << modify_name<dim> (fe2.get_name());
p2 = FETools::get_fe_from_name<dim> (modify_name<dim> (fe2.get_name()));
- Assert (fe2.get_name() == p2->get_name(),
- ExcInternalError());
+ AssertThrow (fe2.get_name() == p2->get_name(),
+ ExcInternalError());
deallog << " ok" << std::endl;
delete p2;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
product(i,i) -= 1;
output_matrix (product);
- Assert (product.frobenius_norm() < 1e-10, ExcInternalError());
+ AssertThrow (product.frobenius_norm() < 1e-10, ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
FullMatrix<double> X (fe.dofs_per_cell,
q_rhs.size());
- Assert (X.m() == X.n(), ExcInternalError());
+ AssertThrow (X.m() == X.n(), ExcInternalError());
FETools::compute_projection_from_quadrature_points_matrix (fe,
q_rhs, q_rhs,
for (unsigned int i=0; i<X.m(); ++i)
X(i,i) -= 1;
- Assert (X.frobenius_norm() < 1e-10, ExcInternalError());
+ AssertThrow (X.frobenius_norm() < 1e-10, ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
)
);
- Assert (p.distance (pp) < 1e-15, ExcInternalError());
+ AssertThrow (p.distance (pp) < 1e-15, ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
)
);
- Assert (p.distance (pp) < 1e-15, ExcInternalError());
+ AssertThrow (p.distance (pp) < 1e-15, ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
deallog << "<" << cell->vertex(v) << "> ";
deallog << std::endl;
- Assert (p.distance (cell->center()) < cell->diameter()/2,
- ExcInternalError());
+ AssertThrow (p.distance (cell->center()) < cell->diameter()/2,
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
deallog << "<" << cell->vertex(v) << "> ";
deallog << std::endl;
- Assert (p.distance (cell->center()) < cell->diameter()/2,
- ExcInternalError());
+ AssertThrow (p.distance (cell->center()) < cell->diameter()/2,
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<N; ++j)
{
deallog << i << ' ' << j << ' ' << f(i,j) << std::endl;
- Assert (f(i,j) == sm(i,j), ExcInternalError());
+ AssertThrow (f(i,j) == sm(i,j), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
const FullMatrix<double>::const_iterator k = A.begin(),
j = ++A.begin();
- Assert (k < j, ExcInternalError());
- Assert (j > k, ExcInternalError());
+ AssertThrow (k < j, ExcInternalError());
+ AssertThrow (j > k, ExcInternalError());
- Assert (!(j < k), ExcInternalError());
- Assert (!(k > j), ExcInternalError());
+ AssertThrow (!(j < k), ExcInternalError());
+ AssertThrow (!(k > j), ExcInternalError());
- Assert (k != j, ExcInternalError());
- Assert (!(k == j), ExcInternalError());
+ AssertThrow (k != j, ExcInternalError());
+ AssertThrow (!(k == j), ExcInternalError());
- Assert (k == k, ExcInternalError());
- Assert (!(k != k), ExcInternalError());
+ AssertThrow (k == k, ExcInternalError());
+ AssertThrow (!(k != k), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
- Assert (w(i) == i+1, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i+1, ExcInternalError());
}
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (i+2*j)*j*(i+1);
- Assert (s == result, ExcInternalError());
+ AssertThrow (s == result, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int i=0; i<m.m(); ++i)
for (unsigned int j=0; j<m.m(); ++j)
result += (i+2*j)*j*i;
- Assert (s == result, ExcInternalError());
+ AssertThrow (s == result, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
- Assert (w(i) == i+1, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i+1, ExcInternalError());
double result = i+1;
for (unsigned int j=0; j<m.m(); ++j)
result -= (i+2*j)*j;
- Assert (x(i) == result, ExcInternalError());
+ AssertThrow (x(i) == result, ExcInternalError());
}
- Assert (std::fabs((s - x.l2_norm())/s) < 1e-14, ExcInternalError());
+ AssertThrow (std::fabs((s - x.l2_norm())/s) < 1e-14, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2002 - 2014 by the deal.II authors
+// Copyright (C) 2002 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// read from XML
std::ifstream in (SOURCE_DIR "/prm/parameter_handler_read_xml.prm");
bool result = prm.read_input_from_xml (in);
- Assert (result == true, ExcInternalError());
+ AssertThrow (result == true, ExcInternalError());
// write it out again
prm.print_parameters (deallog.get_file_stream(), ParameterHandler::XML);
// ---------------------------------------------------------------------
//
-// Copyright (C) 2002 - 2014 by the deal.II authors
+// Copyright (C) 2002 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// read from XML
std::ifstream in ("prm");
bool result = prm.read_input_from_xml (in);
- Assert (result == false, ExcInternalError());
+ AssertThrow (result == false, ExcInternalError());
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2002 - 2014 by the deal.II authors
+// Copyright (C) 2002 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// read from XML
std::ifstream in ("prm");
bool result = prm.read_input_from_xml (in);
- Assert (result == false, ExcInternalError());
+ AssertThrow (result == false, ExcInternalError());
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2002 - 2014 by the deal.II authors
+// Copyright (C) 2002 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// read from XML
std::ifstream in ("prm");
bool result = prm.read_input_from_xml (in);
- Assert (result == false, ExcInternalError());
+ AssertThrow (result == false, ExcInternalError());
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
bool res = cell->point_inside(testpoint);
deallog << testpoint << " inside " << res <<std::endl;
- Assert (res == expected[i], ExcInternalError());
+ AssertThrow (res == expected[i], ExcInternalError());
}
}
// properly oriented
// faces. mesh_3d_7 does it
// for mis-oriented faces
- Assert (cell->face_orientation(f) == true,
- ExcInternalError());
- Assert (cell->neighbor(f)->face_orientation(nn) == true,
- ExcInternalError());
+ AssertThrow (cell->face_orientation(f) == true,
+ ExcInternalError());
+ AssertThrow (cell->neighbor(f)->face_orientation(nn) == true,
+ ExcInternalError());
fe_face_values1.reinit (cell, f);
fe_face_values2.reinit (cell->neighbor(f), nn);
{
deallog << " " << fe_face_values1.quadrature_point(q)
<< std::endl;
- Assert ((fe_face_values1.quadrature_point(q)-
- fe_face_values2.quadrature_point(q)).norm_square()
- < 1e-20,
- ExcInternalError());
+ AssertThrow ((fe_face_values1.quadrature_point(q)-
+ fe_face_values2.quadrature_point(q)).norm_square()
+ < 1e-20,
+ ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
unsigned int index = 0;
for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
cell != tria.end(); ++cell, ++index)
- Assert (cells[index] == cell,
- ExcInternalError());
+ AssertThrow (cells[index] == cell,
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
unsigned int index = 0;
for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
cell != tria.end(); ++cell, ++index)
- Assert (cells[index] == cell,
- ExcInternalError());
+ AssertThrow (cells[index] == cell,
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
unsigned int index = 0;
for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
cell != tria.end(); ++cell, ++index)
- Assert (cells[index] == cell,
- ExcInternalError());
+ AssertThrow (cells[index] == cell,
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
cell != tria.end (); ++cell)
for (unsigned int child = 0; child < cell->n_children (); ++child)
- Assert (cell->child (child)->parent () == cell,
- ExcInternalError ());
+ AssertThrow (cell->child (child)->parent () == cell,
+ ExcInternalError ());
// coarsen the mesh globally and
// verify that the parent relation
for (typename Triangulation<dim>::cell_iterator cell = tria.begin ();
cell != tria.end(); ++cell)
for (unsigned int child = 0; child < cell->n_children (); ++child)
- Assert (cell->child (child)->parent () == cell,
- ExcInternalError());
+ AssertThrow (cell->child (child)->parent () == cell,
+ ExcInternalError());
deallog << "OK for " << dim << "d" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (typename DoFHandler<dim>::cell_iterator cell = dof_handler.begin();
cell != dof_handler.end (); ++cell)
for (unsigned int child = 0; child < cell->n_children (); ++child)
- Assert (cell->child (child)->parent () == cell,
- ExcInternalError ());
+ AssertThrow (cell->child (child)->parent () == cell,
+ ExcInternalError ());
// coarsen the mesh globally and
// verify that the parent relation
for (typename DoFHandler<dim>::cell_iterator cell = dof_handler.begin ();
cell != dof_handler.end(); ++cell)
for (unsigned int child = 0; child < cell->n_children (); ++child)
- Assert (cell->child (child)->parent () == cell,
- ExcInternalError());
+ AssertThrow (cell->child (child)->parent () == cell,
+ ExcInternalError());
deallog << "OK for " << dim << "d" << std::endl;
}
for (typename DoFHandler<dim>::cell_iterator cell = dof_handler.begin();
cell != dof_handler.end (); ++cell)
for (unsigned int child = 0; child < cell->n_children (); ++child)
- Assert (cell->child (child)->parent () == cell,
- ExcInternalError ());
+ AssertThrow (cell->child (child)->parent () == cell,
+ ExcInternalError ());
// coarsen the mesh globally and
// verify that the parent relation
for (typename DoFHandler<dim>::cell_iterator cell = dof_handler.begin ();
cell != dof_handler.end(); ++cell)
for (unsigned int child = 0; child < cell->n_children (); ++child)
- Assert (cell->child (child)->parent () == cell,
- ExcInternalError());
+ AssertThrow (cell->child (child)->parent () == cell,
+ ExcInternalError());
deallog << "OK for " << dim << "d" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == 2*(i*j*.5+.5), ExcInternalError());
- Assert (m.el(i,j) == 2*(i*j*.5+.5), ExcInternalError());
+ AssertThrow (m(i,j) == 2*(i*j*.5+.5), ExcInternalError());
+ AssertThrow (m.el(i,j) == 2*(i*j*.5+.5), ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == 2*(i*j*.5+.5), ExcInternalError());
- Assert (m.el(i,j) == 2*(i*j*.5+.5), ExcInternalError());
+ AssertThrow (m(i,j) == 2*(i*j*.5+.5), ExcInternalError());
+ AssertThrow (m.el(i,j) == 2*(i*j*.5+.5), ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
SparseMatrix<double> m(sp);
- Assert (m.m() == 5, ExcInternalError());
- Assert (m.n() == 5, ExcInternalError());
+ AssertThrow (m.m() == 5, ExcInternalError());
+ AssertThrow (m.n() == 5, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// compare against the exact value of the
// l2-norm (max row-sum)
deallog << m.frobenius_norm() << std::endl;
- Assert (std::fabs((m.frobenius_norm() - norm)/norm) < 1e-14, ExcInternalError());
+ AssertThrow (std::fabs((m.frobenius_norm() - norm)/norm) < 1e-14, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
- Assert (m.el(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
+ AssertThrow (m(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
+ AssertThrow (m.el(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
- Assert (m.el(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
+ AssertThrow (m(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
+ AssertThrow (m.el(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
// try to add an invalid list of indices to
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.n(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
SparseMatrix<double>::iterator k = A.begin(),
j = ++A.begin();
- Assert (k < j, ExcInternalError());
- Assert (j > k, ExcInternalError());
+ AssertThrow (k < j, ExcInternalError());
+ AssertThrow (j > k, ExcInternalError());
- Assert (!(j < k), ExcInternalError());
- Assert (!(k > j), ExcInternalError());
+ AssertThrow (!(j < k), ExcInternalError());
+ AssertThrow (!(k > j), ExcInternalError());
- Assert (k != j, ExcInternalError());
- Assert (!(k == j), ExcInternalError());
+ AssertThrow (k != j, ExcInternalError());
+ AssertThrow (!(k == j), ExcInternalError());
- Assert (k == k, ExcInternalError());
- Assert (!(k != k), ExcInternalError());
+ AssertThrow (k == k, ExcInternalError());
+ AssertThrow (!(k != k), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
SparseMatrix<double>::const_iterator k = A.begin(),
j = ++A.begin();
- Assert (k < j, ExcInternalError());
- Assert (j > k, ExcInternalError());
+ AssertThrow (k < j, ExcInternalError());
+ AssertThrow (j > k, ExcInternalError());
- Assert (!(j < k), ExcInternalError());
- Assert (!(k > j), ExcInternalError());
+ AssertThrow (!(j < k), ExcInternalError());
+ AssertThrow (!(k > j), ExcInternalError());
- Assert (k != j, ExcInternalError());
- Assert (!(k == j), ExcInternalError());
+ AssertThrow (k != j, ExcInternalError());
+ AssertThrow (!(k == j), ExcInternalError());
- Assert (k == k, ExcInternalError());
- Assert (!(k != k), ExcInternalError());
+ AssertThrow (k == k, ExcInternalError());
+ AssertThrow (!(k != k), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
SparseMatrix<double> m(sp);
for (unsigned int row=0; row<sp.n_rows(); ++row)
- Assert (m.begin(row)-m.begin(row) == 0,
- ExcInternalError());
+ AssertThrow (m.begin(row)-m.begin(row) == 0,
+ ExcInternalError());
for (unsigned int row=0; row<sp.n_rows(); ++row)
- Assert (m.end(row)-m.begin(row) == (int)sp.row_length(row),
- ExcInternalError());
+ AssertThrow (m.end(row)-m.begin(row) == (int)sp.row_length(row),
+ ExcInternalError());
for (unsigned int row=0; row<sp.n_rows(); ++row)
- Assert (m.begin(row)-m.end(row) == -(int)sp.row_length(row),
- ExcInternalError());
+ AssertThrow (m.begin(row)-m.end(row) == -(int)sp.row_length(row),
+ ExcInternalError());
{
unsigned int counter = 0;
for (unsigned int row=0; row<sp.n_rows(); ++row)
{
- Assert (m.begin(row)-m.begin(0) == (int)counter,
- ExcInternalError());
- Assert (m.begin(0)-m.begin(row) == -(int)counter,
- ExcInternalError());
+ AssertThrow (m.begin(row)-m.begin(0) == (int)counter,
+ ExcInternalError());
+ AssertThrow (m.begin(0)-m.begin(row) == -(int)counter,
+ ExcInternalError());
counter += sp.row_length(row);
}
}
- Assert (m.begin() - m.begin(0) == 0, ExcInternalError());
- Assert (m.begin(0) - m.begin() == 0, ExcInternalError());
- Assert (m.end(sp.n_rows()-1) - m.end() == 0, ExcInternalError());
- Assert (m.end() - m.end(sp.n_rows()-1) == 0, ExcInternalError());
- Assert (m.end() - m.begin() == (int)sp.n_nonzero_elements(),
- ExcInternalError());
- Assert (m.begin() - m.end() == -(int)sp.n_nonzero_elements(),
- ExcInternalError());
+ AssertThrow (m.begin() - m.begin(0) == 0, ExcInternalError());
+ AssertThrow (m.begin(0) - m.begin() == 0, ExcInternalError());
+ AssertThrow (m.end(sp.n_rows()-1) - m.end() == 0, ExcInternalError());
+ AssertThrow (m.end() - m.end(sp.n_rows()-1) == 0, ExcInternalError());
+ AssertThrow (m.end() - m.begin() == (int)sp.n_nonzero_elements(),
+ ExcInternalError());
+ AssertThrow (m.begin() - m.end() == -(int)sp.n_nonzero_elements(),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == i+result, ExcInternalError());
+ AssertThrow (w(i) == i+result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == i+result, ExcInternalError());
+ AssertThrow (w(i) == i+result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
- Assert (w(i) == i+1, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i+1, ExcInternalError());
}
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*j*(i+1);
- Assert (s == result, ExcInternalError());
+ AssertThrow (s == result, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int i=0; i<m.m(); ++i)
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*j*i;
- Assert (s == result, ExcInternalError());
+ AssertThrow (s == result, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
- Assert (w(i) == i+1, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i+1, ExcInternalError());
double result = i+1;
for (unsigned int j=0; j<m.n(); ++j)
result -= (i+2*j)*j;
- Assert (x(i) == result, ExcInternalError());
+ AssertThrow (x(i) == result, ExcInternalError());
}
- Assert (std::fabs((s - x.l2_norm())/s) < 1e-14, ExcInternalError());
+ AssertThrow (std::fabs((s - x.l2_norm())/s) < 1e-14, ExcInternalError());
deallog << "OK" << std::endl;
}
fe_values.get_function_values (present_solution,
local_solution_values);
fe_values.get_function_gradients (present_solution,
- local_solution_grads);
+ local_solution_grads);
for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
{
const double x_left = fe_values.quadrature_point(0)[0];
const double x_right = fe_values.quadrature_point(1)[0];
- Assert (x_left == cell->vertex(0)[0], ExcInternalError());
- Assert (x_right == cell->vertex(1)[0], ExcInternalError());
+ AssertThrow (x_left == cell->vertex(0)[0], ExcInternalError());
+ AssertThrow (x_right == cell->vertex(1)[0], ExcInternalError());
const double u_left = local_values[0];
const double u_right = local_values[1];
fe_values.get_function_values (function,
local_solution_values);
fe_values.get_function_gradients (function,
- local_solution_grads);
+ local_solution_grads);
for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
energy += (std::pow (fe_values.quadrature_point(q_point)(0)
// ---------------------------------------------------------------------
//
-// Copyright (C) 2001 - 2014 by the deal.II authors
+// Copyright (C) 2001 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
if (cell->center()(d) > 0)
subdomain |= (1<<d);
- Assert (subdomain < (1<<dim), ExcInternalError());
+ AssertThrow (subdomain < (1<<dim), ExcInternalError());
cell->set_subdomain_id (subdomain);
};
// ---------------------------------------------------------------------
//
-// Copyright (C) 2001 - 2014 by the deal.II authors
+// Copyright (C) 2001 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
if (cell->center()(d) > 0)
subdomain |= (1<<d);
- Assert (subdomain < (1<<dim), ExcInternalError());
+ AssertThrow (subdomain < (1<<dim), ExcInternalError());
cell->set_subdomain_id (subdomain);
};
// since every dof is assigned a valid
// subdomain id
for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
- Assert (subdomain_association[i] < (1<<dim),
- ExcInternalError());
+ AssertThrow (subdomain_association[i] < (1<<dim),
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2001 - 2014 by the deal.II authors
+// Copyright (C) 2001 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
if (cell->center()(d) > 0)
subdomain |= (1<<d);
- Assert (subdomain < (1<<dim), ExcInternalError());
+ AssertThrow (subdomain < (1<<dim), ExcInternalError());
cell->set_subdomain_id (subdomain);
};
// ---------------------------------------------------------------------
//
-// Copyright (C) 2001 - 2014 by the deal.II authors
+// Copyright (C) 2001 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
if (cell->center()(d) > 0)
subdomain |= (1<<d);
- Assert (subdomain < (1<<dim), ExcInternalError());
+ AssertThrow (subdomain < (1<<dim), ExcInternalError());
cell->set_subdomain_id (subdomain);
};
{
// we must just have crossed the
// boundary to another subdomain
- Assert (subdomain_association[i] == present_subdomain+1,
- ExcInternalError());
+ AssertThrow (subdomain_association[i] == present_subdomain+1,
+ ExcInternalError());
++present_subdomain;
}
- Assert (present_subdomain == (1<<dim)-1, ExcInternalError());
+ AssertThrow (present_subdomain == (1<<dim)-1, ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2001 - 2014 by the deal.II authors
+// Copyright (C) 2001 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
if (cell->center()(d) > 0)
subdomain |= (1<<d);
- Assert (subdomain < (1<<dim), ExcInternalError());
+ AssertThrow (subdomain < (1<<dim), ExcInternalError());
cell->set_subdomain_id (subdomain);
};
// check that the number of dofs
// associated is also what the respective
// function returns
- Assert (static_cast<unsigned int>
- (std::count (subdomain_association.begin(),
- subdomain_association.end(), subdomain))
- ==
- DoFTools::count_dofs_with_subdomain_association (dof_handler,
- subdomain),
- ExcInternalError());
+ AssertThrow (static_cast<unsigned int>
+ (std::count (subdomain_association.begin(),
+ subdomain_association.end(), subdomain))
+ ==
+ DoFTools::count_dofs_with_subdomain_association (dof_handler,
+ subdomain),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2001 - 2014 by the deal.II authors
+// Copyright (C) 2001 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
if (cell->center()(d) > 0)
subdomain |= (1<<d);
- Assert (subdomain < (1<<dim), ExcInternalError());
+ AssertThrow (subdomain < (1<<dim), ExcInternalError());
cell->set_subdomain_id (subdomain);
}
// check that the number of cells
// associated is also what the respective
// function returns
- Assert (static_cast<unsigned int>
- (std::count (subdomain_association.begin(),
- subdomain_association.end(), subdomain))
- ==
- GridTools::count_cells_with_subdomain_association (tria,
- subdomain),
- ExcInternalError());
+ AssertThrow (static_cast<unsigned int>
+ (std::count (subdomain_association.begin(),
+ subdomain_association.end(), subdomain))
+ ==
+ GridTools::count_cells_with_subdomain_association (tria,
+ subdomain),
+ ExcInternalError());
// ...and that this is also the correct
// number
- Assert (GridTools::count_cells_with_subdomain_association (tria,
- subdomain)
- == (tria.n_active_cells() / (1<<dim)),
- ExcInternalError());
+ AssertThrow (GridTools::count_cells_with_subdomain_association (tria,
+ subdomain)
+ == (tria.n_active_cells() / (1<<dim)),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2001 - 2014 by the deal.II authors
+// Copyright (C) 2001 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
if (cell->center()(d) > 0)
subdomain |= (1<<d);
- Assert (subdomain < (1<<dim), ExcInternalError());
+ AssertThrow (subdomain < (1<<dim), ExcInternalError());
cell->set_subdomain_id (subdomain);
};
for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
if (subdomain_association[i] == subdomain)
- Assert (index_set.is_element(i) == true,
- ExcInternalError());
+ AssertThrow (index_set.is_element(i) == true,
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 1998 - 2014 by the deal.II authors
+// Copyright (C) 1998 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// flags set
tria.prepare_coarsening_and_refinement();
for (cell=tria.begin_active(); cell!=endc; ++cell)
- Assert (!cell->refine_flag_set(), ExcInternalError());
+ AssertThrow (!cell->refine_flag_set(), ExcInternalError());
tria.execute_coarsening_and_refinement();
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void check_cell1 (const FiniteElement<dim> &fe)
{
for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- Assert (fe.get_unit_support_points()[i] ==
- fe.unit_support_point(i),
- ExcInternalError());
+ AssertThrow (fe.get_unit_support_points()[i] ==
+ fe.unit_support_point(i),
+ ExcInternalError());
deallog << "dim=" << dim << ", cell=ok" << std::endl;
}
void check_face1 (const FiniteElement<dim> &fe)
{
for (unsigned int i=0; i<fe.dofs_per_face; ++i)
- Assert (fe.get_unit_face_support_points()[i] ==
- fe.unit_face_support_point(i),
- ExcInternalError());
+ AssertThrow (fe.get_unit_face_support_points()[i] ==
+ fe.unit_face_support_point(i),
+ ExcInternalError());
deallog << "dim=" << dim << ", face=ok" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress ();
- Assert (v.size() == 100, ExcInternalError());
+ AssertThrow (v.size() == 100, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == i))
- ||
- ((pattern[i] == false) && (v(i) == 0))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == i))
+ ||
+ ((pattern[i] == false) && (v(i) == 0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == i))
- ||
- ((pattern[i] == false) && (v(i) == 0))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == i))
+ ||
+ ((pattern[i] == false) && (v(i) == 0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert (((pattern[i] == true) && (v(i) == i))
- ||
- ((pattern[i] == false) && (v(i) == 0)),
- ExcInternalError());
+ AssertThrow (((pattern[i] == true) && (v(i) == i))
+ ||
+ ((pattern[i] == false) && (v(i) == 0)),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert (((pattern[i] == true) && (v(i) == 2*i))
- ||
- ((pattern[i] == false) && (v(i) == 0)),
- ExcInternalError());
+ AssertThrow (((pattern[i] == true) && (v(i) == 2*i))
+ ||
+ ((pattern[i] == false) && (v(i) == 0)),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert (((pattern[i] == true) && (v(i) == i))
- ||
- ((pattern[i] == false) && (v(i) == 0)),
- ExcInternalError());
+ AssertThrow (((pattern[i] == true) && (v(i) == i))
+ ||
+ ((pattern[i] == false) && (v(i) == 0)),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress ();
// then check the norm
- Assert (std::fabs((v.l2_norm() - std::sqrt(norm))/std::sqrt(norm)) < 1e-14, ExcInternalError());
+ AssertThrow (std::fabs((v.l2_norm() - std::sqrt(norm))/std::sqrt(norm)) < 1e-14, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress ();
// then check the norm
- Assert (v.linfty_norm() == norm, ExcInternalError());
+ AssertThrow (v.linfty_norm() == norm, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that the entries are ok
for (unsigned int i=0; i<v.size(); ++i)
- Assert (((pattern[i] == true) && (v(i) == i*5./4.))
- ||
- ((pattern[i] == false) && (v(i) == 0)),
- ExcInternalError());
+ AssertThrow (((pattern[i] == true) && (v(i) == i*5./4.))
+ ||
+ ((pattern[i] == false) && (v(i) == 0)),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that the entries are ok
for (unsigned int i=0; i<v.size(); ++i)
- Assert (((pattern[i] == true) && (v(i) == i*3./4.))
- ||
- ((pattern[i] == false) && (v(i) == 0)),
- ExcInternalError());
+ AssertThrow (((pattern[i] == true) && (v(i) == i*3./4.))
+ ||
+ ((pattern[i] == false) && (v(i) == 0)),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that the entries are ok
for (unsigned int i=0; i<v.size(); ++i)
- Assert (((pattern[i] == true) && (v(i)-(-3.*i/4.) == 0))
- ||
- ((pattern[i] == false) && (v(i) == 0)),
- ExcInternalError());
+ AssertThrow (((pattern[i] == true) && (v(i)-(-3.*i/4.) == 0))
+ ||
+ ((pattern[i] == false) && (v(i) == 0)),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w.compress ();
// make sure the scalar product is zero
- Assert (v*w == 0, ExcInternalError());
+ AssertThrow (v*w == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w.compress ();
// make sure the scalar product is zero
- Assert (v*w == product, ExcInternalError());
+ AssertThrow (v*w == product, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// vector is really empty
const unsigned int sz = v.size();
v = 0;
- Assert (v.size() == sz, ExcInternalError());
- Assert (v.l2_norm() == 0, ExcInternalError());
+ AssertThrow (v.size() == sz, ExcInternalError());
+ AssertThrow (v.l2_norm() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// vector is really empty
const unsigned int sz = v.size();
v = 0;
- Assert (v.size() == sz, ExcInternalError());
- Assert (v.l2_norm() == 0, ExcInternalError());
+ AssertThrow (v.size() == sz, ExcInternalError());
+ AssertThrow (v.l2_norm() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
const unsigned int sz = v.size();
v = 2;
- Assert (v.size() == sz, ExcInternalError());
- Assert (v.l2_norm() == std::sqrt(4.*sz), ExcInternalError());
+ AssertThrow (v.size() == sz, ExcInternalError());
+ AssertThrow (v.l2_norm() == std::sqrt(4.*sz), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
v.reinit (13, true);
- Assert (v.size() == 13, ExcInternalError());
+ AssertThrow (v.size() == 13, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// then resize with setting to zero
v.reinit (13, false);
- Assert (v.size() == 13, ExcInternalError());
- Assert (v.l2_norm() == 0, ExcInternalError());
+ AssertThrow (v.size() == 13, ExcInternalError());
+ AssertThrow (v.l2_norm() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress ();
// then check the norm
- Assert (std::fabs(v.norm_sqr() - norm) < 1e-14*norm,
- ExcInternalError());
+ AssertThrow (std::fabs(v.norm_sqr() - norm) < 1e-14*norm,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress ();
// then check the norm
- Assert (std::fabs(v.mean_value() - sum/v.size()) < 1e-14*sum/v.size(),
- ExcInternalError());
+ AssertThrow (std::fabs(v.mean_value() - sum/v.size()) < 1e-14*sum/v.size(),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress ();
// then check the norm
- Assert (std::fabs(v.lp_norm(3) - std::pow(sum, 1./3.)) <
- 1e-14*std::pow(sum, 1./3.),
- ExcInternalError());
+ AssertThrow (std::fabs(v.lp_norm(3) - std::pow(sum, 1./3.)) <
+ 1e-14*std::pow(sum, 1./3.),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v = 0;
// then check all_zero
- Assert (v.all_zero() == true, ExcInternalError());
+ AssertThrow (v.all_zero() == true, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
if (i%3 == 0)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i+i+1., ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i+i+1., ExcInternalError());
}
else
{
- Assert (w(i) == 0, ExcInternalError());
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == 0, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
if (i%3 == 0)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i-(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i-(i+1.), ExcInternalError());
}
else
{
- Assert (w(i) == 0, ExcInternalError());
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == 0, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
- Assert (v(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i+1., ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i+2*(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i+2*(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (v(i) == i+2*(i+1.)+3*(i+2.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (v(i) == i+2*(i+1.)+3*(i+2.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == 2*i+(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == 2*i+(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == 3*i+2*(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == 3*i+2*(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (v(i) == 1.5*i+2*(i+1.)+3*(i+2.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (v(i) == 1.5*i+2*(i+1.)+3*(i+2.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (y(i) == i+3., ExcInternalError());
- Assert (v(i) == 1.5*i+2*(i+1.)+3*(i+2.)+4*(i+3), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (y(i) == i+3., ExcInternalError());
+ AssertThrow (v(i) == 1.5*i+2*(i+1.)+3*(i+2.)+4*(i+3), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i*(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i*(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == 2*(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == 2*(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (v(i) == 2*(i+1.)+3*(i+2.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (v(i) == 2*(i+1.)+3*(i+2.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that the vector is really
// non-negative
- Assert (v.is_non_negative() == true, ExcInternalError());
+ AssertThrow (v.is_non_negative() == true, ExcInternalError());
// then set a single element to a negative
// value and check again
v(v.size()/2) = -1;
- Assert (v.is_non_negative() == false, ExcInternalError());
+ AssertThrow (v.is_non_negative() == false, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w(i) = i+1.;
}
- Assert (!(v==w), ExcInternalError());
+ AssertThrow (!(v==w), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// but then copy elements and make sure the
// vectors are actually equal
v = w;
- Assert (v==w, ExcInternalError());
+ AssertThrow (v==w, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w(i) = i+1.;
}
- Assert (v.operator != (w), ExcInternalError());
+ AssertThrow (v.operator != (w), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// but then copy elements and make sure the
// vectors are actually equal
v = w;
- Assert (! (v.operator != (w)), ExcInternalError());
+ AssertThrow (! (v.operator != (w)), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w(i) = i+1.;
}
- Assert (!(v==w), ExcInternalError());
- Assert (!(w==v), ExcInternalError());
+ AssertThrow (!(v==w), ExcInternalError());
+ AssertThrow (!(w==v), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// but then copy elements and make sure the
// vectors are actually equal
v = w;
- Assert (v==w, ExcInternalError());
- Assert (w==v, ExcInternalError());
+ AssertThrow (v==w, ExcInternalError());
+ AssertThrow (w==v, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w(i) = i+1.;
}
- Assert (v!=w, ExcInternalError());
- Assert (w!=v, ExcInternalError());
+ AssertThrow (v!=w, ExcInternalError());
+ AssertThrow (w!=v, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v(i) = i+1.;
Vector<float> w(v);
- Assert (w==v, ExcInternalError());
+ AssertThrow (w==v, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (typename Triangulation<dim>::active_cell_iterator
cell = volume_mesh.begin_active();
cell != volume_mesh.end(); ++cell)
- Assert (cell->direction_flag() == true,
- ExcInternalError());
+ AssertThrow (cell->direction_flag() == true,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
if (cell->center()(d) > 0)
subdomain |= (1<<d);
- Assert (subdomain < (1<<dim), ExcInternalError());
+ AssertThrow (subdomain < (1<<dim), ExcInternalError());
cell->set_subdomain_id (subdomain);
}
// now compare the results of the two
// computations
- Assert (error1 == error2, ExcInternalError());
+ AssertThrow (error1 == error2, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
Point<spacedim> diff(face->vertex(k));
diff -= cell->vertex(k);
- Assert (diff.square() == 0, ExcInternalError());
+ AssertThrow (diff.square() == 0, ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
Point<spacedim> diff(face->vertex(k));
diff -= cell->vertex(k);
- Assert (diff.square() == 0, ExcInternalError());
+ AssertThrow (diff.square() == 0, ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
Point<spacedim> diff(face->vertex(k));
diff -= cell->vertex(k);
- Assert (diff.square() == 0, ExcInternalError());
+ AssertThrow (diff.square() == 0, ExcInternalError());
}
}
}
surface_to_volume_mapping
= GridGenerator::extract_boundary_mesh (volume_mesh, boundary_mesh,
- boundary_ids);
+ boundary_ids);
deallog << volume_mesh.n_active_cells () << std::endl;
deallog << boundary_mesh.n_active_cells () << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
{
- Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
- != bv.end(),
- ExcInternalError());
- Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
- ==
- Functions::SquareFunction<spacedim>()
- .value(cell->face(f)->vertex(v),i),
- ExcInternalError());
+ AssertThrow (bv.find(cell->face(f)->vertex_dof_index(v,i))
+ != bv.end(),
+ ExcInternalError());
+ AssertThrow (bv[cell->face(f)->vertex_dof_index(v,i)]
+ ==
+ Functions::SquareFunction<spacedim>()
+ .value(cell->face(f)->vertex(v),i),
+ ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
{
- Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
- != bv.end(),
- ExcInternalError());
- Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
- ==
- Functions::SquareFunction<spacedim>()
- .value(cell->face(f)->vertex(v),i),
- ExcInternalError());
+ AssertThrow (bv.find(cell->face(f)->vertex_dof_index(v,i))
+ != bv.end(),
+ ExcInternalError());
+ AssertThrow (bv[cell->face(f)->vertex_dof_index(v,i)]
+ ==
+ Functions::SquareFunction<spacedim>()
+ .value(cell->face(f)->vertex(v),i),
+ ExcInternalError());
}
}
}
for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
{
- Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
- != bv.end(),
- ExcInternalError());
- Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
- ==
- X<spacedim>()
- .value(cell->face(f)->vertex(v),i),
- ExcInternalError());
+ AssertThrow (bv.find(cell->face(f)->vertex_dof_index(v,i))
+ != bv.end(),
+ ExcInternalError());
+ AssertThrow (bv[cell->face(f)->vertex_dof_index(v,i)]
+ ==
+ X<spacedim>()
+ .value(cell->face(f)->vertex(v),i),
+ ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
{
- Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
- != bv.end(),
- ExcInternalError());
- Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
- ==
- Functions::SquareFunction<spacedim>()
- .value(cell->face(f)->vertex(v),i),
- ExcInternalError());
+ AssertThrow (bv.find(cell->face(f)->vertex_dof_index(v,i))
+ != bv.end(),
+ ExcInternalError());
+ AssertThrow (bv[cell->face(f)->vertex_dof_index(v,i)]
+ ==
+ Functions::SquareFunction<spacedim>()
+ .value(cell->face(f)->vertex(v),i),
+ ExcInternalError());
}
}
}
for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
{
- Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
- != bv.end(),
- ExcInternalError());
- Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
- ==
- Functions::SquareFunction<spacedim>()
- .value(cell->face(f)->vertex(v),i),
- ExcInternalError());
+ AssertThrow (bv.find(cell->face(f)->vertex_dof_index(v,i))
+ != bv.end(),
+ ExcInternalError());
+ AssertThrow (bv[cell->face(f)->vertex_dof_index(v,i)]
+ ==
+ Functions::SquareFunction<spacedim>()
+ .value(cell->face(f)->vertex(v),i),
+ ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
x, 0);
// we have a symmetric domain and a symmetric function. the result
// should be close to zero
- Assert (std::fabs(mean) < 1e-15, ExcInternalError());
+ AssertThrow (std::fabs(mean) < 1e-15, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
cell != triangulation.end(); ++cell, ++index)
if (flags[index])
cell->set_refine_flag();
- Assert (index == triangulation.n_active_cells(), ExcInternalError());
+ AssertThrow (index == triangulation.n_active_cells(), ExcInternalError());
// flag all other cells for coarsening
// (this should ensure that at least
// verify that none of the cells
// violates the level-1-at-vertex rule
- Assert (satisfies_level1_at_vertex_rule (triangulation),
- ExcInternalError());
+ AssertThrow (satisfies_level1_at_vertex_rule (triangulation),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// verify that none of the cells
// violates the level-1-at-vertex rule
- Assert (satisfies_level1_at_vertex_rule (triangulation),
- ExcInternalError());
+ AssertThrow (satisfies_level1_at_vertex_rule (triangulation),
+ ExcInternalError());
deallog << "Iteration " << i
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// verify that none of the cells
// violates the level-1-at-vertex rule
- Assert (satisfies_level1_at_vertex_rule (triangulation),
- ExcInternalError());
+ AssertThrow (satisfies_level1_at_vertex_rule (triangulation),
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
deallog << "Check that both constraint matrices are identical... ";
for (unsigned int i=0; i<dof.n_dofs(); ++i)
{
- Assert (correct_constraints.is_constrained(i) ==
- library_constraints.is_constrained(i), ExcInternalError());
+ AssertThrow (correct_constraints.is_constrained(i) ==
+ library_constraints.is_constrained(i), ExcInternalError());
typedef const std::vector<std::pair<types::global_dof_index, double> > &constraint_format;
if (correct_constraints.is_constrained(i))
{
constraint_format correct = *correct_constraints.get_constraint_entries(i);
constraint_format library = *library_constraints.get_constraint_entries(i);
- Assert (correct.size() == library.size(), ExcInternalError());
+ AssertThrow (correct.size() == library.size(), ExcInternalError());
for (unsigned int q=0; q<correct.size(); ++q)
{
- Assert (correct[q].first == library[q].first, ExcInternalError());
- Assert (std::fabs(correct[q].second-library[q].second) < 1e-14,
- ExcInternalError());
+ AssertThrow (correct[q].first == library[q].first, ExcInternalError());
+ AssertThrow (std::fabs(correct[q].second-library[q].second) < 1e-14,
+ ExcInternalError());
}
- Assert (std::fabs(correct_constraints.get_inhomogeneity(i)-
- library_constraints.get_inhomogeneity(i))<1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs(correct_constraints.get_inhomogeneity(i)-
+ library_constraints.get_inhomogeneity(i))<1e-14,
+ ExcInternalError());
}
}
deallog << "OK." << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 by the deal.II authors
+// Copyright (C) 2014-2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
cell != triangulation.end(); ++cell, ++index)
if (flags[index])
cell->set_refine_flag();
- Assert (index == triangulation.n_active_cells(), ExcInternalError());
+ AssertThrow (index == triangulation.n_active_cells(), ExcInternalError());
// flag all other cells for coarsening
// (this should ensure that at least
FE_Q<dim> fe(2);
DoFHandler<dim> dof_handler (triangulation);
dof_handler.distribute_dofs(fe);
-
+
// now extract patches and print the number of dofs on each
for (typename DoFHandler<dim>::active_cell_iterator
- cell = dof_handler.begin_active();
+ cell = dof_handler.begin_active();
cell != dof_handler.end(); ++cell)
deallog << cell << ": "
- << DoFTools::count_dofs_on_patch<DoFHandler<dim> >
- (GridTools::get_patch_around_cell<DoFHandler<dim> > (cell))
- << std::endl;
+ << DoFTools::count_dofs_on_patch<DoFHandler<dim> >
+ (GridTools::get_patch_around_cell<DoFHandler<dim> > (cell))
+ << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2000 - 2014 by the deal.II authors
+// Copyright (C) 2000 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
for (unsigned int q=0; q<uh.size(); ++q)
{
- Assert (computed_quantities[q].size() == 1,
- ExcInternalError());
+ AssertThrow (computed_quantities[q].size() == 1,
+ ExcInternalError());
computed_quantities[q](0) = uh[q](0)*uh[q](0) + uh[q](1)*uh[q](1);
- Assert (std::fabs(computed_quantities[q](0)-1) < 1e-12,
- ExcInternalError());
+ AssertThrow (std::fabs(computed_quantities[q](0)-1) < 1e-12,
+ ExcInternalError());
}
}
};
// ---------------------------------------------------------------------
//
-// Copyright (C) 2000 - 2014 by the deal.II authors
+// Copyright (C) 2000 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
ExcInternalError());
computed_quantities[q](0) = uh[q](0)*uh[q](0) + uh[q](1)*uh[q](1);
- Assert (std::fabs(computed_quantities[q](0)-1) < 1e-12,
- ExcInternalError());
+ AssertThrow (std::fabs(computed_quantities[q](0)-1) < 1e-12,
+ ExcInternalError());
}
}
};
// ---------------------------------------------------------------------
//
-// Copyright (C) 2000 - 2014 by the deal.II authors
+// Copyright (C) 2000 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
computed_quantities[q](d) = uh[q](0)*uh[q](0) + uh[q](1)*uh[q](1);
- Assert (std::fabs(computed_quantities[q](0)-1) < 1e-12,
- ExcInternalError());
+ AssertThrow (std::fabs(computed_quantities[q](0)-1) < 1e-12,
+ ExcInternalError());
}
}
};
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
cell != triangulation.end(); ++cell, ++index)
if (flags[index])
cell->set_refine_flag();
- Assert (index == triangulation.n_active_cells(), ExcInternalError());
+ AssertThrow (index == triangulation.n_active_cells(), ExcInternalError());
// flag all other cells for coarsening
// (this should ensure that at least
IndexSet all (N);
all.add_range (0, N);
- Assert (dof_handler.n_locally_owned_dofs() == N,
- ExcInternalError());
- Assert (dof_handler.locally_owned_dofs() == all,
- ExcInternalError());
- Assert (dof_handler.n_locally_owned_dofs_per_processor() ==
- std::vector<types::global_dof_index> (1,N),
- ExcInternalError());
- Assert (dof_handler.locally_owned_dofs_per_processor() ==
- std::vector<IndexSet>(1,all),
- ExcInternalError());
+ AssertThrow (dof_handler.n_locally_owned_dofs() == N,
+ ExcInternalError());
+ AssertThrow (dof_handler.locally_owned_dofs() == all,
+ ExcInternalError());
+ AssertThrow (dof_handler.n_locally_owned_dofs_per_processor() ==
+ std::vector<types::global_dof_index> (1,N),
+ ExcInternalError());
+ AssertThrow (dof_handler.locally_owned_dofs_per_processor() ==
+ std::vector<IndexSet>(1,all),
+ ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2002 - 2014 by the deal.II authors
+// Copyright (C) 2002 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// face is misoriented,
// then there must be a
// neighbor over there
- Assert (cell->neighbor(f)
- ->face_orientation(cell->neighbor_of_neighbor(f))
- == true,
- ExcInternalError());
+ AssertThrow (cell->neighbor(f)
+ ->face_orientation(cell->neighbor_of_neighbor(f))
+ == true,
+ ExcInternalError());
}
deallog << " " << misoriented_faces << " misoriented faces" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2007 - 2014 by the deal.II authors
+// Copyright (C) 2007 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
{
- Assert (fe_values[vec_components].value (i,q)[d]
- ==
- fe_values.shape_value_component (i,q,c+d),
- ExcInternalError());
-
- Assert (fe_values[vec_components].gradient (i,q)[d]
- ==
- fe_values.shape_grad_component (i,q,c+d),
- ExcInternalError());
-
- Assert (fe_values[vec_components].symmetric_gradient (i,q)
- ==
- (fe_values[vec_components].gradient(i,q) +
- transpose(fe_values[vec_components].gradient(i,q)))/2,
- ExcInternalError());
-
- Assert (fe_values[vec_components].hessian (i,q)[d]
- ==
- fe_values.shape_hessian_component (i,q,c+d),
- ExcInternalError());
+ AssertThrow (fe_values[vec_components].value (i,q)[d]
+ ==
+ fe_values.shape_value_component (i,q,c+d),
+ ExcInternalError());
+
+ AssertThrow (fe_values[vec_components].gradient (i,q)[d]
+ ==
+ fe_values.shape_grad_component (i,q,c+d),
+ ExcInternalError());
+
+ AssertThrow (fe_values[vec_components].symmetric_gradient (i,q)
+ ==
+ (fe_values[vec_components].gradient(i,q) +
+ transpose(fe_values[vec_components].gradient(i,q)))/2,
+ ExcInternalError());
+
+ AssertThrow (fe_values[vec_components].hessian (i,q)[d]
+ ==
+ fe_values.shape_hessian_component (i,q,c+d),
+ ExcInternalError());
}
- Assert (fe_values[vec_components].divergence (i,q)
- ==
- trace (fe_values[vec_components].gradient (i,q)),
- ExcInternalError());
+ AssertThrow (fe_values[vec_components].divergence (i,q)
+ ==
+ trace (fe_values[vec_components].gradient (i,q)),
+ ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2007 - 2014 by the deal.II authors
+// Copyright (C) 2007 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
{
- Assert (fe_values[vec_components].value (i,q)[d]
- ==
- fe_values.shape_value_component (i,q,c+d),
- ExcInternalError());
-
- Assert (fe_values[vec_components].gradient (i,q)[d]
- ==
- fe_values.shape_grad_component (i,q,c+d),
- ExcInternalError());
-
- Assert (fe_values[vec_components].symmetric_gradient (i,q)
- ==
- (fe_values[vec_components].gradient(i,q) +
- transpose(fe_values[vec_components].gradient(i,q)))/2,
- ExcInternalError());
-
- Assert (fe_values[vec_components].hessian (i,q)[d]
- ==
- fe_values.shape_hessian_component (i,q,c+d),
- ExcInternalError());
+ AssertThrow (fe_values[vec_components].value (i,q)[d]
+ ==
+ fe_values.shape_value_component (i,q,c+d),
+ ExcInternalError());
+
+ AssertThrow (fe_values[vec_components].gradient (i,q)[d]
+ ==
+ fe_values.shape_grad_component (i,q,c+d),
+ ExcInternalError());
+
+ AssertThrow (fe_values[vec_components].symmetric_gradient (i,q)
+ ==
+ (fe_values[vec_components].gradient(i,q) +
+ transpose(fe_values[vec_components].gradient(i,q)))/2,
+ ExcInternalError());
+
+ AssertThrow (fe_values[vec_components].hessian (i,q)[d]
+ ==
+ fe_values.shape_hessian_component (i,q,c+d),
+ ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2007 - 2014 by the deal.II authors
+// Copyright (C) 2007 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
grad[d] = vector_values[q][c+d];
- Assert ((selected_vector_values[q] - symmetrize(grad)).norm()
- <= 1e-12 * selected_vector_values[q].norm(),
- ExcInternalError());
+ AssertThrow ((selected_vector_values[q] - symmetrize(grad)).norm()
+ <= 1e-12 * selected_vector_values[q].norm(),
+ ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2007 - 2014 by the deal.II authors
+// Copyright (C) 2007 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
grad[d] = vector_values[q][c+d];
- Assert (std::fabs(selected_vector_values[q] - trace(grad))
- <= 1e-12 * std::fabs(selected_vector_values[q]),
- ExcInternalError());
+ AssertThrow (std::fabs(selected_vector_values[q] - trace(grad))
+ <= 1e-12 * std::fabs(selected_vector_values[q]),
+ ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2007 - 2014 by the deal.II authors
+// Copyright (C) 2007 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
grad[d] = vector_values[q][c+d];
- Assert ((std::fabs(selected_vector_values[q] - trace(grad))
- <= 1e-12 * std::fabs(selected_vector_values[q]))
- ||
- (std::fabs(selected_vector_values[q]) <= 1e-10),
- ExcInternalError());
+ AssertThrow ((std::fabs(selected_vector_values[q] - trace(grad))
+ <= 1e-12 * std::fabs(selected_vector_values[q]))
+ ||
+ (std::fabs(selected_vector_values[q]) <= 1e-10),
+ ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int m = 0; m < dim; m++)
{
for (unsigned int n = 0; n< dim; n++)
- Assert ( (local_values[q])[m][n] == stress_value, ExcInternalError());
+ AssertThrow ( (local_values[q])[m][n] == stress_value, ExcInternalError());
- Assert ( (local_divergences[q])[m] == 0.0, ExcInternalError());
- Assert ( local_scalar_values[q] == gamma_value, ExcInternalError());
+ AssertThrow ( (local_divergences[q])[m] == 0.0, ExcInternalError());
+ AssertThrow ( local_scalar_values[q] == gamma_value, ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2007 - 2014 by the deal.II authors
+// Copyright (C) 2007 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
F() : Function<2>(2) {}
virtual void vector_value (const Point<2> &p,
- Vector<double> &v) const
- {
- // make the function equal to (0,x^2)
- v[0] = 0;
- v[1] = p[0]*p[0];
- }
+ Vector<double> &v) const
+ {
+ // make the function equal to (0,x^2)
+ v[0] = 0;
+ v[1] = p[0]*p[0];
+ }
};
Tensor<1,3> curl (const Tensor<2,3> &grads)
{
return Point<3>(grads[2][1] - grads[1][2],
- grads[0][2] - grads[2][0],
- grads[1][0] - grads[0][1]);
+ grads[0][2] - grads[2][0],
+ grads[1][0] - grads[0][1]);
}
for (unsigned int q=0; q<quadrature.size(); ++q)
{
deallog << " curls[q]= " << curls[q] << std::endl
- << " grads[q]= " << grads[q] << std::endl;
+ << " grads[q]= " << grads[q] << std::endl;
Assert ((curl(grads[q]) - curls[q]).norm()
- <= 1e-10,
- ExcInternalError());
+ <= 1e-10,
+ ExcInternalError());
// we know the function F=(0,x^2) and we chose an element with
// high enough degree to exactly represent this function, so the
// curl of this function should be
// curl F = d_x F_y - d_y F_x = 2x
// verify that this is true
- Assert (std::fabs(curls[q][0] - 2*fe_values.quadrature_point(q)[0])
- <= 1e-10,
- ExcInternalError());
+ AssertThrow (std::fabs(curls[q][0] - 2*fe_values.quadrature_point(q)[0])
+ <= 1e-10,
+ ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2007 - 2014 by the deal.II authors
+// Copyright (C) 2007 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
F() : Function<2>(2) {}
virtual void vector_value (const Point<2> &p,
- Vector<double> &v) const
- {
- // make the function equal to (0,x^2)
- v[0] = 0;
- v[1] = p[0]*p[0];
- }
+ Vector<double> &v) const
+ {
+ // make the function equal to (0,x^2)
+ v[0] = 0;
+ v[1] = p[0]*p[0];
+ }
};
Tensor<1,3> curl (const Tensor<2,3> &grads)
{
return Point<3>(grads[2][1] - grads[1][2],
- grads[0][2] - grads[2][0],
- grads[1][0] - grads[0][1]);
+ grads[0][2] - grads[2][0],
+ grads[1][0] - grads[0][1]);
}
template<int dim>
void test (const Triangulation<dim> &tr,
const FiniteElement<dim> &fe,
- const unsigned int degree)
+ const unsigned int degree)
{
deallog << "FE=" << fe.get_name()
<< std::endl;
ConstraintMatrix cm;
cm.close ();
VectorTools::project (dof, cm, QGauss<2>(2+degree), F(), fe_function);
-
+
const QGauss<dim> quadrature(2);
FEValues<dim> fe_values (fe, quadrature,
update_values | update_gradients | update_q_points);
for (unsigned int q=0; q<quadrature.size(); ++q)
{
deallog << " curls[q]= " << curls[q] << std::endl
- << " grads[q]= " << grads[q] << std::endl;
+ << " grads[q]= " << grads[q] << std::endl;
Assert ((curl(grads[q]) - curls[q]).norm()
- <= 1e-10,
- ExcInternalError());
+ <= 1e-10,
+ ExcInternalError());
// we know the function F=(0,x^2) and we chose an element with
// high enough degree to exactly represent this function, so the
// curl of this function should be
// curl F = d_x F_y - d_y F_x = 2x
// verify that this is true
- Assert (std::fabs(curls[q][0] - 2*fe_values.quadrature_point(q)[0])
- <= 1e-10,
- ExcInternalError());
+ AssertThrow (std::fabs(curls[q][0] - 2*fe_values.quadrature_point(q)[0])
+ <= 1e-10,
+ ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2001 - 2014 by the deal.II authors
+// Copyright (C) 2001 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<2; ++d)
if (cell->center()(d) > 0)
subdomain |= (1<<d);
- Assert (subdomain < (1<<2), ExcInternalError());
+ AssertThrow (subdomain < (1<<2), ExcInternalError());
cell->set_subdomain_id (subdomain);
};
(cell1->subdomain_id () != 1))
++cell1;
- Assert (cell == cell1, ExcInternalError());
- Assert (cell1 == cell, ExcInternalError());
+ AssertThrow (cell == cell1, ExcInternalError());
+ AssertThrow (cell1 == cell, ExcInternalError());
if (cell.state() != IteratorState::valid)
break;
};
- Assert (cell == endc, ExcInternalError());
- Assert (cell1 == endc, ExcInternalError());
+ AssertThrow (cell == endc, ExcInternalError());
+ AssertThrow (cell1 == endc, ExcInternalError());
logfile << "Check 5: OK" << std::endl;
};
// ---------------------------------------------------------------------
//
-// Copyright (C) 2001 - 2014 by the deal.II authors
+// Copyright (C) 2001 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<2; ++d)
if (cell->center()(d) > 0)
subdomain |= (1<<d);
- Assert (subdomain < (1<<2), ExcInternalError());
+ AssertThrow (subdomain < (1<<2), ExcInternalError());
cell->set_subdomain_id (subdomain);
};
(cell1->subdomain_id () != 1))
++cell1;
- Assert (cell == cell1, ExcInternalError());
- Assert (cell1 == cell, ExcInternalError());
+ AssertThrow (cell == cell1, ExcInternalError());
+ AssertThrow (cell1 == cell, ExcInternalError());
if (cell.state() != IteratorState::valid)
break;
};
- Assert (cell == endc, ExcInternalError());
- Assert (cell1 == endc, ExcInternalError());
+ AssertThrow (cell == endc, ExcInternalError());
+ AssertThrow (cell1 == endc, ExcInternalError());
logfile << "Check 5: OK" << std::endl;
};
// ---------------------------------------------------------------------
//
-// Copyright (C) 2001 - 2014 by the deal.II authors
+// Copyright (C) 2001 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<2; ++d)
if (cell->center()(d) > 0)
subdomain |= (1<<d);
- Assert (subdomain < (1<<2), ExcInternalError());
+ AssertThrow (subdomain < (1<<2), ExcInternalError());
cell->set_subdomain_id (subdomain);
};
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2014 by the deal.II authors
+// Copyright (C) 2013 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (std::map<types::global_dof_index,double>::const_iterator i=bv.begin();
i!=bv.end(); ++i)
- Assert (std::fabs(u(i->first) - i->second) < 1e-8,
- ExcInternalError());
+ AssertThrow (std::fabs(u(i->first) - i->second) < 1e-8,
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 by the deal.II authors
+// Copyright (C) 2014-2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
cell != triangulation.end(); ++cell, ++index)
if (flags[index])
cell->set_refine_flag();
- Assert (index == triangulation.n_active_cells(), ExcInternalError());
+ AssertThrow (index == triangulation.n_active_cells(), ExcInternalError());
// flag all other cells for coarsening
// (this should ensure that at least
FE_Q<dim> fe(2);
DoFHandler<dim> dof_handler (triangulation);
dof_handler.distribute_dofs(fe);
-
+
// now extract patches and print the mapping from global to patch dofs
for (typename DoFHandler<dim>::active_cell_iterator
- cell = dof_handler.begin_active();
+ cell = dof_handler.begin_active();
cell != dof_handler.end(); ++cell)
{
const std::vector<types::global_dof_index>
- m = DoFTools::get_dofs_on_patch<DoFHandler<dim> >
- (GridTools::get_patch_around_cell<DoFHandler<dim> > (cell));
+ m = DoFTools::get_dofs_on_patch<DoFHandler<dim> >
+ (GridTools::get_patch_around_cell<DoFHandler<dim> > (cell));
deallog << cell << ": ";
for (unsigned int i=0; i<m.size(); ++i)
- deallog << i << "->" << m[i]
- << ' ';
+ deallog << i << "->" << m[i]
+ << ' ';
deallog << std::endl;
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
cell != triangulation.end(); ++cell, ++index)
if (flags[index])
cell->set_refine_flag();
- Assert (index == triangulation.n_active_cells(), ExcInternalError());
+ AssertThrow (index == triangulation.n_active_cells(), ExcInternalError());
// flag all other cells for coarsening
// (this should ensure that at least
// now extract patches and print every fifth of them
unsigned int index = 0;
for (typename Triangulation<dim>::active_cell_iterator
- cell = triangulation.begin_active();
+ cell = triangulation.begin_active();
cell != triangulation.end(); ++cell, ++index)
{
std::vector<typename Triangulation<dim>::active_cell_iterator> patch_cells
- = GridTools::get_patch_around_cell<Triangulation<dim> > (cell);
+ = GridTools::get_patch_around_cell<Triangulation<dim> > (cell);
if (index % 5 == 0)
- {
- deallog << "Patch around cell " << cell << ": ";
- for (unsigned int i=0; i<patch_cells.size(); ++i)
- deallog << patch_cells[i] << ' ';
- deallog << std::endl;
- }
+ {
+ deallog << "Patch around cell " << cell << ": ";
+ for (unsigned int i=0; i<patch_cells.size(); ++i)
+ deallog << patch_cells[i] << ' ';
+ deallog << std::endl;
+ }
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2007 - 2014 by the deal.II authors
+// Copyright (C) 2007 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
cell = tria.begin_active();
cell != tria.end(); ++cell)
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- Assert (cell->face(f)->at_boundary() == cell->at_boundary(f),
- ExcInternalError());
+ AssertThrow (cell->face(f)->at_boundary() == cell->at_boundary(f),
+ ExcInternalError());
// also output something slightly
// more useful
cell != tria.end(); ++cell)
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
if (cell->face(f)->at_boundary())
- for (unsigned int l=0; l<GeometryInfo<dim>::lines_per_face; ++l)
- Assert (cell->face(f)->line(l)->boundary_indicator()
- ==
- cell->face(f)->boundary_indicator(),
- ExcInternalError());
+ for (unsigned int l=0; l<GeometryInfo<dim>::lines_per_face; ++l)
+ AssertThrow (cell->face(f)->line(l)->boundary_indicator()
+ ==
+ cell->face(f)->boundary_indicator(),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2002 - 2014 by the deal.II authors
+// Copyright (C) 2002 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int e=0; e<GeometryInfo<2>::faces_per_cell; ++e)
if (f != e)
if (!cell->at_boundary(e) && !cell->at_boundary(f))
- Assert (cell->neighbor(e) !=
- cell->neighbor(f),
- ExcInternalError());
+ AssertThrow (cell->neighbor(e) !=
+ cell->neighbor(f),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// and compare whether we really got the
// same right hand side vector
test -= system_rhs;
- Assert (test.l2_norm() <= 1e-12, ExcInternalError());
+ AssertThrow (test.l2_norm() <= 1e-12, ExcInternalError());
}
template <int dim>
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
triangulation.refine_global (3);
std::map<types::material_id, const Function<dim>*> functions;
for (typename Triangulation<dim>::active_cell_iterator
- cell = triangulation.begin_active();
+ cell = triangulation.begin_active();
cell != triangulation.end();
++cell)
{
cell->set_material_id(cell->index() % 128);
if (functions.find(cell->index() % 128) == functions.end())
- functions[cell->index() % 128]
- = new ConstantFunction<dim>(cell->index() % 128);
+ functions[cell->index() % 128]
+ = new ConstantFunction<dim>(cell->index() % 128);
}
-
+
for (unsigned int p=1; p<7-dim; ++p)
{
FE_DGQ<dim> fe(p);
Vector<double> interpolant (dof_handler.n_dofs());
VectorTools::interpolate_based_on_material_id (MappingQ1<dim>(),
- dof_handler,
- functions,
- interpolant);
+ dof_handler,
+ functions,
+ interpolant);
for (typename DoFHandler<dim>::active_cell_iterator
- cell = dof_handler.begin_active();
- cell != dof_handler.end();
- ++cell)
- {
- Vector<double> values (fe.dofs_per_cell);
- cell->get_dof_values (interpolant, values);
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- Assert (values[i] == cell->index() % 128, ExcInternalError());
- }
+ cell = dof_handler.begin_active();
+ cell != dof_handler.end();
+ ++cell)
+ {
+ Vector<double> values (fe.dofs_per_cell);
+ cell->get_dof_values (interpolant, values);
+ for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+ AssertThrow (values[i] == cell->index() % 128, ExcInternalError());
+ }
}
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
if (fixed_dofs[i] == true)
{
- Assert (dirichlet_dofs[i] == 13, ExcInternalError());
+ AssertThrow (dirichlet_dofs[i] == 13, ExcInternalError());
}
else
{
- Assert (dirichlet_dofs[i] == 1, ExcInternalError());
+ AssertThrow (dirichlet_dofs[i] == 1, ExcInternalError());
};
};
cell != triangulation.end(); ++cell)
for (unsigned int face_no=0;
face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
- Assert (cell->at_boundary(face_no)
- ==
- cell->face(face_no)->at_boundary(),
- ExcInternalError());
+ AssertThrow (cell->at_boundary(face_no)
+ ==
+ cell->face(face_no)->at_boundary(),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
cell = triangulation.begin();
cell != triangulation.end(); ++cell)
{
- Assert ((cell->refine_flag_set() == false)
- &&
- (cell->coarsen_flag_set() == false),
- ExcInternalError());
+ AssertThrow ((cell->refine_flag_set() == false)
+ &&
+ (cell->coarsen_flag_set() == false),
+ ExcInternalError());
if (!cell->active())
- Assert (cell_is_patch_level_1<2>(cell),
- ExcInternalError());
+ AssertThrow (cell_is_patch_level_1<2>(cell),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
face=cell->face(face_no);
boundary.get_normals_at_vertices(face, normals);
for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
- Assert ((boundary.normal_vector (face,
- face->vertex(v))
- -
- normals[v] / normals[v].norm()).norm()
- <
- 1e-12,
- ExcInternalError());
+ AssertThrow ((boundary.normal_vector (face,
+ face->vertex(v))
+ -
+ normals[v] / normals[v].norm()).norm()
+ <
+ 1e-12,
+ ExcInternalError());
}
tria.clear();
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
face=cell->face(face_no);
boundary.get_normals_at_vertices(face, normals);
for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_face; ++v)
- Assert ((boundary.normal_vector (face,
- face->vertex(v))
- -
- normals[v] / normals[v].norm()).norm()
- <
- 1e-12,
- ExcInternalError());
+ AssertThrow ((boundary.normal_vector (face,
+ face->vertex(v))
+ -
+ normals[v] / normals[v].norm()).norm()
+ <
+ 1e-12,
+ ExcInternalError());
}
tria.clear();
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
Triangulation<3>::face_iterator face = cell->face(face_no);
boundary.get_normals_at_vertices(face, normals);
for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
- Assert ((boundary.normal_vector (face,
- face->vertex(v))
- -
- normals[v] / normals[v].norm()).norm()
- <
- 1e-12,
- ExcInternalError());
+ AssertThrow ((boundary.normal_vector (face,
+ face->vertex(v))
+ -
+ normals[v] / normals[v].norm()).norm()
+ <
+ 1e-12,
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
Triangulation<2>::face_iterator face = cell->face(face_no);
boundary.get_normals_at_vertices(face, normals);
for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_face; ++v)
- Assert ((boundary.normal_vector (face,
- face->vertex(v))
- -
- normals[v] / normals[v].norm()).norm()
- <
- 1e-12,
- ExcInternalError());
+ AssertThrow ((boundary.normal_vector (face,
+ face->vertex(v))
+ -
+ normals[v] / normals[v].norm()).norm()
+ <
+ 1e-12,
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// trial_point than any of
// the vertices of the quad
for (unsigned int v=0; v<4; ++v)
- Assert (p.distance (trial_point) <=
- quad->vertex(v).distance (trial_point),
- ExcInternalError());
+ AssertThrow (p.distance (trial_point) <=
+ quad->vertex(v).distance (trial_point),
+ ExcInternalError());
}
tria.clear();
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// trial_point than any of
// the vertices of the quad
for (unsigned int v=0; v<4; ++v)
- Assert (p.distance (trial_point) <=
- quad->vertex(v).distance (trial_point),
- ExcInternalError());
+ AssertThrow (p.distance (trial_point) <=
+ quad->vertex(v).distance (trial_point),
+ ExcInternalError());
}
deallog << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// now verify that it is really only the active cells
for (auto cell : tr.cell_iterators())
- Assert (cell->user_flag_set() == !cell->has_children(),
- ExcInternalError());
+ AssertThrow (cell->user_flag_set() == !cell->has_children(),
+ ExcInternalError());
}
// now do the same again for all levels of the triangulation
{
tr.clear_user_flags ();
for (auto cell : tr.active_cell_iterators_on_level(l))
- cell->set_user_flag();
+ cell->set_user_flag();
for (auto cell : tr.cell_iterators_on_level(l))
- Assert (cell->user_flag_set() == !cell->has_children(),
- ExcInternalError());
-
+ AssertThrow (cell->user_flag_set() == !cell->has_children(),
+ ExcInternalError());
+
for (auto cell : tr.cell_iterators())
- Assert ((cell->user_flag_set() == !cell->has_children())
- ||
- (l != cell->level()),
- ExcInternalError());
+ AssertThrow ((cell->user_flag_set() == !cell->has_children())
+ ||
+ (l != cell->level()),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2007 - 2014 by the deal.II authors
+// Copyright (C) 2007 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
deallog << n << std::endl;
if (t==0)
- Assert (n == GeometryInfo<dim>::max_children_per_cell,
- ExcInternalError())
- else
- Assert (n == 2,
- ExcInternalError());
+ {
+ AssertThrow (n == GeometryInfo<dim>::max_children_per_cell,
+ ExcInternalError());
+ }
+ else
+ {
+ AssertThrow (n == 2,
+ ExcInternalError());
+ }
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2001 - 2014 by the deal.II authors
+// Copyright (C) 2001 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int d=0; d<dim; ++d)
if (cell->center()(d) > 0)
subdomain |= (1<<d);
- Assert (subdomain < (1<<dim), ExcInternalError());
+ AssertThrow (subdomain < (1<<dim), ExcInternalError());
cell->set_subdomain_id (subdomain);
};
std::vector<unsigned int> subdomain_cells(1<<dim, 0);
for (; cell!=endc; ++cell)
{
- Assert (cell->subdomain_id() < (1<<dim), ExcInternalError());
+ AssertThrow (cell->subdomain_id() < (1<<dim), ExcInternalError());
++subdomain_cells[cell->subdomain_id()];
};
for (unsigned int i=0; i<(1<<dim); ++i)
- Assert (subdomain_cells[i] == tria.n_active_cells()/(1<<dim),
- ExcNumberMismatch(subdomain_cells[i],
- tria.n_active_cells()/(1<<dim)));
+ AssertThrow (subdomain_cells[i] == tria.n_active_cells()/(1<<dim),
+ ExcNumberMismatch(subdomain_cells[i],
+ tria.n_active_cells()/(1<<dim)));
deallog << "Check 1 (dim=" << dim << ") ok" << std::endl;
};
std::vector<unsigned int> subdomain_cells(1<<dim, 0);
for (; cell!=endc; ++cell)
{
- Assert (cell->subdomain_id() < (1<<dim), ExcInternalError());
+ AssertThrow (cell->subdomain_id() < (1<<dim), ExcInternalError());
++subdomain_cells[cell->subdomain_id()];
};
for (unsigned int i=0; i<(1<<dim); ++i)
- Assert (subdomain_cells[i] == tria.n_active_cells()/(1<<dim),
- ExcNumberMismatch(subdomain_cells[i],
- tria.n_active_cells()/(1<<dim)));
+ AssertThrow (subdomain_cells[i] == tria.n_active_cells()/(1<<dim),
+ ExcNumberMismatch(subdomain_cells[i],
+ tria.n_active_cells()/(1<<dim)));
deallog << "Check 2 (dim=" << dim << ") ok" << std::endl;
};
{
DoFTools::extract_subdomain_dofs (dof_handler, subdomain,
selected_dofs);
- Assert (static_cast<unsigned int>(std::count (selected_dofs.begin(),
- selected_dofs.end(),
- true))
- ==
- dof_handler.n_dofs() / (1<<dim),
- ExcNumberMismatch(std::count (selected_dofs.begin(),
- selected_dofs.end(),
- true),
- dof_handler.n_dofs() / (1<<dim)));
+ AssertThrow (static_cast<unsigned int>(std::count (selected_dofs.begin(),
+ selected_dofs.end(),
+ true))
+ ==
+ dof_handler.n_dofs() / (1<<dim),
+ ExcNumberMismatch(std::count (selected_dofs.begin(),
+ selected_dofs.end(),
+ true),
+ dof_handler.n_dofs() / (1<<dim)));
}
deallog << "Check 3 (dim=" << dim << ") ok" << std::endl;
};
{
DoFTools::extract_subdomain_dofs (dof_handler, subdomain,
selected_dofs);
- Assert (static_cast<unsigned int>(std::count (selected_dofs.begin(),
- selected_dofs.end(),
- true))
- ==
- std::pow(static_cast<double>(cells_per_direction/2+1),dim),
- ExcNumberMismatch(std::count (selected_dofs.begin(),
- selected_dofs.end(),
- true),
- static_cast<unsigned int>(std::pow(static_cast<double>(
- cells_per_direction/2+1),dim))));
+ AssertThrow (static_cast<unsigned int>(std::count (selected_dofs.begin(),
+ selected_dofs.end(),
+ true))
+ ==
+ std::pow(static_cast<double>(cells_per_direction/2+1),dim),
+ ExcNumberMismatch(std::count (selected_dofs.begin(),
+ selected_dofs.end(),
+ true),
+ static_cast<unsigned int>(std::pow(static_cast<double>(
+ cells_per_direction/2+1),dim))));
}
deallog << "Check 4 (dim=" << dim << ") ok" << std::endl;
};
// ---------------------------------------------------------------------
//
-// Copyright (C) 2001 - 2014 by the deal.II authors
+// Copyright (C) 2001 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
cell = tria.begin_active (),
endc = tria.end ();
for (; cell!=endc; ++cell)
- Assert (cell->subdomain_id() == 42,
- ExcInternalError());
+ AssertThrow (cell->subdomain_id() == 42,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
td.end_sweep ();
// make sure we have called TimeStep::end_sweep once for every time step object
- Assert (end_sweep_flags == std::vector<bool> (n_time_steps, true),
- ExcInternalError());
+ AssertThrow (end_sweep_flags == std::vector<bool> (n_time_steps, true),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
cell != triangulation.end(); ++cell, ++index)
if (flags[index])
cell->set_refine_flag();
- Assert (index == triangulation.n_active_cells(), ExcInternalError());
+ AssertThrow (index == triangulation.n_active_cells(), ExcInternalError());
// flag all other cells for coarsening
// (this should ensure that at least
std::vector<types::global_dof_index> dofs_per_block (fe.n_components());
DoFTools::count_dofs_per_block (dof_handler, dofs_per_block);
- Assert (std::accumulate (dofs_per_block.begin(), dofs_per_block.end(), 0U)
- == dof_handler.n_dofs(),
- ExcInternalError());
+ AssertThrow (std::accumulate (dofs_per_block.begin(), dofs_per_block.end(), 0U)
+ == dof_handler.n_dofs(),
+ ExcInternalError());
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
if (myid == 0)
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
cell != triangulation.end(); ++cell, ++index)
if (flags[index])
cell->set_refine_flag();
- Assert (index == triangulation.n_active_cells(), ExcInternalError());
+ AssertThrow (index == triangulation.n_active_cells(), ExcInternalError());
// flag all other cells for coarsening
// (this should ensure that at least
IndexSet all (N);
all.add_range (0, N);
- Assert (dof_handler.n_locally_owned_dofs() == N,
- ExcInternalError());
- Assert (dof_handler.locally_owned_dofs() == all,
- ExcInternalError());
- Assert (dof_handler.n_locally_owned_dofs_per_processor() ==
- std::vector<types::global_dof_index> (1,N),
- ExcInternalError());
- Assert (dof_handler.locally_owned_dofs_per_processor() ==
- std::vector<IndexSet>(1,all),
- ExcInternalError());
+ AssertThrow (dof_handler.n_locally_owned_dofs() == N,
+ ExcInternalError());
+ AssertThrow (dof_handler.locally_owned_dofs() == all,
+ ExcInternalError());
+ AssertThrow (dof_handler.n_locally_owned_dofs_per_processor() ==
+ std::vector<types::global_dof_index> (1,N),
+ ExcInternalError());
+ AssertThrow (dof_handler.locally_owned_dofs_per_processor() ==
+ std::vector<IndexSet>(1,all),
+ ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void test ()
{
BlockMask m;
- Assert (m[0] == true, ExcInternalError());
- Assert (m[42] == true, ExcInternalError());
- Assert (m[1000000000] == true, ExcInternalError());
+ AssertThrow (m[0] == true, ExcInternalError());
+ AssertThrow (m[42] == true, ExcInternalError());
+ AssertThrow (m[1000000000] == true, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// verify equality
for (unsigned int i=0; i<v.size(); ++i)
- Assert (m[i] == v[i], ExcInternalError());
+ AssertThrow (m[i] == v[i], ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void test ()
{
- Assert (BlockMask(12, false).size() == 12, ExcInternalError());
- Assert (BlockMask().size() == 0, ExcInternalError());
+ AssertThrow (BlockMask(12, false).size() == 12, ExcInternalError());
+ AssertThrow (BlockMask().size() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void test ()
{
// test for an initialized mask
- Assert (BlockMask(12,false).represents_n_blocks(12) == true,
- ExcInternalError());
- Assert (BlockMask(12,false).represents_n_blocks(13) == false,
- ExcInternalError());
+ AssertThrow (BlockMask(12,false).represents_n_blocks(12) == true,
+ ExcInternalError());
+ AssertThrow (BlockMask(12,false).represents_n_blocks(13) == false,
+ ExcInternalError());
// test for an empty mask
- Assert (BlockMask().represents_n_blocks(12) == true,
- ExcInternalError());
- Assert (BlockMask().represents_n_blocks(13) == true,
- ExcInternalError());
+ AssertThrow (BlockMask().represents_n_blocks(12) == true,
+ ExcInternalError());
+ AssertThrow (BlockMask().represents_n_blocks(13) == true,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void test ()
{
// test for an initialized mask
- Assert (BlockMask(12,false).represents_the_all_selected_mask() == false,
- ExcInternalError());
+ AssertThrow (BlockMask(12,false).represents_the_all_selected_mask() == false,
+ ExcInternalError());
// note the semantics of the following as
// described in the documentation
- Assert (BlockMask(12,true).represents_the_all_selected_mask() == false,
- ExcInternalError());
+ AssertThrow (BlockMask(12,true).represents_the_all_selected_mask() == false,
+ ExcInternalError());
// test for an empty mask
- Assert (BlockMask().represents_the_all_selected_mask() == true,
- ExcInternalError());
+ AssertThrow (BlockMask().represents_the_all_selected_mask() == true,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// verify equality
for (unsigned int i=0; i<v1.size(); ++i)
- Assert (m[i] == (v1[i] || v2[i]), ExcInternalError());
+ AssertThrow (m[i] == (v1[i] || v2[i]), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// verify equality
for (unsigned int i=0; i<v1.size(); ++i)
- Assert (m[i] == (v1[i] && v2[i]), ExcInternalError());
+ AssertThrow (m[i] == (v1[i] && v2[i]), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
BlockMask m = m1 | m2;
// verify equality
- Assert (m == BlockMask(v),
- ExcInternalError());
- Assert (!(m == m1),
- ExcInternalError());
- Assert (!(m == BlockMask(v1)),
- ExcInternalError());
- Assert (!(m == BlockMask(v2)),
- ExcInternalError());
+ AssertThrow (m == BlockMask(v),
+ ExcInternalError());
+ AssertThrow (!(m == m1),
+ ExcInternalError());
+ AssertThrow (!(m == BlockMask(v1)),
+ ExcInternalError());
+ AssertThrow (!(m == BlockMask(v2)),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
delta_x;
}
- Assert ((gradient-fd_grad).norm () <= 2e-5,
- ExcInternalError());
+ AssertThrow ((gradient-fd_grad).norm () <= 2e-5,
+ ExcInternalError());
}
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void test ()
{
ComponentMask m;
- Assert (m[0] == true, ExcInternalError());
- Assert (m[42] == true, ExcInternalError());
- Assert (m[1000000000] == true, ExcInternalError());
+ AssertThrow (m[0] == true, ExcInternalError());
+ AssertThrow (m[42] == true, ExcInternalError());
+ AssertThrow (m[1000000000] == true, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// verify equality
for (unsigned int i=0; i<v.size(); ++i)
- Assert (m[i] == v[i], ExcInternalError());
+ AssertThrow (m[i] == v[i], ExcInternalError());
// this needs to throw an exception
try
// verify equality
for (unsigned int i=0; i<v.size(); ++i)
- Assert (m[i] == v[i], ExcInternalError());
+ AssertThrow (m[i] == v[i], ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void test ()
{
- Assert (ComponentMask(12, false).size() == 12, ExcInternalError());
- Assert (ComponentMask().size() == 0, ExcInternalError());
+ AssertThrow (ComponentMask(12, false).size() == 12, ExcInternalError());
+ AssertThrow (ComponentMask().size() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void test ()
{
// test for an initialized mask
- Assert (ComponentMask(12,false).represents_n_components(12) == true,
- ExcInternalError());
- Assert (ComponentMask(12,false).represents_n_components(13) == false,
- ExcInternalError());
+ AssertThrow (ComponentMask(12,false).represents_n_components(12) == true,
+ ExcInternalError());
+ AssertThrow (ComponentMask(12,false).represents_n_components(13) == false,
+ ExcInternalError());
// test for an empty mask
- Assert (ComponentMask().represents_n_components(12) == true,
- ExcInternalError());
- Assert (ComponentMask().represents_n_components(13) == true,
- ExcInternalError());
+ AssertThrow (ComponentMask().represents_n_components(12) == true,
+ ExcInternalError());
+ AssertThrow (ComponentMask().represents_n_components(13) == true,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void test ()
{
// test for an initialized mask
- Assert (ComponentMask(12,false).represents_the_all_selected_mask() == false,
- ExcInternalError());
+ AssertThrow (ComponentMask(12,false).represents_the_all_selected_mask() == false,
+ ExcInternalError());
// note the semantics of the following as
// described in the documentation
- Assert (ComponentMask(12,true).represents_the_all_selected_mask() == false,
- ExcInternalError());
+ AssertThrow (ComponentMask(12,true).represents_the_all_selected_mask() == false,
+ ExcInternalError());
// test for an empty mask
- Assert (ComponentMask().represents_the_all_selected_mask() == true,
- ExcInternalError());
+ AssertThrow (ComponentMask().represents_the_all_selected_mask() == true,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// verify equality
for (unsigned int i=0; i<v1.size(); ++i)
- Assert (m[i] == (v1[i] || v2[i]), ExcInternalError());
+ AssertThrow (m[i] == (v1[i] || v2[i]), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// verify equality
for (unsigned int i=0; i<v1.size(); ++i)
- Assert (m[i] == (v1[i] && v2[i]), ExcInternalError());
+ AssertThrow (m[i] == (v1[i] && v2[i]), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
ComponentMask m = m1 | m2;
// verify equality
- Assert (m == ComponentMask(v),
- ExcInternalError());
- Assert (!(m == m1),
- ExcInternalError());
- Assert (!(m == ComponentMask(v1)),
- ExcInternalError());
- Assert (!(m == ComponentMask(v2)),
- ExcInternalError());
+ AssertThrow (m == ComponentMask(v),
+ ExcInternalError());
+ AssertThrow (!(m == m1),
+ ExcInternalError());
+ AssertThrow (!(m == ComponentMask(v1)),
+ ExcInternalError());
+ AssertThrow (!(m == ComponentMask(v2)),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// element corresponds to a
// block)
for (unsigned int c=0; c<fe.n_components(); ++c)
- Assert (component_mask[c] == fe.block_mask(component_mask)[c],
- ExcInternalError());
+ AssertThrow (component_mask[c] == fe.block_mask(component_mask)[c],
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
block_mask[c] = (int_mask & (1<<c));
// make sure that the round-trip works
- Assert (BlockMask(block_mask) == fe.block_mask(fe.component_mask(BlockMask(block_mask))),
- ExcInternalError());
+ AssertThrow (BlockMask(block_mask) == fe.block_mask(fe.component_mask(BlockMask(block_mask))),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
fe_values.reinit (cell);
for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
- Assert (fe_values.shape_value (0,q) == 1,
- ExcInternalError());
+ AssertThrow (fe_values.shape_value (0,q) == 1,
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int i=0; i<fine_fe.dofs_per_cell; ++i)
for (unsigned int j=0; j<coarse_fe.dofs_per_cell; ++j)
injection_2(i,j) -= injection_1(i,j);
- Assert (injection_2.frobenius_norm() <=
- 1e-12 * injection_1.frobenius_norm(),
- ExcInternalError());
+ AssertThrow (injection_2.frobenius_norm() <=
+ 1e-12 * injection_1.frobenius_norm(),
+ ExcInternalError());
}
}
// some numerical checks for correctness
for (unsigned int i=0; i<2; ++i)
{
- Assert (std::fabs(c1_values.normal_vector(i) *
- c1_values.normal_vector(i) - 1) < 1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs(c1_values.normal_vector(i) *
+ c1_values.normal_vector(i) - 1) < 1e-14,
+ ExcInternalError());
Point<2> radius = c1_values.quadrature_point(i);
radius /= std::sqrt(radius.square());
- Assert ((radius-c1_values.normal_vector(i)).norm_square() < 1e-14,
- ExcInternalError());
+ AssertThrow ((radius-c1_values.normal_vector(i)).norm_square() < 1e-14,
+ ExcInternalError());
};
};
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// the same point again
const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
- Assert (unit_points[i].distance(p_unit) < 1e-10,
- ExcInternalError());
+ AssertThrow (unit_points[i].distance(p_unit) < 1e-10,
+ ExcInternalError());
}
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// the same point again
const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
- Assert (unit_points[i].distance(p_unit) < 1e-10,
- ExcInternalError());
+ AssertThrow (unit_points[i].distance(p_unit) < 1e-10,
+ ExcInternalError());
}
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// the same point again
const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
- Assert (unit_points[i].distance(p_unit) < 1e-10,
- ExcInternalError());
+ AssertThrow (unit_points[i].distance(p_unit) < 1e-10,
+ ExcInternalError());
}
deallog << "OK" << std::endl;
}
// the same point again
const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
- Assert (unit_points[i].distance(p_unit) < 1e-10,
- ExcInternalError());
+ AssertThrow (unit_points[i].distance(p_unit) < 1e-10,
+ ExcInternalError());
}
}
deallog << "OK" << std::endl;
// written out a little bit, only
// write every so-many-th element
SparseMatrix<double>::const_iterator p1 = A1.begin(),
- p2 = A2.begin(),
- p3 = A3.begin();
+ p2 = A2.begin(),
+ p3 = A3.begin();
for (unsigned int i=0; i<A1.n_nonzero_elements(); ++i, ++p1, ++p2, ++p3)
{
if (i % (dim*dim*dim) == 0)
deallog << i << ' ' << p1->value() << std::endl;
- Assert (p1->value() == p2->value(),
- ExcInternalError());
- Assert (p1->value() == p3->value(),
- ExcInternalError());
+ AssertThrow (p1->value() == p2->value(),
+ ExcInternalError());
+ AssertThrow (p1->value() == p3->value(),
+ ExcInternalError());
};
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2014 by the deal.II authors
+// Copyright (C) 2013 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
hierarchic_to_lexicographic_numbering[next_index++] = (n-1)*n*n+n*(i+1)+j+1;
// inside hex
- Assert (fe.dofs_per_hex == fe.dofs_per_quad*fe.dofs_per_line,
- ExcInternalError());
+ AssertThrow (fe.dofs_per_hex == fe.dofs_per_quad*fe.dofs_per_line,
+ ExcInternalError());
for (unsigned int i=0; i<fe.dofs_per_line; ++i)
for (unsigned int j=0; j<fe.dofs_per_line; ++j)
for (unsigned int k=0; k<fe.dofs_per_line; ++k)
hierarchic_to_lexicographic_numbering[next_index++] = n*n*(i+1)+n*(j+1)+k+1;
- Assert (next_index == fe.dofs_per_cell, ExcInternalError());
+ AssertThrow (next_index == fe.dofs_per_cell, ExcInternalError());
break;
}
// for equality
std::vector<unsigned int> h2l (fe.dofs_per_cell);
FETools::hierarchic_to_lexicographic_numbering (fe, h2l);
- Assert (hierarchic_to_lexicographic_numbering == h2l,
- ExcInternalError());
+ AssertThrow (hierarchic_to_lexicographic_numbering == h2l,
+ ExcInternalError());
}
for (unsigned int c=0; c<fe.get_fe().n_components(); ++c)
{
if (fe.get_fe().system_to_component_index(i).first == c)
- Assert ((fe.shape_value(i,k) ==
- fe.shape_value_component(i,k,c))
- &&
- (fe.shape_grad(i,k) ==
- fe.shape_grad_component(i,k,c))
- &&
- (fe.shape_hessian(i,k) ==
- fe.shape_hessian_component(i,k,c)),
- ExcInternalError())
+ AssertThrow ((fe.shape_value(i,k) ==
+ fe.shape_value_component(i,k,c))
+ &&
+ (fe.shape_grad(i,k) ==
+ fe.shape_grad_component(i,k,c))
+ &&
+ (fe.shape_hessian(i,k) ==
+ fe.shape_hessian_component(i,k,c)),
+ ExcInternalError())
else
- Assert ((fe.shape_value_component(i,k,c) == 0) &&
- (fe.shape_grad_component(i,k,c) == Tensor<1,dim>()) &&
- (fe.shape_hessian_component(i,k,c) == Tensor<2,dim>()),
- ExcInternalError());
+ AssertThrow ((fe.shape_value_component(i,k,c) == 0) &&
+ (fe.shape_grad_component(i,k,c) == Tensor<1,dim>()) &&
+ (fe.shape_hessian_component(i,k,c) == Tensor<2,dim>()),
+ ExcInternalError());
};
}
deallog << std::endl;
if (fe.get_fe().system_to_component_index(i).first == c)
{
if (uflags & update_values)
- Assert ((fe.shape_value(i,k) == fe.shape_value_component(i,k,c)),
- ExcInternalError());
+ AssertThrow ((fe.shape_value(i,k) == fe.shape_value_component(i,k,c)),
+ ExcInternalError());
if (uflags & update_gradients)
- Assert((fe.shape_grad(i,k) == fe.shape_grad_component(i,k,c)),
- ExcInternalError());
+ AssertThrow((fe.shape_grad(i,k) == fe.shape_grad_component(i,k,c)),
+ ExcInternalError());
if (uflags & update_hessians)
- Assert((fe.shape_hessian(i,k) == fe.shape_hessian_component(i,k,c)),
- ExcInternalError());
+ AssertThrow((fe.shape_hessian(i,k) == fe.shape_hessian_component(i,k,c)),
+ ExcInternalError());
}
else
{
if (uflags & update_values)
- Assert ((fe.shape_value_component(i,k,c) == 0),
- ExcInternalError());
+ AssertThrow ((fe.shape_value_component(i,k,c) == 0),
+ ExcInternalError());
if (uflags & update_gradients)
- Assert ((fe.shape_grad_component(i,k,c) == Tensor<1,dim>()),
- ExcInternalError());
+ AssertThrow ((fe.shape_grad_component(i,k,c) == Tensor<1,dim>()),
+ ExcInternalError());
if (uflags & update_hessians)
- Assert ((fe.shape_hessian_component(i,k,c) == Tensor<2,dim>()),
- ExcInternalError());
+ AssertThrow ((fe.shape_hessian_component(i,k,c) == Tensor<2,dim>()),
+ ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2014 by the deal.II authors
+// Copyright (C) 2013 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// to be active, not only
// some of them
for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
- Assert (cell->child(c)->active(), ExcInternalError());
+ AssertThrow (cell->child(c)->active(), ExcInternalError());
// then restrict and prolongate
cell->get_interpolated_dof_values (tmp, v);
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
std::vector<typename Vector::value_type> values1 (indices.size());
vector.extract_subvector_to (indices, values1);
for (unsigned int j=0; j<vector.size()/2; ++j)
- Assert (values1[j] == 2*j, ExcInternalError());
+ AssertThrow (values1[j] == 2*j, ExcInternalError());
// do the same with the version of the function that takes iterators
std::vector<typename Vector::value_type> values2 (indices.size());
vector.extract_subvector_to (indices.begin(),
- indices.end(),
- values2.begin());
+ indices.end(),
+ values2.begin());
for (unsigned int j=0; j<vector.size()/2; ++j)
- Assert (values2[j] == 2*j, ExcInternalError());
+ AssertThrow (values2[j] == 2*j, ExcInternalError());
// done
if (myid==0)
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
std::vector<typename Vector::value_type> values1 (indices.size());
vector.extract_subvector_to (indices, values1);
for (unsigned int j=0; j<vector.size()/2; ++j)
- Assert (values1[j] == 2*j, ExcInternalError());
+ AssertThrow (values1[j] == 2*j, ExcInternalError());
// do the same with the version of the function that takes iterators
std::vector<typename Vector::value_type> values2 (indices.size());
vector.extract_subvector_to (indices.begin(),
- indices.end(),
- values2.begin());
+ indices.end(),
+ values2.begin());
for (unsigned int j=0; j<vector.size()/2; ++j)
- Assert (values2[j] == 2*j, ExcInternalError());
+ AssertThrow (values2[j] == 2*j, ExcInternalError());
// done
if (myid==0)
{
IndexSet block1(10);
if (myid==0)
- block1.add_range(0,7);
+ block1.add_range(0,7);
if (myid==1)
- block1.add_range(7,10);
+ block1.add_range(7,10);
IndexSet block2(6);
if (myid==0)
- block2.add_range(0,2);
+ block2.add_range(0,2);
if (myid==1)
- block2.add_range(2,6);
+ block2.add_range(2,6);
partitioning.push_back(block1);
partitioning.push_back(block2);
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
vertices.insert (cell->face(f)->vertex_index(2));
vertices.insert (cell->face(f)->vertex_index(3));
}
- Assert (vertices.size() == 8, ExcInternalError());
+ AssertThrow (vertices.size() == 8, ExcInternalError());
}
deallog << " ok." << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int ff=0; ff<GeometryInfo<3>::faces_per_cell; ++ff)
if (neighbor->neighbor(ff) == cell)
{
- Assert (found == false, ExcInternalError());
- Assert (ff == nb_nb, ExcInternalError());
+ AssertThrow (found == false, ExcInternalError());
+ AssertThrow (ff == nb_nb, ExcInternalError());
- Assert (cell->face(f) == neighbor->face(ff),
- ExcInternalError());
+ AssertThrow (cell->face(f) == neighbor->face(ff),
+ ExcInternalError());
found = true;
break;
}
- Assert (found == true, ExcInternalError());
+ AssertThrow (found == true, ExcInternalError());
}
deallog << " ok." << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
const Triangulation<3>::active_cell_iterator neighbor_child
= neighbor->child(neighbor_child_index);
- Assert (neighbor_child->face(neighbor_neighbor) ==
- cell->face(face_no)->child(subface_no),
- ExcInternalError());
- Assert (!neighbor->child(neighbor_child_index)->has_children(),
- ExcInternalError());
+ AssertThrow (neighbor_child->face(neighbor_neighbor) ==
+ cell->face(face_no)->child(subface_no),
+ ExcInternalError());
+ AssertThrow (!neighbor->child(neighbor_child_index)->has_children(),
+ ExcInternalError());
}
}
for (unsigned int q=0; q<quadrature.size(); ++q)
{
- Assert ((fe_face_values1.quadrature_point(q)-
- fe_face_values2.quadrature_point(q)).norm_square()
- < 1e-20,
- ExcInternalError());
-
- Assert (std::fabs(fe_face_values1.JxW(q)-
- fe_face_values2.JxW(q)) < 1e-15,
- ExcInternalError());
- Assert ((fe_face_values1.normal_vector(q) +
- fe_face_values2.normal_vector(q)).norm_square()
- < 1e-20,
- ExcInternalError());
+ AssertThrow ((fe_face_values1.quadrature_point(q)-
+ fe_face_values2.quadrature_point(q)).norm_square()
+ < 1e-20,
+ ExcInternalError());
+
+ AssertThrow (std::fabs(fe_face_values1.JxW(q)-
+ fe_face_values2.JxW(q)) < 1e-15,
+ ExcInternalError());
+ AssertThrow ((fe_face_values1.normal_vector(q) +
+ fe_face_values2.normal_vector(q)).norm_square()
+ < 1e-20,
+ ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure, that both ways yield
// the same result
- Assert (neighbor_child ==
- cell->neighbor_child_on_subface (face_no,
- subface_no),
- ExcInternalError());
+ AssertThrow (neighbor_child ==
+ cell->neighbor_child_on_subface (face_no,
+ subface_no),
+ ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// CellAccessor::neighbor_child_on_subface it
// should work. let's make sure we get the
// status we expect.
- Assert (cell->face(3)->child(1) ==
- neighbor_child->face(cell->neighbor_of_neighbor(3)),
- ExcInternalError());
+ AssertThrow (cell->face(3)->child(1) ==
+ neighbor_child->face(cell->neighbor_of_neighbor(3)),
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
const unsigned int our_face_no=neighbor_child->neighbor_of_coarser_neighbor(neighbor_neighbor).first;
const unsigned int our_subface_no=neighbor_child->neighbor_of_coarser_neighbor(neighbor_neighbor).second;
- Assert (our_face_no==face_no, ExcInternalError());
- Assert (our_subface_no==subface_no, ExcInternalError());
+ AssertThrow (our_face_no==face_no, ExcInternalError());
+ AssertThrow (our_subface_no==subface_no, ExcInternalError());
deallog << "from coarse to fine and back: OK" <<std::endl;
}
else if (cell->neighbor(face_no)->level()<cell->level())
// try to find the way back to our cell
const DoFHandler<3>::active_cell_iterator our_cell=cell->neighbor(face_no)->neighbor_child_on_subface(neighbor_face_no,
neighbor_subface_no);
- Assert (our_cell==cell, ExcInternalError());
+ AssertThrow (our_cell==cell, ExcInternalError());
deallog << "from fine to coarse and back: OK" <<std::endl;
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure by hand that certain
// vertices match up
- Assert (cells[0]->vertex(1) == cells[1]->vertex(4),
- ExcInternalError());
- Assert (cells[0]->vertex(3) == cells[1]->vertex(6),
- ExcInternalError());
- Assert (cells[0]->vertex(5) == cells[1]->vertex(5),
- ExcInternalError());
- Assert (cells[0]->vertex(7) == cells[1]->vertex(7),
- ExcInternalError());
+ AssertThrow (cells[0]->vertex(1) == cells[1]->vertex(4),
+ ExcInternalError());
+ AssertThrow (cells[0]->vertex(3) == cells[1]->vertex(6),
+ ExcInternalError());
+ AssertThrow (cells[0]->vertex(5) == cells[1]->vertex(5),
+ ExcInternalError());
+ AssertThrow (cells[0]->vertex(7) == cells[1]->vertex(7),
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
std::set<Triangulation<3>::line_iterator> lines;
for (unsigned int l=0; l<GeometryInfo<3>::lines_per_cell; ++l)
{
- Assert (lines.find (cell->line(l)) == lines.end(),
- ExcInternalError());
+ AssertThrow (lines.find (cell->line(l)) == lines.end(),
+ ExcInternalError());
lines.insert (cell->line(l));
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2003 - 2014 by the deal.II authors
+// Copyright (C) 2003 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
vertices.insert (cell->line(l)->vertex_index(0));
vertices.insert (cell->line(l)->vertex_index(1));
}
- Assert (vertices.size() == 8, ExcInternalError());
+ AssertThrow (vertices.size() == 8, ExcInternalError());
}
deallog << " ok." << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
cell->line(line)->get_dof_indices (line_dof_indices_2,
cell->line(line)->nth_active_fe_index(j));
- Assert (line_dof_indices_1 == line_dof_indices_2,
- ExcInternalError());
+ AssertThrow (line_dof_indices_1 == line_dof_indices_2,
+ ExcInternalError());
}
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
cell != triangulation.end(); ++cell, ++index)
if (flags[index])
cell->set_refine_flag();
- Assert (index == triangulation.n_active_cells(), ExcInternalError());
+ AssertThrow (index == triangulation.n_active_cells(), ExcInternalError());
// flag all other cells for coarsening
// (this should ensure that at least
IndexSet all (N);
all.add_range (0, N);
- Assert (dof_handler.n_locally_owned_dofs() == N,
- ExcInternalError());
- Assert (dof_handler.locally_owned_dofs() == all,
- ExcInternalError());
- Assert (dof_handler.n_locally_owned_dofs_per_processor() ==
- std::vector<types::global_dof_index> (1,N),
- ExcInternalError());
- Assert (dof_handler.locally_owned_dofs_per_processor() ==
- std::vector<IndexSet>(1,all),
- ExcInternalError());
+ AssertThrow (dof_handler.n_locally_owned_dofs() == N,
+ ExcInternalError());
+ AssertThrow (dof_handler.locally_owned_dofs() == all,
+ ExcInternalError());
+ AssertThrow (dof_handler.n_locally_owned_dofs_per_processor() ==
+ std::vector<types::global_dof_index> (1,N),
+ ExcInternalError());
+ AssertThrow (dof_handler.locally_owned_dofs_per_processor() ==
+ std::vector<IndexSet>(1,all),
+ ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
hp::FECollection<dim> fe_collection;
fe_collection.push_back (FESystem<dim>(FE_Q<dim>(2),dim));
fe_collection.push_back (FESystem<dim>(FE_Q<dim>(2),dim));
- Assert (fe_collection.n_components() == dim,
- ExcInternalError());
+ AssertThrow (fe_collection.n_components() == dim,
+ ExcInternalError());
}
// now the same with one of the elements
hp::FECollection<dim> fe_collection;
fe_collection.push_back (FESystem<dim>(FE_Q<dim>(2),dim));
fe_collection.push_back (FE_RaviartThomas<dim>(1));
- Assert (fe_collection.n_components() == dim,
- ExcInternalError());
+ AssertThrow (fe_collection.n_components() == dim,
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
hp::FECollection<dim> fe_collection;
fe_collection.push_back (FESystem<dim>(FE_Q<dim>(2),dim));
fe_collection.push_back (FESystem<dim>(FE_Q<dim>(2),dim));
- Assert (fe_collection.n_components() == dim,
- ExcInternalError());
+ AssertThrow (fe_collection.n_components() == dim,
+ ExcInternalError());
}
// now the same with one of the elements
hp::FECollection<dim> fe_collection;
fe_collection.push_back (FESystem<dim>(FESystem<dim>(FE_Q<dim>(2),dim),1));
fe_collection.push_back (FE_RaviartThomas<dim>(1));
- Assert (fe_collection.n_blocks() == 1,
- ExcInternalError());
+ AssertThrow (fe_collection.n_blocks() == 1,
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 1998 - 2014 by the deal.II authors
+// Copyright (C) 1998 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// then do the same with the "correct", local fe_index
Vector<double> local2 (cell->get_fe().dofs_per_cell);
cell->get_interpolated_dof_values (solution, local2,
- cell->active_fe_index());
+ cell->active_fe_index());
// and do it a third time with the fe_index for a Q1 element
Vector<double> local3 (fe[0].dofs_per_cell);
cell->get_interpolated_dof_values (solution, local3,
- 0);
+ 0);
// now verify correctness
- Assert (local1 == local2, ExcInternalError());
+ AssertThrow (local1 == local2, ExcInternalError());
// also for the second test. note that vertex dofs always come first in
// local1, so we can easily compare
for (unsigned int i=0; i<fe[0].dofs_per_cell; ++i)
- Assert (local1[i] == local3[i],
- ExcInternalError());
+ AssertThrow (local1[i] == local3[i],
+ ExcInternalError());
}
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// brings us back to the first of the
// three identical elements in the
// collection)
- Assert (identities ==
- fe_collection[i/3*3].hp_line_dof_identities (fe_collection[j/3*3]),
- ExcInternalError());
+ AssertThrow (identities ==
+ fe_collection[i/3*3].hp_line_dof_identities (fe_collection[j/3*3]),
+ ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// also ensure that we indeed get the
// same value on every cell
diff. add(-1);
- Assert (diff.l2_norm() == 0, ExcInternalError());
+ AssertThrow (diff.l2_norm() == 0, ExcInternalError());
}
// W1infty norm. the Linfty norm is one, so
VectorTools::W1infty_norm);
deallog << "W1infty, diff=" << diff.linfty_norm() << std::endl;
diff.add(-2);
- Assert (diff.l1_norm() > 0.5, ExcInternalError());
+ AssertThrow (diff.l1_norm() > 0.5, ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
hp::QCollection<dim>(QGauss<dim>(q+2)),
VectorTools::L2_norm);
if (q<=p)
- Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
- ExcInternalError());
+ AssertThrow (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+ ExcInternalError());
deallog << fe.get_name() << ", P_" << q
<< ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
hp::QCollection<dim>(QGauss<dim>(q+2)),
VectorTools::L2_norm);
if (q<=p)
- Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
- ExcInternalError());
+ AssertThrow (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+ ExcInternalError());
deallog << fe.get_name() << ", P_" << q
<< ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
hp::QCollection<dim>(QGauss<dim>(q+2)),
VectorTools::L2_norm);
if (q<=p)
- Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
- ExcInternalError());
+ AssertThrow (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+ ExcInternalError());
deallog << fe.get_name() << ", P_" << q
<< ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
hp::QCollection<dim>(QGauss<dim>(q+2)),
VectorTools::L2_norm);
if (q<=p)
- Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
- ExcInternalError());
+ AssertThrow (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+ ExcInternalError());
deallog << fe.get_name() << ", P_" << q
<< ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
DoFRenumbering::block_wise (dof);
const std::vector<types::global_dof_index> vb = get_dofs (dof);
- Assert (vc == vb, ExcInternalError());
+ AssertThrow (vc == vb, ExcInternalError());
deallog << "OK" << std::endl;
}
// make sure all dof indices have
// actually been used
for (unsigned int i=0; i<touched.size(); ++i)
- Assert (touched[i] == true, ExcInternalError());
+ AssertThrow (touched[i] == true, ExcInternalError());
deallog << "OK" << std::endl;
}
DoFRenumbering::block_wise (dof);
const std::vector<types::global_dof_index> vb = get_dofs (dof);
- Assert (vc == vb, ExcInternalError());
+ AssertThrow (vc == vb, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 1998 - 2014 by the deal.II authors
+// Copyright (C) 1998 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// set values without specifying an explicit fe_index
Vector<double> local (cell->get_fe().dofs_per_cell);
for (unsigned int i=0; i<local.size(); ++i)
- local(i) = i;
+ local(i) = i;
cell->set_dof_values_by_interpolation (local, solution1);
// then do the same with the "correct", local fe_index
cell->set_dof_values_by_interpolation (local, solution2,
- cell->active_fe_index());
+ cell->active_fe_index());
// now verify correctness
- Assert (solution1 == solution2, ExcInternalError());
+ AssertThrow (solution1 == solution2, ExcInternalError());
}
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2011 - 2014 by the deal.II authors
+// Copyright (C) 2011 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// set refine flag for the only cell we have, then do the refinement
SolutionTransfer<dim, Vector<double>, hp::DoFHandler<dim> >
- solution_trans(dof_handler);
+ solution_trans(dof_handler);
dof_handler.begin_active()->set_refine_flag ();
solution_trans.prepare_for_coarsening_and_refinement(solution);
triangulation.execute_coarsening_and_refinement ();
// distribute dofs and transfer solution there
dof_handler.distribute_dofs (fe_collection);
-
+
Vector<double> new_solution(dof_handler.n_dofs());
solution_trans.interpolate(solution, new_solution);
// we should now have only 1s in the new_solution vector
for (unsigned int i=0; i<new_solution.size(); ++i)
- Assert (new_solution[i] == 1, ExcInternalError());
-
+ AssertThrow (new_solution[i] == 1, ExcInternalError());
+
// we are good if we made it to here
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2011 - 2014 by the deal.II authors
+// Copyright (C) 2011 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// set refine flag for the only cell we have, then do the refinement
SolutionTransfer<dim, Vector<double>, hp::DoFHandler<dim> >
- solution_trans(dof_handler);
+ solution_trans(dof_handler);
dof_handler.begin_active()->set_refine_flag ();
solution_trans.prepare_for_pure_refinement();
triangulation.execute_coarsening_and_refinement ();
// distribute dofs and transfer solution there
dof_handler.distribute_dofs (fe_collection);
-
+
Vector<double> new_solution(dof_handler.n_dofs());
solution_trans.refine_interpolate(solution, new_solution);
// we should now have only 1s in the new_solution vector
for (unsigned int i=0; i<new_solution.size(); ++i)
- Assert (new_solution[i] == 1, ExcInternalError());
-
+ AssertThrow (new_solution[i] == 1, ExcInternalError());
+
// we are good if we made it to here
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2011 - 2014 by the deal.II authors
+// Copyright (C) 2011 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
Triangulation<dim> triangulation;
GridGenerator::hyper_cube (triangulation);
triangulation.refine_global (1);
-
+
hp::FECollection<dim> fe_collection;
fe_collection.push_back(FE_Q<dim>(1));
fe_collection.push_back(FE_Q<dim>(2));
// coarsen everything away
SolutionTransfer<dim, Vector<double>, hp::DoFHandler<dim> >
- solution_trans(dof_handler);
+ solution_trans(dof_handler);
for (unsigned int c=0; c<dof_handler.begin(0)->n_children(); ++c)
dof_handler.begin(0)->child(c)->set_coarsen_flag ();
-
+
solution_trans.prepare_for_coarsening_and_refinement(solution);
triangulation.execute_coarsening_and_refinement ();
// distribute dofs and transfer solution there
dof_handler.distribute_dofs (fe_collection);
-
+
Vector<double> new_solution(dof_handler.n_dofs());
solution_trans.interpolate(solution, new_solution);
// we should now have only 1s in the new_solution vector
for (unsigned int i=0; i<new_solution.size(); ++i)
- Assert (new_solution[i] == 1, ExcInternalError());
-
+ AssertThrow (new_solution[i] == 1, ExcInternalError());
+
// we are good if we made it to here
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2011 - 2014 by the deal.II authors
+// Copyright (C) 2011 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// set refine flag for the only cell we have, then do the refinement
SolutionTransfer<dim, Vector<double>, hp::DoFHandler<dim> >
- solution_trans(dof_handler);
+ solution_trans(dof_handler);
dof_handler.begin_active()->set_refine_flag ();
solution_trans.prepare_for_pure_refinement();
triangulation.execute_coarsening_and_refinement ();
// distribute dofs and transfer solution there
dof_handler.distribute_dofs (fe_collection);
-
+
Vector<double> new_solution(dof_handler.n_dofs());
solution_trans.refine_interpolate(solution, new_solution);
// we should now have only 1s in the new_solution vector
for (unsigned int i=0; i<new_solution.size(); ++i)
- Assert (new_solution[i] == 1, ExcInternalError());
-
+ AssertThrow (new_solution[i] == 1, ExcInternalError());
+
// we are good if we made it to here
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// and while at it also check
// whether the result was correct
- Assert (b(0) == 2, ExcInternalError());
- Assert (b(1) == 3, ExcInternalError());
- Assert (b(2) == 4, ExcInternalError());
- Assert (b(3) == 5, ExcInternalError());
+ AssertThrow (b(0) == 2, ExcInternalError());
+ AssertThrow (b(1) == 3, ExcInternalError());
+ AssertThrow (b(2) == 4, ExcInternalError());
+ AssertThrow (b(3) == 5, ExcInternalError());
// now solve with MinRes. This
// didn't work at one point
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
partition[i] = 3;
dealii::BlockVector<double> b(partition);
- Assert (b.n_blocks() == partition.size(),
- ExcInternalError());
+ AssertThrow (b.n_blocks() == partition.size(),
+ ExcInternalError());
unsigned int size = 0;
for (unsigned int i = 0; i < b.n_blocks(); ++i)
{
- Assert (b.block(i).size() == partition[i], ExcInternalError());
+ AssertThrow (b.block(i).size() == partition[i], ExcInternalError());
size += b.block(i).size();
}
- Assert (b.size() == size, ExcInternalError());
+ AssertThrow (b.size() == size, ExcInternalError());
for (unsigned int i = 0; i < b.size(); ++i)
{
b(i) = v[i];
- Assert (b(i) == v[i], ExcInternalError());
+ AssertThrow (b(i) == v[i], ExcInternalError());
}
dealii::BlockVector<double> c;
c = b;
- Assert (c == b, ExcInternalError());
- Assert (c.n_blocks() == b.n_blocks(), ExcInternalError());
+ AssertThrow (c == b, ExcInternalError());
+ AssertThrow (c.n_blocks() == b.n_blocks(), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v1(i) = 1+i*i;
v2 = v1;
- Assert (v1==v2, ExcInternalError());
+ AssertThrow (v1==v2, ExcInternalError());
BlockVector<double> v3 (ivector);
v3 = v2;
- Assert (v3==v2, ExcInternalError());
- Assert (v3==v1, ExcInternalError());
+ AssertThrow (v3==v2, ExcInternalError());
+ AssertThrow (v3==v1, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v1(i) = 1+i*i;
v2 = v1;
- Assert (v1==v2, ExcInternalError());
+ AssertThrow (v1==v2, ExcInternalError());
BlockVector<std::complex<double> > v3 (ivector);
v3 = v2;
- Assert (v3==v2, ExcInternalError());
- Assert (v3==v1, ExcInternalError());
+ AssertThrow (v3==v2, ExcInternalError());
+ AssertThrow (v3==v1, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
A.mTmult(C,B);
D.add(-1,C);
- Assert ( D.frobenius_norm() < 1e-15,
- ExcInternalError());
+ AssertThrow ( D.frobenius_norm() < 1e-15,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
A.TmTmult(C,B);
D.add(-1,C);
- Assert ( D.frobenius_norm() < 1e-15,
- ExcInternalError());
+ AssertThrow ( D.frobenius_norm() < 1e-15,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// correct
for (unsigned int i=0; i<X.m(); ++i)
for (unsigned int j=0; j<X.n(); ++j)
- Assert (X(i,j) == 2*i + 2*j,
- ExcInternalError());
+ AssertThrow (X(i,j) == 2*i + 2*j,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2011 - 2014 by the deal.II authors
+// Copyright (C) 2011 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// correct
for (unsigned int i=0; i<X.m(); ++i)
for (unsigned int j=0; j<X.n(); ++j)
- if ((i % 2 == 0) && (j % 2 == 0))
- Assert (X(i,j) == i/2 + j/2,
- ExcInternalError())
+ {
+ if ((i % 2 == 0) && (j % 2 == 0))
+ {
+ AssertThrow (X(i,j) == i/2 + j/2,
+ ExcInternalError());
+ }
else
- Assert (X(i,j) == 0,
- ExcInternalError());
+ {
+ AssertThrow (X(i,j) == 0,
+ ExcInternalError());
+ }
+ }
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 1998 - 2014 by the deal.II authors
+// Copyright (C) 1998 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
Vector<double> in(size), out(size);
in = 1.;
-
+
{
IterationNumberControl control(5);
SolverCG<> solver(control);
solver.solve(A, out, in, PreconditionIdentity());
- Assert (control.last_step() == 1, ExcInternalError());
+ AssertThrow (control.last_step() == 1, ExcInternalError());
}
for (unsigned int i=0; i<size; ++i)
- Assert(std::abs(out(i)-0.5) < 1e-12, ExcInternalError());
+ AssertThrow (std::abs(out(i)-0.5) < 1e-12, ExcInternalError());
// Check 2: should only do 5 iterations but the solution should not be exact
for (unsigned int i=0; i<size; ++i)
IterationNumberControl control(5);
SolverCG<> solver(control);
solver.solve(A, out, in, PreconditionIdentity());
- Assert (control.last_step() == 5, ExcInternalError());
+ AssertThrow (control.last_step() == 5, ExcInternalError());
}
bool solved_exactly = true;
for (unsigned int i=0; i<size; ++i)
if (std::abs(out(i)-1./(1+size)) > 1e-8)
solved_exactly = false;
- Assert(solved_exactly == false, ExcInternalError());
+ AssertThrow(solved_exactly == false, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2011 - 2014 by the deal.II authors
+// Copyright (C) 2011 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
A.Tvmult (z, tmp);
y -= z;
- Assert (y.l2_norm() <= 1e-12 * z.l2_norm(),
- ExcInternalError());
+ AssertThrow (y.l2_norm() <= 1e-12 * z.l2_norm(),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2011 - 2014 by the deal.II authors
+// Copyright (C) 2011 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
A.Tvmult (z, tmp);
y -= z;
- Assert (y.l2_norm() <= 1e-12 * z.l2_norm(),
- ExcInternalError());
+ AssertThrow (y.l2_norm() <= 1e-12 * z.l2_norm(),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2011 - 2014 by the deal.II authors
+// Copyright (C) 2011 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
A.vmult (z, tmp);
y -= z;
- Assert (y.l2_norm() <= 1e-12 * z.l2_norm(),
- ExcInternalError());
+ AssertThrow (y.l2_norm() <= 1e-12 * z.l2_norm(),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2011 - 2014 by the deal.II authors
+// Copyright (C) 2011 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
A.vmult (z, tmp);
y -= z;
- Assert (y.l2_norm() <= 1e-12 * z.l2_norm(),
- ExcInternalError());
+ AssertThrow (y.l2_norm() <= 1e-12 * z.l2_norm(),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2001 - 2014 by the deal.II authors
+// Copyright (C) 2001 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
SparsityPattern::const_iterator p3=sp3.begin(row), p4=sp4.begin(row);
for (; p3!=sp3.end(row); ++p3, ++p4)
- Assert (p3->column() == p4->column(), ExcInternalError());
+ AssertThrow (p3->column() == p4->column(), ExcInternalError());
};
const SparsityPattern &
sp = (loop==1 ? sp1 : (loop==2 ? sp2 : (loop==3 ? sp3 : sp4)));
for (unsigned int i=0; i<sp.n_nonzero_elements(); ++i)
- Assert (sp(sp.matrix_position(i).first,
- sp.matrix_position(i).second) == i,
- ExcInternalError());
+ AssertThrow (sp(sp.matrix_position(i).first,
+ sp.matrix_position(i).second) == i,
+ ExcInternalError());
for (types::global_dof_index row=0; row<sp.n_rows(); ++row)
for (types::global_dof_index col=0; col<sp.n_cols(); ++col)
if (sp(row,col) != SparsityPattern::invalid_entry)
- Assert (sp.matrix_position(sp(row,col)) ==
- std::make_pair(row,col),
- ExcInternalError());
+ AssertThrow (sp.matrix_position(sp(row,col)) ==
+ std::make_pair(row,col),
+ ExcInternalError());
};
{
SparsityPattern::const_iterator p3=sp3.begin(row), p5=sp5.begin(row);
for (; p3!=sp3.end(row); ++p3, ++p5)
- Assert (p3->column() == p5->column(), ExcInternalError());
+ AssertThrow (p3->column() == p5->column(), ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
if ((sparsity_pattern.stores_only_added_elements() == true)
&&
(sp4.stores_only_added_elements() == true))
- Assert (sparsity_pattern.n_nonzero_elements() ==
- sp4.n_nonzero_elements(),
- ExcInternalError());
+ AssertThrow (sparsity_pattern.n_nonzero_elements() ==
+ sp4.n_nonzero_elements(),
+ ExcInternalError());
for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
for (unsigned int j=0; j<sparsity_pattern.n_cols(); ++j)
- if ((sparsity_pattern.stores_only_added_elements() == true)
- &&
- (sp4.stores_only_added_elements() == true))
- Assert (sparsity_pattern.exists(i,j) == sp4.exists (i,j),
- ExcInternalError())
+ {
+ if ((sparsity_pattern.stores_only_added_elements() == true)
+ &&
+ (sp4.stores_only_added_elements() == true))
+ {
+ AssertThrow (sparsity_pattern.exists(i,j) == sp4.exists (i,j),
+ ExcInternalError());
+ }
else if (sparsity_pattern.exists(i,j))
- Assert (sp4.exists (i,j), ExcInternalError());
+ {
+ AssertThrow (sp4.exists (i,j), ExcInternalError());
+ }
+ }
deallog << "OK" << std::endl;
}
if ((sparsity_pattern.stores_only_added_elements() == true)
&&
(sp4.stores_only_added_elements() == true))
- Assert (sparsity_pattern.n_nonzero_elements() ==
- sp4.n_nonzero_elements(),
- ExcInternalError());
+ AssertThrow (sparsity_pattern.n_nonzero_elements() ==
+ sp4.n_nonzero_elements(),
+ ExcInternalError());
for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
for (unsigned int j=0; j<sparsity_pattern.n_cols(); ++j)
- if ((sparsity_pattern.stores_only_added_elements() == true)
- &&
- (sp4.stores_only_added_elements() == true))
- Assert (sparsity_pattern.exists(i,j) == sp4.exists (i,j),
- ExcInternalError())
+ {
+ if ((sparsity_pattern.stores_only_added_elements() == true)
+ &&
+ (sp4.stores_only_added_elements() == true))
+ {
+ AssertThrow (sparsity_pattern.exists(i,j) == sp4.exists (i,j),
+ ExcInternalError());
+ }
else if (sparsity_pattern.exists(i,j))
- Assert (sp4.exists (i,j), ExcInternalError());
+ {
+ AssertThrow (sp4.exists (i,j), ExcInternalError());
+ }
+ }
deallog << "OK" << std::endl;
}
// now check for equivalence of original
// and copy
if (sp4.stores_only_added_elements() == true)
- Assert (sp4.n_nonzero_elements() ==
- static_cast<unsigned int>(sparsity_pattern.frobenius_norm() *
- sparsity_pattern.frobenius_norm()
- + 0.5),
- ExcInternalError())
- else
- Assert (sp4.n_nonzero_elements() >=
- static_cast<unsigned int>(sparsity_pattern.frobenius_norm() *
- sparsity_pattern.frobenius_norm()
- + 0.5),
- ExcInternalError());
+ {
+ AssertThrow (sp4.n_nonzero_elements() ==
+ static_cast<unsigned int>(sparsity_pattern.frobenius_norm() *
+ sparsity_pattern.frobenius_norm()
+ + 0.5),
+ ExcInternalError());
+ }
+ else
+ {
+ AssertThrow (sp4.n_nonzero_elements() >=
+ static_cast<unsigned int>(sparsity_pattern.frobenius_norm() *
+ sparsity_pattern.frobenius_norm()
+ + 0.5),
+ ExcInternalError());
+ }
for (unsigned int i=0; i<M; ++i)
for (unsigned int j=0; j<M; ++j)
if (std::abs((int)(i-j)) == 3)
- Assert (sp4.exists (i,j)
- == true,
- ExcInternalError());
+ AssertThrow (sp4.exists (i,j)
+ == true,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// function should be the inverse
// of operator()
for (unsigned int i=0; i<sparsity_pattern.n_nonzero_elements(); ++i)
- Assert (sparsity_pattern(sparsity_pattern.matrix_position(i).first,
- sparsity_pattern.matrix_position(i).second) == i,
- ExcInternalError());
+ AssertThrow (sparsity_pattern(sparsity_pattern.matrix_position(i).first,
+ sparsity_pattern.matrix_position(i).second) == i,
+ ExcInternalError());
for (types::global_dof_index row=0; row<sparsity_pattern.n_rows(); ++row)
for (types::global_dof_index col=0; col<sparsity_pattern.n_cols(); ++col)
if (sparsity_pattern(row,col) != SparsityPattern::invalid_entry)
- Assert (sparsity_pattern.matrix_position(sparsity_pattern(row,col)) ==
- std::make_pair(row,col),
- ExcInternalError());
+ AssertThrow (sparsity_pattern.matrix_position(sparsity_pattern(row,col)) ==
+ std::make_pair(row,col),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
for (unsigned int j=0; j<sparsity_pattern.n_cols(); ++j)
- Assert (sparsity_pattern.exists(i,j) == sp5.exists (i,j),
- ExcInternalError());
+ AssertThrow (sparsity_pattern.exists(i,j) == sp5.exists (i,j),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
vec(i) = static_cast<number>(Testing::rand())/static_cast<number>(RAND_MAX);
const typename Vector<number>::real_type norm = vec.l2_norm();
for (unsigned int i=0; i<30; ++i)
- Assert (vec.l2_norm() == norm, ExcInternalError());
+ AssertThrow (vec.l2_norm() == norm, ExcInternalError());
Vector<number> vec2 (vec);
for (unsigned int i=0; i<10; ++i)
- Assert (vec2.l2_norm() == norm, ExcInternalError());
+ AssertThrow (vec2.l2_norm() == norm, ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v(7) = 1e20;
const double correct = std::sqrt(1e26 + 1e38 + 1e42 + 1e40 + 1.);
- Assert (std::abs(v.l2_norm() - correct) < 1e-6*correct, ExcInternalError());
+ AssertThrow (std::abs(v.l2_norm() - correct) < 1e-6*correct, ExcInternalError());
v = 0.;
v(5) = 1e-30;
v(9) = 1e-32;
const double correct2 = std::sqrt(1e-60 + 1e-64);
- Assert (std::abs(v.l2_norm() - correct2) < 1e-6*correct2, ExcInternalError());
+ AssertThrow (std::abs(v.l2_norm() - correct2) < 1e-6*correct2, ExcInternalError());
Vector<double> w(7);
w(0) = 1e232;
w(6) = 1e231;
w(3) = 1e200;
const double correct3 = std::sqrt(100. + 1.) * 1e231;
- Assert (std::abs(w.l2_norm() - correct3) < 1e-13*correct3, ExcInternalError());
+ AssertThrow (std::abs(w.l2_norm() - correct3) < 1e-13*correct3, ExcInternalError());
w = 0;
w(1) = 1e-302;
w(4) = 3e-303;
w(5) = -1e-303;
const double correct4 = std::sqrt(100. + 1. + 4. + 9 + 1.) * 1e-303;
- Assert (std::abs(w.l2_norm() - correct4) < 1e-13*correct4, ExcInternalError());
+ AssertThrow (std::abs(w.l2_norm() - correct4) < 1e-13*correct4, ExcInternalError());
const double correct5 = std::pow(1000. + 1. + 8. + 27 + 1., 1./3.) * 1e-303;
- Assert (std::abs(w.lp_norm(3.) - correct5) < 1e-13*correct5, ExcInternalError());
+ AssertThrow (std::abs(w.lp_norm(3.) - correct5) < 1e-13*correct5, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2012 - 2014 by the deal.II authors
+// Copyright (C) 2012 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
vec(i) = i+1;
const number l1_norm = vec.l1_norm();
- Assert (std::abs(l1_norm-0.5*size*(size+1)) < acc*0.5*size*(size+1),
- ExcInternalError());
+ AssertThrow (std::abs(l1_norm-0.5*size*(size+1)) < acc*0.5*size*(size+1),
+ ExcInternalError());
// test accuracy of summation
const long double value = 3.14159265358979323846;
vec = (number)value;
const number l1_norma = vec.l1_norm();
- Assert (std::abs(l1_norma-value*size) < acc*size*value,
- ExcInternalError());
+ AssertThrow (std::abs(l1_norma-value*size) < acc*size*value,
+ ExcInternalError());
const number l2_norma = vec.l2_norm();
- Assert (std::abs(l2_norma-value*std::sqrt((number)size)) < acc*std::sqrt(size)*value,
- ExcInternalError());
+ AssertThrow (std::abs(l2_norma-value*std::sqrt((number)size)) < acc*std::sqrt(size)*value,
+ ExcInternalError());
const number lp_norma = vec.lp_norm(3.);
- Assert (std::abs(lp_norma-value*std::pow(static_cast<number>(size),
- static_cast<number>(1./3.))) <
- std::max(acc,number(1e-15))*std::pow(static_cast<number>(size),
- static_cast<number>(1./3.))*value,
- ExcInternalError());
+ AssertThrow (std::abs(lp_norma-value*std::pow(static_cast<number>(size),
+ static_cast<number>(1./3.))) <
+ std::max(acc,number(1e-15))*std::pow(static_cast<number>(size),
+ static_cast<number>(1./3.))*value,
+ ExcInternalError());
}
}
}
const number l1_norm = vec.l1_norm();
- Assert (std::abs(l1_norm-sum) < acc*sum,
- ExcInternalError());
+ AssertThrow (std::abs(l1_norm-sum) < acc*sum,
+ ExcInternalError());
// test accuracy of summation
const std::complex<long double> value (3.14159265358979323846, 0.1);
vec = std::complex<number>(value);
const number l1_norma = vec.l1_norm();
- Assert (std::abs(l1_norma-std::abs(value)*size) <
- acc*size*std::abs(value),
- ExcInternalError());
+ AssertThrow (std::abs(l1_norma-std::abs(value)*size) <
+ acc*size*std::abs(value),
+ ExcInternalError());
const number l2_norma = vec.l2_norm();
- Assert (std::abs(l2_norma-std::abs(value)*std::sqrt((number)size)) <
- acc*std::sqrt((number)size)*std::abs(value),
- ExcInternalError());
+ AssertThrow (std::abs(l2_norma-std::abs(value)*std::sqrt((number)size)) <
+ acc*std::sqrt((number)size)*std::abs(value),
+ ExcInternalError());
const number lp_norma = vec.lp_norm(3.);
- Assert (std::abs(lp_norma-std::abs(value)*
- std::pow(static_cast<number>(size),
- static_cast<number>(1./3.))) <
- acc*std::pow(static_cast<number>(size),
- static_cast<number>(1./3.))*std::abs(value),
- ExcInternalError());
+ AssertThrow (std::abs(lp_norma-std::abs(value)*
+ std::pow(static_cast<number>(size),
+ static_cast<number>(1./3.))) <
+ acc*std::pow(static_cast<number>(size),
+ static_cast<number>(1./3.))*std::abs(value),
+ ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 by the deal.II authors
+// Copyright (C) 2014-2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void test (const unsigned int size,
- const bool reinit_square)
+ const bool reinit_square)
{
// this test can not currently work with matrices smaller than
// 1\times2.
- Assert (size>2, ExcInternalError());
+ AssertThrow (size>2, ExcInternalError());
// initialise a first matrix with the standard constructor and fill
// it with some numbers
LAPACKFullMatrix<double> M (size, size);
-
+
for (unsigned int i=0; i<size; ++i)
for (unsigned int j=0; j<size; ++j)
M(i,j) = i+2.*j;
for (unsigned int i=0; i<N.m(); ++i)
for (unsigned int j=0; j<N.n (); ++j)
N(i,j) = i+2.*j;
-
+
// clearly, this should be the case
- Assert (N.m () != M.m (), ExcInternalError());
- Assert (N.n () != M.n (), ExcInternalError());
+ AssertThrow (N.m () != M.m (), ExcInternalError());
+ AssertThrow (N.n () != M.n (), ExcInternalError());
// if reinit_square is true, reinitialise the rectangle matrix to a
// square matrix (use reinit (const unsigned int))
{
// reinitialise the matrix and fill it with some numbers
N.reinit (size);
-
+
for (unsigned int i=0; i<N.m (); ++i)
- for (unsigned int j=0; j<N.n (); ++j)
- N(i,j) = i+2.*j;
+ for (unsigned int j=0; j<N.n (); ++j)
+ N(i,j) = i+2.*j;
}
// otherwise reinitialise the rectangle matrix to a square one (use
{
// reinitialise the matrix and fill it with some numbers
M.reinit (size+2, size-2);
-
+
for (unsigned int i=0; i<M.m (); ++i)
- for (unsigned int j=0; j<M.n (); ++j)
- M(i,j) = i+2.*j;
+ for (unsigned int j=0; j<M.n (); ++j)
+ M(i,j) = i+2.*j;
}
// and now this should be true
- Assert (N.m () == M.m (), ExcInternalError());
- Assert (N.n () == M.n (), ExcInternalError());
+ AssertThrow (N.m () == M.m (), ExcInternalError());
+ AssertThrow (N.n () == M.n (), ExcInternalError());
- // in fact, this should be true too, so check
+ // in fact, this should be true too, so check
for (unsigned int i=0; i<M.m (); ++i)
for (unsigned int j=0; j<M.n (); ++j)
- Assert (M(i,j) == N(i,j), ExcInternalError());
+ AssertThrow (M(i,j) == N(i,j), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
//compare the two files
std::string cmd = std::string("diff -q ")+file1+std::string(" ")+file2;
- Assert (system(cmd.c_str()) == 0, ExcInternalError());
+ AssertThrow (system(cmd.c_str()) == 0, ExcInternalError());
//and delete them
std::remove (file1.c_str());
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
= GridTools::get_locally_owned_vertices (tr);
for (unsigned int v=0; v<tr.n_vertices(); ++v)
if ((moved_locally_owned_vertices[v] == true)
- &&
- (tr.get_vertices()[v][0] < 1./3))
+ &&
+ (tr.get_vertices()[v][0] < 1./3))
moved_locally_owned_vertices[v] = false;
// now do the move
for (unsigned int v=0; v<tr.n_vertices(); ++v)
if (moved_locally_owned_vertices[v] == true)
{
- // maybe not the most elegant way to do it, but it works for the purpose
- // of the test...
- const_cast<Point<dim>&>(tr.get_vertices()[v]) += shift;
- ++n_vertices_moved;
+ // maybe not the most elegant way to do it, but it works for the purpose
+ // of the test...
+ const_cast<Point<dim>&>(tr.get_vertices()[v]) += shift;
+ ++n_vertices_moved;
}
- Assert (Utilities::MPI::sum (n_vertices_moved, MPI_COMM_WORLD)
- ==
- (dim==2 ? 15 : 75),
- ExcInternalError());
+ AssertThrow (Utilities::MPI::sum (n_vertices_moved, MPI_COMM_WORLD)
+ ==
+ (dim==2 ? 15 : 75),
+ ExcInternalError());
tr.communicate_locally_moved_vertices (moved_locally_owned_vertices);
{
for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); ++i)
{
- deallog << "Partition " << i << std::endl;
-
+ deallog << "Partition " << i << std::endl;
+
cat_file((std::string("communicate_moved_vertices_02.dat.") + Utilities::int_to_string(i)).c_str());
}
}
-
-
+
+
if (myid == 0)
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
cell != triangulation.end(); ++cell, ++index)
if (flags[index])
cell->set_refine_flag();
- Assert (index == triangulation.n_active_cells(), ExcInternalError());
+ AssertThrow (index == triangulation.n_active_cells(), ExcInternalError());
// flag all other cells for coarsening
// (this should ensure that at least
std::vector<types::global_dof_index> dofs_per_block (fe.n_components());
DoFTools::count_dofs_per_block (dof_handler, dofs_per_block);
- Assert (std::accumulate (dofs_per_block.begin(), dofs_per_block.end(), 0U)
- == dof_handler.n_dofs(),
- ExcInternalError());
+ AssertThrow (std::accumulate (dofs_per_block.begin(), dofs_per_block.end(), 0U)
+ == dof_handler.n_dofs(),
+ ExcInternalError());
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
if (myid == 0)
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
std::vector<types::global_dof_index> dofs_per_component (fe.n_components());
DoFTools::count_dofs_per_component (dof_handler, dofs_per_component);
- Assert (std::accumulate (dofs_per_component.begin(), dofs_per_component.end(), 0U)
- == dof_handler.n_dofs(),
- ExcInternalError());
+ AssertThrow (std::accumulate (dofs_per_component.begin(), dofs_per_component.end(), 0U)
+ == dof_handler.n_dofs(),
+ ExcInternalError());
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
if (myid == 0)
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
cell != triangulation.end(); ++cell, ++index)
if (flags[index])
cell->set_refine_flag();
- Assert (index == triangulation.n_active_cells(), ExcInternalError());
+ AssertThrow (index == triangulation.n_active_cells(), ExcInternalError());
// flag all other cells for coarsening
// (this should ensure that at least
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
ExcInternalError());
for (unsigned int i=0;
i<dof_handler.n_locally_owned_dofs_per_processor().size(); ++i)
- Assert (dof_handler.n_locally_owned_dofs_per_processor()[i] <= N,
- ExcInternalError());
- Assert (std::accumulate (dof_handler.n_locally_owned_dofs_per_processor().begin(),
- dof_handler.n_locally_owned_dofs_per_processor().end(),
- 0U) == N,
- ExcInternalError());
+ AssertThrow (dof_handler.n_locally_owned_dofs_per_processor()[i] <= N,
+ ExcInternalError());
+ AssertThrow (std::accumulate (dof_handler.n_locally_owned_dofs_per_processor().begin(),
+ dof_handler.n_locally_owned_dofs_per_processor().end(),
+ 0U) == N,
+ ExcInternalError());
IndexSet all (N), really_all (N);
// poor man's union operation
if (dof_handler.locally_owned_dofs_per_processor()[i]
.is_element(j))
{
- Assert (all.is_element(j) == false, ExcInternalError());
+ AssertThrow (all.is_element(j) == false, ExcInternalError());
all.add_index (j);
}
really_all.add_range (0, N);
- Assert (all == really_all,
- ExcInternalError());
+ AssertThrow (all == really_all,
+ ExcInternalError());
}
}
// this
DoFTools::extract_locally_relevant_dofs (dofh, relevant_set);
boundary_dofs.subtract_set (relevant_set);
- Assert (boundary_dofs.n_elements() == 0,
- ExcInternalError());
+ AssertThrow (boundary_dofs.n_elements() == 0,
+ ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
DoFTools::extract_locally_relevant_dofs (dofh, relevant_set);
for (unsigned int i=0; i<dofh.n_dofs(); ++i)
- if (relevant_set.is_element(i))
- Assert (points.find(i) != points.end(),
- ExcInternalError())
+ {
+ if (relevant_set.is_element(i))
+ {
+ AssertThrow (points.find(i) != points.end(),
+ ExcInternalError());
+ }
else
- Assert (points.find(i) == points.end(),
- ExcInternalError());
+ {
+ AssertThrow (points.find(i) == points.end(),
+ ExcInternalError());
+ }
+ }
}
const std::pair<unsigned int,unsigned int> range = vector.local_range();
for (unsigned int i=range.first; i<range.second; ++i)
if (constraints.is_constrained(i))
- Assert (vector(i)==0, ExcInternalError());
+ AssertThrow (vector(i)==0, ExcInternalError());
if (myid==0)
deallog << "OK" << std::endl;
const std::pair<unsigned int,unsigned int> range = vector.local_range();
for (unsigned int i=range.first; i<range.second; ++i)
if (constraints.is_constrained(i))
- Assert (vector(i)==0, ExcInternalError());
+ AssertThrow (vector(i)==0, ExcInternalError());
if (myid==0)
deallog << "OK" << std::endl;
const std::pair<unsigned int,unsigned int> range = vector.local_range();
for (unsigned int i=range.first; i<range.second; ++i)
if (constraints.is_constrained(i))
- Assert (vector(i)==0, ExcInternalError());
+ AssertThrow (vector(i)==0, ExcInternalError());
if (myid==0)
deallog << "OK" << std::endl;
const std::pair<unsigned int,unsigned int> range = vector.local_range();
for (unsigned int i=range.first; i<range.second; ++i)
if (constraints.is_constrained(i))
- Assert (vector(i)==0, ExcInternalError());
+ AssertThrow (vector(i)==0, ExcInternalError());
if (myid==0)
deallog << "OK" << std::endl;
{
if (cell->subdomain_id() != (unsigned int)myid)
{
- Assert (cell->is_ghost() || cell->is_artificial(),
- ExcInternalError());
+ AssertThrow (cell->is_ghost() || cell->is_artificial(),
+ ExcInternalError());
continue;
}
{
if (cell->at_boundary(n))
continue;
- Assert (cell->neighbor(n).state() == IteratorState::valid,
- ExcInternalError());
+ AssertThrow (cell->neighbor(n).state() == IteratorState::valid,
+ ExcInternalError());
- Assert( cell->neighbor(n)->level() == cell->level(),
- ExcInternalError());
+ AssertThrow ( cell->neighbor(n)->level() == cell->level(),
+ ExcInternalError());
- Assert(!cell->neighbor(n)->has_children(), ExcInternalError() );
- Assert( cell->neighbor(n)->subdomain_id()< numprocs, ExcInternalError());
+ AssertThrow (!cell->neighbor(n)->has_children(), ExcInternalError() );
+ AssertThrow ( cell->neighbor(n)->subdomain_id()< numprocs, ExcInternalError());
// all neighbors of
// locally owned cells
// must be ghosts but
// can't be artificial
- Assert (cell->neighbor(n)->is_ghost(), ExcInternalError());
- Assert (!cell->neighbor(n)->is_artificial(), ExcInternalError());
+ AssertThrow (cell->neighbor(n)->is_ghost(), ExcInternalError());
+ AssertThrow (!cell->neighbor(n)->is_artificial(), ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
if (cell->subdomain_id() != (unsigned int)myid)
{
- Assert (cell->is_ghost() || cell->is_artificial(),
- ExcInternalError());
+ AssertThrow (cell->is_ghost() || cell->is_artificial(),
+ ExcInternalError());
continue;
}
{
if (cell->at_boundary(n))
continue;
- Assert (cell->neighbor(n).state() == IteratorState::valid,
- ExcInternalError());
+ AssertThrow (cell->neighbor(n).state() == IteratorState::valid,
+ ExcInternalError());
- Assert( cell->neighbor(n)->level() == cell->level(),
- ExcInternalError());
+ AssertThrow ( cell->neighbor(n)->level() == cell->level(),
+ ExcInternalError());
- Assert(!cell->neighbor(n)->has_children(), ExcInternalError() );
+ AssertThrow (!cell->neighbor(n)->has_children(), ExcInternalError() );
}
}
<< checksum
<< std::endl;
- Assert (tr.n_global_active_cells() ==
- static_cast<unsigned int>(std::pow (1.*GeometryInfo<dim>::max_children_per_cell, i+1)),
- ExcInternalError());
+ AssertThrow (tr.n_global_active_cells() ==
+ static_cast<unsigned int>(std::pow (1.*GeometryInfo<dim>::max_children_per_cell, i+1)),
+ ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
if (cell->subdomain_id() != (unsigned int)myid)
{
- Assert (cell->is_ghost() || cell->is_artificial(),
- ExcInternalError());
+ AssertThrow (cell->is_ghost() || cell->is_artificial(),
+ ExcInternalError());
}
else
for (unsigned int n=0; n<GeometryInfo<dim>::faces_per_cell; ++n)
{
if (cell->at_boundary(n))
continue;
- Assert (cell->neighbor(n).state() == IteratorState::valid,
- ExcInternalError());
+ AssertThrow (cell->neighbor(n).state() == IteratorState::valid,
+ ExcInternalError());
- Assert( cell->neighbor(n)->level() == cell->level(),
- ExcInternalError());
+ AssertThrow ( cell->neighbor(n)->level() == cell->level(),
+ ExcInternalError());
- Assert(!cell->neighbor(n)->has_children(), ExcInternalError() );
+ AssertThrow (!cell->neighbor(n)->has_children(), ExcInternalError() );
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
unsigned int idx = locally_owned_dofs.nth_index_in_set (i);
//std::cout << '[' << idx << ']' << ' ' << solution(idx) << std::endl;
- Assert (idx == solution (idx), ExcInternalError());
- Assert (2*idx == solution2 (idx), ExcInternalError());
+ AssertThrow (idx == solution (idx), ExcInternalError());
+ AssertThrow (2*idx == solution2 (idx), ExcInternalError());
}
double norm = solution.l1_norm();
v*=2.0;
if (myid < 8)
{
- Assert(v(myid*2) == myid*4.0, ExcInternalError());
- Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+ AssertThrow (v(myid*2) == myid*4.0, ExcInternalError());
+ AssertThrow (v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
}
parallel::distributed::BlockVector<double> w(3);
const double l2_norm = w.l2_norm();
if (myid == 0)
deallog << "l2 norm: " << l2_norm << std::endl;
- Assert(std::abs(v.l2_norm()*std::sqrt(3.)-w.l2_norm()) < 1e-13,
- ExcInternalError());
+ AssertThrow (std::abs(v.l2_norm()*std::sqrt(3.)-w.l2_norm()) < 1e-13,
+ ExcInternalError());
}
// check l1 norm
const double l1_norm = w.l1_norm();
if (myid == 0)
deallog << "l1 norm: " << l1_norm << std::endl;
- Assert(std::abs(v.l1_norm()*3.-w.l1_norm()) < 1e-14,
- ExcInternalError());
+ AssertThrow (std::abs(v.l1_norm()*3.-w.l1_norm()) < 1e-14,
+ ExcInternalError());
}
// check linfty norm
const double linfty_norm = w.linfty_norm();
if (myid == 0)
deallog << "linfty norm: " << linfty_norm << std::endl;
- Assert(v.linfty_norm()==w.linfty_norm(),
- ExcInternalError());
+ AssertThrow (v.linfty_norm()==w.linfty_norm(),
+ ExcInternalError());
}
// check lp norm
if (myid == 0)
deallog << "l2.2 norm: " << lp_norm << std::endl;
- Assert (std::fabs (w.l2_norm() - w.lp_norm(2.0)) < 1e-14,
- ExcInternalError());
+ AssertThrow (std::fabs (w.l2_norm() - w.lp_norm(2.0)) < 1e-14,
+ ExcInternalError());
}
// check mean value (should be equal to l1
if (myid == 0)
deallog << "Mean value: " << mean << std::endl;
- Assert (std::fabs (mean * w.size() - w.l1_norm()) < 1e-15,
- ExcInternalError());
+ AssertThrow (std::fabs (mean * w.size() - w.l1_norm()) < 1e-15,
+ ExcInternalError());
}
// check inner product
{
const double norm_sqr = w.norm_sqr();
- Assert (std::fabs(w * w - norm_sqr) < 1e-15,
- ExcInternalError());
+ AssertThrow (std::fabs(w * w - norm_sqr) < 1e-15,
+ ExcInternalError());
parallel::distributed::BlockVector<double> w2;
w2 = w;
- Assert (std::fabs(w2 * w - norm_sqr) < 1e-15,
- ExcInternalError());
+ AssertThrow (std::fabs(w2 * w - norm_sqr) < 1e-15,
+ ExcInternalError());
if (myid<8)
w2.block(0).local_element(0) = -1;
// processors
if (myid == 0)
{
- Assert (v.is_ghost_entry (13) == false, ExcInternalError());
+ AssertThrow (v.is_ghost_entry (13) == false, ExcInternalError());
}
else
{
- Assert (v.is_ghost_entry (13) == true, ExcInternalError());
+ AssertThrow (v.is_ghost_entry (13) == true, ExcInternalError());
}
// count that 27 is ghost nowhere
- Assert (v.is_ghost_entry (27) == false, ExcInternalError());
+ AssertThrow (v.is_ghost_entry (27) == false, ExcInternalError());
if (myid == 0)
{
- Assert (v.in_local_range (27) == true, ExcInternalError());
+ AssertThrow (v.in_local_range (27) == true, ExcInternalError());
}
else
{
- Assert (v.in_local_range (27) == false, ExcInternalError());
+ AssertThrow (v.in_local_range (27) == false, ExcInternalError());
}
// element with number set is ghost
if (myid == 1)
{
- Assert (v.is_ghost_entry (set) == false, ExcInternalError());
+ AssertThrow (v.is_ghost_entry (set) == false, ExcInternalError());
}
else
{
- Assert (v.is_ghost_entry (set) == true, ExcInternalError());
+ AssertThrow (v.is_ghost_entry (set) == true, ExcInternalError());
}
if (myid == 0)
v.compress(VectorOperation::add);
v*=2.0;
- Assert(v(myid*2) == myid*4.0, ExcInternalError());
- Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+ AssertThrow(v(myid*2) == myid*4.0, ExcInternalError());
+ AssertThrow(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
// set ghost dof, compress
v(1) = 7;
// import ghosts onto all procs
v.update_ghost_values();
- Assert (v(1) == 7. * numproc, ExcInternalError());
+ AssertThrow (v(1) == 7. * numproc, ExcInternalError());
// check l2 norm
const double l2_norm = v.l2_norm();
v.compress(VectorOperation::insert);
v*=2.0;
- Assert(v(myid*2) == myid*4.0, ExcInternalError());
- Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+ AssertThrow(v(myid*2) == myid*4.0, ExcInternalError());
+ AssertThrow(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
// set ghost dof on all processors, compress
// (insert mode)
// import ghosts onto all procs
v.update_ghost_values();
- Assert (v(1) == 7.0, ExcInternalError());
+ AssertThrow (v(1) == 7.0, ExcInternalError());
// check l2 norm
const double l2_norm = v.l2_norm();
v.compress(VectorOperation::insert);
v*=2.0;
- Assert(v(myid*2) == myid*4.0, ExcInternalError());
- Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+ AssertThrow(v(myid*2) == myid*4.0, ExcInternalError());
+ AssertThrow(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
// set ghost dof on remote process, no
// compress called
if (myid > 0)
v(1) = 7;
- Assert(v(myid*2) == myid*4.0, ExcInternalError());
- Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+ AssertThrow(v(myid*2) == myid*4.0, ExcInternalError());
+ AssertThrow(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
if (myid > 0)
- Assert (v(1) == 7.0, ExcInternalError());
+ AssertThrow (v(1) == 7.0, ExcInternalError());
// reset to zero
v = 0;
- Assert(v(myid*2) == 0., ExcInternalError());
- Assert(v(myid*2+1) == 0., ExcInternalError());
+ AssertThrow (v(myid*2) == 0., ExcInternalError());
+ AssertThrow (v(myid*2+1) == 0., ExcInternalError());
// check that everything remains zero also
// after compress
v.compress(VectorOperation::add);
- Assert(v(myid*2) == 0., ExcInternalError());
- Assert(v(myid*2+1) == 0., ExcInternalError());
+ AssertThrow (v(myid*2) == 0., ExcInternalError());
+ AssertThrow (v(myid*2+1) == 0., ExcInternalError());
// set element 1 on owning process to
// something nonzero
if (myid == 0)
v(1) = 2.;
if (myid > 0)
- Assert (v(1) == 0., ExcInternalError());
+ AssertThrow (v(1) == 0., ExcInternalError());
// check that all processors get the correct
// value again, and that it is erased by
// operator=
v.update_ghost_values();
- Assert (v(1) == 2.0, ExcInternalError());
+ AssertThrow (v(1) == 2.0, ExcInternalError());
v = 0;
- Assert (v(1) == 0.0, ExcInternalError());
+ AssertThrow (v(1) == 0.0, ExcInternalError());
if (myid == 0)
deallog << "OK" << std::endl;
v*=2.0;
if (myid < 8)
{
- Assert(v(myid*2) == myid*4.0, ExcInternalError());
- Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+ AssertThrow(v(myid*2) == myid*4.0, ExcInternalError());
+ AssertThrow(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
}
// check l2 norm
// check inner product
{
const double norm_sqr = v.norm_sqr();
- Assert (std::fabs(v * v - norm_sqr) < 1e-15,
- ExcInternalError());
+ AssertThrow (std::fabs(v * v - norm_sqr) < 1e-15,
+ ExcInternalError());
parallel::distributed::Vector<double> v2;
v2 = v;
- Assert (std::fabs(v2 * v - norm_sqr) < 1e-15,
- ExcInternalError());
+ AssertThrow (std::fabs(v2 * v - norm_sqr) < 1e-15,
+ ExcInternalError());
if (myid<8)
v2.local_element(0) = -1;
// check local values for correctness
for (unsigned int i=0; i<local_size; ++i)
- Assert (v.local_element(i) == 2.0 * (i + my_start), ExcInternalError());
+ AssertThrow (v.local_element(i) == 2.0 * (i + my_start), ExcInternalError());
// check local values with two different
// access operators
for (unsigned int i=0; i<local_size; ++i)
- Assert (v.local_element(i) == v(local_owned.nth_index_in_set (i)), ExcInternalError());
+ AssertThrow (v.local_element(i) == v(local_owned.nth_index_in_set (i)), ExcInternalError());
for (unsigned int i=0; i<local_size; ++i)
- Assert (v.local_element(i) == v(i+my_start), ExcInternalError());
+ AssertThrow (v.local_element(i) == v(i+my_start), ExcInternalError());
// check non-local entries on all processors
for (unsigned int i=0; i<10; ++i)
- Assert (v(ghost_indices[i])== 2. * ghost_indices[i], ExcInternalError());
+ AssertThrow (v(ghost_indices[i])== 2. * ghost_indices[i], ExcInternalError());
// compare direct access [] with access ()
for (unsigned int i=0; i<10; ++i)
if (ghost_indices[i] < my_start)
- Assert (v(ghost_indices[i])==v.local_element(local_size+i), ExcInternalError());
+ AssertThrow (v(ghost_indices[i])==v.local_element(local_size+i), ExcInternalError());
if (myid == 0)
for (unsigned int i=5; i<10; ++i)
- Assert (v(ghost_indices[i])==v.local_element(local_size+i-5), ExcInternalError());
+ AssertThrow (v(ghost_indices[i])==v.local_element(local_size+i-5), ExcInternalError());
if (myid == 0)
deallog << "OK" << std::endl;
// check local values for correctness
for (unsigned int i=0; i<local_size; ++i)
- Assert (v.local_element(i) == 2.0 * (i + my_start), ExcInternalError());
+ AssertThrow (v.local_element(i) == 2.0 * (i + my_start), ExcInternalError());
// check local values with two different
// access operators
for (unsigned int i=0; i<local_size; ++i)
- Assert (v.local_element(i) == v(local_owned.nth_index_in_set (i)), ExcInternalError());
+ AssertThrow (v.local_element(i) == v(local_owned.nth_index_in_set (i)), ExcInternalError());
for (unsigned int i=0; i<local_size; ++i)
- Assert (v.local_element(i) == v(i+my_start), ExcInternalError());
+ AssertThrow (v.local_element(i) == v(i+my_start), ExcInternalError());
// check non-local entries on all processors
for (unsigned int i=0; i<10; ++i)
- Assert (v(ghost_indices[i])== 2. * ghost_indices[i], ExcInternalError());
+ AssertThrow (v(ghost_indices[i])== 2. * ghost_indices[i], ExcInternalError());
// compare direct access local_element with access ()
for (unsigned int i=0; i<10; ++i)
if (ghost_indices[i] < my_start)
- Assert (v(ghost_indices[i])==v.local_element(local_size+i), ExcInternalError());
+ AssertThrow (v(ghost_indices[i])==v.local_element(local_size+i), ExcInternalError());
if (myid == 0)
for (unsigned int i=5; i<10; ++i)
- Assert (v(ghost_indices[i])==v.local_element(local_size+i-5), ExcInternalError());
+ AssertThrow (v(ghost_indices[i])==v.local_element(local_size+i-5), ExcInternalError());
// now the same again, but import ghosts
// check local values for correctness
for (unsigned int i=0; i<local_size; ++i)
- Assert (v.local_element(i) == 2.0 * (i + my_start), ExcInternalError());
+ AssertThrow (v.local_element(i) == 2.0 * (i + my_start), ExcInternalError());
// check local values with two different
// access operators
for (unsigned int i=0; i<local_size; ++i)
- Assert (v.local_element(i) == v(local_owned.nth_index_in_set (i)), ExcInternalError());
+ AssertThrow (v.local_element(i) == v(local_owned.nth_index_in_set (i)), ExcInternalError());
for (unsigned int i=0; i<local_size; ++i)
- Assert (v.local_element(i) == v(i+my_start), ExcInternalError());
+ AssertThrow (v.local_element(i) == v(i+my_start), ExcInternalError());
// check non-local entries on all processors
for (unsigned int i=0; i<10; ++i)
- Assert (v(ghost_indices[i])== 2. * ghost_indices[i], ExcInternalError());
+ AssertThrow (v(ghost_indices[i])== 2. * ghost_indices[i], ExcInternalError());
// compare direct access [] with access ()
for (unsigned int i=0; i<10; ++i)
if (ghost_indices[i] < my_start)
- Assert (v(ghost_indices[i])==v.local_element(local_size+i), ExcInternalError());
+ AssertThrow (v(ghost_indices[i])==v.local_element(local_size+i), ExcInternalError());
if (myid == 0)
for (unsigned int i=5; i<10; ++i)
- Assert (v(ghost_indices[i])==v.local_element(local_size+i-5), ExcInternalError());
+ AssertThrow (v(ghost_indices[i])==v.local_element(local_size+i-5), ExcInternalError());
// now do not call import_ghosts and check
// check non-local entries on all processors
for (unsigned int i=0; i<10; ++i)
if (local_owned.is_element (ghost_indices[i]) == false)
- Assert (v(ghost_indices[i]) == 0., ExcInternalError());
+ AssertThrow (v(ghost_indices[i]) == 0., ExcInternalError());
if (myid == 0)
deallog << "OK" << std::endl;
v.update_ghost_values();
// check that the value of the ghost is 1.0
- Assert (v(1) == 1., ExcInternalError());
+ AssertThrow (v(1) == 1., ExcInternalError());
// copy vector
w = v;
v.update_ghost_values();
w.update_ghost_values();
- Assert (v(1) == 2., ExcInternalError());
- Assert (w(1) == 1., ExcInternalError());
+ AssertThrow (v(1) == 2., ExcInternalError());
+ AssertThrow (w(1) == 1., ExcInternalError());
if (myid == 0)
deallog << "OK" << std::endl;
y = v;
for (int i=0; i<actual_local_size; ++i)
- Assert (y.local_element(i) == i+my_start, ExcInternalError());
+ AssertThrow (y.local_element(i) == i+my_start, ExcInternalError());
if (myid==0) deallog << "Check add (scalar): ";
y.add (42);
for (int i=0; i<actual_local_size; ++i)
- Assert (y.local_element(i) == i+my_start+42, ExcInternalError());
+ AssertThrow (y.local_element(i) == i+my_start+42, ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
if (myid==0) deallog << "Check add (vector): ";
y.add (w);
for (int i=0; i<actual_local_size; ++i)
- Assert (y.local_element(i) == 3*(i+my_start)+1042, ExcInternalError());
+ AssertThrow (y.local_element(i) == 3*(i+my_start)+1042, ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
if (myid==0) deallog << "Check add (factor, vector): ";
y.add (-1., w);
for (int i=0; i<actual_local_size; ++i)
- Assert (y.local_element(i) == i+my_start+42, ExcInternalError());
+ AssertThrow (y.local_element(i) == i+my_start+42, ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
if (myid==0) deallog << "Check add (factor, vector, factor, vector): ";
y.add (2., w, -0.5, x);
for (int i=0; i<actual_local_size; ++i)
- Assert (y.local_element(i) == 5*(i+my_start)+2042-5000,ExcInternalError());
+ AssertThrow (y.local_element(i) == 5*(i+my_start)+2042-5000,ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
if (myid==0) deallog << "Check sadd (factor, factor, vector): ";
y = v;
y.sadd (-3.,2.,v);
for (int i=0; i<actual_local_size; ++i)
- Assert (y.local_element(i)==(-i-my_start), ExcInternalError());
+ AssertThrow (y.local_element(i)==(-i-my_start), ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
if (myid==0) deallog << "Check sadd (factor, factor, vector, factor, vector): ";
y.sadd (2.,3.,v, 2., w);
for (int i=0; i<actual_local_size; ++i)
- Assert (y.local_element(i) == 5*(i+my_start)+2000, ExcInternalError());
+ AssertThrow (y.local_element(i) == 5*(i+my_start)+2000, ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
if (myid==0) deallog << "Check sadd (factor, factor, vector, factor, vector, factor, vector): ";
y.sadd (-1.,1.,v, 2., w, 2., x);
for (int i=0; i<actual_local_size; ++i)
- Assert (y.local_element(i) == 20000, ExcInternalError());
+ AssertThrow (y.local_element(i) == 20000, ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
if (myid==0) deallog << "Check add (factor, vector_1, factor, vector_1): ";
y = 0;
y.add (1.,v, 3., v);
for (int i=0; i<actual_local_size; ++i)
- Assert (y.local_element(i) == 4*(i+my_start), ExcInternalError());
+ AssertThrow (y.local_element(i) == 4*(i+my_start), ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
if (myid==0) deallog << "Check operator * (scalar): ";
x *= 2.;
for (int i=0; i<actual_local_size; ++i)
- Assert (x.local_element(i) == 20000., ExcInternalError());
+ AssertThrow (x.local_element(i) == 20000., ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
if (myid==0) deallog << "Check operator / (scalar): ";
x /= 2.;
for (int i=0; i<actual_local_size; ++i)
- Assert (x.local_element(i) == 10000., ExcInternalError());
+ AssertThrow (x.local_element(i) == 10000., ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
if (myid==0) deallog << "Check scale (vector): ";
y.scale (x);
for (int i=0; i<actual_local_size; ++i)
- Assert (y.local_element(i) == 40000.*(i+my_start), ExcInternalError());
+ AssertThrow (y.local_element(i) == 40000.*(i+my_start), ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
if (myid==0) deallog << "Check equ (factor, vector): ";
y. equ (10., x);
for (int i=0; i<actual_local_size; ++i)
- Assert (y.local_element(i) == 100000., ExcInternalError());
+ AssertThrow (y.local_element(i) == 100000., ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
if (myid==0) deallog << "Check equ (factor, vector, factor, vector): ";
y. equ (10., v, -2., w);
for (int i=0; i<actual_local_size; ++i)
- Assert (y.local_element(i) == 6.*(i+my_start)-2000, ExcInternalError());
+ AssertThrow (y.local_element(i) == 6.*(i+my_start)-2000, ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
if (myid==0) deallog << "Check equ (factor, vector, factor, vector, factor, vector): ";
y. equ (10., v, -2., w, 3., x);
for (int i=0; i<actual_local_size; ++i)
- Assert (y.local_element(i) == 6.*(i+my_start)+28000, ExcInternalError());
+ AssertThrow (y.local_element(i) == 6.*(i+my_start)+28000, ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
if (myid==0) deallog << "Check equ<float> (factor, vector): ";
z = v;
y.equ (1., z);
for (int i=0; i<actual_local_size; ++i)
- Assert (y.local_element(i) == i+my_start, ExcInternalError());
+ AssertThrow (y.local_element(i) == i+my_start, ExcInternalError());
if (myid==0) deallog << "OK" << std::endl;
}
v1 = 2;
// check assignment in initial state
for (unsigned int i=0; i<v0.local_size(); ++i)
- Assert (v0.local_element(i) == 1., ExcNonEqual(v0.local_element(i),1.));
+ AssertThrow (v0.local_element(i) == 1., ExcNonEqual(v0.local_element(i),1.));
for (unsigned int i=0; i<v1.local_size(); ++i)
- Assert (v1.local_element(i) == 2., ExcNonEqual(v1.local_element(i),2.));
+ AssertThrow (v1.local_element(i) == 2., ExcNonEqual(v1.local_element(i),2.));
// check ghost elements in initial state
v0.update_ghost_values();
v1.update_ghost_values();
- Assert (v0(2) == 1., ExcNonEqual(v0(2),1.));
+ AssertThrow (v0(2) == 1., ExcNonEqual(v0(2),1.));
if (numproc > 2)
- Assert (v0(8) == 1., ExcNonEqual(v0(8),2.));
- Assert (v1(0) == 2., ExcNonEqual(v1(0),2.));
- Assert (v1(2) == 2., ExcNonEqual(v1(2),2.));
+ AssertThrow (v0(8) == 1., ExcNonEqual(v0(8),2.));
+ AssertThrow (v1(0) == 2., ExcNonEqual(v1(0),2.));
+ AssertThrow (v1(2) == 2., ExcNonEqual(v1(2),2.));
if (numproc > 2)
{
- Assert (v1(8) == 2., ExcNonEqual(v1(8),2.));
- Assert (v1(10) == 2., ExcNonEqual(v1(10),2.));
+ AssertThrow (v1(8) == 2., ExcNonEqual(v1(8),2.));
+ AssertThrow (v1(10) == 2., ExcNonEqual(v1(10),2.));
}
if (myid==0) deallog << "Initial set and ghost update OK" << std::endl;
MPI_Barrier (MPI_COMM_WORLD);
AssertDimension (v0.size(), global_size1);
AssertDimension (v1.size(), global_size0);
for (unsigned int i=0; i<local_size1; ++i)
- Assert (v0.local_element(i) == 2., ExcNonEqual(v0.local_element(i),2.));
+ AssertThrow (v0.local_element(i) == 2., ExcNonEqual(v0.local_element(i),2.));
for (unsigned int i=0; i<actual_local_size0; ++i)
- Assert (v1.local_element(i) == 1., ExcNonEqual(v1.local_element(i),1.));
+ AssertThrow (v1.local_element(i) == 1., ExcNonEqual(v1.local_element(i),1.));
if (myid==0) deallog << "First swap OK" << std::endl;
v0.update_ghost_values ();
v1.update_ghost_values ();
- Assert (v1(2) == 1., ExcNonEqual(v1(2),1.));
+ AssertThrow (v1(2) == 1., ExcNonEqual(v1(2),1.));
if (numproc > 2)
- Assert (v1(8) == 1., ExcNonEqual(v1(8),1.));
- Assert (v0(0) == 2., ExcNonEqual(v0(0),2.));
- Assert (v0(2) == 2., ExcNonEqual(v0(2),2.));
+ AssertThrow (v1(8) == 1., ExcNonEqual(v1(8),1.));
+ AssertThrow (v0(0) == 2., ExcNonEqual(v0(0),2.));
+ AssertThrow (v0(2) == 2., ExcNonEqual(v0(2),2.));
if (numproc > 2)
{
- Assert (v0(8) == 2., ExcNonEqual(v0(8),2.));
- Assert (v0(10) == 2., ExcNonEqual(v0(10),2.));
+ AssertThrow (v0(8) == 2., ExcNonEqual(v0(8),2.));
+ AssertThrow (v0(10) == 2., ExcNonEqual(v0(10),2.));
}
if (myid==0) deallog << "Ghost values after first swap OK" << std::endl;
v1 = 42.;
v0.update_ghost_values();
v1.update_ghost_values();
- Assert (v1(2) == 42., ExcNonEqual(v1(2),42.));
+ AssertThrow (v1(2) == 42., ExcNonEqual(v1(2),42.));
if (numproc > 2)
- Assert (v1(8) == 42., ExcNonEqual(v1(8),42.));
- Assert (v0(0) == 7., ExcNonEqual(v0(0),7.));
- Assert (v0(2) == 7., ExcNonEqual(v0(2),7.));
+ AssertThrow (v1(8) == 42., ExcNonEqual(v1(8),42.));
+ AssertThrow (v0(0) == 7., ExcNonEqual(v0(0),7.));
+ AssertThrow (v0(2) == 7., ExcNonEqual(v0(2),7.));
if (numproc > 2)
{
- Assert (v0(8) == 7., ExcNonEqual(v0(8),7.));
- Assert (v0(10) == 7., ExcNonEqual(v0(10),7.));
+ AssertThrow (v0(8) == 7., ExcNonEqual(v0(8),7.));
+ AssertThrow (v0(10) == 7., ExcNonEqual(v0(10),7.));
}
if (myid==0) deallog << "Ghost values after re-set OK" << std::endl;
AssertDimension (v2.size(), global_size1);
AssertDimension (v2.local_size(), local_size1);
for (int i=my_start1; i<my_end1; ++i)
- Assert (v2(i) == 7., ExcNonEqual(v2(i),7.));
+ AssertThrow (v2(i) == 7., ExcNonEqual(v2(i),7.));
if (myid==0) deallog << "Second swap OK" << std::endl;
v2 = -1.;
v2.update_ghost_values();
- Assert (v2(0) == -1., ExcNonEqual(v2(0), -1.));
- Assert (v2(2) == -1., ExcNonEqual(v2(2),-1.));
+ AssertThrow (v2(0) == -1., ExcNonEqual(v2(0), -1.));
+ AssertThrow (v2(2) == -1., ExcNonEqual(v2(2),-1.));
if (numproc > 2)
{
- Assert (v2(8) == -1., ExcNonEqual(v2(8),-1.));
- Assert (v2(10) == -1., ExcNonEqual(v2(10),-1.));
+ AssertThrow (v2(8) == -1., ExcNonEqual(v2(8),-1.));
+ AssertThrow (v2(10) == -1., ExcNonEqual(v2(10),-1.));
}
if (myid==0) deallog << "Ghost values after second swap OK" << std::endl;
}
v*=2.0;
v.add(1.0);
- Assert(v(myid*2) == myid*4.0+1, ExcInternalError());
- Assert(v(myid*2+1) == myid*4.0+3.0, ExcInternalError());
+ AssertThrow(v(myid*2) == myid*4.0+1, ExcInternalError());
+ AssertThrow(v(myid*2+1) == myid*4.0+3.0, ExcInternalError());
// set ghost dof on all processors, compress
// (insert mode)
// import ghosts onto all procs
v.update_ghost_values();
- Assert (v(1) == -7.0, ExcInternalError());
+ AssertThrow (v(1) == -7.0, ExcInternalError());
// check l2 norm
const double l2_norm = v.l2_norm();
const unsigned int n_mpi_processes=Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD);
MPI_Comm mpi_communicator= MPI_COMM_WORLD;
parallel::distributed::Triangulation<2> fluid_triangulation(mpi_communicator,
- typename Triangulation<2>::MeshSmoothing
- (Triangulation<2>::smoothing_on_refinement |
- Triangulation<2>::smoothing_on_coarsening));
+ typename Triangulation<2>::MeshSmoothing
+ (Triangulation<2>::smoothing_on_refinement |
+ Triangulation<2>::smoothing_on_coarsening));
- {
+ {
Triangulation<2> tmp_tria_fluid;
Triangulation<2> tmp_tria_buffer;
Triangulation<2> tmp_rectangle;
const double cell_size_x=0.1;
const double cell_size_y=0.1;
const double lenght = solid_cells_x*cell_size_x,
- height= static_cast<double>(h_cells*cell_size_y),
- h_distance=static_cast<double>(cell_size_x*inflow_cells),
- v_distance=static_cast<double>(cell_size_y*v_space_cells),
- solid_top=static_cast<double>(v_distance+solid_cells_y*cell_size_y),
- total_length=(inflow_cells+solid_cells_x+outflow_cells)*cell_size_x;
+ height= static_cast<double>(h_cells*cell_size_y),
+ h_distance=static_cast<double>(cell_size_x*inflow_cells),
+ v_distance=static_cast<double>(cell_size_y*v_space_cells),
+ solid_top=static_cast<double>(v_distance+solid_cells_y*cell_size_y),
+ total_length=(inflow_cells+solid_cells_x+outflow_cells)*cell_size_x;
std::vector< std::vector< double > > step_sizes(2);
//----------------INFLOW ---------------
- for(unsigned int i =0; i<inflow_cells; ++i)
+ for (unsigned int i =0; i<inflow_cells; ++i)
step_sizes[0].push_back(cell_size_x);
- for(unsigned int i =0; i<h_cells; ++i)
+ for (unsigned int i =0; i<h_cells; ++i)
step_sizes[1].push_back(cell_size_y);
GridGenerator::subdivided_hyper_rectangle(tmp_tria_fluid,
- step_sizes,
- Point<2>(0,0),
- Point<2>(h_distance,height),
- false);
+ step_sizes,
+ Point<2>(0,0),
+ Point<2>(h_distance,height),
+ false);
//------------------------LOWER-------------
step_sizes[0].clear();
step_sizes[1].clear();
- for(unsigned int i =0; i<solid_cells_x; ++i)
+ for (unsigned int i =0; i<solid_cells_x; ++i)
step_sizes[0].push_back(cell_size_x);
- for(unsigned int i =0; i<v_space_cells; ++i)
+ for (unsigned int i =0; i<v_space_cells; ++i)
step_sizes[1].push_back(cell_size_y);
GridGenerator::subdivided_hyper_rectangle(tmp_rectangle,
- step_sizes,
- Point<2>(h_distance,0),
- Point<2>(lenght+h_distance,v_distance),
- false);
+ step_sizes,
+ Point<2>(h_distance,0),
+ Point<2>(lenght+h_distance,v_distance),
+ false);
tmp_tria_buffer.copy_triangulation(tmp_tria_fluid);
GridGenerator::merge_triangulations(tmp_tria_buffer,
- tmp_rectangle,
- tmp_tria_fluid);
+ tmp_rectangle,
+ tmp_tria_fluid);
tmp_tria_buffer.clear();
tmp_rectangle.clear();
step_sizes[1].clear();
- for(unsigned int i =0; i<(h_cells-v_space_cells-solid_cells_y); ++i)
+ for (unsigned int i =0; i<(h_cells-v_space_cells-solid_cells_y); ++i)
step_sizes[1].push_back(cell_size_y);
GridGenerator::subdivided_hyper_rectangle(tmp_rectangle,
- step_sizes,
- Point<2>(h_distance,solid_top),
- Point<2>(h_distance+lenght,height),
- false);
+ step_sizes,
+ Point<2>(h_distance,solid_top),
+ Point<2>(h_distance+lenght,height),
+ false);
tmp_tria_buffer.copy_triangulation(tmp_tria_fluid);
GridGenerator::merge_triangulations(tmp_tria_buffer,
- tmp_rectangle,
- tmp_tria_fluid);
+ tmp_rectangle,
+ tmp_tria_fluid);
tmp_tria_buffer.clear();
tmp_rectangle.clear();
//
//----------------------------outflow----------
step_sizes[0].clear();
step_sizes[1].clear();
- for(unsigned int i =0; i<outflow_cells; ++i)
+ for (unsigned int i =0; i<outflow_cells; ++i)
step_sizes[0].push_back(cell_size_x);
- for(unsigned int i =0; i<h_cells; ++i)
+ for (unsigned int i =0; i<h_cells; ++i)
step_sizes[1].push_back(cell_size_y);
GridGenerator::subdivided_hyper_rectangle(tmp_rectangle,
- step_sizes,
- Point<2>(h_distance+lenght,0),
- Point<2>(total_length,height),
- false);
+ step_sizes,
+ Point<2>(h_distance+lenght,0),
+ Point<2>(total_length,height),
+ false);
tmp_tria_buffer.copy_triangulation(tmp_tria_fluid);
GridGenerator::merge_triangulations(tmp_tria_buffer,
- tmp_rectangle,
- tmp_tria_fluid);
+ tmp_rectangle,
+ tmp_tria_fluid);
//-----------COPY to distributed
fluid_triangulation.copy_triangulation(tmp_tria_fluid);
}
-
+
fluid_triangulation.refine_global(1);
// ---------END GENERATING TRIA ------------
IndexSet locally_owned_dofs = handler.locally_owned_dofs();
IndexSet locally_relevant_dofs = handler.locally_owned_dofs();
DoFTools::extract_locally_relevant_dofs(handler,
- locally_relevant_dofs);
+ locally_relevant_dofs);
PETScWrappers::MPI::Vector vector;
vector.reinit(locally_owned_dofs,
- locally_relevant_dofs,
- mpi_communicator);
+ locally_relevant_dofs,
+ mpi_communicator);
// ensure that all elements we can access locally are initially at
// zero. check this first for the locally owned elements...
for (unsigned int i=0; i<handler.n_dofs(); ++i)
if (locally_owned_dofs.is_element(i))
- Assert (vector(i) == 0,
- ExcInternalError());
+ AssertThrow (vector(i) == 0,
+ ExcInternalError());
// ...end then also for the ghost elements
for (unsigned int i=0; i<handler.n_dofs(); ++i)
if (locally_relevant_dofs.is_element(i)
- &&
- !locally_owned_dofs.is_element(i))
- Assert (vector(i) == 0,
- ExcInternalError());
+ &&
+ !locally_owned_dofs.is_element(i))
+ AssertThrow (vector(i) == 0,
+ ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// create a vector that consists of elements indexed from 0 to n
PETScWrappers::MPI::Vector vec (MPI_COMM_WORLD, 100 * n_processes, 100);
- Assert (vec.local_size() == 100, ExcInternalError());
- Assert (vec.local_range().first == 100*myid, ExcInternalError());
- Assert (vec.local_range().second == 100*myid+100, ExcInternalError());
+ AssertThrow (vec.local_size() == 100, ExcInternalError());
+ AssertThrow (vec.local_range().first == 100*myid, ExcInternalError());
+ AssertThrow (vec.local_range().second == 100*myid+100, ExcInternalError());
for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
vec(i) = i;
vec.compress(VectorOperation::insert);
double exact_l1 = 0;
for (unsigned int i=0; i<vec.size(); ++i)
exact_l1 += i;
- Assert (vec.l1_norm() == exact_l1, ExcInternalError());
+ AssertThrow (vec.l1_norm() == exact_l1, ExcInternalError());
}
// verify correctness
if (myid != 0)
- Assert (vec(vec.local_range().first+10) == vec.local_range().first-25,
- ExcInternalError());
+ AssertThrow (vec(vec.local_range().first+10) == vec.local_range().first-25,
+ ExcInternalError());
if (myid != n_processes-1)
- Assert (vec(vec.local_range().first+90) == vec.local_range().first+105,
- ExcInternalError());
+ AssertThrow (vec(vec.local_range().first+90) == vec.local_range().first+105,
+ ExcInternalError());
for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
{
(i != vec.local_range().first+90))
{
double val = vec(i);
- Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+ AssertThrow (std::fabs(val - i) <= 1e-6, ExcInternalError());
}
}
}
const double l1_norm = vec.l1_norm();
- Assert (l1_norm == exact_l1, ExcInternalError());
+ AssertThrow (l1_norm == exact_l1, ExcInternalError());
if (myid == 0)
deallog << "Norm = " << l1_norm << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
vec.block(0).reinit(MPI_COMM_WORLD, 100 * n_processes, 100);
vec.block(1).reinit(MPI_COMM_WORLD, 100 * n_processes, 100);
vec.collect_sizes();
- Assert (vec.block(0).local_size() == 100, ExcInternalError());
- Assert (vec.block(0).local_range().first == 100*myid, ExcInternalError());
- Assert (vec.block(0).local_range().second == 100*myid+100, ExcInternalError());
- Assert (vec.block(1).local_size() == 100, ExcInternalError());
- Assert (vec.block(1).local_range().first == 100*myid, ExcInternalError());
- Assert (vec.block(1).local_range().second == 100*myid+100, ExcInternalError());
+ AssertThrow (vec.block(0).local_size() == 100, ExcInternalError());
+ AssertThrow (vec.block(0).local_range().first == 100*myid, ExcInternalError());
+ AssertThrow (vec.block(0).local_range().second == 100*myid+100, ExcInternalError());
+ AssertThrow (vec.block(1).local_size() == 100, ExcInternalError());
+ AssertThrow (vec.block(1).local_range().first == 100*myid, ExcInternalError());
+ AssertThrow (vec.block(1).local_range().second == 100*myid+100, ExcInternalError());
for (unsigned int i=vec.block(0).local_range().first; i<vec.block(0).local_range().second; ++i)
vec.block(0)(i) = i;
double exact_l1 = 0;
for (unsigned int i=0; i<vec.block(0).size(); ++i)
exact_l1 += 2*i;
- Assert (vec.l1_norm() == exact_l1, ExcInternalError());
+ AssertThrow (vec.l1_norm() == exact_l1, ExcInternalError());
}
// verify correctness
if (myid != 0)
- Assert (vec(vec.block(0).local_range().first+10) == vec.block(0).local_range().first-25,
- ExcInternalError());
+ AssertThrow (vec(vec.block(0).local_range().first+10) == vec.block(0).local_range().first-25,
+ ExcInternalError());
if (myid != n_processes-1)
- Assert (vec(vec.block(0).local_range().first+90) == vec.block(0).local_range().first+105,
- ExcInternalError());
+ AssertThrow (vec(vec.block(0).local_range().first+90) == vec.block(0).local_range().first+105,
+ ExcInternalError());
if (myid != 0)
- Assert (vec(vec.block(0).size()+vec.block(1).local_range().first+10) == vec.block(1).local_range().first-25,
- ExcInternalError());
+ AssertThrow (vec(vec.block(0).size()+vec.block(1).local_range().first+10) == vec.block(1).local_range().first-25,
+ ExcInternalError());
if (myid != n_processes-1)
- Assert (vec(vec.block(0).size()+vec.block(1).local_range().first+90) == vec.block(1).local_range().first+105,
- ExcInternalError());
+ AssertThrow (vec(vec.block(0).size()+vec.block(1).local_range().first+90) == vec.block(1).local_range().first+105,
+ ExcInternalError());
for (unsigned int i=vec.block(0).local_range().first; i<vec.block(0).local_range().second; ++i)
(i != vec.block(0).local_range().first+90))
{
double val = vec.block(0)(i);
- Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+ AssertThrow (std::fabs(val - i) <= 1e-6, ExcInternalError());
}
}
for (unsigned int i=vec.block(1).local_range().first; i<vec.block(1).local_range().second; ++i)
(i != vec.block(1).local_range().first+90))
{
double val = vec.block(1)(i);
- Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+ AssertThrow (std::fabs(val - i) <= 1e-6, ExcInternalError());
}
}
}
const double l1_norm = vec.l1_norm();
- Assert (l1_norm == 2*exact_l1, ExcInternalError());
+ AssertThrow (l1_norm == 2*exact_l1, ExcInternalError());
// generate output. write the norm divided by two so that it matches the
// results of the _01 test
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// create a vector that consists of elements indexed from 0 to n
PETScWrappers::MPI::Vector vec (MPI_COMM_WORLD, 100 * n_processes, 100);
- Assert (vec.local_size() == 100, ExcInternalError());
- Assert (vec.local_range().first == 100*myid, ExcInternalError());
- Assert (vec.local_range().second == 100*myid+100, ExcInternalError());
+ AssertThrow (vec.local_size() == 100, ExcInternalError());
+ AssertThrow (vec.local_range().first == 100*myid, ExcInternalError());
+ AssertThrow (vec.local_range().second == 100*myid+100, ExcInternalError());
for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
vec(i) = i;
vec.compress(VectorOperation::insert);
double exact_l1 = 0;
for (unsigned int i=0; i<vec.size(); ++i)
exact_l1 += i;
- Assert (vec.l1_norm() == exact_l1, ExcInternalError());
+ AssertThrow (vec.l1_norm() == exact_l1, ExcInternalError());
}
// verify correctness
if (myid != 0)
- Assert (vec(vec.local_range().first+10) == vec.local_range().first-25+1,
- ExcInternalError());
+ AssertThrow (vec(vec.local_range().first+10) == vec.local_range().first-25+1,
+ ExcInternalError());
if (myid != n_processes-1)
- Assert (vec(vec.local_range().first+90) == vec.local_range().first+105-1,
- ExcInternalError());
+ AssertThrow (vec(vec.local_range().first+90) == vec.local_range().first+105-1,
+ ExcInternalError());
for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
{
(i != vec.local_range().first+90))
{
double val = vec(i);
- Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+ AssertThrow (std::fabs(val - i) <= 1e-6, ExcInternalError());
}
}
}
const double l1_norm = vec.l1_norm();
- Assert (l1_norm == exact_l1, ExcInternalError());
+ AssertThrow (l1_norm == exact_l1, ExcInternalError());
if (myid == 0)
deallog << "Norm = " << l1_norm << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
vec.block(0).reinit(MPI_COMM_WORLD, 100 * n_processes, 100);
vec.block(1).reinit(MPI_COMM_WORLD, 100 * n_processes, 100);
vec.collect_sizes();
- Assert (vec.block(0).local_size() == 100, ExcInternalError());
- Assert (vec.block(0).local_range().first == 100*myid, ExcInternalError());
- Assert (vec.block(0).local_range().second == 100*myid+100, ExcInternalError());
- Assert (vec.block(1).local_size() == 100, ExcInternalError());
- Assert (vec.block(1).local_range().first == 100*myid, ExcInternalError());
- Assert (vec.block(1).local_range().second == 100*myid+100, ExcInternalError());
+ AssertThrow (vec.block(0).local_size() == 100, ExcInternalError());
+ AssertThrow (vec.block(0).local_range().first == 100*myid, ExcInternalError());
+ AssertThrow (vec.block(0).local_range().second == 100*myid+100, ExcInternalError());
+ AssertThrow (vec.block(1).local_size() == 100, ExcInternalError());
+ AssertThrow (vec.block(1).local_range().first == 100*myid, ExcInternalError());
+ AssertThrow (vec.block(1).local_range().second == 100*myid+100, ExcInternalError());
IndexSet locally_owned (vec.size());
locally_owned.add_range (100*myid, 100*myid+100);
locally_owned.add_range (vec.block(0).size()+100*myid,
vec.block(0).size()+100*myid+100);
- Assert (vec.locally_owned_elements() == locally_owned,
- ExcInternalError());
+ AssertThrow (vec.locally_owned_elements() == locally_owned,
+ ExcInternalError());
if (myid == 0)
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
++my_cell_index;
indicators(cell_index) = my_cell_index;
}
- Assert (my_cell_index == 20, ExcInternalError());
+ AssertThrow (my_cell_index == 20, ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
++my_cell_index;
indicators(cell_index) = my_cell_index+1;
}
- Assert (my_cell_index == 20, ExcInternalError());
+ AssertThrow (my_cell_index == 20, ExcInternalError());
}
parallel::distributed::GridRefinement
typedef parallel::distributed::Triangulation<2,3>::cell_iterator cell_iterator;
DeclException1(ExcMissingCell,
- cell_iterator,
- << "Trying to find cell " << arg1 << " but it doesn't appear to be in the list");
+ cell_iterator,
+ << "Trying to find cell " << arg1 << " but it doesn't appear to be in the list");
int main(int argc, char *argv[])
{
dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, numbers::invalid_unsigned_int);
MPILogInitAll log;
-
+
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
{
static std::ofstream logfile("output");
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
}
-
+
parallel::distributed::Triangulation<2,3> triangulation(MPI_COMM_WORLD,
- typename Triangulation<2,3>::MeshSmoothing
- (Triangulation<2,3>::smoothing_on_refinement |
- Triangulation<2,3 >::smoothing_on_coarsening));
+ typename Triangulation<2,3>::MeshSmoothing
+ (Triangulation<2,3>::smoothing_on_refinement |
+ Triangulation<2,3 >::smoothing_on_coarsening));
GridGenerator::torus(triangulation, 1, 0.2);
// create a set of all cells, and insert all cells into it
{
cells.insert (cell);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
- deallog << "Adding cell " << cell << std::endl;
+ deallog << "Adding cell " << cell << std::endl;
}
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
deallog << "List contains " << cells.size() << " items" << std::endl;
// verify that every cell is in there
- for(parallel::distributed::Triangulation<2,3>::cell_iterator cell= triangulation.begin(0);
- cell!=triangulation.end(0);
- ++cell)
- Assert (cells.find(cell)!=cells.end(),
- ExcMissingCell(cell));
+ for (parallel::distributed::Triangulation<2,3>::cell_iterator cell= triangulation.begin(0);
+ cell!=triangulation.end(0);
+ ++cell)
+ AssertThrow (cells.find(cell)!=cells.end(),
+ ExcMissingCell(cell));
// refine triangulation and verify that every coarse mesh cell is in there
triangulation.refine_global(2);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
deallog << "List contains " << cells.size() << " items" << std::endl;
- for(parallel::distributed::Triangulation<2,3>::cell_iterator cell= triangulation.begin(0);
- cell!=triangulation.end(0);
- ++cell)
- Assert (cells.find(cell)!=cells.end(),
- ExcMissingCell(cell));
+ for (parallel::distributed::Triangulation<2,3>::cell_iterator cell= triangulation.begin(0);
+ cell!=triangulation.end(0);
+ ++cell)
+ AssertThrow (cells.find(cell)!=cells.end(),
+ ExcMissingCell(cell));
}
x1.ReplaceGlobalValues(1, &GID, &value);
x1.GlobalAssemble (Insert);
if (Comm.MyPID()==0)
- Assert (x1[0][0] == 1, ExcInternalError());
+ AssertThrow (x1[0][0] == 1, ExcInternalError());
// copy vector
Epetra_FEVector x2 (x1);
x2.GlobalAssemble (Insert);
if (Comm.MyPID()==0)
- Assert (x1[0][0] == 1, ExcInternalError());
+ AssertThrow (x1[0][0] == 1, ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
is.add_range (100*myid, 100*myid+100);
vec.reinit (is, MPI_COMM_WORLD);
}
- Assert (vec.local_size() == 100, ExcInternalError());
- Assert (vec.local_range().first == 100*myid, ExcInternalError());
- Assert (vec.local_range().second == 100*myid+100, ExcInternalError());
+ AssertThrow (vec.local_size() == 100, ExcInternalError());
+ AssertThrow (vec.local_range().first == 100*myid, ExcInternalError());
+ AssertThrow (vec.local_range().second == 100*myid+100, ExcInternalError());
for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
vec(i) = i;
vec.compress(VectorOperation::insert);
double exact_l1 = 0;
for (unsigned int i=0; i<vec.size(); ++i)
exact_l1 += i;
- Assert (vec.l1_norm() == exact_l1, ExcInternalError());
+ AssertThrow (vec.l1_norm() == exact_l1, ExcInternalError());
}
// verify correctness
if (myid != 0)
- Assert (vec(vec.local_range().first+10) == vec.local_range().first-25,
- ExcInternalError());
+ AssertThrow (vec(vec.local_range().first+10) == vec.local_range().first-25,
+ ExcInternalError());
if (myid != n_processes-1)
- Assert (vec(vec.local_range().first+90) == vec.local_range().first+105,
- ExcInternalError());
+ AssertThrow (vec(vec.local_range().first+90) == vec.local_range().first+105,
+ ExcInternalError());
for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
{
(i != vec.local_range().first+90))
{
double val = vec(i);
- Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+ AssertThrow (std::fabs(val - i) <= 1e-6, ExcInternalError());
}
}
}
const double l1_norm = vec.l1_norm();
- Assert (l1_norm == exact_l1, ExcInternalError());
+ AssertThrow (l1_norm == exact_l1, ExcInternalError());
if (myid == 0)
deallog << "Norm = " << l1_norm << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
vec.block(1).reinit (is, MPI_COMM_WORLD);
}
vec.collect_sizes();
- Assert (vec.block(0).local_size() == 100, ExcInternalError());
- Assert (vec.block(0).local_range().first == 100*myid, ExcInternalError());
- Assert (vec.block(0).local_range().second == 100*myid+100, ExcInternalError());
- Assert (vec.block(1).local_size() == 100, ExcInternalError());
- Assert (vec.block(1).local_range().first == 100*myid, ExcInternalError());
- Assert (vec.block(1).local_range().second == 100*myid+100, ExcInternalError());
+ AssertThrow (vec.block(0).local_size() == 100, ExcInternalError());
+ AssertThrow (vec.block(0).local_range().first == 100*myid, ExcInternalError());
+ AssertThrow (vec.block(0).local_range().second == 100*myid+100, ExcInternalError());
+ AssertThrow (vec.block(1).local_size() == 100, ExcInternalError());
+ AssertThrow (vec.block(1).local_range().first == 100*myid, ExcInternalError());
+ AssertThrow (vec.block(1).local_range().second == 100*myid+100, ExcInternalError());
for (unsigned int i=vec.block(0).local_range().first; i<vec.block(0).local_range().second; ++i)
vec.block(0)(i) = i;
double exact_l1 = 0;
for (unsigned int i=0; i<vec.block(0).size(); ++i)
exact_l1 += 2*i;
- Assert (vec.l1_norm() == exact_l1, ExcInternalError());
+ AssertThrow (vec.l1_norm() == exact_l1, ExcInternalError());
}
// verify correctness
if (myid != 0)
- Assert (vec(vec.block(0).local_range().first+10) == vec.block(0).local_range().first-25,
- ExcInternalError());
+ AssertThrow (vec(vec.block(0).local_range().first+10) == vec.block(0).local_range().first-25,
+ ExcInternalError());
if (myid != n_processes-1)
- Assert (vec(vec.block(0).local_range().first+90) == vec.block(0).local_range().first+105,
- ExcInternalError());
+ AssertThrow (vec(vec.block(0).local_range().first+90) == vec.block(0).local_range().first+105,
+ ExcInternalError());
if (myid != 0)
- Assert (vec(vec.block(0).size()+vec.block(1).local_range().first+10) == vec.block(1).local_range().first-25,
- ExcInternalError());
+ AssertThrow (vec(vec.block(0).size()+vec.block(1).local_range().first+10) == vec.block(1).local_range().first-25,
+ ExcInternalError());
if (myid != n_processes-1)
- Assert (vec(vec.block(0).size()+vec.block(1).local_range().first+90) == vec.block(1).local_range().first+105,
- ExcInternalError());
+ AssertThrow (vec(vec.block(0).size()+vec.block(1).local_range().first+90) == vec.block(1).local_range().first+105,
+ ExcInternalError());
for (unsigned int i=vec.block(0).local_range().first; i<vec.block(0).local_range().second; ++i)
(i != vec.block(0).local_range().first+90))
{
double val = vec.block(0)(i);
- Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+ AssertThrow (std::fabs(val - i) <= 1e-6, ExcInternalError());
}
}
for (unsigned int i=vec.block(1).local_range().first; i<vec.block(1).local_range().second; ++i)
(i != vec.block(1).local_range().first+90))
{
double val = vec.block(1)(i);
- Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+ AssertThrow (std::fabs(val - i) <= 1e-6, ExcInternalError());
}
}
}
const double l1_norm = vec.l1_norm();
- Assert (l1_norm == 2*exact_l1, ExcInternalError());
+ AssertThrow (l1_norm == 2*exact_l1, ExcInternalError());
// generate output. write the norm divided by two so that it matches the
// results of the _01 test
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
is.add_range (100*myid, 100*myid+100);
vec.reinit (is, MPI_COMM_WORLD);
}
- Assert (vec.local_size() == 100, ExcInternalError());
- Assert (vec.local_range().first == 100*myid, ExcInternalError());
- Assert (vec.local_range().second == 100*myid+100, ExcInternalError());
+ AssertThrow (vec.local_size() == 100, ExcInternalError());
+ AssertThrow (vec.local_range().first == 100*myid, ExcInternalError());
+ AssertThrow (vec.local_range().second == 100*myid+100, ExcInternalError());
for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
vec(i) = i;
vec.compress(VectorOperation::insert);
double exact_l1 = 0;
for (unsigned int i=0; i<vec.size(); ++i)
exact_l1 += i;
- Assert (vec.l1_norm() == exact_l1, ExcInternalError());
+ AssertThrow (vec.l1_norm() == exact_l1, ExcInternalError());
}
// verify correctness
if (myid != 0)
- Assert (vec(vec.local_range().first+10) == vec.local_range().first-25+1,
- ExcInternalError());
+ AssertThrow (vec(vec.local_range().first+10) == vec.local_range().first-25+1,
+ ExcInternalError());
if (myid != n_processes-1)
- Assert (vec(vec.local_range().first+90) == vec.local_range().first+105-1,
- ExcInternalError());
+ AssertThrow (vec(vec.local_range().first+90) == vec.local_range().first+105-1,
+ ExcInternalError());
for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
{
(i != vec.local_range().first+90))
{
double val = vec(i);
- Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+ AssertThrow (std::fabs(val - i) <= 1e-6, ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// create non-contiguous index set
{
- Assert(n_processes == 2, ExcNotImplemented());
+ AssertThrow(n_processes == 2, ExcNotImplemented());
IndexSet index (10);
for (unsigned int i=0; i<10; i+=2)
index.add_range(i+myid, i+myid+1);
TrilinosWrappers::MPI::Vector vec(index, MPI_COMM_WORLD);
IndexSet index2 = vec.locally_owned_elements();
- Assert (index == index2, ExcInternalError());
+ AssertThrow (index == index2, ExcInternalError());
}
// create contiguous index set
TrilinosWrappers::MPI::Vector vec(index, MPI_COMM_WORLD);
IndexSet index2 = vec.locally_owned_elements();
- Assert (index == index2, ExcInternalError());
+ AssertThrow (index == index2, ExcInternalError());
}
if (myid == 0)
for (unsigned int i=0; i<row_partitioning.n_elements(); ++i)
{
const unsigned int global_index = row_partitioning.nth_index_in_set(i);
- Assert (dy(global_index) == y(global_index), ExcInternalError());
+ AssertThrow (dy(global_index) == y(global_index), ExcInternalError());
}
if (my_id == 0) deallog << "OK" << std::endl;
}
for (unsigned int i=0; i<row_partitioning.n_elements(); ++i)
{
const unsigned int global_index = row_partitioning.nth_index_in_set(i);
- Assert (dy(global_index) == y(global_index), ExcInternalError());
+ AssertThrow (dy(global_index) == y(global_index), ExcInternalError());
}
A.vmult_add (y, x);
for (unsigned int i=0; i<row_partitioning.n_elements(); ++i)
{
const unsigned int global_index = row_partitioning.nth_index_in_set(i);
- Assert (dy(global_index) == y(global_index), ExcInternalError());
+ AssertThrow (dy(global_index) == y(global_index), ExcInternalError());
}
A.Tvmult (x, y);
for (unsigned int i=0; i<col_partitioning.n_elements(); ++i)
{
const unsigned int global_index = col_partitioning.nth_index_in_set(i);
- Assert (dx(global_index) == x(global_index), ExcInternalError());
+ AssertThrow (dx(global_index) == x(global_index), ExcInternalError());
}
A.Tvmult_add (x, y);
for (unsigned int i=0; i<col_partitioning.n_elements(); ++i)
{
const unsigned int global_index = col_partitioning.nth_index_in_set(i);
- Assert (dx(global_index) == x(global_index), ExcInternalError());
+ AssertThrow (dx(global_index) == x(global_index), ExcInternalError());
}
if (my_id == 0) deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2009 - 2014 by the deal.II authors
+// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
TrilinosWrappers::MPI::Vector interpolated(dofh.locally_owned_dofs(),
MPI_COMM_WORLD);
- Assert (interpolated.has_ghost_elements() == false,
- ExcInternalError());
+ AssertThrow (interpolated.has_ghost_elements() == false,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
TrilinosWrappers::MPI::Vector test1, test2;
- Assert (test1.vector_partitioner().SameAs(test2.vector_partitioner()),
- ExcInternalError());
+ AssertThrow (test1.vector_partitioner().SameAs(test2.vector_partitioner()),
+ ExcInternalError());
// first processor owns 2 indices, second
// processor owns none
// reinit Trilinos vector from other vector
test2.reinit (test1, true);
- Assert (test1.vector_partitioner().SameAs(test2.vector_partitioner()),
- ExcInternalError());
+ AssertThrow (test1.vector_partitioner().SameAs(test2.vector_partitioner()),
+ ExcInternalError());
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
deallog << "OK" << std::endl;
DoFRenumbering::component_wise (mgdof);
for (unsigned int l=0; l<tr.n_levels(); ++l)
DoFRenumbering::component_wise (mgdof, l);
-
+
typename DoFHandler<dim>::level_cell_iterator
cell = mgdof.begin_mg(),
// dof index
for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
for (unsigned int j=i+1; j<fe.dofs_per_cell; ++j)
- if (fe.system_to_component_index(i).first <
- fe.system_to_component_index(j).first)
- Assert (mg_dof_indices[i] < mg_dof_indices[j],
- ExcInternalError())
+ {
+ if (fe.system_to_component_index(i).first <
+ fe.system_to_component_index(j).first)
+ {
+ AssertThrow (mg_dof_indices[i] < mg_dof_indices[j],
+ ExcInternalError());
+ }
else if (fe.system_to_component_index(i).first >
fe.system_to_component_index(j).first)
- Assert (mg_dof_indices[i] > mg_dof_indices[j],
- ExcInternalError());
+ {
+ AssertThrow (mg_dof_indices[i] > mg_dof_indices[j],
+ ExcInternalError());
+ }
+ }
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m(i,j) == 0, ExcInternalError());
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m(i,j) == 0, ExcInternalError());
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void test (PETScWrappers::SparseMatrix &m)
{
- Assert (m.m() == 5, ExcInternalError());
- Assert (m.n() == 5, ExcInternalError());
+ AssertThrow (m.m() == 5, ExcInternalError());
+ AssertThrow (m.n() == 5, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// compare against the exact value of the
// l1-norm (max col-sum)
deallog << m.l1_norm() << std::endl;
- Assert (m.l1_norm() == 7, ExcInternalError());
+ AssertThrow (m.l1_norm() == 7, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
- Assert (m.el(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
+ AssertThrow (m(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
+ AssertThrow (m.el(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
}
else
{
- Assert (m(i,j) == 0, ExcInternalError());
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
- Assert (m.el(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
+ AssertThrow (m(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
+ AssertThrow (m.el(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
}
else
{
- Assert (m(i,j) == 0, ExcInternalError());
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress (VectorOperation::insert);
- Assert (v.size() == 100, ExcInternalError());
+ AssertThrow (v.size() == 100, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ( ( (pattern[i] == true) && (v(i) == i) )
- ||
- ( (pattern[i] == false) && (v(i) == 0) ),
- ExcInternalError());
+ AssertThrow ( ( (pattern[i] == true) && (v(i) == i) )
+ ||
+ ( (pattern[i] == false) && (v(i) == 0) ),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ( ( (pattern[i] == true) && (v(i) == i) )
- ||
- ( (pattern[i] == false) && (v(i) == 0) ),
- ExcInternalError());
+ AssertThrow ( ( (pattern[i] == true) && (v(i) == i) )
+ ||
+ ( (pattern[i] == false) && (v(i) == 0) ),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress (VectorOperation::insert);
// then check the norm
- Assert (v.l1_norm() == norm, ExcInternalError());
+ AssertThrow (v.l1_norm() == norm, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// then check the norm
const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
- Assert (fabs(v.l2_norm()-std::sqrt(norm))<eps, ExcInternalError());
+ AssertThrow (fabs(v.l2_norm()-std::sqrt(norm))<eps, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v.compress (VectorOperation::insert);
// then check the norm
- Assert (v.linfty_norm() == norm, ExcInternalError());
+ AssertThrow (v.linfty_norm() == norm, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that the entries are ok
for (unsigned int i=0; i<v.size(); ++i)
- Assert ( ( (pattern[i] == true) && (v(i) == i*5./4.) )
- ||
- ( (pattern[i] == false) && (v(i) == 0) ),
- ExcInternalError());
+ AssertThrow ( ( (pattern[i] == true) && (v(i) == i*5./4.) )
+ ||
+ ( (pattern[i] == false) && (v(i) == 0) ),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that the entries are ok
for (unsigned int i=0; i<v.size(); ++i)
- Assert ( ( (pattern[i] == true) && (v(i) == i*3./4.) )
- ||
- ( (pattern[i] == false) && (v(i) == 0) ),
- ExcInternalError());
+ AssertThrow ( ( (pattern[i] == true) && (v(i) == i*3./4.) )
+ ||
+ ( (pattern[i] == false) && (v(i) == 0) ),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
w.compress (VectorOperation::insert);
// make sure the scalar product is zero
- Assert (v*w == 0, ExcInternalError());
+ AssertThrow (v*w == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w.compress (VectorOperation::insert);
// make sure the scalar product is zero
- Assert (v*w == product, ExcInternalError());
+ AssertThrow (v*w == product, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// vector is really empty
const unsigned int sz = v.size();
v = 0;
- Assert (v.size() == sz, ExcInternalError());
- Assert (v.l2_norm() == 0, ExcInternalError());
+ AssertThrow (v.size() == sz, ExcInternalError());
+ AssertThrow (v.l2_norm() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// vector is really empty
const unsigned int sz = v.size();
v = 0;
- Assert (v.size() == sz, ExcInternalError());
- Assert (v.l2_norm() == 0, ExcInternalError());
+ AssertThrow (v.size() == sz, ExcInternalError());
+ AssertThrow (v.l2_norm() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
const unsigned int sz = v.size();
v = 2;
- Assert (v.size() == sz, ExcInternalError());
- Assert (v.l2_norm() == std::sqrt(4.*sz), ExcInternalError());
+ AssertThrow (v.size() == sz, ExcInternalError());
+ AssertThrow (v.l2_norm() == std::sqrt(4.*sz), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
v.reinit (13, true);
- Assert (v.size() == 13, ExcInternalError());
+ AssertThrow (v.size() == 13, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// then resize with setting to zero
v.reinit (13, false);
- Assert (v.size() == 13, ExcInternalError());
- Assert (v.l2_norm() == 0, ExcInternalError());
+ AssertThrow (v.size() == 13, ExcInternalError());
+ AssertThrow (v.l2_norm() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// then check the norm
const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
- Assert (std::fabs(v.norm_sqr() - norm) < eps*norm,
- ExcInternalError());
+ AssertThrow (std::fabs(v.norm_sqr() - norm) < eps*norm,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// then check the norm
const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
- Assert (std::fabs(v.mean_value() - sum/v.size()) < eps*sum/v.size(),
- ExcInternalError());
+ AssertThrow (std::fabs(v.mean_value() - sum/v.size()) < eps*sum/v.size(),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// then check the norm
const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
const double true_value=std::pow(sum, static_cast<PetscScalar> (1./3.));
- Assert (std::fabs(v.lp_norm(3) - true_value) < eps*true_value,
- ExcInternalError());
+ AssertThrow (std::fabs(v.lp_norm(3) - true_value) < eps*true_value,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v = 0;
// then check all_zero
- Assert (v.all_zero() == true, ExcInternalError());
+ AssertThrow (v.all_zero() == true, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
if (i%3 == 0)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i+i+1., ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i+i+1., ExcInternalError());
}
else
{
- Assert (w(i) == 0, ExcInternalError());
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == 0, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
{
if (i%3 == 0)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i-(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i-(i+1.), ExcInternalError());
}
else
{
- Assert (w(i) == 0, ExcInternalError());
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == 0, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
- Assert (v(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i+1., ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i+(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i+(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i+2*(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i+2*(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (v(i) == i+2*(i+1.)+3*(i+2.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (v(i) == i+2*(i+1.)+3*(i+2.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == 2*i+(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == 2*i+(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == 3*i+2*(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == 3*i+2*(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (v(i) == 1.5*i+2*(i+1.)+3*(i+2.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (v(i) == 1.5*i+2*(i+1.)+3*(i+2.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (y(i) == i+3., ExcInternalError());
- Assert (v(i) == 1.5*i+2*(i+1.)+3*(i+2.)+4*(i+3), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (y(i) == i+3., ExcInternalError());
+ AssertThrow (v(i) == 1.5*i+2*(i+1.)+3*(i+2.)+4*(i+3), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i*(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i*(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == 2*(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == 2*(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (v(i) == 2*(i+1.)+3*(i+2.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (v(i) == 2*(i+1.)+3*(i+2.), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (std::fabs(v(i) - (i+1.)/(i+2.)) < eps*v(i),
- ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (std::fabs(v(i) - (i+1.)/(i+2.)) < eps*v(i),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i, ExcInternalError());
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
v = w;
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i, ExcInternalError());
- Assert (v(i) == i, ExcInternalError());
- Assert (x(i) == i+1, ExcInternalError());
+ AssertThrow (w(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
+ AssertThrow (x(i) == i+1, ExcInternalError());
}
v = x;
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i, ExcInternalError());
- Assert (v(i) == i+1, ExcInternalError());
- Assert (x(i) == i+1, ExcInternalError());
+ AssertThrow (w(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i+1, ExcInternalError());
+ AssertThrow (x(i) == i+1, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m(i,j) == 0, ExcInternalError());
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ( ( (pattern[i] == true) && (v(i) == 2*i) )
- ||
- ( (pattern[i] == false) && (v(i) == 0) ),
- ExcInternalError());
+ AssertThrow ( ( (pattern[i] == true) && (v(i) == 2*i) )
+ ||
+ ( (pattern[i] == false) && (v(i) == 0) ),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ( ( (pattern[i] == true) && (v(i) == i) )
- ||
- ( (pattern[i] == false) && (v(i) == 0) ),
- ExcInternalError());
+ AssertThrow ( ( (pattern[i] == true) && (v(i) == i) )
+ ||
+ ( (pattern[i] == false) && (v(i) == 0) ),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// check that the vector is really
// non-negative
- Assert (v.is_non_negative() == true, ExcInternalError());
+ AssertThrow (v.is_non_negative() == true, ExcInternalError());
// then set a single element to a negative
// value and check again
v(v.size()/2) = -1;
- Assert (v.is_non_negative() == false, ExcInternalError());
+ AssertThrow (v.is_non_negative() == false, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == w(i), ExcInternalError());
- Assert (v(i) == x(i), ExcInternalError());
+ AssertThrow (v(i) == w(i), ExcInternalError());
+ AssertThrow (v(i) == x(i), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w1(i) == w(i), ExcInternalError());
- Assert (x1(i) == x(i), ExcInternalError());
+ AssertThrow (w1(i) == w(i), ExcInternalError());
+ AssertThrow (x1(i) == x(i), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == w(i), ExcInternalError());
- Assert (v(i) == x(i), ExcInternalError());
+ AssertThrow (v(i) == w(i), ExcInternalError());
+ AssertThrow (v(i) == x(i), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w1(i) == w(i), ExcInternalError());
- Assert (x1(i) == x(i), ExcInternalError());
+ AssertThrow (w1(i) == w(i), ExcInternalError());
+ AssertThrow (x1(i) == x(i), ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void test (PETScWrappers::MatrixBase &m)
{
- Assert (m.m() != 0, ExcInternalError());
- Assert (m.n() != 0, ExcInternalError());
+ AssertThrow (m.m() != 0, ExcInternalError());
+ AssertThrow (m.n() != 0, ExcInternalError());
m.clear ();
- Assert (m.m() == 0, ExcInternalError());
- Assert (m.n() == 0, ExcInternalError());
+ AssertThrow (m.m() == 0, ExcInternalError());
+ AssertThrow (m.n() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void test (PETScWrappers::MatrixBase &m)
{
- Assert (m.m() == 100, ExcInternalError());
- Assert (m.n() == 100, ExcInternalError());
+ AssertThrow (m.m() == 100, ExcInternalError());
+ AssertThrow (m.n() == 100, ExcInternalError());
m = 0;
- Assert (m.m() == 100, ExcInternalError());
- Assert (m.n() == 100, ExcInternalError());
+ AssertThrow (m.m() == 100, ExcInternalError());
+ AssertThrow (m.n() == 100, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure that zeroing out rows does at
// least not add new nonzero entries (it
// may remove some, though)
- Assert (m.n_nonzero_elements() <= nnz, ExcInternalError());
+ AssertThrow (m.n_nonzero_elements() <= nnz, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure that zeroing out rows does at
// least not add new nonzero entries (it
// may remove some, though)
- Assert (m.n_nonzero_elements() <= nnz, ExcInternalError());
+ AssertThrow (m.n_nonzero_elements() <= nnz, ExcInternalError());
deallog << "OK" << std::endl;
}
// iterator
{
PETScWrappers::BlockVector::const_iterator i=v.begin();
- Assert (*i == 1, ExcInternalError());
+ AssertThrow (*i == 1, ExcInternalError());
++i;
- Assert (*i == 2, ExcInternalError());
+ AssertThrow (*i == 2, ExcInternalError());
}
// same, but create iterator in a different
{
PETScWrappers::BlockVector::const_iterator
i=const_cast<const PETScWrappers::BlockVector &>(v).begin();
- Assert (*i == 1, ExcInternalError());
+ AssertThrow (*i == 1, ExcInternalError());
++i;
- Assert (*i == 2, ExcInternalError());
+ AssertThrow (*i == 2, ExcInternalError());
}
// read through a read-write iterator
{
PETScWrappers::BlockVector::iterator i = v.begin();
- Assert (*i == 1, ExcInternalError());
+ AssertThrow (*i == 1, ExcInternalError());
++i;
- Assert (*i == 2, ExcInternalError());
+ AssertThrow (*i == 2, ExcInternalError());
}
// write through a read-write iterator
// and read again
{
PETScWrappers::BlockVector::iterator i = v.begin();
- Assert (*i == 2, ExcInternalError());
+ AssertThrow (*i == 2, ExcInternalError());
++i;
- Assert (*i == 3, ExcInternalError());
+ AssertThrow (*i == 3, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// iterator
{
PETScWrappers::BlockVector::const_iterator i=v.begin();
- Assert (i[0] == 1, ExcInternalError());
- Assert (i[1] == 2, ExcInternalError());
+ AssertThrow (i[0] == 1, ExcInternalError());
+ AssertThrow (i[1] == 2, ExcInternalError());
}
// same, but create iterator in a different
{
PETScWrappers::BlockVector::const_iterator
i=const_cast<const PETScWrappers::BlockVector &>(v).begin();
- Assert (i[0] == 1, ExcInternalError());
- Assert (i[1] == 2, ExcInternalError());
+ AssertThrow (i[0] == 1, ExcInternalError());
+ AssertThrow (i[1] == 2, ExcInternalError());
}
// read through a read-write iterator
{
PETScWrappers::BlockVector::iterator i = v.begin();
- Assert (i[0] == 1, ExcInternalError());
- Assert (i[1] == 2, ExcInternalError());
+ AssertThrow (i[0] == 1, ExcInternalError());
+ AssertThrow (i[1] == 2, ExcInternalError());
}
// write through a read-write iterator
// and read again
{
PETScWrappers::BlockVector::iterator i = v.begin();
- Assert (i[0] == 2, ExcInternalError());
- Assert (i[1] == 3, ExcInternalError());
+ AssertThrow (i[0] == 2, ExcInternalError());
+ AssertThrow (i[1] == 3, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2000 - 2014 by the deal.II authors
+// Copyright (C) 2000 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
PETScWrappers::BlockVector::iterator p1 = v1.begin();
for (unsigned int i=0; i<v1.size(); ++i, ++p1)
- Assert (*p1 == i, ExcInternalError());
+ AssertThrow (*p1 == i, ExcInternalError());
Assert (p1 == v1.end(), ExcInternalError());
// check backwards
for (unsigned int i=0; i<v1.size(); ++i, --p1)
- Assert (*p1 == v1.size()-i-1, ExcInternalError());
+ AssertThrow (*p1 == v1.size()-i-1, ExcInternalError());
// if we came thus far,
// everything is alright
PETScWrappers::BlockVector::const_iterator p1 = v1.begin();
for (unsigned int i=0; i<v1.size(); ++i, ++p1)
- Assert (*p1 == i, ExcInternalError());
+ AssertThrow (*p1 == i, ExcInternalError());
Assert (p1 == v1.end(), ExcInternalError());
{
const double val = *p1;
const double ref = v1.size()-i-1;
- Assert (val==ref, ExcInternalError());
+ AssertThrow (val==ref, ExcInternalError());
};
// if we came thus far,
{
const PETScWrappers::BlockVector::iterator p = (v1.begin()+i);
for (unsigned int j=0; j<v1.size(); ++j)
- Assert (p[(signed)j-(signed)i] == j, ExcInternalError());
+ AssertThrow (p[(signed)j-(signed)i] == j, ExcInternalError());
};
// if we came thus far,
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
m.compress (VectorOperation::insert);
// things we know
- Assert (m.m() == 3, ExcInternalError());
- Assert (m.n() == 3, ExcInternalError());
-
+ AssertThrow (m.m() == 3, ExcInternalError());
+ AssertThrow (m.n() == 3, ExcInternalError());
+
// Generate some output
deallog << "initial matrix: " << std::endl;
for (unsigned int i=0; i<m.m(); ++i)
{
for (unsigned int j=0; j<m.n(); ++j)
- deallog << m(i,j) << " ";
+ deallog << m(i,j) << " ";
deallog << std::endl;
}
deallog << std::endl;
for (unsigned int j=0; j<m.n(); ++j)
m.set (i, j, j+2*i);
m.compress (VectorOperation::insert);
-
+
// things we know
- Assert (m.m() == 5, ExcInternalError());
- Assert (m.n() == 5, ExcInternalError());
+ AssertThrow (m.m() == 5, ExcInternalError());
+ AssertThrow (m.n() == 5, ExcInternalError());
// Generate some output
deallog << "after reinit: " << std::endl;
for (unsigned int i=0; i<m.m(); ++i)
{
for (unsigned int j=0; j<m.n(); ++j)
- deallog << m(i,j) << " ";
+ deallog << m(i,j) << " ";
deallog << std::endl;
}
deallog << std::endl;
-
+
// done
deallog << "OK" << std::endl;
}
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
{
- // Standard intialiser...
+ // Standard intialiser...
PETScWrappers::FullMatrix m (3,3);
test (m);
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m(i,j) == 0, ExcInternalError());
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m(i,j) == 0, ExcInternalError());
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
void test (PETScWrappers::FullMatrix &m)
{
- Assert (m.m() == 5, ExcInternalError());
- Assert (m.n() == 5, ExcInternalError());
+ AssertThrow (m.m() == 5, ExcInternalError());
+ AssertThrow (m.n() == 5, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
- Assert (m.el(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
+ AssertThrow (m(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
+ AssertThrow (m.el(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
}
else
{
- Assert (m(i,j) == 0, ExcInternalError());
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
- Assert (m.el(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
+ AssertThrow (m(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
+ AssertThrow (m.el(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
}
else
{
- Assert (m(i,j) == 0, ExcInternalError());
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == i+result, ExcInternalError());
+ AssertThrow (w(i) == i+result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == i+result, ExcInternalError());
+ AssertThrow (w(i) == i+result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
- Assert (w(i) == i+1, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i+1, ExcInternalError());
}
PetscScalar result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (i+2*j)*j*(i+1);
- Assert (s == result, ExcInternalError());
+ AssertThrow (s == result, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
PetscScalar result = 0;
for (unsigned int i=0; i<m.m(); ++i)
for (unsigned int j=0; j<m.m(); ++j)
result += (i+2*j)*j*i;
- Assert (s == result, ExcInternalError());
+ AssertThrow (s == result, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
- Assert (w(i) == i+1, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i+1, ExcInternalError());
double result = i+1;
for (unsigned int j=0; j<m.m(); ++j)
result -= (i+2*j)*j;
- Assert (x(i) == result, ExcInternalError());
+ AssertThrow (x(i) == result, ExcInternalError());
}
- Assert (s == x.l2_norm(), ExcInternalError());
+ AssertThrow (s == x.l2_norm(), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == i+result, ExcInternalError());
+ AssertThrow (w(i) == i+result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == i+result, ExcInternalError());
+ AssertThrow (w(i) == i+result, ExcInternalError());
}
deallog << "OK" << std::endl;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
- Assert (w(i) == i+1, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i+1, ExcInternalError());
}
PetscScalar result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (i+2*j)*j*(i+1);
- Assert (s == result, ExcInternalError());
+ AssertThrow (s == result, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
- Assert (w(i) == i+1, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i+1, ExcInternalError());
double result = i+1;
for (unsigned int j=0; j<m.m(); ++j)
result -= (i+2*j)*j;
- Assert (x(i) == result, ExcInternalError());
+ AssertThrow (x(i) == result, ExcInternalError());
}
- Assert (s == x.l2_norm(), ExcInternalError());
+ AssertThrow (s == x.l2_norm(), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w(i) = v(i);
// check that they're equal
- Assert (v==w, ExcInternalError());
+ AssertThrow (v==w, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w(i) += v(i);
// check that they're equal
- Assert (v==w, ExcInternalError());
+ AssertThrow (v==w, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
w(i) = i+1.;
}
- Assert (!(v==w), ExcInternalError());
+ AssertThrow (!(v==w), ExcInternalError());
deallog << "OK" << std::endl;
}
// but then copy elements and make sure the
// vectors are actually equal
v = w;
- Assert (v==w, ExcInternalError());
+ AssertThrow (v==w, ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2004 - 2014 by the deal.II authors
+// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// but then copy elements and make sure the
// vectors are actually equal
v = w;
- Assert (! (v!=w), ExcInternalError());
+ AssertThrow (! (v!=w), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// p2 should have been created, and should
// have been different from the address of
// p1
- Assert (p2 != 0, ExcInternalError());
- Assert (p1 != p2, ExcInternalError());
+ AssertThrow (p2 != 0, ExcInternalError());
+ AssertThrow (p1 != p2, ExcInternalError());
delete p1;
delete p2;
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
verify (p1, p2);
- Assert (p1 != p2, ExcInternalError());
+ AssertThrow (p1 != p2, ExcInternalError());
delete p1;
delete p2;
// a pointer to a new object, leaving the
// original object pointed to as a memory
// leak. assert that this behavior persists
- Assert (objects_destroyed == 2, ExcInternalError());
+ AssertThrow (objects_destroyed == 2, ExcInternalError());
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// consequently re-create only one object
// that the two components of the
// re-created pair point to
- Assert (pair_2.first == pair_2.second, ExcInternalError());
- Assert (object_number == 3, ExcInternalError());
+ AssertThrow (pair_2.first == pair_2.second, ExcInternalError());
+ AssertThrow (object_number == 3, ExcInternalError());
// destroy the newly created object. this
// must succeed
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// consequently re-create only one object
// that the two components of the
// re-created pair point to
- Assert (pair_2.first == pair_2.second, ExcInternalError());
- Assert (object_number == 3, ExcInternalError());
+ AssertThrow (pair_2.first == pair_2.second, ExcInternalError());
+ AssertThrow (object_number == 3, ExcInternalError());
// destroy the newly created object. this
// must succeed and would likely throw
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// consequently re-create only one object
// that the two components of the
// re-created pair point to
- Assert (pair_2.first.c == pair_2.second.c, ExcInternalError());
- Assert (object_number == 3, ExcInternalError());
+ AssertThrow (pair_2.first.c == pair_2.second.c, ExcInternalError());
+ AssertThrow (object_number == 3, ExcInternalError());
// destroy the newly created object. this
// must succeed and would likely throw
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
ia >> t2;
- Assert (compare (t1, t2), ExcInternalError());
+ AssertThrow (compare (t1, t2), ExcInternalError());
}
}
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == 2*(i*j*.5+.5), ExcInternalError());
- Assert (m.el(i,j) == 2*(i*j*.5+.5), ExcInternalError());
+ AssertThrow (m(i,j) == 2*(i*j*.5+.5), ExcInternalError());
+ AssertThrow (m.el(i,j) == 2*(i*j*.5+.5), ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
void test (TrilinosWrappers::SparseMatrix &m)
{
- Assert (m.m() == 5, ExcInternalError());
- Assert (m.n() == 5, ExcInternalError());
+ AssertThrow (m.m() == 5, ExcInternalError());
+ AssertThrow (m.n() == 5, ExcInternalError());
deallog << "OK" << std::endl;
}
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
- Assert (m.el(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
+ AssertThrow (m(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
+ AssertThrow (m.el(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
- Assert (m.el(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
+ AssertThrow (m(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
+ AssertThrow (m.el(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
v.compress (VectorOperation::insert);
- Assert (v.size() == 100, ExcInternalError());
+ AssertThrow (v.size() == 100, ExcInternalError());
deallog << "OK" << std::endl;
}
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == i))
- ||
- ((pattern[i] == false) && (v(i) == 0))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == i))
+ ||
+ ((pattern[i] == false) && (v(i) == 0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == i))
- ||
- ((pattern[i] == false) && (v(i) == 0))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == i))
+ ||
+ ((pattern[i] == false) && (v(i) == 0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == i))
- ||
- ((pattern[i] == false) && (v(i) == 0))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == i))
+ ||
+ ((pattern[i] == false) && (v(i) == 0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == 2*i))
- ||
- ((pattern[i] == false) && (v(i) == 0))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == 2*i))
+ ||
+ ((pattern[i] == false) && (v(i) == 0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == i))
- ||
- ((pattern[i] == false) && (v(i) == 0))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == i))
+ ||
+ ((pattern[i] == false) && (v(i) == 0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
v.compress (VectorOperation::insert);
// then check the norm
- Assert (v.l1_norm() == norm, ExcInternalError());
+ AssertThrow (v.l1_norm() == norm, ExcInternalError());
deallog << "OK" << std::endl;
}
// then check the norm
const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
- Assert (fabs(v.l2_norm()-std::sqrt(norm))<eps, ExcInternalError());
+ AssertThrow (fabs(v.l2_norm()-std::sqrt(norm))<eps, ExcInternalError());
deallog << "OK" << std::endl;
}
v.compress (VectorOperation::insert);
// then check the norm
- Assert (v.linfty_norm() == norm, ExcInternalError());
+ AssertThrow (v.linfty_norm() == norm, ExcInternalError());
deallog << "OK" << std::endl;
}
// check that the entries are ok
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == i*5./4.))
- ||
- ((pattern[i] == false) && (v(i) == 0))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == i*5./4.))
+ ||
+ ((pattern[i] == false) && (v(i) == 0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// check that the entries are ok
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == i*3./4.))
- ||
- ((pattern[i] == false) && (v(i) == 0))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == i*3./4.))
+ ||
+ ((pattern[i] == false) && (v(i) == 0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
w.compress (VectorOperation::insert);
// make sure the scalar product is zero
- Assert (v*w == 0, ExcInternalError());
+ AssertThrow (v*w == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
w.compress (VectorOperation::insert);
// make sure the scalar product is zero
- Assert (v*w == product, ExcInternalError());
+ AssertThrow (v*w == product, ExcInternalError());
deallog << "OK" << std::endl;
}
// vector is really empty
const unsigned int sz = v.size();
v = 0;
- Assert (v.size() == sz, ExcInternalError());
- Assert (v.l2_norm() == 0, ExcInternalError());
+ AssertThrow (v.size() == sz, ExcInternalError());
+ AssertThrow (v.l2_norm() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// vector is really empty
const unsigned int sz = v.size();
v = 0;
- Assert (v.size() == sz, ExcInternalError());
- Assert (v.l2_norm() == 0, ExcInternalError());
+ AssertThrow (v.size() == sz, ExcInternalError());
+ AssertThrow (v.l2_norm() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
const unsigned int sz = v.size();
v = 2;
- Assert (v.size() == sz, ExcInternalError());
- Assert (v.l2_norm() == std::sqrt(4.*sz), ExcInternalError());
+ AssertThrow (v.size() == sz, ExcInternalError());
+ AssertThrow (v.l2_norm() == std::sqrt(4.*sz), ExcInternalError());
deallog << "OK" << std::endl;
}
{
v.reinit (13);
- Assert (v.size() == 13, ExcInternalError());
+ AssertThrow (v.size() == 13, ExcInternalError());
deallog << "OK" << std::endl;
}
// then resize with setting to zero
v.reinit (13);
- Assert (v.size() == 13, ExcInternalError());
- Assert (v.l2_norm() == 0, ExcInternalError());
+ AssertThrow (v.size() == 13, ExcInternalError());
+ AssertThrow (v.l2_norm() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// then check the norm
const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
- Assert (std::fabs(v.norm_sqr() - norm) < eps*norm,
- ExcInternalError());
+ AssertThrow (std::fabs(v.norm_sqr() - norm) < eps*norm,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// then check the norm
const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
- Assert (std::fabs(v.mean_value() - sum/v.size()) < eps*sum/v.size(),
- ExcInternalError());
+ AssertThrow (std::fabs(v.mean_value() - sum/v.size()) < eps*sum/v.size(),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// then check the norm
const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
const double true_value=std::pow(sum, static_cast<TrilinosScalar> (1./3.));
- Assert (std::fabs(v.lp_norm(3) - true_value) < eps*true_value,
- ExcInternalError());
+ AssertThrow (std::fabs(v.lp_norm(3) - true_value) < eps*true_value,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
v = 0;
// then check all_zero
- Assert (v.all_zero() == true, ExcInternalError());
+ AssertThrow (v.all_zero() == true, ExcInternalError());
deallog << "OK" << std::endl;
}
{
if (i%3 == 0)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i+i+1., ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i+i+1., ExcInternalError());
}
else
{
- Assert (w(i) == 0, ExcInternalError());
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == 0, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
}
}
{
if (i%3 == 0)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i-(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i-(i+1.), ExcInternalError());
}
else
{
- Assert (w(i) == 0, ExcInternalError());
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == 0, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
}
}
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
- Assert (v(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i+1., ExcInternalError());
deallog << "OK" << std::endl;
}
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i+(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i+(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i+2*(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i+2*(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (v(i) == i+2*(i+1.)+3*(i+2.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (v(i) == i+2*(i+1.)+3*(i+2.), ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == 2*i+(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == 2*i+(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == 3*i+2*(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == 3*i+2*(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (v(i) == 1.5*i+2*(i+1.)+3*(i+2.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (v(i) == 1.5*i+2*(i+1.)+3*(i+2.), ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (y(i) == i+3., ExcInternalError());
- Assert (v(i) == 1.5*i+2*(i+1.)+3*(i+2.)+4*(i+3), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (y(i) == i+3., ExcInternalError());
+ AssertThrow (v(i) == 1.5*i+2*(i+1.)+3*(i+2.)+4*(i+3), ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i*(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == i*(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == 2*(i+1.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (v(i) == 2*(i+1.), ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (v(i) == 2*(i+1.)+3*(i+2.), ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (v(i) == 2*(i+1.)+3*(i+2.), ExcInternalError());
}
deallog << "OK" << std::endl;
const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i+1., ExcInternalError());
- Assert (x(i) == i+2., ExcInternalError());
- Assert (std::fabs(v(i) - (i+1.)/(i+2.)) < eps*v(i),
- ExcInternalError());
+ AssertThrow (w(i) == i+1., ExcInternalError());
+ AssertThrow (x(i) == i+2., ExcInternalError());
+ AssertThrow (std::fabs(v(i) - (i+1.)/(i+2.)) < eps*v(i),
+ ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i, ExcInternalError());
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i, ExcInternalError());
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
}
// now also check the reverse assignment
w = v;
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i, ExcInternalError());
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
}
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i, ExcInternalError());
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
}
// now also check the reverse assignment
w = v;
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i, ExcInternalError());
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
}
v = w;
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i, ExcInternalError());
- Assert (v(i) == i, ExcInternalError());
- Assert (x(i) == i+1, ExcInternalError());
+ AssertThrow (w(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
+ AssertThrow (x(i) == i+1, ExcInternalError());
}
v = x;
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w(i) == i, ExcInternalError());
- Assert (v(i) == i+1, ExcInternalError());
- Assert (x(i) == i+1, ExcInternalError());
+ AssertThrow (w(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i+1, ExcInternalError());
+ AssertThrow (x(i) == i+1, ExcInternalError());
}
deallog << "OK" << std::endl;
for (unsigned int j=0; j<m.m(); ++j)
if ((i+2*j+1) % 3 == 0)
{
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m(i,j) == i*j*.5+.5, ExcInternalError());
+ AssertThrow (m.el(i,j) == i*j*.5+.5, ExcInternalError());
}
else
{
- Assert (m.el(i,j) == 0, ExcInternalError());
+ AssertThrow (m.el(i,j) == 0, ExcInternalError());
}
deallog << "OK" << std::endl;
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == 2*i))
- ||
- ((pattern[i] == false) && (v(i) == 0))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == 2*i))
+ ||
+ ((pattern[i] == false) && (v(i) == 0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == i))
- ||
- ((pattern[i] == false) && (v(i) == 0))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == i))
+ ||
+ ((pattern[i] == false) && (v(i) == 0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == 2*i))
- ||
- ((pattern[i] == false) && (v(i) == 0))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == 2*i))
+ ||
+ ((pattern[i] == false) && (v(i) == 0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// check that they are ok, and this time
// all of them
for (unsigned int i=0; i<v.size(); ++i)
- Assert ((((pattern[i] == true) && (v(i) == i))
- ||
- ((pattern[i] == false) && (v(i) == 0))),
- ExcInternalError());
+ AssertThrow ((((pattern[i] == true) && (v(i) == i))
+ ||
+ ((pattern[i] == false) && (v(i) == 0))),
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// check that the vector is really
// non-negative
- Assert (v.is_non_negative() == true, ExcInternalError());
+ AssertThrow (v.is_non_negative() == true, ExcInternalError());
// then set a single element to a negative
// value and check again
v(v.size()/2) = -1;
- Assert (v.is_non_negative() == false, ExcInternalError());
+ AssertThrow (v.is_non_negative() == false, ExcInternalError());
deallog << "OK" << std::endl;
}
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == w(i), ExcInternalError());
- Assert (v(i) == x(i), ExcInternalError());
+ AssertThrow (v(i) == w(i), ExcInternalError());
+ AssertThrow (v(i) == x(i), ExcInternalError());
}
deallog << "OK" << std::endl;
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w1(i) == w(i), ExcInternalError());
- Assert (x1(i) == x(i), ExcInternalError());
+ AssertThrow (w1(i) == w(i), ExcInternalError());
+ AssertThrow (x1(i) == x(i), ExcInternalError());
}
deallog << "OK" << std::endl;
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == w(i), ExcInternalError());
- Assert (v(i) == x(i), ExcInternalError());
+ AssertThrow (v(i) == w(i), ExcInternalError());
+ AssertThrow (v(i) == x(i), ExcInternalError());
}
deallog << "OK" << std::endl;
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (w1(i) == w(i), ExcInternalError());
- Assert (x1(i) == x(i), ExcInternalError());
+ AssertThrow (w1(i) == w(i), ExcInternalError());
+ AssertThrow (x1(i) == x(i), ExcInternalError());
}
deallog << "OK" << std::endl;
void test (TrilinosWrappers::SparseMatrix &m)
{
- Assert (m.m() != 0, ExcInternalError());
- Assert (m.n() != 0, ExcInternalError());
+ AssertThrow (m.m() != 0, ExcInternalError());
+ AssertThrow (m.n() != 0, ExcInternalError());
m.clear ();
- Assert (m.m() == 0, ExcInternalError());
- Assert (m.n() == 0, ExcInternalError());
+ AssertThrow (m.m() == 0, ExcInternalError());
+ AssertThrow (m.n() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
void test (TrilinosWrappers::SparseMatrix &m)
{
- Assert (m.m() == 100, ExcInternalError());
- Assert (m.n() == 100, ExcInternalError());
+ AssertThrow (m.m() == 100, ExcInternalError());
+ AssertThrow (m.n() == 100, ExcInternalError());
m = 0;
- Assert (m.m() == 100, ExcInternalError());
- Assert (m.n() == 100, ExcInternalError());
+ AssertThrow (m.m() == 100, ExcInternalError());
+ AssertThrow (m.n() == 100, ExcInternalError());
deallog << "OK" << std::endl;
}
// make sure that zeroing out rows does at
// least not add new nonzero entries (it
// may remove some, though)
- Assert (m.n_nonzero_elements() <= nnz, ExcInternalError());
+ AssertThrow (m.n_nonzero_elements() <= nnz, ExcInternalError());
deallog << "OK" << std::endl;
}
// elements really are zero
norm += m2.block(block_row,block_col).frobenius_norm();
}
- Assert (norm == 0, ExcInternalError());
+ AssertThrow (norm == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// elements really are zero
norm += m2.block(block_row,block_col).frobenius_norm();
}
- Assert (norm == 0, ExcInternalError());
+ AssertThrow (norm == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
result += (i+2*j)*j;
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*(j+m.n());
- Assert (w(i) == result, ExcInternalError());
- Assert (w(i+m.m()) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
+ AssertThrow (w(i+m.m()) == result, ExcInternalError());
}
for (unsigned int i=0; i<w.size(); ++i)
result += (j+2*i)*j;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*(j+m.m());
- Assert (v(i) == result, ExcInternalError());
- Assert (v(i+m.n()) == result, ExcInternalError());
+ AssertThrow (v(i) == result, ExcInternalError());
+ AssertThrow (v(i+m.n()) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == result, ExcInternalError());
- Assert (w(i+m.m()) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
+ AssertThrow (w(i+m.m()) == result, ExcInternalError());
}
for (unsigned int i=0; i<w.size(); ++i)
result += (j+2*i)*j;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*(j+m.m());
- Assert (v(i) == result, ExcInternalError());
+ AssertThrow (v(i) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
result += (i+2*j)*j;
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*(j+m.n());
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
for (unsigned int i=0; i<w.size(); ++i)
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*j;
- Assert (v(i) == result, ExcInternalError());
- Assert (v(i+m.n()) == result, ExcInternalError());
+ AssertThrow (v(i) == result, ExcInternalError());
+ AssertThrow (v(i+m.n()) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
for (unsigned int i=0; i<w.size(); ++i)
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*j;
- Assert (v(i) == result, ExcInternalError());
+ AssertThrow (v(i) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
// iterator
{
TrilinosWrappers::BlockVector::const_iterator i=v.begin();
- Assert (*i == 1, ExcInternalError());
+ AssertThrow (*i == 1, ExcInternalError());
++i;
- Assert (*i == 2, ExcInternalError());
+ AssertThrow (*i == 2, ExcInternalError());
}
// same, but create iterator in a different
{
TrilinosWrappers::BlockVector::const_iterator
i=const_cast<const TrilinosWrappers::BlockVector &>(v).begin();
- Assert (*i == 1, ExcInternalError());
+ AssertThrow (*i == 1, ExcInternalError());
++i;
- Assert (*i == 2, ExcInternalError());
+ AssertThrow (*i == 2, ExcInternalError());
}
// read through a read-write iterator
{
TrilinosWrappers::BlockVector::iterator i = v.begin();
- Assert (*i == 1, ExcInternalError());
+ AssertThrow (*i == 1, ExcInternalError());
++i;
- Assert (*i == 2, ExcInternalError());
+ AssertThrow (*i == 2, ExcInternalError());
}
// write through a read-write iterator
// and read again
{
TrilinosWrappers::BlockVector::iterator i = v.begin();
- Assert (*i == 2, ExcInternalError());
+ AssertThrow (*i == 2, ExcInternalError());
++i;
- Assert (*i == 3, ExcInternalError());
+ AssertThrow (*i == 3, ExcInternalError());
}
deallog << "OK" << std::endl;
// iterator
{
TrilinosWrappers::BlockVector::const_iterator i=v.begin();
- Assert (i[0] == 1, ExcInternalError());
- Assert (i[1] == 2, ExcInternalError());
+ AssertThrow (i[0] == 1, ExcInternalError());
+ AssertThrow (i[1] == 2, ExcInternalError());
}
// same, but create iterator in a different
{
TrilinosWrappers::BlockVector::const_iterator
i=const_cast<const TrilinosWrappers::BlockVector &>(v).begin();
- Assert (i[0] == 1, ExcInternalError());
- Assert (i[1] == 2, ExcInternalError());
+ AssertThrow (i[0] == 1, ExcInternalError());
+ AssertThrow (i[1] == 2, ExcInternalError());
}
// read through a read-write iterator
{
TrilinosWrappers::BlockVector::iterator i = v.begin();
- Assert (i[0] == 1, ExcInternalError());
- Assert (i[1] == 2, ExcInternalError());
+ AssertThrow (i[0] == 1, ExcInternalError());
+ AssertThrow (i[1] == 2, ExcInternalError());
}
// write through a read-write iterator
// and read again
{
TrilinosWrappers::BlockVector::iterator i = v.begin();
- Assert (i[0] == 2, ExcInternalError());
- Assert (i[1] == 3, ExcInternalError());
+ AssertThrow (i[0] == 2, ExcInternalError());
+ AssertThrow (i[1] == 3, ExcInternalError());
}
deallog << "OK" << std::endl;
TrilinosWrappers::BlockVector::iterator p2 = v2.begin();
for (unsigned int i=0; i<v1.size(); ++i, ++p2)
*p2 = i;
- Assert (p2==v2.end(), ExcInternalError());
+ AssertThrow (p2==v2.end(), ExcInternalError());
// check that the two vectors are equal
deallog << "Check 1: " << (v1==v2 ? "true" : "false") << std::endl;
TrilinosWrappers::BlockVector::iterator p1 = v1.begin();
for (unsigned int i=0; i<v1.size(); ++i, ++p1)
- Assert (*p1 == i, ExcInternalError());
+ AssertThrow (*p1 == i, ExcInternalError());
- Assert (p1 == v1.end(), ExcInternalError());
+ AssertThrow (p1 == v1.end(), ExcInternalError());
// move back into allowable
// region
// check backwards
for (unsigned int i=0; i<v1.size(); ++i, --p1)
- Assert (*p1 == v1.size()-i-1, ExcInternalError());
+ AssertThrow (*p1 == v1.size()-i-1, ExcInternalError());
// if we came thus far,
// everything is alright
TrilinosWrappers::BlockVector::const_iterator p1 = v1.begin();
for (unsigned int i=0; i<v1.size(); ++i, ++p1)
- Assert (*p1 == i, ExcInternalError());
+ AssertThrow (*p1 == i, ExcInternalError());
- Assert (p1 == v1.end(), ExcInternalError());
+ AssertThrow (p1 == v1.end(), ExcInternalError());
// move back into allowable
// region
{
const double val = *p1;
const double ref = v1.size()-i-1;
- Assert (val==ref, ExcInternalError());
+ AssertThrow (val==ref, ExcInternalError());
};
// if we came thus far,
{
const TrilinosWrappers::BlockVector::iterator p = (v1.begin()+i);
for (unsigned int j=0; j<v1.size(); ++j)
- Assert (p[(signed)j-(signed)i] == j, ExcInternalError());
+ AssertThrow (p[(signed)j-(signed)i] == j, ExcInternalError());
};
// if we came thus far,
// indeed what we expect. verify
// that both methods of accessing
// the entry work
- Assert (A.el(2, 3) == 2, ExcInternalError());
- Assert (A(2, 3) == 2, ExcInternalError());
+ AssertThrow (A.el(2, 3) == 2, ExcInternalError());
+ AssertThrow (A(2, 3) == 2, ExcInternalError());
deallog << "OK" << std::endl;
}
// matrix in order to check whether all
// elements really are zero
double norm = m2.frobenius_norm();
- Assert (norm == 0, ExcInternalError());
+ AssertThrow (norm == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// matrix in order to check whether all
// elements really are zero
double norm = m2.frobenius_norm();
- Assert (norm == 0, ExcInternalError());
+ AssertThrow (norm == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// also compare for equality with the original
for (SparsityPattern::const_iterator
p = sparsity.begin(); p != sparsity.end(); ++p)
- Assert (copy(p->row(), p->column()) == matrix(p->row(), p->column()),
- ExcInternalError());
+ AssertThrow (copy(p->row(), p->column()) == matrix(p->row(), p->column()),
+ ExcInternalError());
}
// matrix in order to check whether all
// elements really are zero.
double norm = m2.frobenius_norm();
- Assert (norm == 0, ExcInternalError());
+ AssertThrow (norm == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// matrix in order to check whether all
// elements really are zero
double norm = m2.frobenius_norm();
- Assert (norm == 0, ExcInternalError());
+ AssertThrow (norm == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == i+result, ExcInternalError());
+ AssertThrow (w(i) == i+result, ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == i+result, ExcInternalError());
+ AssertThrow (w(i) == i+result, ExcInternalError());
}
deallog << "OK" << std::endl;
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
- Assert (w(i) == i+1, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i+1, ExcInternalError());
}
TrilinosScalar result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (i+2*j)*j*(i+1);
- Assert (s == result, ExcInternalError());
+ AssertThrow (s == result, ExcInternalError());
deallog << "OK" << std::endl;
}
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
- Assert (v(i) == i, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
TrilinosScalar result = 0;
for (unsigned int i=0; i<m.m(); ++i)
for (unsigned int j=0; j<m.m(); ++j)
result += (i+2*j)*j*i;
- Assert (s == result, ExcInternalError());
+ AssertThrow (s == result, ExcInternalError());
deallog << "OK" << std::endl;
}
// make sure we get the expected result
for (unsigned int i=0; i<v.size(); ++i)
{
- Assert (v(i) == i, ExcInternalError());
- Assert (w(i) == i+1, ExcInternalError());
+ AssertThrow (v(i) == i, ExcInternalError());
+ AssertThrow (w(i) == i+1, ExcInternalError());
double result = i+1;
for (unsigned int j=0; j<m.m(); ++j)
result -= (i+2*j)*j;
- Assert (x(i) == result, ExcInternalError());
+ AssertThrow (x(i) == result, ExcInternalError());
}
- Assert (s == x.l2_norm(), ExcInternalError());
+ AssertThrow (s == x.l2_norm(), ExcInternalError());
deallog << "OK" << std::endl;
}
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
m.vmult_add (w, v);
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == result+result, ExcInternalError());
+ AssertThrow (w(i) == result+result, ExcInternalError());
}
deallog << "OK" << std::endl;
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
m.Tvmult_add (w, v);
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == result+result, ExcInternalError());
+ AssertThrow (w(i) == result+result, ExcInternalError());
}
deallog << "OK" << std::endl;
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
m.vmult_add (w, v);
double result = 0;
for (unsigned int j=0; j<m.n(); ++j)
result += (i+2*j)*j;
- Assert (w(i) == result+result, ExcInternalError());
+ AssertThrow (w(i) == result+result, ExcInternalError());
}
deallog << "OK" << std::endl;
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == result, ExcInternalError());
+ AssertThrow (w(i) == result, ExcInternalError());
}
m.Tvmult_add (w, v);
double result = 0;
for (unsigned int j=0; j<m.m(); ++j)
result += (j+2*i)*j;
- Assert (w(i) == result+result, ExcInternalError());
+ AssertThrow (w(i) == result+result, ExcInternalError());
}
deallog << "OK" << std::endl;
TrilinosWrappers::SparseMatrix::iterator k = A.begin(),
j = ++A.begin();
- Assert (k < j, ExcInternalError());
- Assert (j > k, ExcInternalError());
+ AssertThrow (k < j, ExcInternalError());
+ AssertThrow (j > k, ExcInternalError());
- Assert (!(j < k), ExcInternalError());
- Assert (!(k > j), ExcInternalError());
+ AssertThrow (!(j < k), ExcInternalError());
+ AssertThrow (!(k > j), ExcInternalError());
- Assert (k != j, ExcInternalError());
- Assert (!(k == j), ExcInternalError());
+ AssertThrow (k != j, ExcInternalError());
+ AssertThrow (!(k == j), ExcInternalError());
- Assert (k == k, ExcInternalError());
- Assert (!(k != k), ExcInternalError());
+ AssertThrow (k == k, ExcInternalError());
+ AssertThrow (!(k != k), ExcInternalError());
deallog << "OK" << std::endl;
}
TrilinosWrappers::SparseMatrix::const_iterator k = A.begin(),
j = ++A.begin();
- Assert (k < j, ExcInternalError());
- Assert (j > k, ExcInternalError());
+ AssertThrow (k < j, ExcInternalError());
+ AssertThrow (j > k, ExcInternalError());
- Assert (!(j < k), ExcInternalError());
- Assert (!(k > j), ExcInternalError());
+ AssertThrow (!(j < k), ExcInternalError());
+ AssertThrow (!(k > j), ExcInternalError());
- Assert (k != j, ExcInternalError());
- Assert (!(k == j), ExcInternalError());
+ AssertThrow (k != j, ExcInternalError());
+ AssertThrow (!(k == j), ExcInternalError());
- Assert (k == k, ExcInternalError());
- Assert (!(k != k), ExcInternalError());
+ AssertThrow (k == k, ExcInternalError());
+ AssertThrow (!(k != k), ExcInternalError());
deallog << "OK" << std::endl;
}
w(i) = v(i);
// check that they're equal
- Assert (v==w, ExcInternalError());
+ AssertThrow (v==w, ExcInternalError());
deallog << "OK" << std::endl;
}
w(i) += v(i);
// check that they're equal
- Assert (v==w, ExcInternalError());
+ AssertThrow (v==w, ExcInternalError());
deallog << "OK" << std::endl;
}
w(i) = i+1.;
}
- Assert (!(v==w), ExcInternalError());
+ AssertThrow (!(v==w), ExcInternalError());
deallog << "OK" << std::endl;
}
// but then copy elements and make sure the
// vectors are actually equal
v = w;
- Assert (v==w, ExcInternalError());
+ AssertThrow (v==w, ExcInternalError());
deallog << "OK" << std::endl;
}
w(i) = i+1.;
}
- Assert (v!=w, ExcInternalError());
+ AssertThrow (v!=w, ExcInternalError());
deallog << "OK" << std::endl;
}
// but then copy elements and make sure the
// vectors are actually equal
v = w;
- Assert (! (v!=w), ExcInternalError());
+ AssertThrow (! (v!=w), ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2002 - 2014 by the deal.II authors
+// Copyright (C) 2002 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (SparseMatrix<double>::iterator p=B.begin();
p!=B.end(); ++p)
if (p->column() != p->row())
- Assert (B(p->row(),p->column()) != B(p->column(),p->row()),
- ExcInternalError());
+ AssertThrow (B(p->row(),p->column()) != B(p->column(),p->row()),
+ ExcInternalError());
// for a number of different solution
// vectors, make up a matching rhs vector
// ---------------------------------------------------------------------
//
-// Copyright (C) 2002 - 2014 by the deal.II authors
+// Copyright (C) 2002 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
umfpackb.solve(ubb);
for (unsigned int i=0; i<4; ++i)
- Assert (std::fabs (ubb(i) - i) < 1e-12,
- ExcInternalError());
+ AssertThrow (std::fabs (ubb(i) - i) < 1e-12,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2002 - 2014 by the deal.II authors
+// Copyright (C) 2002 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
umfpackb.solve(ubb);
for (unsigned int i=0; i<4; ++i)
- Assert (std::fabs (ubb(i) - i) < 1e-12,
- ExcInternalError());
+ AssertThrow (std::fabs (ubb(i) - i) < 1e-12,
+ ExcInternalError());
deallog << "OK" << std::endl;
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2002 - 2014 by the deal.II authors
+// Copyright (C) 2002 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
for (SparseMatrix<float>::iterator p=B.begin();
p!=B.end(); ++p)
if (p->column() != p->row())
- Assert (B(p->row(),p->column()) != B(p->column(),p->row()),
- ExcInternalError());
+ AssertThrow (B(p->row(),p->column()) != B(p->column(),p->row()),
+ ExcInternalError());
// for a number of different solution
// vectors, make up a matching rhs vector
for (SparseMatrix<double>::iterator p=xB.begin();
p!=xB.end(); ++p)
if (p->column() != p->row())
- Assert (xB(p->row(),p->column()) != xB(p->column(),p->row()),
- ExcInternalError());
+ AssertThrow (xB(p->row(),p->column()) != xB(p->column(),p->row()),
+ ExcInternalError());
// now copy stuff over
for (SparseMatrix<double>::const_iterator i = xB.begin(); i != xB.end(); ++i)
for (SparseMatrix<double>::iterator p=xB.begin();
p!=xB.end(); ++p)
if (p->column() != p->row())
- Assert (xB(p->row(),p->column()) != xB(p->column(),p->row()),
- ExcInternalError());
+ AssertThrow (xB(p->row(),p->column()) != xB(p->column(),p->row()),
+ ExcInternalError());
// now copy stuff over
for (SparseMatrix<double>::const_iterator i = xB.begin(); i != xB.end(); ++i)
for (SparseMatrix<double>::iterator p=B.begin();
p!=B.end(); ++p)
if (p->column() != p->row())
- Assert (B(p->row(),p->column()) != B(p->column(),p->row()),
- ExcInternalError());
+ AssertThrow (B(p->row(),p->column()) != B(p->column(),p->row()),
+ ExcInternalError());
SparseMatrixEZ<double> B_ez(dof_handler.n_dofs(),
for (SparseMatrix<double>::iterator p=xB.begin();
p!=xB.end(); ++p)
if (p->column() != p->row())
- Assert (xB(p->row(),p->column()) != xB(p->column(),p->row()),
- ExcInternalError());
+ AssertThrow (xB(p->row(),p->column()) != xB(p->column(),p->row()),
+ ExcInternalError());
// now copy stuff over
for (SparseMatrix<double>::const_iterator i = xB.begin(); i != xB.end(); ++i)