Coverage for src/pymor/analyticalproblems/thermalblock : 100%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
# -*- coding: utf-8 -*- # This file is part of the pyMOR project (http://www.pymor.org). # Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
'''Analytical description of a 2D thermal block diffusion problem.
This problem is to solve the elliptic equation ::
- ∇ ⋅ [ d(x, μ) ∇ u(x, μ) ] = f(x, μ)
on the domain [0,1]^2 with Dirichlet zero boundary values. The domain is partitioned into nx x ny blocks and the diffusion function d(x, μ) is constant on each such block (i,j) with value μ_ij. ::
---------------------------- | | | | | μ_11 | μ_12 | μ_13 | | | | | |--------------------------- | | | | | μ_21 | μ_22 | μ_23 | | | | | ----------------------------
The Problem is implemented as an |EllipticProblem| with the characteristic functions of the blocks as `diffusion_functions`.
Parameters ---------- num_blocks The tuple (nx, ny) parameter_range A tuple (μ_min, μ_max). Each |Parameter| component μ_ij is allowed to lie in the interval [μ_min, μ_max]. rhs The |Function| f(x, μ). '''
# creating the id-string once for every diffusion function reduces the size of the pickled sid
* (X[..., 1] >= y * dy) * (X[..., 1] < (y + 1) * dy))
component_shape=(num_blocks[1], num_blocks[0]), coordinates=(num_blocks[1] - y - 1, x), name='diffusion_{}_{}'.format(x, y))
for x, y in product(xrange(num_blocks[0]), xrange(num_blocks[1]))) for x, y in product(xrange(num_blocks[0]), xrange(num_blocks[1])))
name='ThermalBlock') |