diff --git a/src/python/Makefile.am b/src/python/Makefile.am deleted file mode 100644 index 85f749297461c4c711c0ea48f859939dfdd337a8..0000000000000000000000000000000000000000 --- a/src/python/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -SUBDIRS = - -check_PROGRAMS = \ - test-python - -TESTS = test-python - -test_python_SOURCES = \ - test-python.cc -test_python_CPPFLAGS= \ - $(AM_CPPFLAGS) -DDUNE_NICE_FUNCTION_MODULE_PATH="\"$(srcdir)\"" - -AM_CPPFLAGS = \ - $(DUNE_CPPFLAGS) \ - $(PYTHON_CPPFLAGS) \ - -I$(top_srcdir) - -LDADD = \ - $(DUNE_LDFLAGS) $(DUNE_LIBS) \ - $(PYTHON_LIBS) -AM_LDFLAGS = \ - $(DUNE_LDFLAGS) \ - $(PYTHON_LDFLAGS) - -include $(top_srcdir)/am/global-rules diff --git a/src/python/nicefunction.py b/src/python/nicefunction.py deleted file mode 100644 index f4c4bbe6f4320603711716182e33ca7a951b239d..0000000000000000000000000000000000000000 --- a/src/python/nicefunction.py +++ /dev/null @@ -1,8 +0,0 @@ -class sampleFunction: - def __call__(self, x): - if x < 1: - return x - else: - return 2*x - 1 - -Functions = {'sampleFunction' : sampleFunction()} diff --git a/src/python/test-python.cc b/src/python/test-python.cc deleted file mode 100644 index f070876deef583c5a03cb19509fe6a485d7895bc..0000000000000000000000000000000000000000 --- a/src/python/test-python.cc +++ /dev/null @@ -1,51 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef DUNE_NICE_FUNCTION_MODULE_PATH -#error DUNE_NICE_FUNCTION_MODULE_PATH unset -#endif - -#ifndef HAVE_PYTHON -#error Python is necessary -#else -#define EMBEDDED_PYTHON 1 -#endif - -#include <Python.h> - -#include <dune/common/exceptions.hh> -#include <dune/common/stdstreams.hh> - -#include <dune/fufem/dunepython.hh> -#include <dune/fufem/sharedpointermap.hh> - -int main() { - typedef Dune::VirtualFunction<double, double> Function; - typedef SharedPointerMap<std::string, Function> FunctionMap; - FunctionMap functions; - - try { - Python::start(); - - Python::run("import sys"); - std::string importString("sys.path.append('"); - importString += DUNE_NICE_FUNCTION_MODULE_PATH; - importString += "')"; - Python::run(importString.c_str()); - - Python::Reference module = Python::import("nicefunction"); - Python::Reference funcRef = module.get("Functions"); - funcRef.toC<FunctionMap::Base>(functions); - - double const in(2.0); - Function const &foo = functions.get("sampleFunction"); - double out; - foo.evaluate(in, out); - - Python::stop(); - } - catch (Dune::Exception &e) { - Dune::derr << "Dune reported error: " << e << std::endl; - } -}