<commit_before>//---------------------------------------------------------------------------
//    $Id$
//
//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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__mesh_worker_integration_info_h
#define __deal2__mesh_worker_integration_info_h

#include <deal.II/base/config.h>
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/std_cxx1x/shared_ptr.h>
#include <deal.II/dofs/block_info.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/meshworker/local_results.h>
#include <deal.II/meshworker/dof_info.h>
#include <deal.II/meshworker/vector_selector.h>

DEAL_II_NAMESPACE_OPEN

namespace MeshWorker
{
  /**
   * Class for objects handed to local integration functions.
   *
   * Objects of this class contain one or more objects of type FEValues,
   * FEFaceValues or FESubfaceValues to be used in local
   * integration. They are stored in an array of pointers to the base
   * classes FEValuesBase. The template parameter VECTOR allows the
   * use of different data types for the global system.
   *
   * Additionally, this function contains space to store the values of
   * finite element functions stored in #global_data in the
   * quadrature points. These vectors are initialized automatically on
   * each cell or face. In order to avoid initializing unused vectors,
   * you can use initialize_selector() to select the vectors by name
   * that you actually want to use.
   *
   * <h3>Integration models</h3>
   *
   * This class supports two local integration models, corresponding to
   * the data models in the documentation of the Assembler namespace.
   * One is the
   * standard model suggested by the use of FESystem. Namely, there is
   * one FEValuseBase object in this class, containing all shape
   * functions of the whole system, and having as many components as the
   * system. Using this model involves loops over all system shape
   * functions. It requires to identify the system components
   * for each shape function and to select the correct bilinear form,
   * usually in an @p if or @p switch statement.
   *
   * The second integration model builds one FEValuesBase object per
   * base element of the system. The degrees of freedom on each cell are
   * renumbered by block, such that they represent the same block
   * structure as the global system. Objects performing the integration
   * can then process each block separately, which improves reusability
   * of code considerably.
   *
   * @note As described in DoFInfo, the use of the local block model is
   * triggered by calling BlockInfo::initialize_local() before
   * using initialize() in this class.
   *
   * @ingroup MeshWorker
   * @author <NAME>, 2009
   */
  template<int dim, int spacedim = dim>
  class IntegrationInfo
  {
  private:
    /// vector of FEValues objects
    std::vector<std_cxx1x::shared_ptr<FEValuesBase<dim, spacedim> > > fevalv;
  public:
    static const unsigned int dimension = dim;
    static const unsigned int space_dimension = spacedim;

    /**
     * Constructor.
     */
    IntegrationInfo();

    /**
     * Copy constructor, creating a
     * clone to be used by
     * WorksTream::run().
     */
    IntegrationInfo(const IntegrationInfo<dim, spacedim> &other);

    /**
     * Build all internal
     * structures, in particular
     * the FEValuesBase objects
     * and allocate space for
     * data vectors.
     *
     * @param el is the finite
     * element of the DoFHandler.
     *
     * @param mapping is the Mapping
     * object used to map the
     * mesh cells.
     *
     * @param quadrature is a
     * Quadrature formula used in
     * the constructor of the
     * FEVALUES objects.
     *
     * @param flags are the
     * UpdateFlags used in
     * the constructor of the
     * FEVALUES objects.
     *
     * @param local_block_info is
     * an optional parameter for
     * systems of PDE. If it is
     * provided with reasonable
     * data, then the degrees of
     * freedom on the cells will be
     * re-ordered to reflect the
     * block structure of the system.
     */
    template <class FEVALUES>
    void initialize(const FiniteElement<dim,spacedim> &el,
                    const Mapping<dim,spacedim> &mapping,
                    const Quadrature<FEVALUES::integral_dimension> &quadrature,
                    const UpdateFlags flags,
                    const BlockInfo *local_block_info = 0);

    /**
     * Initialize the data
     * vector and cache the
     * selector.
     */
    void initialize_data(const std_cxx1x::shared_ptr<VectorDataBase<dim,spacedim> > &data);

