# coding=utf-8 """ .. moduleauthor:: Torbjörn Klatt <*****@*****.**> .. moduleauthor:: Dieter Moser <*****@*****.**> """ from collections import OrderedDict import numpy as np dt = 0.001 from pypint.utilities.logging import LOG, print_logging_message_tree, VERBOSITY_LVL1, SEPARATOR_LVL1, SEPARATOR_LVL2 LOG.info("%sSetting Up Multigrid Space Solver" % VERBOSITY_LVL1) from pypint.plugins.multigrid.stencil import Stencil laplace_stencil = Stencil(np.array([1.0, -2.0, 1.0]), None, 2) LOG.info("%s Laplace Discretization Stencil: %s" % (VERBOSITY_LVL1, laplace_stencil.arr)) LOG.info(SEPARATOR_LVL2) LOG.info("%sSetting Up 1D Heat Equation" % VERBOSITY_LVL1) LOG.info("%s Setting Up Geometry" % VERBOSITY_LVL1) geo = np.asarray([[0, 1]]) LOG.info("%s Setting Up Boundary Functions" % VERBOSITY_LVL1) boundary_types = ['dirichlet'] * 2 def left_f(x): _s = np.zeros(x.shape) LOG.debug("Left Bnd Fnc: %s -> %s" % (x.reshape(-1), _s.reshape(-1))) return _s