<commit_before>//----------------------------  fe.h  ---------------------------
//    $Id$
//    Version: $Name$
//
//    Copyright (C) 1998, 1999, 2000, 2001, 2002 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.
//
//----------------------------  fe.h  ---------------------------
#ifndef __deal2__fe_h
#define __deal2__fe_h

#include <base/config.h>
#include <fe/fe_base.h>
#include <dofs/dof_handler.h>

template <int dim> class FEValuesData;
template <int dim> class FEValuesBase;
template <int dim> class FEValues;
template <int dim> class FEFaceValues;
template <int dim> class FESubfaceValues;
template <int dim> class FESystem;


/**
 * Common interface of all finite elements. Here, the functions to
 * fill the data fields of @ref{FEValues} are declared. While
 * @ref{FiniteElementBase} provides implementation of common
 * functionality, this class only serves as an abstract base class.
 *
 * The interface of this class is very restrictive. The reason is that
 * finite element values should be accessed only by use of
 * @ref{FEValues} objects. These, together with @p{FiniteElement} are
 * responsible to provide an optimized implementation.
 *
 * This even holds for evaluating finite elements at their support
 * points (provided the element is based on Lagrangian interpolation):
 * first, it is necessary to construct a quadrature rule from the
 * support points. This is then fed into an object of class
 * @ref{FEValues}. Even for evaluation on the unit cell, you will need
 * a triangulation containing that single cell.
 *
 * Basically, this class just declares the shape function and their
 * derivatives on the unit cell $[0,1]^d$, and the means to transform
 * them onto a given cell in physical space if provided by the
 * @ref{FEValues} class with a @ref{Mapping} object.
 *
 * @author <NAME>, <NAME>, <NAME>, 1998, 2000, 2001
 */
template <int dim>
class FiniteElement : public FiniteElementBase<dim>
{
  private:
				     /**
				      * Copy constructor prohibited.
				      */
    FiniteElement(const FESystem<dim>&);

  public:
				     /**
				      * Constructor
				      */
    FiniteElement (const FiniteElementData<dim> &fe_data,
		   const std::vector<bool> &restriction_is_additive_flags,
		   const std::vector<std::vector<bool> > &nonzero_components);

				     /**
				      * Virtual destructor. Makes sure
				      * that pointers to this class
				      * are deleted properly.
				      */
    virtual ~FiniteElement ();
    
				     /**
				      * Number of base elements in a
				      * mixed discretization.
				      *
				      * Note that even for vector
				      * valued finite elements, the
				      * number of components needs not
				      * coincide with the number of
				      * base elements, since they may
				      * be reused. For example, if you
				      * create a @ref{FESystem} with
				      * three identical finite element
				      * classes by using the
				      * constructor that takes one
				      * finite element and a
				      * multiplicity, then the number
				      * of base elements is still one,
				      * although the number of
				      * components of the finite
				      * element is equal to the
				      * multiplicity.
				      */
    virtual unsigned int n_base_elements () const = 0;
    
				     /**
				      * Access to base element
				      * objects. If the element is
				      * scalar, then
				      * @p{base_element(0)} is
				      * @p{this}.
				      */
    virtual const FiniteElement<dim> & base_element (const unsigned int index) const = 0;

				     /**
				      * Check for non-zero values on a face.
				      *
				      * This function returns
				      * @p{true}, if the shape
				      * function @p{shape_index} has
				      * non-zero values on the face
				      * @p{face_index}.
				      */
    virtual bool has_support_on_face (const unsigned int shape_index,
				      const unsigned int face_index) const = 0;
    
				     /**
				      * Determine an estimate for the
				      * memory consumption (in bytes)
				      * of this object.
				      *
				      * This function is made virtual,
				      * since finite element objects
				      * are usually accessed through
				      * pointers to their base class,
				      * rather than the class itself.
				      */
    virtual unsigned int memory_consumption () const;

