pymor.analyticalproblems package

Submodules

advection module


class pymor.analyticalproblems.advection.InstationaryAdvectionProblem(domain=RectDomain([[0 0], [1 1]]), rhs=ConstantFunction(array(1.0), 2), flux_function=ConstantFunction(array([0, 0]), 1), flux_function_derivative=ConstantFunction(array([0, 0]), 1), dirichlet_data=ConstantFunction(array(0), 2), initial_data=ConstantFunction(array(1), 2), T=1, name=None)[source]

Bases: pymor.core.interfaces.ImmutableInterface

Instationary advection problem.

The problem is to solve the scalar conservation law:

∂_t u(x, t, μ)  +  ∇ ⋅ f(u(x, t, μ), t, μ) = s(x, t, μ)
                                u(x, 0, μ) = u_0(x, μ)

for u with t in [0, T], x in Ω.

Parameters

domain
A DomainDescription of the domain Ω the problem is posed on.
rhs
The Function s. Note that the current time is handled as an additional '_t' component of the Parameter mu passed to rhs.
flux_function
The Function f. Note that the current time is handled as an additional '_t' component of the Parameter mu which is passed to flux_function. flux_function.dim_domain has to be 1, whereas flux_function.shape_range has to be (dim Ω,).
flux_function_derivative
The derivative of f with respect to u.
dirichlet_data
Function providing the Dirichlet boundary values.
initial_data
Function providing the initial values u_0.
T
The final time T.
name
Name of the problem.
domain
rhs
flux_function
flux_function_derivative
dirichlet_data
initial_data
T

burgers module


class pymor.analyticalproblems.burgers.Burgers2DBumpInitialData[source]

Bases: pymor.functions.interfaces.FunctionInterface

evaluate(x, mu=None)[source]

Evaluate the function for given argument x and Parameter mu.


class pymor.analyticalproblems.burgers.Burgers2DFlux(vx, vy)[source]

Bases: pymor.functions.interfaces.FunctionInterface

evaluate(U, mu=None)[source]

Evaluate the function for given argument x and Parameter mu.


class pymor.analyticalproblems.burgers.Burgers2DFluxDerivative(vx, vy)[source]

Bases: pymor.functions.interfaces.FunctionInterface

evaluate(U, mu=None)[source]

Evaluate the function for given argument x and Parameter mu.


class pymor.analyticalproblems.burgers.Burgers2DProblem(vx=1.0, vy=1.0, torus=True, initial_data_type='sin', parameter_range=(1.0, 2.0))[source]

Bases: pymor.analyticalproblems.advection.InstationaryAdvectionProblem

Two-dimensional Burgers-type problem.

The problem is to solve

∂_t u(x, t, μ)  +  ∇ ⋅ (v * u(x, t, μ)^μ) = 0
                               u(x, 0, μ) = u_0(x)

for u with t in [0, 0.3], x in [0, 2] x [0, 1].

Parameters

vx
The x component of the velocity vector v.
vy
The y component of the velocity vector v.
torus
If True, impose periodic boundary conditions. Otherwise, Dirichlet left and bottom, outflow top and right.
initial_data_type
Type of initial data ('sin' or 'bump').
parameter_range
The interval in which μ is allowed to vary.

class pymor.analyticalproblems.burgers.Burgers2DSinInitialData[source]

Bases: pymor.functions.interfaces.FunctionInterface

evaluate(x, mu=None)[source]

Evaluate the function for given argument x and Parameter mu.


class pymor.analyticalproblems.burgers.BurgersBumpInitialData[source]

Bases: pymor.functions.interfaces.FunctionInterface

evaluate(x, mu=None)[source]

Evaluate the function for given argument x and Parameter mu.


class pymor.analyticalproblems.burgers.BurgersFlux(v)[source]

Bases: pymor.functions.interfaces.FunctionInterface

evaluate(U, mu=None)[source]

Evaluate the function for given argument x and Parameter mu.


class pymor.analyticalproblems.burgers.BurgersFluxDerivative(v)[source]

Bases: pymor.functions.interfaces.FunctionInterface

evaluate(U, mu=None)[source]

Evaluate the function for given argument x and Parameter mu.


class pymor.analyticalproblems.burgers.BurgersProblem(v=1.0, circle=True, initial_data_type='sin', parameter_range=(1.0, 2.0))[source]

Bases: pymor.analyticalproblems.advection.InstationaryAdvectionProblem

One-dimensional Burgers-type problem.

The problem is to solve

∂_t u(x, t, μ)  +  ∂_x (v * u(x, t, μ)^μ) = 0
                               u(x, 0, μ) = u_0(x)

for u with t in [0, 0.3] and x in [0, 2].

Parameters

v
The velocity v.
circle
If True, impose periodic boundary conditions. Otherwise Dirichlet left, outflow right.
initial_data_type
Type of initial data ('sin' or 'bump').
parameter_range
The interval in which μ is allowed to vary.

class pymor.analyticalproblems.burgers.BurgersSinInitialData[source]

Bases: pymor.functions.interfaces.FunctionInterface

evaluate(x, mu=None)[source]

Evaluate the function for given argument x and Parameter mu.

elliptic module


class pymor.analyticalproblems.elliptic.EllipticProblem(domain=RectDomain([[0 0], [1 1]]), rhs=ConstantFunction(array(1.0), 2), diffusion_functions=None, diffusion_functionals=None, advection_functions=None, advection_functionals=None, reaction_functions=None, reaction_functionals=None, dirichlet_data=None, neumann_data=None, robin_data=None, parameter_space=None, name=None)[source]

