pymor.analyticalproblems package¶
Submodules¶
burgers module¶
-
pymor.analyticalproblems.burgers.burgers_problem(v=1.0, circle=True, initial_data_type='sin', parameter_range=(1.0, 2.0))[source]¶ 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.
-
pymor.analyticalproblems.burgers.burgers_problem_2d(vx=1.0, vy=1.0, torus=True, initial_data_type='sin', parameter_range=(1.0, 2.0))[source]¶ 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.
elliptic module¶
-
class
pymor.analyticalproblems.elliptic.StationaryProblem(domain, rhs=None, diffusion=None, advection=None, nonlinear_advection=None, nonlinear_advection_derivative=None, reaction=None, nonlinear_reaction=None, nonlinear_reaction_derivative=None, dirichlet_data=None, neumann_data=None, robin_data=None, outputs=None, parameter_space=None, name=None)[source]¶ Bases:
pymor.core.interfaces.ImmutableInterfaceLinear elliptic problem description.
The problem consists in solving
- ∇ ⋅ [d(x, μ) ∇ u(x, μ)] + ∇ ⋅ [f(x, u(x, μ), μ)] + c(x, u(x, μ), μ) = f(x, μ)
for u.
Parameters
- domain
A
DomainDescriptionof the domain the problem is posed on.- rhs
The
Functionf(x, μ).rhs.dim_domainhas to agree with the dimension ofdomain, whereasrhs.shape_rangehas to be().- diffusion
The
Functiond(x, μ) withshape_rangeof either()or(dim domain, dim domain).- advection
The
Functionf, only depending on x, withshape_rangeof(dim domain,).- nonlinear_advection
The
Functionf, only depending on u, withshape_rangeof(dim domain,).- nonlinear_advection_derivative
The derivative of f, only depending on u, with respect to u.
- reaction
The
Functionc, only depending on x, withshape_rangeof().- nonlinear_reaction
The
Functionc, only depending on u, withshape_rangeof().- nonlinear_reaction_derivative
The derivative of the
Functionc, only depending on u, withshape_rangeof().- dirichlet_data
Functionproviding the Dirichlet boundary values.- neumann_data
Functionproviding the Neumann boundary values.- robin_data
Tuple of two
Functionsproviding the Robin parameter and boundary values.- outputs
Tuple of additional output functionals to assemble. Each value must be a tuple of the form
(functional_type, data)wherefunctional_typeis a string defining the type of functional to assemble anddatais aFunctionholding the corresponding coefficient function. Currently implementedfunctional_typesare:- l2
Evaluate the l2-product with the given data function.
- l2_boundary
Evaluate the l2-product with the given data function on the boundary.
- parameter_space
ParameterSpacefor the problem.- name
Name of the problem.
Attributes
advection,diffusion,dirichlet_data,domain,neumann_data,nonlinear_advection,nonlinear_advection_derivative,nonlinear_reaction,nonlinear_reaction_derivative,outputs,reaction,rhs,robin_data-
domain¶
-
rhs¶
-
diffusion¶
-
advection¶
-
nonlinear_advection¶
-
nonlinear_advection_derivative¶
-
reaction¶
-
nonlinear_reaction¶
-
nonlinear_reaction_derivative¶
-
dirichlet_data¶
-
neumann_data¶
-
robin_data¶
-
outputs¶
helmholtz module¶
-
pymor.analyticalproblems.helmholtz.helmholtz_problem(domain=RectDomain(domain=array([[0, 0], [1, 1]])), rhs=None, parameter_range=(0.0, 100.0), dirichlet_data=None, neumann_data=None)[source]¶ 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
DomainDescriptionof the domain the problem is posed on.- rhs
The
Functionf(x, μ).- parameter_range
A tuple
(k_min, k_max)describing the interval in which k is allowd to vary.- dirichlet_data
Functionproviding the Dirichlet boundary values.- neumann_data
Functionproviding the Neumann boundary values.
instationary module¶
-
class
pymor.analyticalproblems.instationary.InstationaryProblem(stationary_part, initial_data, T=1.0, parameter_space=None, name=None)[source]¶ Bases:
pymor.core.interfaces.ImmutableInterfaceInstationary problem description.
This class describes an instationary problem of the form
| ∂_t u(x, t, μ) + A(u(x, t, μ), t, μ) = f(x, t, μ), | u(x, 0, μ) = u_0(x, μ)
where A, f are given by the problem’s
stationary_partand t is allowed to vary in the interval [0, T].Parameters
- stationary_part
The stationary part of the problem.
- initial_data
Functionproviding the initial values u_0.- T
The final time T.
- parameter_space
ParameterSpacefor the problem.- name
Name of the problem.
Methods
with_stationary_partdisable_logging,enable_logging,has_interface_name,implementor_names,implementorsAttributes
-
T¶
-
stationary_part¶
-
parameter_space¶
-
name¶
thermalblock module¶
-
pymor.analyticalproblems.thermalblock.thermal_block_problem(num_blocks=(3, 3), parameter_range=(0.1, 1))[source]¶ Analytical description of a 2D ‘thermal block’ diffusion problem.
The 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 | | | | | ----------------------------
Parameters
- num_blocks
The tuple
(nx, ny)- parameter_range
A tuple
(μ_min, μ_max). EachParametercomponent μ_ij is allowed to lie in the interval [μ_min, μ_max].