				     /**
				      * Exception
				      */
    DeclException0 (ExcBoundaryFaceUsed);
				     /**
				      * Exception
				      */
    DeclException0 (ExcJacobiDeterminantHasWrongSign);
				     /**
				      * Exception
				      */
    DeclException1 (ExcComputationNotUseful,
		    int,
		    << "The computation you required from this function is not "
		    << "feasible or not probable in the present dimension ("
		    << arg1 << ") because it would be prohibitively expensive.");

  protected:

				     /**
				      * Given a set of flags indicating
				      * what quantities are requested
				      * from a @p{FEValues} object,
				      * return which of these can be
				      * precomputed once and for
				      * all. Often, the values of
				      * shape function at quadrature
				      * points can be precomputed, for
				      * example, in which case the
				      * return value of this function
				      * would be the logical and of
				      * the input @p{flags} and
				      * @p{update_values}.
				      */
    virtual UpdateFlags update_once (const UpdateFlags flags) const = 0;
  
				     /**
				      * This is the opposite to the
				      * above function: given a set of
				      * flags indicating what we want
				      * to know, return which of these
				      * need to be computed each time
				      * we visit a new cell.
				      *
				      * If for the computation of one
				      * quantity something else is
				      * also required (for example, we
				      * often need the covariant
				      * transformation when gradients
				      * need to be computed), include
				      * this in the result as well.
				      */
    virtual UpdateFlags update_each (const UpdateFlags flags) const = 0;
  
				     /**
				      * @p{clone} function instead of
				      * a copy constructor.
				      *
				      * This function is needed by the
				      * constructors of @p{FESystem}.
				      */
    virtual FiniteElement<dim> *clone() const = 0;
    
				     /**
				      * Prepare internal data
				      * structures and fill in values
				      * independent of the
				      * cell. Returns a pointer to an<commit_msg>Doc updated<commit_after>//----------------------------  fe.h  ---------------------------
//    $Id$
//    Version: $Name$
//
//    Copyright (C) 1998, 1999, 2000, 2001, 2002 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.
//
//----------------------------  fe.h  ---------------------------
#ifndef __deal2__fe_h
#define __deal2__fe_h

#include <base/config.h>
#include <fe/fe_base.h>
#include <dofs/dof_handler.h>

template <int dim> class FEValuesData;
template <int dim> class FEValuesBase;
template <int dim> class FEValues;
template <int dim> class FEFaceValues;
template <int dim> class FESubfaceValues;
template <int dim> class FESystem;


/**
 * Common interface of all finite elements. Here, the functions to
 * fill the data fields of @ref{FEValues} are declared. While
 * @ref{FiniteElementBase} provides implementation of common
 * functionality, this class only serves as an abstract base class.
 *
 * The interface of this class is very restrictive. The reason is that
 * finite element values should be accessed only by use of
 * @ref{FEValues} objects. These, together with @p{FiniteElement} are
 * responsible to provide an optimized implementation.
 *
 * This even holds for evaluating finite elements at their support
 * points (provided the element is based on Lagrangian interpolation):
 * first, it is necessary to construct a quadrature rule from the
 * support points. This is then fed into an object of class
 * @ref{FEValues}. Even for evaluation on the unit cell, you will need
 * a triangulation containing that single cell.
 *
 * Basically, this class just declares the shape function and their
 * derivatives on the unit cell $[0,1]^d$, and the means to transform
 * them onto a given cell in physical space if provided by the
 * @ref{FEValues} class with a @ref{Mapping} object.
 *
 * @author <NAME>, <NAME>, <NAME>, 1998, 2000, 2001
 */
template <int dim>
class FiniteElement : public FiniteElementBase<dim>
{
  private:
				     /**
				      * Copy constructor prohibited.
				      */
    FiniteElement(const FESystem<dim>&);

  public:
				     /**
				      * Constructor
				      */
    FiniteElement (const FiniteElementData<dim> &fe_data,
		   const std::vector<bool> &restriction_is_additive_flags,
		   const std::vector<std::vector<bool> > &nonzero_components);

				     /**
				      * Virtual destructor. Makes sure
				      * that pointers to this class
				      * are deleted properly.
				      */
    virtual ~FiniteElement ();
    
