From: Luca Heltai Date: Thu, 3 Mar 2016 14:43:24 +0000 (+0100) Subject: Fixed test one and two X-Git-Tag: v8.5.0-rc1~1131^2~23 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b41aeb831154363a0ce825ce5f43ac0b6e3aea44;p=dealii.git Fixed test one and two --- diff --git a/source/fe/mapping_manifold.cc b/source/fe/mapping_manifold.cc index ba3eff3796..2832ffd07b 100644 --- a/source/fe/mapping_manifold.cc +++ b/source/fe/mapping_manifold.cc @@ -1073,7 +1073,7 @@ fill_fe_values (const typename Triangulation::cell_iterator &cell, // QProjector::DataSetDescriptor::cell (), // data, // output_data.jacobian_pushed_forward_3rd_derivatives); - Assert(false, ExcNotImplemented()); + return cell_similarity; } @@ -2110,10 +2110,8 @@ namespace //--------------------------- Explicit instantiations ----------------------- -#include "mapping_q_generic.inst" +#include "mapping_manifold.inst" DEAL_II_NAMESPACE_CLOSE -template class dealii::MappingManifold<2,2>; - diff --git a/tests/fe/mapping_manifold_01.cc b/tests/fe/mapping_manifold_01.cc index 068beaa71d..9dea26d2b2 100644 --- a/tests/fe/mapping_manifold_01.cc +++ b/tests/fe/mapping_manifold_01.cc @@ -13,7 +13,7 @@ // // --------------------------------------------------------------------- - +// Check that MappingManifold and MappingQ1 are the same thing on a FlatManifold #include "../tests.h" @@ -24,8 +24,6 @@ #include #include -#include - template void test() { @@ -33,52 +31,33 @@ void test() Triangulation triangulation; - const Point<2> center (7,9); - const Point<2> origin (0,0); - const double inner_radius = 0.5, - outer_radius = 1.0; - GridGenerator::hyper_shell (triangulation, - center, inner_radius, outer_radius, - 10); - - - static const SphericalManifold manifold(center); + GridGenerator::hyper_cube (triangulation, 2.0, 3.0); - triangulation.set_all_manifold_ids_on_boundary(0); - triangulation.set_manifold (0, manifold); - typename Triangulation::active_cell_iterator - cell = triangulation.begin_active(), - endc = triangulation.end(); - for (; cell!=endc; ++cell) - cell->set_all_manifold_ids (0); - triangulation.refine_global (0); - const QIterated > quadrature(7); - - std::vector > q_points = quadrature.get_points(); + const QGauss quadrature(5); + std::vector > q_points = quadrature.get_points(); MappingManifold map_manifold; MappingQGeneric map_q1(1); - - cell = triangulation.begin_active(); - - std::ofstream two_be_plotted ("points.txt"); + typename Triangulation::active_cell_iterator + cell = triangulation.begin_active(), + endc = triangulation.end(); for (; cell!=endc; ++cell) { for (unsigned int i=0; i p = map.transform_unit_to_real_cell(cell,q_points[i]); - // deallog << "mapping manifold ---> " << p.distance() << std::endl; - const Point pq = map_manifold.transform_unit_to_real_cell(cell,q_points[i]); - deallog << "mapping q1 ---> " << pq.distance(origin) << std::endl; - for (unsigned int d=0; d pq1 = map_q1.transform_unit_to_real_cell(cell, q_points[i]); + if (pq.distance(pq1) > 1e-10) + { + deallog << "Expected: " << pq << ", got: " + << pq1 << std::endl; + } } } + deallog << "OK" << std::endl; } @@ -90,13 +69,13 @@ main() deallog.threshold_double(1.e-10); - // test<1,1>(); + test<1,1>(); test<2,2>(); - // test<3,3>(); + test<3,3>(); - // test<1,2>(); - // test<1,3>(); - // test<2,3>(); + test<1,2>(); + test<1,3>(); + test<2,3>(); return 0; } diff --git a/tests/fe/mapping_manifold_01.output b/tests/fe/mapping_manifold_01.output index e69de29bb2..4367a39484 100644 --- a/tests/fe/mapping_manifold_01.output +++ b/tests/fe/mapping_manifold_01.output @@ -0,0 +1,13 @@ + +DEAL::dim=1, spacedim=1 +DEAL::OK +DEAL::dim=2, spacedim=2 +DEAL::OK +DEAL::dim=3, spacedim=3 +DEAL::OK +DEAL::dim=1, spacedim=2 +DEAL::OK +DEAL::dim=1, spacedim=3 +DEAL::OK +DEAL::dim=2, spacedim=3 +DEAL::OK diff --git a/tests/fe/mapping_manifold_02.cc b/tests/fe/mapping_manifold_02.cc index 9ef5c321ba..784eba74cf 100644 --- a/tests/fe/mapping_manifold_02.cc +++ b/tests/fe/mapping_manifold_02.cc @@ -30,8 +30,6 @@ #include #include -#include - template void test() { @@ -39,58 +37,47 @@ void test() Triangulation triangulation; - const Point<2> center (7,9); - const Point<2> origin (0,0); + Point center; + for (unsigned int i=0; i manifold(center); - triangulation.set_all_manifold_ids_on_boundary(0); + triangulation.set_all_manifold_ids(0); triangulation.set_manifold (0, manifold); - typename Triangulation::active_cell_iterator - cell = triangulation.begin_active(), - endc = triangulation.end(); - for (; cell!=endc; ++cell) - cell->set_all_manifold_ids (0); - const QGauss quadrature(1); - - std::vector > q_points_from_quadrature = quadrature.get_points(); + const QGauss quad(3); FE_Q fe(1); DoFHandler dof(triangulation); dof.distribute_dofs(fe); + MappingManifold mapping; - FEValues fe_values (fe, quadrature, + FEValues fe_values (mapping, fe, quad, update_quadrature_points); - - MappingManifold map_manifold; - - cell = triangulation.begin_active(); - - std::ofstream two_be_plotted("plot.txt"); - for (; cell!=endc; ++cell) + for (typename Triangulation::active_cell_iterator cell= triangulation.begin_active(); + cell != triangulation.end(); ++cell) { fe_values.reinit(cell); - std::vector > q_points_from_fe_values = fe_values.get_quadrature_points(); - for (unsigned int q=0; q > fev_qp = fe_values.get_quadrature_points(); + for (unsigned int q=0; q pq = map_manifold.transform_unit_to_real_cell(cell,q_points_from_quadrature[q]); + const Point pq = mapping.transform_unit_to_real_cell(cell,quad.point(q)); - if (pq.distance(q_points_from_fe_values[q]) > 1e-10) + if (pq.distance(fev_qp[q]) > 1e-10) { deallog << "Expected: " << pq << ", got: " - << q_points_from_fe_values[q] << std::endl; + << fev_qp[q] << std::endl; } - two_be_plotted << pq << " " << q_points_from_fe_values[q] << std::endl; } } deallog << "OK" << std::endl; @@ -104,14 +91,8 @@ main() deallog.attach(logfile); deallog.threshold_double(1.e-10); - - // test<1,1>(); test<2,2>(); - // test<3,3>(); - - // test<1,2>(); - // test<1,3>(); - // test<2,3>(); + test<3,3>(); return 0; } diff --git a/tests/fe/mapping_manifold_02.output b/tests/fe/mapping_manifold_02.output index e69de29bb2..2aae953332 100644 --- a/tests/fe/mapping_manifold_02.output +++ b/tests/fe/mapping_manifold_02.output @@ -0,0 +1,5 @@ + +DEAL::dim=2, spacedim=2 +DEAL::OK +DEAL::dim=3, spacedim=3 +DEAL::OK