#ifndef GUARD_d3d9b8a21e3075c9ff40117c5244f28e
#define GUARD_d3d9b8a21e3075c9ff40117c5244f28e

#define USING_DUNE_PYTHON 1
#include <config.h>
#include <dune/alugrid/dgf.hh>
#include <dune/alugrid/grid.hh>
#include <dune/fem/gridpart/adaptiveleafgridpart.hh>
#include <dune/fem/gridpart/filter/simple.hh>
#include <dune/fem/gridpart/filteredgridpart.hh>
#include <dune/fempy/py/gridview.hh>
#include <dune/python/grid/gridview.hh>
#include <dune/python/grid/hierarchical.hh>
#include <dune/fem/function/localfunction/bindable.hh>
#include <dune/fem/common/intersectionside.hh>
#include <dune/python/pybind11/pybind11.h>
#include <dune/python/pybind11/extensions.h>
#include <dune/fempy/py/grid/gridpart.hh>
#include <dune/common/exceptions.hh>
#include <dune/fempy/py/ufllocalfunction.hh>

namespace UFLLocalFunctions_d3d9b8a21e3075c9ff40117c5244f28e
{

  // UFLLocalFunction
// ----------------

template< class GridPart >
struct UFLLocalFunction
  : public Dune::Fem::BindableGridFunctionWithSpace<GridPart,Dune::Dim<2>>
{
  typedef GridPart GridPartType;
  typedef typename GridPartType::GridViewType GridView;
  typedef typename GridView::ctype ctype;
  typedef Dune::Fem::BindableGridFunctionWithSpace<GridPart,Dune::Dim<2>> BaseType;
  typedef Dune::Fem::GridFunctionSpace<GridPartType,Dune::Dim<2>> FunctionSpaceType;
  typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
  typedef typename GridPartType::IntersectionType IntersectionType;
  typedef typename EntityType::Geometry Geometry;
  typedef typename Geometry::GlobalCoordinate GlobalCoordinateType;
  typedef Dune::Fem::IntersectionSide Side;
  typedef double Conlmbda;
  typedef std::tuple< std::shared_ptr< Conlmbda > > ConstantTupleType;
  template< std::size_t i >
  using ConstantsRangeType = typename std::tuple_element_t< i, ConstantTupleType >::element_type;
  typedef std::tuple<> CoefficientTupleType;
  static constexpr bool gridPartValid = true;
  template< std::size_t i >
  using CoefficientType = std::tuple_element_t< i, CoefficientTupleType >;
  template< std::size_t i >
  using ConstantType = typename std::tuple_element_t< i, ConstantTupleType >::element_type;
  using BaseType::entity;
  using BaseType::geometry;

  UFLLocalFunction ( const GridPartType &gridPart, const std::string &name, int order, const Dune::Fem::ParameterReader &parameter = Dune::Fem::Parameter::container() )
    : BaseType(gridPart,name,order)
  {
    std::get< 0 >( constants_ ) = std::make_shared< Conlmbda >( (Conlmbda(0)) );
  }

  void bind ( const IntersectionType &intersection, Side side )
  {
    BaseType::bind(intersection, side);
  }

  void bind ( const EntityType &entity )
  {
    BaseType::bind(entity);
  }

  void unbind ()
  {
    BaseType::unbind();
  }

  template< class Point >
  void evaluate ( const Point &x, typename FunctionSpaceType::RangeType &result ) const
  {
    using std::abs;
    using std::logical_and;
    using std::sin;
    GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
    const auto tmp1 = 6.283185307179586 * tmp0[ 1 ];
    const auto tmp2 = tmp1 / 0.1;
    const auto tmp3 = std::sin( tmp2 );
    const auto tmp4 = 6.283185307179586 * tmp0[ 0 ];
    const auto tmp5 = tmp4 / 0.1;
    const auto tmp6 = std::sin( tmp5 );
    const auto tmp7 = tmp6 * tmp3;
    const auto tmp8 = 0.1 * tmp7;
    const auto tmp9 = 0.5 + tmp8;
    const auto tmp10 = std::abs( tmp0[ 1 ] );
    const auto tmp11 = std::abs( tmp0[ 0 ] );
    const auto tmp12 = std::logical_and()( tmp11 < 0.1, tmp10 < 0.1 );
    const auto tmp13 = -1 * tmp6;
    const auto tmp14 = 62.83185307179586 * tmp13;
    const auto tmp15 = 62.83185307179586 * tmp14;
    const auto tmp16 = tmp15 * tmp3;
    const auto tmp17 = 0.1 * tmp16;
    const auto tmp18 = -1 * tmp3;
    const auto tmp19 = 62.83185307179586 * tmp18;
    const auto tmp20 = 62.83185307179586 * tmp19;
    const auto tmp21 = tmp20 * tmp6;
    const auto tmp22 = 0.1 * tmp21;
    const auto tmp23 = (tmp12 ? tmp22 : 0.0) + (tmp12 ? tmp17 : 0.0);
    double tmp24 = constant< 0 >();
    const auto tmp25 = tmp24 * tmp23;
    const auto tmp26 = -1 * tmp25;
    const auto tmp27 = (tmp12 ? tmp9 : 0.5) * (tmp12 ? tmp9 : 0.5);
    const auto tmp28 = 400 * tmp27;
    const auto tmp29 = 200 + tmp28;
    const auto tmp30 = tmp29 * (tmp12 ? tmp9 : 0.5);
    const auto tmp31 = 600 * tmp27;
    const auto tmp32 = tmp31 + tmp30;
    const auto tmp33 = tmp32 + tmp26;
    result[ 0 ] = (tmp12 ? tmp9 : 0.5);
    result[ 1 ] = tmp33;
  }

  template< class Point >
  void jacobian ( const Point &x, typename FunctionSpaceType::JacobianRangeType &result ) const
  {
    using std::abs;
    using std::cos;
    using std::logical_and;
    using std::sin;
    GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
    const auto tmp1 = 6.283185307179586 * tmp0[ 1 ];
    const auto tmp2 = tmp1 / 0.1;
    const auto tmp3 = std::sin( tmp2 );
    const auto tmp4 = 6.283185307179586 * tmp0[ 0 ];
    const auto tmp5 = tmp4 / 0.1;
    const auto tmp6 = std::cos( tmp5 );
    const auto tmp7 = 62.83185307179586 * tmp6;
    const auto tmp8 = tmp7 * tmp3;
    const auto tmp9 = 0.1 * tmp8;
    const auto tmp10 = std::abs( tmp0[ 1 ] );
    const auto tmp11 = std::abs( tmp0[ 0 ] );
    const auto tmp12 = std::logical_and()( tmp11 < 0.1, tmp10 < 0.1 );
    const auto tmp13 = std::sin( tmp5 );
    const auto tmp14 = std::cos( tmp2 );
    const auto tmp15 = 62.83185307179586 * tmp14;
    const auto tmp16 = tmp15 * tmp13;
    const auto tmp17 = 0.1 * tmp16;
    const auto tmp18 = -1 * tmp7;
    const auto tmp19 = 62.83185307179586 * tmp18;
    const auto tmp20 = 62.83185307179586 * tmp19;
    const auto tmp21 = tmp20 * tmp3;
    const auto tmp22 = 0.1 * tmp21;
    const auto tmp23 = -1 * tmp3;
    const auto tmp24 = 62.83185307179586 * tmp23;
    const auto tmp25 = 62.83185307179586 * tmp24;
    const auto tmp26 = tmp25 * tmp7;
    const auto tmp27 = 0.1 * tmp26;
    const auto tmp28 = (tmp12 ? tmp27 : 0.0) + (tmp12 ? tmp22 : 0.0);
    double tmp29 = constant< 0 >();
    const auto tmp30 = tmp29 * tmp28;
    const auto tmp31 = -1 * tmp30;
    const auto tmp32 = tmp13 * tmp3;
    const auto tmp33 = 0.1 * tmp32;
    const auto tmp34 = 0.5 + tmp33;
    const auto tmp35 = (tmp12 ? tmp9 : 0.0) * (tmp12 ? tmp34 : 0.5);
    const auto tmp36 = tmp35 + tmp35;
    const auto tmp37 = 600 * tmp36;
    const auto tmp38 = 400 * tmp36;
    const auto tmp39 = tmp38 * (tmp12 ? tmp34 : 0.5);
    const auto tmp40 = (tmp12 ? tmp34 : 0.5) * (tmp12 ? tmp34 : 0.5);
    const auto tmp41 = 400 * tmp40;
    const auto tmp42 = 200 + tmp41;
    const auto tmp43 = tmp42 * (tmp12 ? tmp9 : 0.0);
    const auto tmp44 = tmp43 + tmp39;
    const auto tmp45 = tmp44 + tmp37;
    const auto tmp46 = tmp45 + tmp31;
    const auto tmp47 = -1 * tmp15;
    const auto tmp48 = 62.83185307179586 * tmp47;
    const auto tmp49 = 62.83185307179586 * tmp48;
    const auto tmp50 = tmp49 * tmp13;
    const auto tmp51 = 0.1 * tmp50;
    const auto tmp52 = -1 * tmp13;
    const auto tmp53 = 62.83185307179586 * tmp52;
    const auto tmp54 = 62.83185307179586 * tmp53;
    const auto tmp55 = tmp54 * tmp15;
    const auto tmp56 = 0.1 * tmp55;
    const auto tmp57 = (tmp12 ? tmp56 : 0.0) + (tmp12 ? tmp51 : 0.0);
    const auto tmp58 = tmp29 * tmp57;
    const auto tmp59 = -1 * tmp58;
    const auto tmp60 = (tmp12 ? tmp17 : 0.0) * (tmp12 ? tmp34 : 0.5);
    const auto tmp61 = tmp60 + tmp60;
    const auto tmp62 = 600 * tmp61;
    const auto tmp63 = 400 * tmp61;
    const auto tmp64 = tmp63 * (tmp12 ? tmp34 : 0.5);
    const auto tmp65 = tmp42 * (tmp12 ? tmp17 : 0.0);
    const auto tmp66 = tmp65 + tmp64;
    const auto tmp67 = tmp66 + tmp62;
    const auto tmp68 = tmp67 + tmp59;
    (result[ 0 ])[ 0 ] = (tmp12 ? tmp9 : 0.0);
    (result[ 0 ])[ 1 ] = (tmp12 ? tmp17 : 0.0);
    (result[ 1 ])[ 0 ] = tmp46;
    (result[ 1 ])[ 1 ] = tmp68;
  }

  template< class Point >
  void hessian ( const Point &x, typename FunctionSpaceType::HessianRangeType &result ) const
  {
    using std::abs;
    using std::cos;
    using std::logical_and;
    using std::sin;
    GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
    const auto tmp1 = 6.283185307179586 * tmp0[ 1 ];
    const auto tmp2 = tmp1 / 0.1;
    const auto tmp3 = std::sin( tmp2 );
    const auto tmp4 = 6.283185307179586 * tmp0[ 0 ];
    const auto tmp5 = tmp4 / 0.1;
    const auto tmp6 = std::sin( tmp5 );
    const auto tmp7 = -1 * tmp6;
    const auto tmp8 = 62.83185307179586 * tmp7;
    const auto tmp9 = 62.83185307179586 * tmp8;
    const auto tmp10 = tmp9 * tmp3;
    const auto tmp11 = 0.1 * tmp10;
    const auto tmp12 = std::abs( tmp0[ 1 ] );
    const auto tmp13 = std::abs( tmp0[ 0 ] );
    const auto tmp14 = std::logical_and()( tmp13 < 0.1, tmp12 < 0.1 );
    const auto tmp15 = std::cos( tmp2 );
    const auto tmp16 = 62.83185307179586 * tmp15;
    const auto tmp17 = std::cos( tmp5 );
    const auto tmp18 = 62.83185307179586 * tmp17;
    const auto tmp19 = tmp18 * tmp16;
    const auto tmp20 = 0.1 * tmp19;
    const auto tmp21 = -1 * tmp3;
    const auto tmp22 = 62.83185307179586 * tmp21;
    const auto tmp23 = 62.83185307179586 * tmp22;
    const auto tmp24 = tmp23 * tmp6;
    const auto tmp25 = 0.1 * tmp24;
    const auto tmp26 = -1 * tmp9;
    const auto tmp27 = 62.83185307179586 * tmp26;
    const auto tmp28 = 62.83185307179586 * tmp27;
    const auto tmp29 = tmp28 * tmp3;
    const auto tmp30 = 0.1 * tmp29;
    const auto tmp31 = tmp9 * tmp23;
    const auto tmp32 = 0.1 * tmp31;
    const auto tmp33 = (tmp14 ? tmp32 : 0.0) + (tmp14 ? tmp30 : 0.0);
    double tmp34 = constant< 0 >();
    const auto tmp35 = tmp34 * tmp33;
    const auto tmp36 = -1 * tmp35;
    const auto tmp37 = tmp6 * tmp3;
    const auto tmp38 = 0.1 * tmp37;
    const auto tmp39 = 0.5 + tmp38;
    const auto tmp40 = (tmp14 ? tmp11 : 0.0) * (tmp14 ? tmp39 : 0.5);
    const auto tmp41 = tmp18 * tmp3;
    const auto tmp42 = 0.1 * tmp41;
    const auto tmp43 = (tmp14 ? tmp42 : 0.0) * (tmp14 ? tmp42 : 0.0);
    const auto tmp44 = tmp43 + tmp40;
    const auto tmp45 = tmp44 + tmp44;
    const auto tmp46 = 600 * tmp45;
    const auto tmp47 = 400 * tmp45;
    const auto tmp48 = tmp47 * (tmp14 ? tmp39 : 0.5);
    const auto tmp49 = (tmp14 ? tmp42 : 0.0) * (tmp14 ? tmp39 : 0.5);
    const auto tmp50 = tmp49 + tmp49;
    const auto tmp51 = 400 * tmp50;
    const auto tmp52 = tmp51 * (tmp14 ? tmp42 : 0.0);
    const auto tmp53 = tmp52 + tmp48;
    const auto tmp54 = (tmp14 ? tmp39 : 0.5) * (tmp14 ? tmp39 : 0.5);
    const auto tmp55 = 400 * tmp54;
    const auto tmp56 = 200 + tmp55;
    const auto tmp57 = tmp56 * (tmp14 ? tmp11 : 0.0);
    const auto tmp58 = tmp57 + tmp52;
    const auto tmp59 = tmp58 + tmp53;
    const auto tmp60 = tmp59 + tmp46;
    const auto tmp61 = tmp60 + tmp36;
    const auto tmp62 = -1 * tmp18;
    const auto tmp63 = 62.83185307179586 * tmp62;
    const auto tmp64 = 62.83185307179586 * tmp63;
    const auto tmp65 = tmp64 * tmp16;
    const auto tmp66 = 0.1 * tmp65;
    const auto tmp67 = -1 * tmp16;
    const auto tmp68 = 62.83185307179586 * tmp67;
    const auto tmp69 = 62.83185307179586 * tmp68;
    const auto tmp70 = tmp69 * tmp18;
    const auto tmp71 = 0.1 * tmp70;
    const auto tmp72 = (tmp14 ? tmp71 : 0.0) + (tmp14 ? tmp66 : 0.0);
    const auto tmp73 = tmp34 * tmp72;
    const auto tmp74 = -1 * tmp73;
    const auto tmp75 = (tmp14 ? tmp20 : 0.0) * (tmp14 ? tmp39 : 0.5);
    const auto tmp76 = tmp16 * tmp6;
    const auto tmp77 = 0.1 * tmp76;
    const auto tmp78 = (tmp14 ? tmp77 : 0.0) * (tmp14 ? tmp42 : 0.0);
    const auto tmp79 = tmp78 + tmp75;
    const auto tmp80 = tmp79 + tmp79;
    const auto tmp81 = 600 * tmp80;
    const auto tmp82 = 400 * tmp80;
    const auto tmp83 = tmp82 * (tmp14 ? tmp39 : 0.5);
    const auto tmp84 = tmp51 * (tmp14 ? tmp77 : 0.0);
    const auto tmp85 = tmp84 + tmp83;
    const auto tmp86 = (tmp14 ? tmp77 : 0.0) * (tmp14 ? tmp39 : 0.5);
    const auto tmp87 = tmp86 + tmp86;
    const auto tmp88 = 400 * tmp87;
    const auto tmp89 = tmp88 * (tmp14 ? tmp42 : 0.0);
    const auto tmp90 = tmp56 * (tmp14 ? tmp20 : 0.0);
    const auto tmp91 = tmp90 + tmp89;
    const auto tmp92 = tmp91 + tmp85;
    const auto tmp93 = tmp92 + tmp81;
    const auto tmp94 = tmp93 + tmp74;
    const auto tmp95 = tmp89 + tmp83;
    const auto tmp96 = tmp90 + tmp84;
    const auto tmp97 = tmp96 + tmp95;
    const auto tmp98 = tmp97 + tmp81;
    const auto tmp99 = tmp98 + tmp74;
    const auto tmp100 = -1 * tmp23;
    const auto tmp101 = 62.83185307179586 * tmp100;
    const auto tmp102 = 62.83185307179586 * tmp101;
    const auto tmp103 = tmp102 * tmp6;
    const auto tmp104 = 0.1 * tmp103;
    const auto tmp105 = (tmp14 ? tmp32 : 0.0) + (tmp14 ? tmp104 : 0.0);
    const auto tmp106 = tmp34 * tmp105;
    const auto tmp107 = -1 * tmp106;
    const auto tmp108 = (tmp14 ? tmp25 : 0.0) * (tmp14 ? tmp39 : 0.5);
    const auto tmp109 = (tmp14 ? tmp77 : 0.0) * (tmp14 ? tmp77 : 0.0);
    const auto tmp110 = tmp109 + tmp108;
    const auto tmp111 = tmp110 + tmp110;
    const auto tmp112 = 600 * tmp111;
    const auto tmp113 = 400 * tmp111;
    const auto tmp114 = tmp113 * (tmp14 ? tmp39 : 0.5);
    const auto tmp115 = tmp88 * (tmp14 ? tmp77 : 0.0);
    const auto tmp116 = tmp115 + tmp114;
    const auto tmp117 = tmp56 * (tmp14 ? tmp25 : 0.0);
    const auto tmp118 = tmp117 + tmp115;
    const auto tmp119 = tmp118 + tmp116;
    const auto tmp120 = tmp119 + tmp112;
    const auto tmp121 = tmp120 + tmp107;
    ((result[ 0 ])[ 0 ])[ 0 ] = (tmp14 ? tmp11 : 0.0);
    ((result[ 0 ])[ 0 ])[ 1 ] = (tmp14 ? tmp20 : 0.0);
    ((result[ 0 ])[ 1 ])[ 0 ] = (tmp14 ? tmp20 : 0.0);
    ((result[ 0 ])[ 1 ])[ 1 ] = (tmp14 ? tmp25 : 0.0);
    ((result[ 1 ])[ 0 ])[ 0 ] = tmp61;
    ((result[ 1 ])[ 0 ])[ 1 ] = tmp94;
    ((result[ 1 ])[ 1 ])[ 0 ] = tmp99;
    ((result[ 1 ])[ 1 ])[ 1 ] = tmp121;
  }

  template< std::size_t i >
  const ConstantType< i > &constant () const
  {
    return *std::get< i >( constants_ );
  }

  template< std::size_t i >
  ConstantType< i > &constant ()
  {
    return *std::get< i >( constants_ );
  }

  const Conlmbda &conlmbda () const
  {
    return *std::get< 0 >( constants_ );
  }

  Conlmbda &conlmbda ()
  {
    return *std::get< 0 >( constants_ );
  }
  ConstantTupleType constants_;
  std::tuple<  > coefficients_;
};

} // namespace UFLLocalFunctions_d3d9b8a21e3075c9ff40117c5244f28e

