From f1c5264b2b04d08cd4e30a57b9bc7acd1adb1211 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Mon, 18 Dec 2000 12:17:44 +0000 Subject: [PATCH] new class FE_Q git-svn-id: https://svn.dealii.org/trunk@3549 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/continuous.h | 158 ++++++++++++++++++++++++ deal.II/deal.II/include/fe/fe_q.h | 158 ++++++++++++++++++++++++ 2 files changed, 316 insertions(+) create mode 100644 deal.II/deal.II/include/fe/continuous.h create mode 100644 deal.II/deal.II/include/fe/fe_q.h diff --git a/deal.II/deal.II/include/fe/continuous.h b/deal.II/deal.II/include/fe/continuous.h new file mode 100644 index 0000000000..5d0c9c065d --- /dev/null +++ b/deal.II/deal.II/include/fe/continuous.h @@ -0,0 +1,158 @@ +//--------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 1998, 1999, 2000 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//--------------------------------------------------------------- +#ifndef __deal2__fe_continuous_h +#define __deal2__fe_continuous_h + +#include + +template class TensorProductPolynomials; + +/** + * Tensor product elements based on equitdistant support points. + */ +template +class FE_Q : public FiniteElement +{ +public: + /** + * Constructor for tensor product + * polynomials of degree @p{k}. + */ + FE_Q (unsigned int k); + /** + * Destructor. + */ + ~FE_Q (); + + /** + * Prepare internal data + * structures and fill in values + * independent of the cell. + */ + virtual FEValuesBase::InternalData* + get_data (const UpdateFlags, + const Quadrature& quadrature) const ; + + /** + * Prepare internal data + * structure for transformation + * of faces and fill in values + * independent of the cell. + */ + virtual FEValuesBase::InternalData* + get_face_data (const UpdateFlags flags, + const Quadrature& quadrature) const ; + + /** + * Prepare internal data + * structure for transformation + * of children of faces and fill + * in values independent of the + * cell. + */ + virtual FEValuesBase::InternalData* + get_subface_data (const UpdateFlags flags, + const Quadrature& quadrature) const; + + virtual void + fill_fe_values (const Mapping &mapping, + const DoFHandler::cell_iterator &cell, + const Quadrature &quadrature, + FEValuesBase::InternalData &mapping_internal, + FEValuesBase::InternalData &fe_internal, + FEValuesData& data) const; + + virtual void + fill_fe_face_values (const Mapping &mapping, + const DoFHandler::cell_iterator &cell, + const unsigned int face_no, + const Quadrature &quadrature, + FEValuesBase::InternalData &mapping_internal, + FEValuesBase::InternalData &fe_internal, + FEValuesData& data) const ; + + virtual void + fill_fe_subface_values (const Mapping &mapping, + const DoFHandler::cell_iterator &cell, + const unsigned int face_no, + const unsigned int sub_no, + const Quadrature &quadrature, + FEValuesBase::InternalData &mapping_internal, + FEValuesBase::InternalData &fe_internal, + FEValuesData& data) const ; + +private: + /** + * Map tensor product data to shape + * function numbering. + * + * The node values are ordered such + * that vertices are first, + * followed by lines, + * quadrilaterals and + * hexahedra. Furthermore, the + * ordering inside each group may + * be confused, too. Therefore, + * this function computes a mapping + * from lexicographic ordering + * (x,y,z) to the shape function + * structure. + */ + void build_renumbering (unsigned int degree, + vector& numbering); + + /** + * Compute flags for initial update only. + */ + static UpdateFlags update_once (UpdateFlags flags); + + /** + * Compute flags for update on each cell. + */ + static UpdateFlags update_each (UpdateFlags flags); + + /** + * Degree of the polynomials. + */ + const unsigned int degree; + /** + * Mapping from lexicographic to + * shape function numbering. + */ + vector renumber; + /** + * Fields of cell-independent data. + */ + class InternalData : public FEValuesBase::InternalData + { + public: + vector shape_values; + vector > shape_grads; + }; + + /** + * Vector of one-dimensional + * polynomials used. + */ + vector polynomials; + + /** + * Implementation of the tensor + * product of polynomials. + */ + TensorProductPolynomials* poly; +}; + + + +#endif diff --git a/deal.II/deal.II/include/fe/fe_q.h b/deal.II/deal.II/include/fe/fe_q.h new file mode 100644 index 0000000000..5d0c9c065d --- /dev/null +++ b/deal.II/deal.II/include/fe/fe_q.h @@ -0,0 +1,158 @@ +//--------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 1998, 1999, 2000 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//--------------------------------------------------------------- +#ifndef __deal2__fe_continuous_h +#define __deal2__fe_continuous_h + +#include + +template class TensorProductPolynomials; + +/** + * Tensor product elements based on equitdistant support points. + */ +template +class FE_Q : public FiniteElement +{ +public: + /** + * Constructor for tensor product + * polynomials of degree @p{k}. + */ + FE_Q (unsigned int k); + /** + * Destructor. + */ + ~FE_Q (); + + /** + * Prepare internal data + * structures and fill in values + * independent of the cell. + */ + virtual FEValuesBase::InternalData* + get_data (const UpdateFlags, + const Quadrature& quadrature) const ; + + /** + * Prepare internal data + * structure for transformation + * of faces and fill in values + * independent of the cell. + */ + virtual FEValuesBase::InternalData* + get_face_data (const UpdateFlags flags, + const Quadrature& quadrature) const ; + + /** + * Prepare internal data + * structure for transformation + * of children of faces and fill + * in values independent of the + * cell. + */ + virtual FEValuesBase::InternalData* + get_subface_data (const UpdateFlags flags, + const Quadrature& quadrature) const; + + virtual void + fill_fe_values (const Mapping &mapping, + const DoFHandler::cell_iterator &cell, + const Quadrature &quadrature, + FEValuesBase::InternalData &mapping_internal, + FEValuesBase::InternalData &fe_internal, + FEValuesData& data) const; + + virtual void + fill_fe_face_values (const Mapping &mapping, + const DoFHandler::cell_iterator &cell, + const unsigned int face_no, + const Quadrature &quadrature, + FEValuesBase::InternalData &mapping_internal, + FEValuesBase::InternalData &fe_internal, + FEValuesData& data) const ; + + virtual void + fill_fe_subface_values (const Mapping &mapping, + const DoFHandler::cell_iterator &cell, + const unsigned int face_no, + const unsigned int sub_no, + const Quadrature &quadrature, + FEValuesBase::InternalData &mapping_internal, + FEValuesBase::InternalData &fe_internal, + FEValuesData& data) const ; + +private: + /** + * Map tensor product data to shape + * function numbering. + * + * The node values are ordered such + * that vertices are first, + * followed by lines, + * quadrilaterals and + * hexahedra. Furthermore, the + * ordering inside each group may + * be confused, too. Therefore, + * this function computes a mapping + * from lexicographic ordering + * (x,y,z) to the shape function + * structure. + */ + void build_renumbering (unsigned int degree, + vector& numbering); + + /** + * Compute flags for initial update only. + */ + static UpdateFlags update_once (UpdateFlags flags); + + /** + * Compute flags for update on each cell. + */ + static UpdateFlags update_each (UpdateFlags flags); + + /** + * Degree of the polynomials. + */ + const unsigned int degree; + /** + * Mapping from lexicographic to + * shape function numbering. + */ + vector renumber; + /** + * Fields of cell-independent data. + */ + class InternalData : public FEValuesBase::InternalData + { + public: + vector shape_values; + vector > shape_grads; + }; + + /** + * Vector of one-dimensional + * polynomials used. + */ + vector polynomials; + + /** + * Implementation of the tensor + * product of polynomials. + */ + TensorProductPolynomials* poly; +}; + + + +#endif -- 2.39.5