<commit_before>// ---------------------------------------------------------------------
//
// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------

#ifndef dealii__q_collection_h
#define dealii__q_collection_h

#include <deal.II/base/config.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/base/quadrature.h>
#include <deal.II/base/memory_consumption.h>
#include <deal.II/fe/fe.h>

#include <vector>
#include <deal.II/base/std_cxx11/shared_ptr.h>

DEAL_II_NAMESPACE_OPEN

namespace hp
{
  /**
   * This class implements a collection of quadrature objects in the same way
   * as the hp::FECollection implements a collection of finite element
   * classes.
   *
   * It implements the concepts stated in the
   * @ref hpcollection
   * module described in the doxygen documentation.
   *
   * @ingroup hp hpcollection
   *
   * @author <NAME>, 2005
   */
  template <int dim>
  class QCollection : public Subscriptor
  {
  public:
    /**
     * Default constructor. Leads to an empty collection that can later be
     * filled using push_back().
     */
    QCollection ();

    /**
     * Conversion constructor. This constructor creates a QCollection from a
     * single quadrature rule. More quadrature formulas can be added with
     * push_back(), if desired, though it would probably be clearer to add all
     * mappings the same way.
     */
    explicit QCollection (const Quadrature<dim> &quadrature);

    /**
     * Copy constructor.
     */
    QCollection (const QCollection<dim> &q_collection);

    /**
     * Adds a new quadrature rule to the QCollection.  The quadrature rules
     * have to be added in the same order as for the FECollection for which
     * this quadrature rule collection is meant. Thus the reference to the
     * quadrature rule for active_fe_index 0 has to be added first, followed
     * by the quadrature rule for active_fe_index 1.
     *
     * This class creates a copy of the given quadrature object, i.e. you can
     * do things like <tt>push_back(QGauss<dim>(3));</tt>. The internal copy
     * is later destroyed by this object upon destruction of the entire
     * collection.
     */
    void push_back (const Quadrature<dim> &new_quadrature);

    /**
     * Returns a reference to the quadrature rule specified by the argument.
     *
     * @pre @p index must be between zero and the number of elements of the
     * collection.
     */
    const Quadrature<dim> &
    operator[] (const unsigned int index) const;

    /**
     * Returns the number of quadrature pointers stored in this object.
     */
    unsigned int size () const;

    /**
     * Return the maximum number of quadrature points over all the elements of
     * the collection. This is mostly useful to initialize arrays to allocate
     * the maximum amount of memory that may be used when re-sizing later on
     * to a articular quadrature formula from within this collection.<commit_msg>Update documentation of QCollection::push_back().<commit_after>// ---------------------------------------------------------------------
//
// Copyright (C) 2005 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------

#ifndef dealii__q_collection_h
#define dealii__q_collection_h

#include <deal.II/base/config.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/base/quadrature.h>
#include <deal.II/base/memory_consumption.h>
#include <deal.II/fe/fe.h>

#include <vector>
#include <deal.II/base/std_cxx11/shared_ptr.h>

DEAL_II_NAMESPACE_OPEN

namespace hp
{
  /**
   * This class implements a collection of quadrature objects in the same way
   * as the hp::FECollection implements a collection of finite element
   * classes.
   *
   * It implements the concepts stated in the
   * @ref hpcollection
   * module described in the doxygen documentation.
   *
   * @ingroup hp hpcollection
   *
   * @author <NAME>, 2005
   */
  template <int dim>
  class QCollection : public Subscriptor
  {
  public:
    /**
     * Default constructor. Leads to an empty collection that can later be
     * filled using push_back().
     */
    QCollection ();

    /**
     * Conversion constructor. This constructor creates a QCollection from a
     * single quadrature rule. More quadrature formulas can be added with
     * push_back(), if desired, though it would probably be clearer to add all
     * mappings the same way.
     */
    explicit QCollection (const Quadrature<dim> &quadrature);

    /**
     * Copy constructor.
     */
    QCollection (const QCollection<dim> &q_collection);

    /**
     * Adds a new quadrature rule to the QCollection. In most cases, you will
     * want to add quadrature rules in the same order as the elements were
     * added to the hp::FECollection for which this quadrature rule collection is
     * meant. If done this way, the hp::FEValues objects with which you will
     * use both hp::FECollection and hp::QCollection objects will automatically
     * choose corresponding elements and quadrature formulas. On the other hand,
     * it is possible to use arbitrary combinations of elements and quadrature
     * formulas in hp::FECollection and hp::QCollection objects when specifically
     * specifying appropriate indices in calls to hp::FEValues::reinit()
     * or hp::FEFaceValues::reinit(). In those cases, there need not be a
     * correspondence between elements of the hp::FECollection and
     * hp::QCollection objects; they need not even be of the same size in this
     * case.
     *
     * This class creates a copy of the given quadrature object, i.e., you can
     * do things like <tt>push_back(QGauss<dim>(3));</tt>. The internal copy
     * is later destroyed by this object upon destruction of the entire
     * collection.
     */
    void push_back (const Quadrature<dim> &new_quadrature);

    /**
     * Returns a reference to the quadrature rule specified by the argument.
     *
     * @pre @p index must be between zero and the number of elements of the
     * collection.
     */
    const Quadrature<dim> &
    operator[] (const unsigned int index) const;

    /**
     * Returns the number of quadrature pointers stored in this object.
     */
    unsigned int size () const;

    /**
     * Return the maximum number of quadrature points over all the elements of
     * the collection. This is mostly useful to initialize arrays to allocate
     * the maximum amount of memory that may be used when re-sizing later on
     * to a articular quadrature formula from within this collection.
{'fraction_non_alphanumeric': 0.11306666666666666, 'fraction_numerical': 0.0048, 'mean_word_length': 2.5821394460362943, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '4990642', 'n_tokens_mistral': 2048, 'n_tokens_neox': 1986, 'n_words': 872}