From d62e7f277623e4fc68350ab9a212f531f784234f Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Wed, 2 Mar 2016 16:00:25 +0100 Subject: [PATCH] Fixed compilation. --- include/deal.II/fe/mapping_manifold.h | 52 +---- source/fe/mapping_manifold.cc | 290 ++++++-------------------- tests/fe/mapping_manifold_01.cc | 2 +- tests/fe/mapping_manifold_02.cc | 10 +- 4 files changed, 81 insertions(+), 273 deletions(-) diff --git a/include/deal.II/fe/mapping_manifold.h b/include/deal.II/fe/mapping_manifold.h index 31beb2326e..9d2c5b111a 100644 --- a/include/deal.II/fe/mapping_manifold.h +++ b/include/deal.II/fe/mapping_manifold.h @@ -445,56 +445,18 @@ protected: * solving a Laplace equation, or if dim > - compute_mapping_support_points (const typename Triangulation::cell_iterator &cell) const; + // virtual + // std::vector > + // compute_mapping_support_points (const typename Triangulation::cell_iterator &cell) const; /** * Transforms the point @p p on the real cell to the corresponding point on * the unit cell @p cell by a Newton iteration. */ - Point - transform_real_to_unit_cell_internal (const typename Triangulation::cell_iterator &cell, - const Point &p, - const Point &initial_p_unit) const; - - /** - * For dim=2,3. Append the support points of all shape functions - * located on bounding lines of the given cell to the vector @p a. Points - * located on the vertices of a line are not included. - * - * Needed by the @p compute_support_points() function. For dim=1 - * this function is empty. The function uses the underlying manifold object - * of the line (or, if none is set, of the cell) for the location of the - * requested points. - * - * This function is made virtual in order to allow derived classes to choose - * shape function support points differently than the present class, which - * chooses the points as interpolation points on the boundary. - */ - virtual - void - add_line_support_points (const typename Triangulation::cell_iterator &cell, - std::vector > &a) const; - - /** - * For dim=3. Append the support points of all shape functions - * located on bounding faces (quads in 3d) of the given cell to the vector - * @p a. Points located on the vertices or lines of a quad are not included. - * - * Needed by the @p compute_support_points() function. For dim=1 - * and dim=2 this function is empty. The function uses the - * underlying manifold object of the quad (or, if none is set, of the cell) - * for the location of the requested points. - * - * This function is made virtual in order to allow derived classes to choose - * shape function support points differently than the present class, which - * chooses the points as interpolation points on the boundary. - */ - virtual - void - add_quad_support_points(const typename Triangulation::cell_iterator &cell, - std::vector > &a) const; + // Point + // transform_real_to_unit_cell_internal (const typename Triangulation::cell_iterator &cell, + // const Point &p, + // const Point &initial_p_unit) const; /** * Make MappingQ a friend since it needs to call the fill_fe_values() diff --git a/source/fe/mapping_manifold.cc b/source/fe/mapping_manifold.cc index d7ba3240a4..22ec5554bc 100644 --- a/source/fe/mapping_manifold.cc +++ b/source/fe/mapping_manifold.cc @@ -223,6 +223,15 @@ MappingManifold::clone () const } +template +Point +MappingManifold:: +transform_real_to_unit_cell (const typename Triangulation::cell_iterator &cell, + const Point &p) const +{ + Assert(false, ExcNotImplemented()); + return Point(); +} template Point @@ -901,15 +910,15 @@ namespace internal -// template -// CellSimilarity::Similarity -// MappingManifold:: -// fill_fe_values (const typename Triangulation::cell_iterator &cell, -// const CellSimilarity::Similarity cell_similarity, -// const Quadrature &quadrature, -// const typename Mapping::InternalDataBase &internal_data, -// internal::FEValues::MappingRelatedData &output_data) const -// { +template +CellSimilarity::Similarity +MappingManifold:: +fill_fe_values (const typename Triangulation::cell_iterator &cell, + const CellSimilarity::Similarity cell_similarity, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &internal_data, + internal::FEValues::MappingRelatedData &output_data) const +{ // // ensure that the following static_cast is really correct: // Assert (dynamic_cast(&internal_data) != 0, // ExcInternalError()); @@ -1075,9 +1084,9 @@ namespace internal // QProjector::DataSetDescriptor::cell (), // data, // output_data.jacobian_pushed_forward_3rd_derivatives); - -// return cell_similarity; -// } + Assert(false, ExcNotImplemented()); + return cell_similarity; +} @@ -1274,7 +1283,7 @@ namespace internal maybe_update_jacobian_3rd_derivatives (CellSimilarity::none, data_set, data, - output_data.jacobian_3rd_derivatives); + output_data.jacobian_3rd_derivatives); maybe_update_jacobian_pushed_forward_3rd_derivatives (CellSimilarity::none, data_set, data, @@ -1290,15 +1299,15 @@ namespace internal -// template -// void -// MappingManifold:: -// fill_fe_face_values (const typename Triangulation::cell_iterator &cell, -// const unsigned int face_no, -// const Quadrature &quadrature, -// const typename Mapping::InternalDataBase &internal_data, -// internal::FEValues::MappingRelatedData &output_data) const -// { +template +void +MappingManifold:: +fill_fe_face_values (const typename Triangulation::cell_iterator &cell, + const unsigned int face_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &internal_data, + internal::FEValues::MappingRelatedData &output_data) const +{ // // ensure that the following cast is really correct: // Assert ((dynamic_cast(&internal_data) != 0), // ExcInternalError()); @@ -1330,20 +1339,21 @@ namespace internal // quadrature, // data, // output_data); -// } + Assert(false, ExcNotImplemented()); +} -// template -// void -// MappingManifold:: -// fill_fe_subface_values (const typename Triangulation::cell_iterator &cell, -// const unsigned int face_no, -// const unsigned int subface_no, -// const Quadrature &quadrature, -// const typename Mapping::InternalDataBase &internal_data, -// internal::FEValues::MappingRelatedData &output_data) const -// { +template +void +MappingManifold:: +fill_fe_subface_values (const typename Triangulation::cell_iterator &cell, + const unsigned int face_no, + const unsigned int subface_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &internal_data, + internal::FEValues::MappingRelatedData &output_data) const +{ // // ensure that the following cast is really correct: // Assert ((dynamic_cast(&internal_data) != 0), // ExcInternalError()); @@ -1376,7 +1386,7 @@ namespace internal // quadrature, // data, // output_data); -// } +} @@ -1694,8 +1704,8 @@ namespace // return; // } // default: - Assert(false, ExcNotImplemented()); - // } + Assert(false, ExcNotImplemented()); + // } } } @@ -1747,20 +1757,20 @@ transform (const ArrayView > &input, // transform_gradients(input, mapping_type, mapping_data, output); // return; // default: - Assert(false, ExcNotImplemented()); - // } + Assert(false, ExcNotImplemented()); + // } } -// template -// void -// MappingManifold:: -// transform (const ArrayView > &input, -// const MappingType mapping_type, -// const typename Mapping::InternalDataBase &mapping_data, -// const ArrayView > &output) const -// { +template +void +MappingManifold:: +transform (const ArrayView > &input, + const MappingType mapping_type, + const typename Mapping::InternalDataBase &mapping_data, + const ArrayView > &output) const +{ // AssertDimension (input.size(), output.size()); // Assert (dynamic_cast(&mapping_data) != 0, @@ -1796,20 +1806,20 @@ transform (const ArrayView > &input, // } // default: -// Assert(false, ExcNotImplemented()); + Assert(false, ExcNotImplemented()); // } -// } +} -// template -// void -// MappingManifold:: -// transform (const ArrayView > &input, -// const MappingType mapping_type, -// const typename Mapping::InternalDataBase &mapping_data, -// const ArrayView > &output) const -// { +template +void +MappingManifold:: +transform (const ArrayView > &input, + const MappingType mapping_type, + const typename Mapping::InternalDataBase &mapping_data, + const ArrayView > &output) const +{ // switch (mapping_type) // { // case mapping_piola_hessian: @@ -1818,9 +1828,9 @@ transform (const ArrayView > &input, // transform_hessians(input, mapping_type, mapping_data, output); // return; // default: -// Assert(false, ExcNotImplemented()); + Assert(false, ExcNotImplemented()); // } -// } +} @@ -2059,170 +2069,6 @@ namespace -template <> -void -MappingManifold<3,3>:: -add_quad_support_points(const Triangulation<3,3>::cell_iterator &cell, - std::vector > &a) const -{ -// const unsigned int faces_per_cell = GeometryInfo<3>::faces_per_cell, -// vertices_per_face = GeometryInfo<3>::vertices_per_face, -// lines_per_face = GeometryInfo<3>::lines_per_face, -// vertices_per_cell = GeometryInfo<3>::vertices_per_cell; - -// static const StraightBoundary<3> straight_boundary; -// // used if face quad at boundary or entirely in the interior of the domain -// std::vector > quad_points ((polynomial_degree-1)*(polynomial_degree-1)); -// // used if only one line of face quad is at boundary -// std::vector > b(4*polynomial_degree); - -// // Used by the new Manifold interface. This vector collects the -// // vertices used to compute the intermediate points. -// std::vector > vertices(4); - -// // loop over all faces and collect points on them -// for (unsigned int face_no=0; face_no::face_iterator face = cell->face(face_no); - -// // select the correct mappings for the present face -// const bool face_orientation = cell->face_orientation(face_no), -// face_flip = cell->face_flip (face_no), -// face_rotation = cell->face_rotation (face_no); - -// #ifdef DEBUG -// // some sanity checks up front -// for (unsigned int i=0; ivertex_index(i)==cell->vertex_index( -// GeometryInfo<3>::face_to_cell_vertices(face_no, i, -// face_orientation, -// face_flip, -// face_rotation)), -// ExcInternalError()); - -// // indices of the lines that bound a face are given by GeometryInfo<3>:: -// // face_to_cell_lines -// for (unsigned int i=0; iline(i)==cell->line(GeometryInfo<3>::face_to_cell_lines( -// face_no, i, face_orientation, face_flip, face_rotation)), -// ExcInternalError()); -// #endif - -// // if face at boundary, then ask boundary object to return intermediate -// // points on it -// if (face->at_boundary()) -// { -// get_intermediate_points_on_object(face->get_manifold(), line_support_points, face, quad_points); - -// // in 3D, the orientation, flip and rotation of the face might not -// // match what we expect here, namely the standard orientation. thus -// // reorder points accordingly. since a Mapping uses the same shape -// // function as an FE_Q, we can ask a FE_Q to do the reordering for us. -// for (unsigned int i=0; iadjust_quad_dof_index_for_face_orientation(i, -// face_orientation, -// face_flip, -// face_rotation)]); -// } -// else -// { -// // face is not at boundary, but maybe some of its lines are. count -// // them -// unsigned int lines_at_boundary=0; -// for (unsigned int i=0; iline(i)->at_boundary()) -// ++lines_at_boundary; - -// Assert(lines_at_boundary<=lines_per_face, ExcInternalError()); - -// // if at least one of the lines bounding this quad is at the -// // boundary, then collect points separately -// if (lines_at_boundary>0) -// { -// // call of function add_weighted_interior_points increases size of b -// // about 1. There resize b for the case the mentioned function -// // was already called. -// b.resize(4*polynomial_degree); - -// // b is of size 4*degree, make sure that this is the right size -// Assert(b.size()==vertices_per_face+lines_per_face*(polynomial_degree-1), -// ExcDimensionMismatch(b.size(), -// vertices_per_face+lines_per_face*(polynomial_degree-1))); - -// // sort the points into b. We used access from the cell (not -// // from the face) to fill b, so we can assume a standard face -// // orientation. Doing so, the calculated points will be in -// // standard orientation as well. -// for (unsigned int i=0; i::face_to_cell_vertices(face_no, i)]; - -// for (unsigned int i=0; i::face_to_cell_lines( -// face_no, i)*(polynomial_degree-1)+j]; - -// // Now b includes the support points on the quad and we can -// // apply the laplace vector -// add_weighted_interior_points (support_point_weights_on_quad, b); -// AssertDimension (b.size(), -// 4*this->polynomial_degree + -// (this->polynomial_degree-1)*(this->polynomial_degree-1)); - -// for (unsigned int i=0; i<(polynomial_degree-1)*(polynomial_degree-1); ++i) -// a.push_back(b[4*polynomial_degree+i]); -// } -// else -// { -// // face is entirely in the interior. get intermediate -// // points from the relevant manifold object. -// vertices.resize(4); -// for (unsigned int i=0; i<4; ++i) -// vertices[i] = face->vertex(i); -// get_intermediate_points (face->get_manifold(), line_support_points, vertices, quad_points); -// // in 3D, the orientation, flip and rotation of the face might -// // not match what we expect here, namely the standard -// // orientation. thus reorder points accordingly. since a Mapping -// // uses the same shape function as an FE_Q, we can ask a FE_Q to -// // do the reordering for us. -// for (unsigned int i=0; iadjust_quad_dof_index_for_face_orientation(i, -// face_orientation, -// face_flip, -// face_rotation)]); -// } -// } -// } -} - - - -template <> -void -MappingManifold<2,3>:: -add_quad_support_points(const Triangulation<2,3>::cell_iterator &cell, - std::vector > &a) const -{ - // std::vector > quad_points ((polynomial_degree-1)*(polynomial_degree-1)); - // get_intermediate_points_on_object (cell->get_manifold(), line_support_points, - // cell, quad_points); - // for (unsigned int i=0; i -void -MappingManifold:: -add_quad_support_points(const typename Triangulation::cell_iterator &, - std::vector > &) const -{ - Assert (false, ExcInternalError()); -} - - - // template // std::vector > // MappingManifold:: diff --git a/tests/fe/mapping_manifold_01.cc b/tests/fe/mapping_manifold_01.cc index f20fb07b60..40fef5fc8f 100644 --- a/tests/fe/mapping_manifold_01.cc +++ b/tests/fe/mapping_manifold_01.cc @@ -58,7 +58,7 @@ void test() std::vector > q_points = quadrature.get_points(); - MappingManifold map_manifold(); + MappingManifold map_manifold; MappingQGeneric map_q1(1); diff --git a/tests/fe/mapping_manifold_02.cc b/tests/fe/mapping_manifold_02.cc index 3102324b5d..f0cf934822 100644 --- a/tests/fe/mapping_manifold_02.cc +++ b/tests/fe/mapping_manifold_02.cc @@ -61,15 +61,15 @@ void test() const QGauss quadrature(1); std::vector > q_points_from_quadrature = quadrature.get_points(); - + FE_Q fe(1); - + DoFHandler dof(tr); dof.distribute_dofs(fe); FEValues fe_values (fe, quadrature, - update_quadrature_points); + update_quadrature_points); MappingManifold map_manifold; @@ -84,8 +84,8 @@ void test() { const Point pq = map_manifold.transform_unit_to_real_cell(cell,q_points[q]); - AssertThrow(pq.distance(q_points_from_fe_values[q]) < 1e-10, - ExcInternalError()); + AssertThrow(pq.distance(q_points_from_fe_values[q]) < 1e-10, + ExcInternalError()); } } deallog << "OK" << std::endl; -- 2.39.5