PYBIND11_MODULE( localfunction_d3d9b8a21e3075c9ff40117c5244f28e_a524c1196983e65de1c06d7d6afdeb44, module )
{
  typedef UFLLocalFunctions_d3d9b8a21e3075c9ff40117c5244f28e::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true > > > LocalFunctionType;
  if constexpr( LocalFunctionType::gridPartValid )
  {
      auto cls = Dune::Python::insertClass<LocalFunctionType>(module,"UFLLocalFunction",Dune::Python::GenerateTypeName("UFLLocalFunctions_d3d9b8a21e3075c9ff40117c5244f28e::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true > > >"), Dune::Python::IncludeFiles({"python/dune/generated/localfunction_d3d9b8a21e3075c9ff40117c5244f28e_a524c1196983e65de1c06d7d6afdeb44.cc"})).first;
      Dune::FemPy::registerUFLLocalFunction( module, cls );
      cls.def( pybind11::init( [] ( pybind11::object gridView, const std::string &name, int order ) {return new LocalFunctionType( Dune::FemPy::gridPart<Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true >>(gridView),name,order); } ), pybind11::keep_alive< 1, 2 >() );
      cls.def_property( "lmbda", [] ( LocalFunctionType &self ) -> UFLLocalFunctions_d3d9b8a21e3075c9ff40117c5244f28e::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true > > >::Conlmbda { return self.conlmbda(); }, [] ( LocalFunctionType &self, const UFLLocalFunctions_d3d9b8a21e3075c9ff40117c5244f28e::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true > > >::Conlmbda &v ) { self.conlmbda() = v; } );
      cls.def_property_readonly( "virtualized", [] ( LocalFunctionType& ) -> bool { return true;});
  }
}

#endif