    /**
     * Delete the data created by initialize().
     */
    void clear();

    /// This is true if we are assembling for multigrid
    bool multigrid;
    /// Access to finite element
    /**
     * This is the access
     * function being used, if
     * the constructor for a
     * single element was
     * used. It throws an
     * exception, if applied to a
     * vector of elements.
     */
    const FEValuesBase<dim, spacedim> &fe_values () const;

    /// Access to finite elements
    /**
     * This access function must
     * be used if the constructor
     * for a group of elements
     * was used.
     *
     * @see DGBlockSplitApplication
     */
    const FEValuesBase<dim, spacedim> &fe_values (const unsigned int i) const;

    /**
     * The vector containing the
     * values of finite element
     * functions in the quadrature
     * points.
     *
     * There is one vector per
     * selected finite element
     * function, containing one
     * vector for each component,
     * containing vectors with
     * values for each quadrature
     * point.
     */
    std::vector<std::vector<std::vector<double> > > values;

    /**
     * The vector containing the
     * derivatives of finite
     * element functions in the
     * quadrature points.
     *
     * There is one vector per
     * selected finite element
     * function, containing one
     * vector for each component,
     * containing vectors with
     * values for each quadrature
     * point.
     */
    std::vector<std::vector<std::vector<Tensor<1,dim> > > > gradients;

    /**
     * The vector containing the
     * second derivatives of finite
     * element functions in the
     * quadrature points.
     *
     * There is one vector per
     * selected finite element
     * function, containing one
     * vector for each component,
     * containing vectors with
     * values for each quadrature
     * point.
     */
    std::vector<std::vector<std::vector<Tensor<2,dim> > > > hessians;

    /**
     * Reinitialize internal data
     * structures for use on a cell.
     */
    template <typename number=double><commit_msg>fix compilation on old gcc<commit_after>//---------------------------------------------------------------------------
//    $Id$
//
//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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__mesh_worker_integration_info_h
#define __deal2__mesh_worker_integration_info_h

#include <deal.II/base/config.h>
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/std_cxx1x/shared_ptr.h>
#include <deal.II/dofs/block_info.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/meshworker/local_results.h>
#include <deal.II/meshworker/dof_info.h>
#include <deal.II/meshworker/vector_selector.h>

DEAL_II_NAMESPACE_OPEN

namespace MeshWorker
{
  /**
   * Class for objects handed to local integration functions.
   *
   * Objects of this class contain one or more objects of type FEValues,
   * FEFaceValues or FESubfaceValues to be used in local
   * integration. They are stored in an array of pointers to the base
   * classes FEValuesBase. The template parameter VECTOR allows the
   * use of different data types for the global system.
   *
   * Additionally, this function contains space to store the values of
   * finite element functions stored in #global_data in the
   * quadrature points. These vectors are initialized automatically on
   * each cell or face. In order to avoid initializing unused vectors,
   * you can use initialize_selector() to select the vectors by name
   * that you actually want to use.
   *
   * <h3>Integration models</h3>
   *
   * This class supports two local integration models, corresponding to
   * the data models in the documentation of the Assembler namespace.
   * One is the
   * standard model suggested by the use of FESystem. Namely, there is
   * one FEValuseBase object in this class, containing all shape
   * functions of the whole system, and having as many components as the
   * system. Using this model involves loops over all system shape
   * functions. It requires to identify the system components
   * for each shape function and to select the correct bilinear form,
   * usually in an @p if or @p switch statement.
   *
   * The second integration model builds one FEValuesBase object per
   * base element of the system. The degrees of freedom on each cell are
   * renumbered by block, such that they represent the same block
   * structure as the global system. Objects performing the integration
   * can then process each block separately, which improves reusability
   * of code considerably.
   *
   * @note As described in DoFInfo, the use of the local block model is
   * triggered by calling BlockInfo::initialize_local() before
   * using initialize() in this class.
   *
   * @ingroup MeshWorker
   * @author <NAME>, 2009
   */
  template<int dim, int spacedim = dim>
  class IntegrationInfo
  {
  private:
    /// vector of FEValues objects
    std::vector<std_cxx1x::shared_ptr<FEValuesBase<dim, spacedim> > > fevalv;
  public:
    static const unsigned int dimension = dim;
    static const unsigned int space_dimension = spacedim;