				     /**
				      * Number of base elements in a
				      * mixed discretization.
				      *
				      * Note that even for vector
				      * valued finite elements, the
				      * number of components needs not
				      * coincide with the number of
				      * base elements, since they may
				      * be reused. For example, if you
				      * create a @ref{FESystem} with
				      * three identical finite element
				      * classes by using the
				      * constructor that takes one
				      * finite element and a
				      * multiplicity, then the number
				      * of base elements is still one,
				      * although the number of
				      * components of the finite
				      * element is equal to the
				      * multiplicity.
				      */
    virtual unsigned int n_base_elements () const = 0;
    
				     /**
				      * Access to base element
				      * objects. If the element is
				      * scalar, then
				      * @p{base_element(0)} is
				      * @p{this}.
				      */
    virtual const FiniteElement<dim> & base_element (const unsigned int index) const = 0;

				     /**
				      * Check for non-zero values on a face.
				      *
				      * This function returns
				      * @p{true}, if the shape
				      * function @p{shape_index} has
				      * non-zero values on the face
				      * @p{face_index}.
				      */
    virtual bool has_support_on_face (const unsigned int shape_index,
				      const unsigned int face_index) const = 0;
    
				     /**
				      * Determine an estimate for the
				      * memory consumption (in bytes)
				      * of this object.
				      *
				      * This function is made virtual,
				      * since finite element objects
				      * are usually accessed through
				      * pointers to their base class,
				      * rather than the class itself.
				      */
    virtual unsigned int memory_consumption () const;

				     /**
				      * Exception
				      */
    DeclException0 (ExcBoundaryFaceUsed);
				     /**
				      * Exception
				      */
    DeclException0 (ExcJacobiDeterminantHasWrongSign);
				     /**
				      * Exception
				      */
    DeclException1 (ExcComputationNotUseful,
		    int,
		    << "The computation you required from this function is not "
		    << "feasible or not probable in the present dimension ("
		    << arg1 << ") because it would be prohibitively expensive.");

  protected:

				     /**
				      * Determine the values a finite
				      * element should compute on
				      * initialization of data for
				      * @p{FEValues}.
				      *
				      * Given a set of flags
				      * indicating what quantities are
				      * requested from a @p{FEValues}
				      * object, @p{update_once} and
				      * @p{update_each} compute which
				      * values must really be
				      * computed. Then, the
				      * @p{fill_*_values} functions
				      * are called with the result of
				      * these.
				      *
				      * Furthermore, values must be
				      * computed either on the unit
				      * cell or on the physical
				      * cell. For instance, the
				      * function values of @p{FE_Q} do
				      * only depend on the quadrature
				      * points on the unit
				      * cell. Therefore, this flags
				      * will be returned by
				      * @p{update_once}. The gradients
				      * require computation of the
				      * covariant transformation
				      * matrix. Therefore,
				      * @p{update_covariant_transformation}
				      * and @p{update_gradients} will
				      * be returned by
				      * @p{update_each}.
				      *
				      * For an example see the same
				      * function in the derived class
				      * @p{FE_Q}.
				      */
    virtual UpdateFlags update_once (const UpdateFlags flags) const = 0;
  
				     /**
				      * Complementary function for
				      * @p{update_once}.
				      *
				      * While @p{update_once} returns
				      * the values to be computed on
				      * the unit cell for yielding the
				      * required data, this function
				      * determines the values that
				      * must be recomputed on each
				      * cell.
				      *
				      * Refer to @p{update_once} for
				      * more details.
				      */
    virtual UpdateFlags update_each (const UpdateFlags flags) const = 0;
  
				     /**
				      * @p{clone} function instead of
				      * a copy constructor.
				      *
				      * This function is needed by the
				      * constructors of @p{FESystem}.
				      */
    virtual FiniteElement<dim> *clone() const = 0;
    
				     /**
				      * Prepare internal data
				      * structures and fill in values
				      * independent of the
				      * cell. Returns a pointer to an
{'fraction_non_alphanumeric': 0.09041057367829021, 'fraction_numerical': 0.006608548931383577, 'mean_word_length': 1.8157165479018211, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1983656', 'n_tokens_mistral': 4704, 'n_tokens_neox': 3528, 'n_words': 1439}