<commit_before>// This file is part of the dune-gdt project:
//   https://github.com/dune-community/dune-gdt
// Copyright 2010-2018 dune-gdt developers and contributors. All rights reserved.
// License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
//      or  GPL-2.0+ (http://opensource.org/licenses/gpl-license)
//          with "runtime exception" (http://www.dune-project.org/license.html)
// Authors:
//   <NAME> (2019)

#ifndef DUNE_GDT_LOCAL_INTEGRANDS_IPDG_HH
#define DUNE_GDT_LOCAL_INTEGRANDS_IPDG_HH

#include <functional>

#include <dune/xt/common/memory.hh>
#include <dune/xt/functions/grid-function.hh>
#include <dune/xt/grid/entity.hh>
#include <dune/xt/grid/intersection.hh>

#include "interfaces.hh"

namespace Dune {
namespace GDT {
namespace LocalIPDGIntegrands {
namespace internal {


template <class Intersection>
static std::function<double(const Intersection&)> default_inner_intersection_diameter()
{
  return [](const Intersection& intersection) {
    if (Intersection::dimension == 1) {
      if (intersection.neighbor())
        return 0.5 * (XT::Grid::diameter(intersection.inside()) + XT::Grid::diameter(intersection.outside()));
      else
        return XT::Grid::diameter(intersection.inside());
    } else
      return XT::Grid::diameter(intersection);
  };
} // ... default_inner_intersection_diameter(...)


template <class Intersection>
static std::function<double(const Intersection&)> default_boundary_intersection_diameter()
{
  return [](const Intersection& intersection) {
    if (Intersection::dimension == 1)
      return XT::Grid::diameter(intersection.inside());
    else
      return XT::Grid::diameter(intersection);
  };
} // ... default_boundary_intersection_diameter(...)


} // namespace internal


template <class I>
class InnerPenalty : public LocalQuaternaryIntersectionIntegrandInterface<I>
{
  using ThisType = InnerPenalty;
  using BaseType = LocalQuaternaryIntersectionIntegrandInterface<I>;

public:
  using BaseType::d;<commit_msg>[...ipdg] add note<commit_after>// This file is part of the dune-gdt project:
//   https://github.com/dune-community/dune-gdt
// Copyright 2010-2018 dune-gdt developers and contributors. All rights reserved.
// License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
//      or  GPL-2.0+ (http://opensource.org/licenses/gpl-license)
//          with "runtime exception" (http://www.dune-project.org/license.html)
// Authors:
//   <NAME> (2019)

#ifndef DUNE_GDT_LOCAL_INTEGRANDS_IPDG_HH
#define DUNE_GDT_LOCAL_INTEGRANDS_IPDG_HH

#include <functional>

#include <dune/xt/common/memory.hh>
#include <dune/xt/functions/grid-function.hh>
#include <dune/xt/grid/entity.hh>
#include <dune/xt/grid/intersection.hh>

#include "interfaces.hh"

namespace Dune {
namespace GDT {
namespace LocalIPDGIntegrands {
namespace internal {


template <class Intersection>
static std::function<double(const Intersection&)> default_inner_intersection_diameter()
{
  return [](const Intersection& intersection) {
    if (Intersection::dimension == 1) {
      if (intersection.neighbor())
        return 0.5 * (XT::Grid::diameter(intersection.inside()) + XT::Grid::diameter(intersection.outside()));
      else
        return XT::Grid::diameter(intersection.inside());
    } else
      return XT::Grid::diameter(intersection);
  };
} // ... default_inner_intersection_diameter(...)


/**
 * \todo Get rid of this one, default_inner_intersection_diameter should be enough!
 */
template <class Intersection>
static std::function<double(const Intersection&)> default_boundary_intersection_diameter()
{
  return [](const Intersection& intersection) {
    if (Intersection::dimension == 1)
      return XT::Grid::diameter(intersection.inside());
    else
      return XT::Grid::diameter(intersection);
  };
} // ... default_boundary_intersection_diameter(...)


} // namespace internal


template <class I>
class InnerPenalty : public LocalQuaternaryIntersectionIntegrandInterface<I>
{
  using ThisType = InnerPenalty;
  using BaseType = LocalQuaternaryIntersectionIntegrandInterface<I>;

public:
  using BaseType::d;
{'fraction_non_alphanumeric': 0.13519364926629782, 'fraction_numerical': 0.009622323791195573, 'mean_word_length': 4.5588235294117645, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '1862561', 'n_tokens_mistral': 1403, 'n_tokens_neox': 1310, 'n_words': 263}