<commit_before>#ifndef DUNE_DETAILED_DISCRETIZATIONS_ASSEMBLER_SYSTEM_HH
#define DUNE_DETAILED_DISCRETIZATIONS_ASSEMBLER_SYSTEM_HH

#include <vector>
#include <memory>

#include <dune/common/dynmatrix.hh>
#include <dune/common/dynvector.hh>
#include <dune/common/static_assert.hh>
#include <dune/common/typetraits.hh>

#include <dune/stuff/la/container/interface.hh>
#include <dune/stuff/la/container/pattern.hh>

#include <dune/detailed/discretizations/space/interface.hh>
#include <dune/detailed/discretizations/space/constraints.hh>

#include "local/codim0.hh"
#include "local/codim1.hh"

namespace Dune {
namespace Detailed {
namespace Discretizations {


template <class TestSpaceImp, class AnsatzSpaceImp>
class SystemAssembler
{
public:
  typedef SpaceInterface<typename TestSpaceImp::Traits> TestSpaceType;
  typedef SpaceInterface<typename AnsatzSpaceImp::Traits> AnsatzSpaceType;
  typedef typename TestSpaceType::GridPartType GridPartType;
  typedef typename GridPartType::GridViewType GridViewType;
  typedef Dune::Stuff::GridboundaryInterface<GridViewType> GridBoundaryType;
  typedef typename GridPartType::IntersectionType IntersectionType;

private:
  typedef typename GridPartType::template Codim<0>::EntityType EntityType;
  typedef typename TestSpaceType::RangeFieldType RangeFieldType;
  typedef Dune::DynamicMatrix<RangeFieldType> LocalMatrixType;
  typedef Dune::DynamicVector<RangeFieldType> LocalVectorType;
  typedef std::vector<std::vector<LocalMatrixType>> LocalMatricesContainerType;
  typedef std::vector<std::vector<LocalVectorType>> LocalVectorsContainerType;
  typedef std::vector<Dune::DynamicVector<size_t>> IndicesContainer;

public:
  /**
   *  \brief Interface for functors to tell on which intersection to assemble on.
   *
   *  The derived class has to provide a method with the following signature:
   *  \code
  bool assembleOn(const GridPartType& gridPart, const IntersectionType& intersection) const
  {
    ...
  }
  \endcode
   */
  class AssembleOnFunctorInterface
  {
  public:
    ~AssembleOnFunctorInterface()
    {
    }
    virtual bool assembleOn(const GridPartType& /*gridPart*/, const IntersectionType& /*intersection*/) const = 0;
  };

  /**
   *  \brief Selects each inner intersection only once.
   *
   *  To decide if this in an inner intersection,
  \code<commit_msg>[assembler.system] added AssembleOnInner flag<commit_after>#ifndef DUNE_DETAILED_DISCRETIZATIONS_ASSEMBLER_SYSTEM_HH
#define DUNE_DETAILED_DISCRETIZATIONS_ASSEMBLER_SYSTEM_HH

#include <vector>
#include <memory>

#include <dune/common/dynmatrix.hh>
#include <dune/common/dynvector.hh>
#include <dune/common/static_assert.hh>
#include <dune/common/typetraits.hh>

#include <dune/stuff/la/container/interface.hh>
#include <dune/stuff/la/container/pattern.hh>

#include <dune/detailed/discretizations/space/interface.hh>
#include <dune/detailed/discretizations/space/constraints.hh>

#include "local/codim0.hh"
#include "local/codim1.hh"

namespace Dune {
namespace Detailed {
namespace Discretizations {


template <class TestSpaceImp, class AnsatzSpaceImp>
class SystemAssembler
{
public:
  typedef SpaceInterface<typename TestSpaceImp::Traits> TestSpaceType;
  typedef SpaceInterface<typename AnsatzSpaceImp::Traits> AnsatzSpaceType;
  typedef typename TestSpaceType::GridPartType GridPartType;
  typedef typename GridPartType::GridViewType GridViewType;
  typedef Dune::Stuff::GridboundaryInterface<GridViewType> GridBoundaryType;
  typedef typename GridPartType::IntersectionType IntersectionType;

private:
  typedef typename GridPartType::template Codim<0>::EntityType EntityType;
  typedef typename TestSpaceType::RangeFieldType RangeFieldType;
  typedef Dune::DynamicMatrix<RangeFieldType> LocalMatrixType;
  typedef Dune::DynamicVector<RangeFieldType> LocalVectorType;
  typedef std::vector<std::vector<LocalMatrixType>> LocalMatricesContainerType;
  typedef std::vector<std::vector<LocalVectorType>> LocalVectorsContainerType;
  typedef std::vector<Dune::DynamicVector<size_t>> IndicesContainer;

public:
  /**
   *  \brief Interface for functors to tell on which intersection to assemble on.
   *
   *  The derived class has to provide a method with the following signature:
   *  \code
  bool assembleOn(const GridPartType& gridPart, const IntersectionType& intersection) const
  {
    ...
  }
  \endcode
   */
  class AssembleOnFunctorInterface
  {
  public:
    ~AssembleOnFunctorInterface()
    {
    }
    virtual bool assembleOn(const GridPartType& /*gridPart*/, const IntersectionType& /*intersection*/) const = 0;
  };

  /**
   *  \brief Selects each inner intersection only once.
   *
   *  To decide if this in an inner intersection,
  \code
  intersection.neighbor() && !intersection.boundary()
  \endcode
   *  is used.
   */
  class AssembleOnInner : public AssembleOnFunctorInterface
  {
  public:
    virtual bool assembleOn(const GridPartType& /*gridPart*/, const IntersectionType& intersection) const
    {
      return intersection.neighbor() && !intersection.boundary();
    }
  }; // class AssembleOnInner

  /**
   *  \brief Selects each inner intersection only once.
   *
   *  To decide if this in an inner intersection,
  \code
{'fraction_non_alphanumeric': 0.09460500963391137, 'fraction_numerical': 0.0015414258188824663, 'mean_word_length': 5.480649188514357, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, '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': '2488273', 'n_tokens_mistral': 1625, 'n_tokens_neox': 1567, 'n_words': 352}