From 34dc9bf7a82153c5bedd0014162e624c652b1a45 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 2 Apr 2015 09:16:46 +0200 Subject: [PATCH] Wolfgang's patch which fixes tests --- tests/fe/function.cc | 6 +++--- tests/integrators/divergence_01.cc | 5 +++-- tests/integrators/elasticity_01.cc | 16 ++++++++-------- tests/integrators/laplacian_01.cc | 16 ++++++++-------- tests/matrix_free/get_functions_common.h | 6 +++--- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/tests/fe/function.cc b/tests/fe/function.cc index 4abd6328e1..4a5577fb1a 100644 --- a/tests/fe/function.cc +++ b/tests/fe/function.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// 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. // @@ -61,8 +61,8 @@ void vector_values(const FiniteElement &fe) v(i) = i; FEValues feval(fe, quadrature, update_values); - std::vector > local(quadrature.size(), - Vector(fe.n_components())); + std::vector > local(quadrature.size(), + Vector(fe.n_components())); typename DoFHandler::active_cell_iterator cell = dof.begin_active(); const typename DoFHandler::active_cell_iterator end = dof.end(); diff --git a/tests/integrators/divergence_01.cc b/tests/integrators/divergence_01.cc index d54a838ea8..99f66a8490 100644 --- a/tests/integrators/divergence_01.cc +++ b/tests/integrators/divergence_01.cc @@ -30,6 +30,7 @@ using namespace LocalIntegrators::Divergence; + template void test_cell(const FEValuesBase &fev, const FEValuesBase &fes) { @@ -63,7 +64,7 @@ void test_cell(const FEValuesBase &fev, const FEValuesBase &fes) u = 0.; u(i) = 1.; w = 0.; - fev.get_function_gradients(u, indices, ugrad, true); + fev.get_function_gradients(u, indices, VectorSlice > > >(ugrad), true); cell_residual(w, fes, make_slice(ugrad)); Md.vmult(v,u); w.add(-1., v); @@ -119,7 +120,7 @@ void test_boundary(const FEValuesBase &fev, const FEValuesBase &fes) u = 0.; u(i) = 1.; w = 0.; - fev.get_function_values(u, indices, uval, true); + fev.get_function_values(u, indices, VectorSlice > >(uval), true); u_dot_n_residual(w, fev, fes, make_slice(uval)); M.vmult(v,u); w.add(-1., v); diff --git a/tests/integrators/elasticity_01.cc b/tests/integrators/elasticity_01.cc index 435222b2a0..bc4cfaedd5 100644 --- a/tests/integrators/elasticity_01.cc +++ b/tests/integrators/elasticity_01.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// 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. // @@ -58,7 +58,7 @@ void test_cell(const FEValuesBase &fev) u = 0.; u(i) = 1.; w = 0.; - fev.get_function_gradients(u, indices, ugrad, true); + fev.get_function_gradients(u, indices, VectorSlice > > >(ugrad), true); cell_residual(w, fev, make_slice(ugrad)); M.vmult(v,u); w.add(-1., v); @@ -99,8 +99,8 @@ void test_boundary(const FEValuesBase &fev) u = 0.; u(i) = 1.; w = 0.; - fev.get_function_values(u, indices, uval, true); - fev.get_function_gradients(u, indices, ugrad, true); + fev.get_function_values(u, indices, VectorSlice > >(uval), true); + fev.get_function_gradients(u, indices, VectorSlice > > >(ugrad), true); nitsche_residual(w, fev, make_slice(uval), make_slice(ugrad), make_slice(null_val), 17); M.vmult(v,u); w.add(-1., v); @@ -163,8 +163,8 @@ void test_face(const FEValuesBase &fev1, u1(i1) = 1.; w1 = 0.; w2 = 0.; - fev1.get_function_values(u1, indices1, u1val, true); - fev1.get_function_gradients(u1, indices1, u1grad, true); + fev1.get_function_values(u1, indices1, VectorSlice > >(u1val), true); + fev1.get_function_gradients(u1, indices1, VectorSlice > > >(u1grad), true); ip_residual(w1, w2, fev1, fev2, make_slice(u1val), make_slice(u1grad), make_slice(nullval), make_slice(nullgrad), @@ -177,8 +177,8 @@ void test_face(const FEValuesBase &fev1, w1 = 0.; w2 = 0.; - fev2.get_function_values(u1, indices2, u1val, true); - fev2.get_function_gradients(u1, indices2, u1grad, true); + fev2.get_function_values(u1, indices2, VectorSlice > >(u1val), true); + fev2.get_function_gradients(u1, indices2, VectorSlice > > >(u1grad), true); ip_residual(w1, w2, fev1, fev2, make_slice(nullval), make_slice(nullgrad), make_slice(u1val), make_slice(u1grad), diff --git a/tests/integrators/laplacian_01.cc b/tests/integrators/laplacian_01.cc index 21334f7120..65a272cc48 100644 --- a/tests/integrators/laplacian_01.cc +++ b/tests/integrators/laplacian_01.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// 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. // @@ -55,7 +55,7 @@ void test_cell(const FEValuesBase &fev) u = 0.; u(i) = 1.; w = 0.; - fev.get_function_gradients(u, indices, ugrad, true); + fev.get_function_gradients(u, indices, VectorSlice > > >(ugrad), true); cell_residual(w, fev, make_slice(ugrad)); M.vmult(v,u); w.add(-1., v); @@ -103,8 +103,8 @@ void test_boundary(const FEValuesBase &fev) u = 0.; u(i) = 1.; w = 0.; - fev.get_function_values(u, indices, uval, true); - fev.get_function_gradients(u, indices, ugrad, true); + fev.get_function_values(u, indices, VectorSlice > >(uval), true); + fev.get_function_gradients(u, indices, VectorSlice > > >(ugrad), true); nitsche_residual(w, fev, make_slice(uval), make_slice(ugrad), make_slice(null_val), 17); M.vmult(v,u); w.add(-1., v); @@ -174,8 +174,8 @@ void test_face(const FEValuesBase &fev1, u1(i1) = 1.; w1 = 0.; w2 = 0.; - fev1.get_function_values(u1, indices1, u1val, true); - fev1.get_function_gradients(u1, indices1, u1grad, true); + fev1.get_function_values(u1, indices1, VectorSlice > >(u1val), true); + fev1.get_function_gradients(u1, indices1, VectorSlice > > >(u1grad), true); ip_residual(w1, w2, fev1, fev2, make_slice(u1val), make_slice(u1grad), make_slice(nullval), make_slice(nullgrad), @@ -200,8 +200,8 @@ void test_face(const FEValuesBase &fev1, w1 = 0.; w2 = 0.; - fev2.get_function_values(u1, indices2, u1val, true); - fev2.get_function_gradients(u1, indices2, u1grad, true); + fev2.get_function_values(u1, indices2, VectorSlice > >(u1val), true); + fev2.get_function_gradients(u1, indices2, VectorSlice > > >(u1grad), true); ip_residual(w1, w2, fev1, fev2, make_slice(nullval), make_slice(nullgrad), make_slice(u1val), make_slice(u1grad), diff --git a/tests/matrix_free/get_functions_common.h b/tests/matrix_free/get_functions_common.h index 19bf335e49..bf0aa20f75 100644 --- a/tests/matrix_free/get_functions_common.h +++ b/tests/matrix_free/get_functions_common.h @@ -69,9 +69,9 @@ public: { FEEvaluation fe_eval (data); - std::vector reference_values (fe_eval.n_q_points); - std::vector > reference_grads (fe_eval.n_q_points); - std::vector > reference_hess (fe_eval.n_q_points); + std::vector reference_values (fe_eval.n_q_points); + std::vector > reference_grads (fe_eval.n_q_points); + std::vector > reference_hess (fe_eval.n_q_points); for (unsigned int cell=cell_range.first; cell