<commit_before>#ifndef DUNE_FUNCTIONALS_EVALUATION_BINARY_ELLIPTIC_HH
#define DUNE_FUNCTIONALS_EVALUATION_BINARY_ELLIPTIC_HH

namespace Dune
{

namespace Functionals
{

namespace Evaluation
{

namespace Binary
{

/**
  \brief  This represents the operation \f$a\nabla u \nabla v\f$.

          \f$a\f$ is a given scalar function (in this case 1) and \f$u\f$ and \f$u\f$ may be local functions, i.e.
          ansatz- and testfunctions.
  \tparam FunctionSpaceImp
          Type of the function space, where \f$f\f$, \f$u\f$ and \f$v\f$ live in.
  **/
template< class FunctionSpaceImp >
class Elliptic
{
public:

  typedef FunctionSpaceImp
    FunctionSpaceType;

  typedef Elliptic< FunctionSpaceType >
    ThisType;

  typedef typename FunctionSpaceType::DomainType
    DomainType;

  typedef typename FunctionSpaceType::RangeType
    RangeType;

  typedef typename FunctionSpaceType::RangeFieldType
    RangeFieldType;

  typedef typename FunctionSpaceType::JacobianRangeType
    JacobianRangeType;

  typedef Dune::FemTools::Function::Runtime< FunctionSpaceType >
    InducingFunctionType;

  //! constructor, takes the inducing functions expression as a runtime parameter
  Elliptic( const std::string expression = "[1.0;1.0;1.0]" )
    : inducingFunction_( expression ),
      order_( 1 )
  {
  }

  //! constructor, takes the inducing functions expression as a runtime parameter
  Elliptic( const std::string expression = "[1.0;1.0;1.0]", const int order = 1 )
    : inducingFunction_( expression ),
      order_( 1 )
  {
    if( order < 0 )
      order_ = 0;
    else
      order_ = order;
  }

private:
  //! copy constructor
  Elliptic( const Elliptic& other )
    : inducingFunction_( other.inducingFunction() ),
      order_( other.order() )
  {
  }

public:
  //! returns the inducing function
  const InducingFunctionType& inducingFunction() const
  {
    return inducingFunction_;
  }

  unsigned int order() const
  {
    return order_;
  }

  /**
    * \brief      Evaluates \f$a(x)\nabla u(x) \nabla v(x)\f$ for a given local point \f$x\f$.
    *
    * \tparam     LocalAnsatzFunctionType
    *             Type of the local ansatz function \f$u\f$, i.e. Dune::LocalFunction.
    * \tparam     LocalTestFunctionType
    *             Type of the local test function \f$v\f$, i.e. Dune::LocalFunction.
    * \tparam     LocalPointType
    *             Type of the local point \f$x\f$, i.e. Dune::FieldVector.
    * \param[in]  localAnsatzFunction<commit_msg>Evaluation::Binary::Elliptic now holds a copy of the inducing function<commit_after>#ifndef DUNE_FUNCTIONALS_EVALUATION_BINARY_ELLIPTIC_HH
#define DUNE_FUNCTIONALS_EVALUATION_BINARY_ELLIPTIC_HH

namespace Dune
{

namespace Functionals
{

namespace Evaluation
{

namespace Binary
{

/**
  \brief  This represents the operation \f$a\nabla u \nabla v\f$.

          \f$a\f$ is a given scalar function (in this case 1) and \f$u\f$ and \f$u\f$ may be local functions, i.e.
          ansatz- and testfunctions.
  \tparam FunctionSpaceImp
          Type of the function space, where \f$f\f$, \f$u\f$ and \f$v\f$ live in.
  **/
template< class FunctionSpaceImp >
class Elliptic
{
public:

  typedef FunctionSpaceImp
    FunctionSpaceType;

  typedef Elliptic< FunctionSpaceType >
    ThisType;

  typedef typename FunctionSpaceType::DomainType
    DomainType;

  typedef typename FunctionSpaceType::RangeType
    RangeType;

  typedef typename FunctionSpaceType::RangeFieldType
    RangeFieldType;

  typedef typename FunctionSpaceType::JacobianRangeType
    JacobianRangeType;

  typedef Dune::FemTools::Function::Runtime< FunctionSpaceType >
    InducingFunctionType;

  //! constructor, takes the inducing functions expression as a runtime parameter
  Elliptic( const std::string expression = "[1.0;1.0;1.0]", const int order = 1 )
    : inducingFunction_( expression ),
      order_( std::max( 0, order ) )
  {
  }

  //! copy constructor
  Elliptic( const Elliptic& other )
    : inducingFunction_( other.inducingFunction() ),
      order_( other.order() )
  {
  }

  //! returns the inducing function
  InducingFunctionType inducingFunction() const
  {
    return inducingFunction_;
  }

  unsigned int order() const
  {
    return order_;
  }

  /**
    * \brief      Evaluates \f$a(x)\nabla u(x) \nabla v(x)\f$ for a given local point \f$x\f$.
    *
    * \tparam     LocalAnsatzFunctionType
    *             Type of the local ansatz function \f$u\f$, i.e. Dune::LocalFunction.
    * \tparam     LocalTestFunctionType
    *             Type of the local test function \f$v\f$, i.e. Dune::LocalFunction.
    * \tparam     LocalPointType
    *             Type of the local point \f$x\f$, i.e. Dune::FieldVector.
    * \param[in]  localAnsatzFunction
{'fraction_non_alphanumeric': 0.10012701100762066, 'fraction_numerical': 0.00571549534292972, 'mean_word_length': 3.0384615384615383, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 9, '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': '3217377', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1476, 'n_words': 407}