<commit_before>// ---------------------------------------------------------------------
//
// Copyright (C) 2015 - 2016 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__fe_p1nc_h
#define dealii__fe_p1nc_h

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


DEAL_II_NAMESPACE_OPEN


/*!@addtogroup fe */
/*@{*/


class FE_P1NC : public FiniteElement<2,2>
{

public:
  /**
   * Constructor for nonparametric version of P1 nonconforming element.
   */
  FE_P1NC() ;

  /**
   * Return the name of the class for the element.
   */
  virtual std::string get_name () const ;

  /**
   * Return the update flags which are needed.
   */
  virtual UpdateFlags     requires_update_flags (const UpdateFlags flags) const ;

  /**
   * Copy constructor.
   */
  virtual FiniteElement<2,2> *clone () const ;

  /**
   * Destructor.
   */
  virtual ~FE_P1NC ();<commit_msg>Add the first description of FE_P1NC<commit_after>// ---------------------------------------------------------------------
//
// Copyright (C) 2015 - 2016 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__fe_p1nc_h
#define dealii__fe_p1nc_h

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


DEAL_II_NAMESPACE_OPEN


/*!@addtogroup fe */
/*@{*/

/**
 * Implementation for the scalar version of the P1 nonconforming finite
 * element, a piecewise linear finite element on quadrilaterals.
 *
 * Unlike any continuous conforming finite element,
 * it does not have the continuity across edges.
 * But it requires the continuity in weak sense:
 * a function in the space should have the same integral values on two sides of the common edge shared by two adjacent elements.
 *
 * Since any function in the space is piecewise linear on each element,
 * the continuity of the integral value across the edge is equivalent to
 * the continuity of the value at the midpoint of the edge.
 *
 * The degrees of freedom on a quadrilateral are given by midpoint values on edges.
 * However these four dofs in 2D are not independent in fact.
 * The simple observation reads that any linear function on a quadrilateral
 * satisfies 'the dice rule': the sum of two function values at two midpoints of the edge pair on opposite
 * position is equal to the sum of those on the another edge pair.
 *
 * \phi(m_0) + \phi(m_1) = \phi(m_2) + \phi(m_3).
 *
 * Due to the dice rule, three values at any three midpoints determine the last value at the last midpoint.
 * It means that the genuine number of independent dofs on a quad is 3,
 * and it is the same number to the dimension of the linear polynomial space in 2D.
 *
 * The canonical basis functions are given as any three shape functions of
 * the following four linear functions:
 *
 * \phi_1, \phi_2, \phi_3, \phi_4.
 *
 * for each vertex v_j, there are two edges of which v_j is one of the end points.
 * Consider the linear function such that one half at two midpoints of such edges,
 * and zero at two midpoints of other edges.


 * 2 -------|------- 3
 * |                 |
 * |                 |
 * |                 |
 * |                 |
 * -                 -
 * |                 |
 * |                 |
 * |                 |
 * |                 |
 * 0 -------|------- 1


 * You can find the paper about the P1NC element at
 * http://epubs.siam.org/doi/abs/10.1137/S0036142902404923.

 **/

class FE_P1NC : public FiniteElement<2,2>
{

public:
  /**
   * Constructor for nonparametric version of P1 nonconforming element.
   */
  FE_P1NC() ;

  /**
   * Return the name of the class for the element.
   */
  virtual std::string get_name () const ;

  /**
   * Return the update flags which are needed.
   */
  virtual UpdateFlags     requires_update_flags (const UpdateFlags flags) const ;

  /**
   * Copy constructor.
   */
  virtual FiniteElement<2,2> *clone () const ;

  /**
   * Destructor.
   */
  virtual ~FE_P1NC ();
{'fraction_non_alphanumeric': 0.14794902429311033, 'fraction_numerical': 0.01592990840302668, 'mean_word_length': 2.2157490396927018, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '2733821', 'n_tokens_mistral': 1491, 'n_tokens_neox': 1415, 'n_words': 595}