    /**
     * Constructor.
     */
    IntegrationInfo();

    /**
     * Copy constructor, creating a
     * clone to be used by
     * WorksTream::run().
     */
    IntegrationInfo(const IntegrationInfo<dim, spacedim> &other);

    /**
     * Build all internal
     * structures, in particular
     * the FEValuesBase objects
     * and allocate space for
     * data vectors.
     *
     * @param el is the finite
     * element of the DoFHandler.
     *
     * @param mapping is the Mapping
     * object used to map the
     * mesh cells.
     *
     * @param quadrature is a
     * Quadrature formula used in
     * the constructor of the
     * FEVALUES objects.
     *
     * @param flags are the
     * UpdateFlags used in
     * the constructor of the
     * FEVALUES objects.
     *
     * @param local_block_info is
     * an optional parameter for
     * systems of PDE. If it is
     * provided with reasonable
     * data, then the degrees of
     * freedom on the cells will be
     * re-ordered to reflect the
     * block structure of the system.
     */
    template <class FEVALUES>
    void initialize(const FiniteElement<dim,spacedim> &el,
                    const Mapping<dim,spacedim> &mapping,
                    const Quadrature<FEVALUES::integral_dimension> &quadrature,
                    const UpdateFlags flags,
                    const BlockInfo *local_block_info = 0);

    /**
     * Initialize the data
     * vector and cache the
     * selector.
     */
    void initialize_data(const std_cxx1x::shared_ptr<VectorDataBase<dim,spacedim> > &data);

    /**
     * Delete the data created by initialize().
     */
    void clear();

    /// This is true if we are assembling for multigrid
    bool multigrid;
    /// Access to finite element
    /**
     * This is the access
     * function being used, if
     * the constructor for a
     * single element was
     * used. It throws an
     * exception, if applied to a
     * vector of elements.
     */
    const FEValuesBase<dim, spacedim> &fe_values () const;

    /// Access to finite elements
    /**
     * This access function must
     * be used if the constructor
     * for a group of elements
     * was used.
     *
     * @see DGBlockSplitApplication
     */
    const FEValuesBase<dim, spacedim> &fe_values (const unsigned int i) const;

    /**
     * The vector containing the
     * values of finite element
     * functions in the quadrature
     * points.
     *
     * There is one vector per
     * selected finite element
     * function, containing one
     * vector for each component,
     * containing vectors with
     * values for each quadrature
     * point.
     */
    std::vector<std::vector<std::vector<double> > > values;

    /**
     * The vector containing the
     * derivatives of finite
     * element functions in the
     * quadrature points.
     *
     * There is one vector per
     * selected finite element
     * function, containing one
     * vector for each component,
     * containing vectors with
     * values for each quadrature
     * point.
     */
    std::vector<std::vector<std::vector<Tensor<1,dim> > > > gradients;

    /**
     * The vector containing the
     * second derivatives of finite
     * element functions in the
     * quadrature points.
     *
     * There is one vector per
     * selected finite element
     * function, containing one
     * vector for each component,
     * containing vectors with
     * values for each quadrature
     * point.
     */
    std::vector<std::vector<std::vector<Tensor<2,dim> > > > hessians;

    /**
     * Reinitialize internal data
     * structures for use on a cell.
     */
    template <typename number>
{'fraction_non_alphanumeric': 0.09634902734705385, 'fraction_numerical': 0.006484352974344516, 'mean_word_length': 2.3759219605044017, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 75, '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': '6197850', 'n_tokens_mistral': 3975, 'n_tokens_neox': 3801, 'n_words': 1489}