Bases: pymor.core.interfaces.ImmutableInterface

Affinely decomposed linear elliptic problem.

The problem consists in solving

|        Kd                                     Kv                             Kr
| - ∇ ⋅  ∑  θ_{d,k}(μ) ⋅ d_k(x) ∇ u(x, μ) + ∇ ⋅ ∑  θ_{v,k}(μ) v_k(x) u(x, μ) + ∑  θ_{r,k}(μ) r_k(x) u(x, μ) = f(x, μ)
|       k=0                                    k=0                            k=0

for u.

Parameters

domain
A DomainDescription of the domain the problem is posed on.
rhs
The Function f(x, μ). rhs.dim_domain has to agree with the dimension of domain, whereas rhs.shape_range has to be ().
diffusion_functions
List containing the Functions d_k(x), each having shape_range of either () or (dim domain, dim domain).
diffusion_functionals
List containing the ParameterFunctionals θ_{d,k}(μ). If len(diffusion_functions) == 1, diffusion_functionals is allowed to be None, in which case no parameter dependence is assumed.
advection_functions
List containing the Functions v_k(x), each having shape_range of (dim domain,).
advection_functionals
List containing the ParameterFunctionals θ_{v,k}(μ). If len(advection_functions) == 1, advection_functionals is allowed to be None, in which case no parameter dependence is assumed.
reaction_functions
List containing the Functions r_k(x), each having shape_range of ().
reaction_functionals
List containing the ParameterFunctionals θ_{r,k}(μ). If len(reaction_functions) == 1, reaction_functionals is allowed to be None, in which case no parameter dependence is assumed.
dirichlet_data
Function providing the Dirichlet boundary values.
neumann_data
Function providing the Neumann boundary values.
robin_data
Tuple of two Functions providing the Robin parameter and boundary values.
parameter_space
ParameterSpace for the problem.
name
Name of the problem.
domain
rhs
diffusion_functions
diffusion_functionals
advection_functions
advection_functionals
reaction_functions
reaction_functionals
dirichlet_data
neumann_data
robin_data

helmholtz module


class pymor.analyticalproblems.helmholtz.HelmholtzProblem(domain=RectDomain([[0 0], [1 1]]), rhs=None, parameter_range=(0.0, 100.0), dirichlet_data=None, neumann_data=None)[source]

Bases: pymor.analyticalproblems.elliptic.EllipticProblem

Helmholtz equation problem.

This problem is to solve the Helmholtz equation

- ∆ u(x, k) - k^2 u(x, k) = f(x, k)

on a given domain.

Parameters

domain
A DomainDescription of the domain the problem is posed on.
rhs
The Function f(x, μ).
parameter_range
A tuple (k_min, k_max) describing the interval in which k is allowd to vary.
dirichlet_data
Function providing the Dirichlet boundary values.
neumann_data
Function providing the Neumann boundary values.
name
Name of the problem.

parabolic module


class pymor.analyticalproblems.parabolic.ParabolicProblem(domain=RectDomain([[0 0], [1 1]]), rhs=ConstantFunction(array(1.0), 2), diffusion_functions=(ConstantFunction(array(1.0), 2),), diffusion_functionals=None, dirichlet_data=None, neumann_data=None, initial_data=ConstantFunction(array(1.0), 2), T=1, parameter_space=None, name=None)[source]

Bases: pymor.core.interfaces.ImmutableInterface

Affinely decomposed linear parabolic problem.

The problem consists in solving

|                       K
|  ∂_t u(x, t, μ) - ∇ ⋅ ∑  θ_k(μ) ⋅ d_k(x) ∇ u(x, t, μ) = f(x, t, μ)
|                      k=0
|                                            u(x, 0, μ) = u_0(x, μ)

for u with t in [0, T], x in Ω.

Parameters

domain
A DomainDescription of the domain the problem is posed on.
rhs
The Function f(x, μ). rhs.dim_domain has to agree with the dimension of domain, whereas rhs.shape_range has to be ().
diffusion_functions
List containing the Functions d_k(x), each having shape_range of either () or (dim domain, dim domain).
diffusion_functionals
List containing the ParameterFunctionals θ_k(μ). If len(diffusion_functions) == 1, diffusion_functionals is allowed to be None, in which case no parameter dependence is assumed.
dirichlet_data
Function providing the Dirichlet boundary values.
neumann_data
Function providing the Neumann boundary values.
initial_data
Function providing the initial values.
T
The final time T.
parameter_space
ParameterSpace for the problem.
name
Name of the problem.
domain
rhs
diffusion_functions
diffusion_functionals
dirichlet_data
neumann_data
initial_data
T

thermalblock module


class pymor.analyticalproblems.thermalblock.ThermalBlockDiffusionFunction(x, y, nx, ny)[source]

Bases: pymor.functions.interfaces.FunctionInterface

evaluate(x, mu=None)[source]

Evaluate the function for given argument x and Parameter mu.


class pymor.analyticalproblems.thermalblock.ThermalBlockProblem(num_blocks=(3, 3), parameter_range=(0.1, 1), rhs=ConstantFunction(array(1.0), 2))[source]

Bases: pymor.analyticalproblems.elliptic.EllipticProblem

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, μ).