From 3d44efdefb74939198a2e1dfefaf96083b97b905 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Fri, 30 Jan 2004 14:26:09 +0000 Subject: [PATCH] compute_fill fixed git-svn-id: https://svn.dealii.org/trunk@8366 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/include/fe/mapping_cartesian.h | 77 +++---------------- .../deal.II/source/fe/mapping_cartesian.cc | 54 ++++++------- 2 files changed, 39 insertions(+), 92 deletions(-) diff --git a/deal.II/deal.II/include/fe/mapping_cartesian.h b/deal.II/deal.II/include/fe/mapping_cartesian.h index c6a947f65d..245404d652 100644 --- a/deal.II/deal.II/include/fe/mapping_cartesian.h +++ b/deal.II/deal.II/include/fe/mapping_cartesian.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2001, 2002, 2003 by the deal.II authors +// Copyright (C) 2001, 2002, 2003, 2004 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -27,7 +27,8 @@ * Mapping of an axis-parallel cell. * * This class maps the unit cell to a grid cell with surfaces parallel - * to the coordinate lines/planes. It is specifically developed for + * to the coordinate lines/planes. The mapping is therefore a scaling + * along the coordinate directions. It is specifically developed for * cartesian meshes. Apply this mapping to a general mesh to get * strange results. * @@ -37,37 +38,21 @@ template class MappingCartesian : public Mapping { public: - /** - * Implementation of the interface in - * @ref{Mapping}. - */ virtual typename Mapping::InternalDataBase * get_data (const UpdateFlags, const Quadrature& quadrature) const; - /** - * Implementation of the interface in - * @ref{Mapping}. - */ virtual typename Mapping::InternalDataBase * get_face_data (const UpdateFlags flags, const Quadrature& quadrature) const; - /** - * Implementation of the interface in - * @ref{Mapping}. - */ virtual typename Mapping::InternalDataBase * get_subface_data (const UpdateFlags flags, const Quadrature& quadrature) const; - /** - * Implementation of the interface in - * @ref{Mapping}. - */ virtual void fill_fe_values (const typename DoFHandler::cell_iterator &cell, const Quadrature& quadrature, @@ -75,10 +60,6 @@ class MappingCartesian : public Mapping std::vector > &quadrature_points, std::vector &JxW_values) const ; - /** - * Implementation of the interface in - * @ref{Mapping}. - */ virtual void fill_fe_face_values (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, @@ -88,11 +69,6 @@ class MappingCartesian : public Mapping std::vector &JxW_values, std::vector > &boundary_form, std::vector > &normal_vectors) const ; - - /** - * Implementation of the interface in - * @ref{Mapping}. - */ virtual void fill_fe_subface_values (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, @@ -104,53 +80,30 @@ class MappingCartesian : public Mapping std::vector > &boundary_form, std::vector > &normal_vectors) const ; - - /** - * Implementation of the interface in - * @ref{Mapping}. - */ virtual void transform_covariant (Tensor<1,dim> *begin, Tensor<1,dim> *end, const Tensor<1,dim> *src, const typename Mapping::InternalDataBase &internal) const; - /** - * Implementation of the interface in - * @ref{Mapping}. - */ virtual void transform_covariant (Tensor<2,dim> *begin, Tensor<2,dim> *end, const Tensor<2,dim> *src, const typename Mapping::InternalDataBase &internal) const; - /** - * Implementation of the interface in - * @ref{Mapping}. - */ virtual void transform_contravariant (Tensor<1,dim> *begin, Tensor<1,dim> *end, const Tensor<1,dim> *src, const typename Mapping::InternalDataBase &internal) const; - /** - * Implementation of the interface in - * @ref{Mapping}. - */ virtual void transform_contravariant (Tensor<2,dim> *begin, Tensor<2,dim> *end, const Tensor<2,dim> *src, const typename Mapping::InternalDataBase &internal) const; - /** - * Transforms the point @p{p} on - * the unit cell to the point - * @p{p_real} on the real cell - * @p{cell} and returns @p{p_real}. - */ virtual Point transform_unit_to_real_cell ( const typename Triangulation::cell_iterator &cell, @@ -171,16 +124,7 @@ class MappingCartesian : public Mapping const typename Triangulation::cell_iterator &cell, const Point &p) const; - /** - * Implementation of the interface in - * @ref{Mapping}. - */ - virtual UpdateFlags update_once (const UpdateFlags) const; - - /** - * Implementation of the interface in - * @ref{Mapping}. - */ + virtual UpdateFlags update_once (const UpdateFlags) const; virtual UpdateFlags update_each (const UpdateFlags) const; /** @@ -195,7 +139,7 @@ class MappingCartesian : public Mapping protected: /** * Storage for internal data of - * d-linear transformation. + * the scaling. */ class InternalData : public Mapping::InternalDataBase { @@ -216,22 +160,22 @@ class MappingCartesian : public Mapping /** * Length of the cell in * different coordinate - * directions, @p{h_x}, - * @p{h_y}, @p{h_z}. + * directions, hx, + * hy, hz. */ Tensor<1,dim> length; /** * Vector of all quadrature * points. Especially, all - * points of all faces. + * points on all faces. */ std::vector > quadrature_points; }; /** * Do the computation for the - * @p{fill_*} functions. + * fill_* functions. */ void compute_fill (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, @@ -253,6 +197,7 @@ class MappingCartesian : public Mapping /* -------------- declaration of explicit specializations ------------- */ +/// @if NoDoc template <> void MappingCartesian<1>::fill_fe_face_values ( const DoFHandler<1>::cell_iterator &, @@ -275,6 +220,6 @@ template <> void MappingCartesian<1>::fill_fe_subface_values ( std::vector >&, std::vector >&) const; - +/// @endif #endif diff --git a/deal.II/deal.II/source/fe/mapping_cartesian.cc b/deal.II/deal.II/source/fe/mapping_cartesian.cc index c750a16577..434ca0fdca 100644 --- a/deal.II/deal.II/source/fe/mapping_cartesian.cc +++ b/deal.II/deal.II/source/fe/mapping_cartesian.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -136,26 +136,6 @@ MappingCartesian::compute_fill (const typename DoFHandler::cell_iterat { const UpdateFlags update_flags(data.current_update_flags()); - const unsigned int npts = quadrature_points.size (); - - const typename QProjector::DataSetDescriptor offset - = (face_no == invalid_face_number - ? - QProjector::DataSetDescriptor::cell() - : - (sub_no == invalid_face_number - ? - // called from FEFaceValues - QProjector::DataSetDescriptor::face (face_no, - cell->face_orientation(face_no), - quadrature_points.size()) - : - // called from FESubfaceValues - QProjector::DataSetDescriptor::sub_face (face_no, sub_no, - cell->face_orientation(face_no), - quadrature_points.size()) - )); - // some more sanity checks if (face_no != invalid_face_number) { @@ -213,9 +193,28 @@ MappingCartesian::compute_fill (const typename DoFHandler::cell_iterat // each direction if (update_flags & update_q_points) { - Assert (quadrature_points.size() == npts, - ExcDimensionMismatch(quadrature_points.size(), npts)); - for (unsigned int i=0; i::DataSetDescriptor offset + = (face_no == invalid_face_number + ? + QProjector::DataSetDescriptor::cell() + : + (sub_no == invalid_face_number + ? + // called from FEFaceValues + QProjector::DataSetDescriptor::face (face_no, + cell->face_orientation(face_no), + quadrature_points.size()) + : + // called from FESubfaceValues + QProjector::DataSetDescriptor::sub_face (face_no, sub_no, + cell->face_orientation(face_no), + quadrature_points.size()) + )); + +//This assertion was nonsense, since we let npts = quadrature_points.size() above +// Assert (quadrature_points.size() == npts, +// ExcDimensionMismatch(quadrature_points.size(), npts)); + for (unsigned int i=0; i::compute_fill (const typename DoFHandler::cell_iterat // value if (update_flags & update_normal_vectors) { - Assert (normal_vectors.size() == npts, - ExcDimensionMismatch(normal_vectors.size(), npts)); +// We would like to have an assertion like this, but if +// we do not compute quadrature points, npts is zero. + +// Assert (normal_vectors.size() == npts, +// ExcDimensionMismatch(normal_vectors.size(), npts)); Assert (face_no < GeometryInfo::faces_per_cell, ExcInternalError()); -- 2.39.5