Skip to content
Snippets Groups Projects
Unverified Commit 3dd6a38d authored by Tobias Leibner's avatar Tobias Leibner Committed by GitHub
Browse files

Merge pull request #32 from dune-community/python_infrastructure_update

Python infrastructure update
parents 5bb2a4f0 93b73bdc
No related branches found
No related tags found
No related merge requests found
Showing
with 279 additions and 421 deletions
......@@ -21,9 +21,9 @@ before_script:
- export IMAGE="dunecommunity/dune-xt-functions-testing_${DOCKER_TAG}:${TRAVIS_BRANCH}"
# get image with fallback to master branch of the super repo
- docker pull ${IMAGE} || export IMAGE="dunecommunity/dune-xt-functions-testing_${DOCKER_TAG}:master" ; docker pull ${IMAGE}
- export MY_MODULE=dune-xt-functions
- export ENV_FILE=${HOME}/env
- python3 ./.travis.make_env_file.py
- export MY_MODULE=dune-xt-functions
- export DOCKER_RUN="docker run --env-file ${ENV_FILE} -v ${TRAVIS_BUILD_DIR}:/root/src/dune-xt-functions ${IMAGE}"
script:
......
......@@ -16,7 +16,9 @@
#include <type_traits>
#if HAVE_EIGEN
#include <dune/xt/common/disable_warnings.hh>
#include <Eigen/Eigenvalues>
#include <dune/xt/common/reenable_warnings.hh>
#endif
#include <dune/geometry/referenceelements.hh>
......
......@@ -16,11 +16,11 @@
#include <limits>
#include <vector>
#include <dune/common/fmatrix.hh>
#include <dune/common/fvector.hh>
#include <dune/xt/common/configuration.hh>
#include <dune/xt/common/exceptions.hh>
#include <dune/xt/common/fmatrix.hh>
#include <dune/xt/common/parallel/threadstorage.hh>
#include "base.hh"
......@@ -31,17 +31,6 @@ namespace XT {
namespace Functions {
// forward, needed for friendliness
template <class EntityImp,
class DomainFieldImp,
size_t domainDim,
class RangeFieldImp,
size_t rangeDim,
size_t rangeDimCols,
class TimeFieldImp>
class TimeDependentExpressionFunction;
template <class EntityImp,
class DomainFieldImp,
size_t domainDim,
......@@ -387,7 +376,7 @@ private:
{
static void get_expression(const Common::Configuration& cfg, ExpressionStringVectorType& expression_as_vectors)
{
typedef typename Dune::FieldMatrix<std::string, dimRange, dimRangeCols> ExpressionMatrixType;
typedef typename XT::Common::FieldMatrix<std::string, dimRange, dimRangeCols> ExpressionMatrixType;
const ExpressionMatrixType expression_as_matrix =
cfg.get<ExpressionMatrixType>("expression", dimRange, dimRangeCols);
// convert FieldMatrix to ExpressionStringVectorType
......@@ -426,7 +415,7 @@ private:
// get gradient as FieldMatrix for every key
for (std::string key : gradient_keys) {
ExpressionStringVectorType gradient_as_vectors_component;
typedef typename Dune::FieldMatrix<std::string, dimRange, dimDomain> JacobianMatrixType;
typedef typename XT::Common::FieldMatrix<std::string, dimRange, dimDomain> JacobianMatrixType;
const JacobianMatrixType gradient_as_matrix = cfg.get<JacobianMatrixType>(key);
// convert FieldMatrix to ExpressionStringVectorType
for (size_t rr = 0; rr < dimRange; ++rr) {
......@@ -439,9 +428,6 @@ private:
}
} // ... get_gradient(...)
template <class _E, class _D, size_t _d, class _R, size_t _r, size_t _rC, class _T>
friend class TimeDependentExpressionFunction;
std::shared_ptr<const MathExpressionFunctionType> function_;
size_t order_;
std::string name_;
......
......@@ -17,6 +17,8 @@
#include <memory>
#include <vector>
#include <dune/common/unused.hh>
#include <dune/xt/common/configuration.hh>
#include <dune/xt/common/debug.hh>
#include <dune/xt/common/exceptions.hh>
......@@ -207,6 +209,7 @@ public:
if (current_level > max_depth)
return;
for (const auto unused_counter : Common::value_range(children)) {
DUNE_UNUSED_PARAMETER(unused_counter);
EllipsoidType child = parent;
const double scale = std::pow(ellipsoid_cfg.get("ellipsoids.recursion_scale", 0.5), current_level);
const auto displace = [&](DomainFieldType& coord) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
add_subdirectory(dune/xt/functions)
add_subdirectory(dune/xt/)
dxt_add_python_tests()
......@@ -21,12 +21,12 @@
#include <python/dune/xt/common/bindings.hh>
#include <python/dune/xt/grid/grids.bindings.hh>
#include "interfaces.pbh"
#include "constant.pbh"
#include "checkerboard.pbh"
#include "ESV2007.bindings.hh"
#include "expression.pbh"
#include "spe10.pbh"
#include <python/dune/xt/functions/interfaces.hh>
#include <python/dune/xt/functions/constant.hh>
#include <python/dune/xt/functions/checkerboard.hh>
#include <python/dune/xt/functions/ESV2007.bindings.hh>
#include <python/dune/xt/functions/expression.hh>
#include <python/dune/xt/functions/spe10.hh>
template <class G>
......
......@@ -9,68 +9,5 @@
# or GPL-2.0+ (http://opensource.org/licenses/gpl-license)
# with "runtime exception" (http://www.dune-project.org/license.html)
from importlib import import_module
from dune.xt.common import DEBUG # inits MPI via mpi4py
_init_logger_methods = list()
_test_logger_methods = list()
_init_mpi_methods = list()
_other_modules = ('xt.common', 'xt.la', 'xt.grid', 'gdt')
from ._functions import __dict__ as module
to_import = [name for name in module if not name.startswith('_')]
globals().update({name: module[name] for name in to_import})
_init_logger_methods.append(module['_init_logger'])
_test_logger_methods.append(module['_test_logger'])
_init_mpi_methods.append(module['_init_mpi'])
del to_import
del module
def init_logger(max_info_level=999,
max_debug_level=999,
enable_warnings=True,
enable_colors=True,
info_color='blue',
debug_color='darkgray',
warning_color='red'):
init_logger_methods = _init_logger_methods.copy()
for module_name in _other_modules:
try:
mm = import_module('dune.{}'.format(module_name))
for init_logger_method in mm._init_logger_methods:
init_logger_methods.append(init_logger_method)
except ModuleNotFoundError:
pass
for init_logger_method in init_logger_methods:
init_logger_method(max_info_level, max_debug_level, enable_warnings, enable_colors, info_color, debug_color,
warning_color)
def test_logger(info=True, debug=True, warning=True):
test_logger_methods = _test_logger_methods.copy()
for module_name in _other_modules:
try:
mm = import_module('dune.{}'.format(module_name))
for test_logger_method in mm._test_logger_methods:
test_logger_methods.append(test_logger_method)
except ModuleNotFoundError:
pass
for test_logger_method in test_logger_methods:
test_logger_method(info, debug, warning)
def init_mpi(args=list()):
if DEBUG:
init_mpi_methods = [_init_mpi_methods[0],]
else:
init_mpi_methods = _init_mpi_methods.copy()
for module_name in _other_modules:
try:
mm = import_module('dune.{}'.format(module_name))
for init_mpi_method in mm._init_mpi_methods:
init_mpi_methods.append(init_mpi_method)
except ModuleNotFoundError:
pass
for init_mpi_method in init_mpi_methods:
init_mpi_method(args)
import dune.xt
from dune.xt._functions import *
\ No newline at end of file
......@@ -14,14 +14,15 @@
#include <dune/pybindxi/pybind11.h>
#include <dune/xt/common/string.hh>
#include <python/dune/xt/common/fvector.pbh>
#include <python/dune/xt/common/fmatrix.pbh>
#include <dune/xt/grid/dd/subdomains/grid.hh>
#include <dune/xt/grid/type_traits.hh>
#include <dune/xt/grid/gridprovider/provider.hh>
#include <dune/xt/functions/interfaces.hh>
#include <dune/xt/functions/checkerboard.hh>
#include <python/dune/xt/common/fvector.hh>
#include <python/dune/xt/common/fmatrix.hh>
namespace Dune {
namespace XT {
namespace Functions {
......
......@@ -18,8 +18,8 @@
#include <dune/xt/grid/gridprovider/provider.hh>
#include <dune/xt/grid/type_traits.hh>
#include <python/dune/xt/common/fvector.pbh>
#include <python/dune/xt/common/fmatrix.pbh>
#include <python/dune/xt/common/fvector.hh>
#include <python/dune/xt/common/fmatrix.hh>
#include <dune/xt/functions/interfaces.hh>
#include <dune/xt/functions/constant.hh>
......
......@@ -17,7 +17,7 @@
#include <dune/xt/common/string.hh>
#include <dune/xt/grid/dd/subdomains/grid.hh>
#include <dune/xt/grid/type_traits.hh>
#include <dune/xt/grid/gridprovider/provider.hh>
#include <dune/xt/functions/interfaces.hh>
#include <dune/xt/functions/expression.hh>
......
......@@ -14,12 +14,13 @@
#include <dune/pybindxi/pybind11.h>
#include <dune/xt/common/string.hh>
#include <python/dune/xt/common/fvector.pbh>
#include <dune/xt/grid/dd/subdomains/grid.hh>
#include <dune/xt/grid/type_traits.hh>
#include <dune/xt/grid/gridprovider/provider.hh>
#include <dune/xt/functions/spe10/model1.hh>
#include <python/dune/xt/common/fvector.hh>
namespace Dune {
namespace XT {
namespace Functions {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment