Release Notes¶
pyMOR 0.4 (September 28, 2016)¶
With the pyMOR 0.4 release we have changed the copyright of pyMOR to
Copyright 2013-2016 pyMOR developers and contributors. All rights reserved.
Moreover, we have added a Contribution guideline to help new users with starting to contribute to pyMOR. Over 800 single commits have entered this release. For a full list of changes see here. pyMOR 0.4 contains contributions by Andreas Buhr, Michael Laier, Falk Meyer, Petar Mlinarić and Michael Schaefer. See here for more details.
Release highlights¶
FEniCS and deal.II support¶
pyMOR now includes wrapper classes for integrating PDE solvers
written with the dolfin library of the FEniCS
project. For a usage example, see pymordemos.thermalblock_simple.discretize_fenics.
Experimental support for deal.II can be
found in the pymor-deal.II
repository of the pyMOR GitHub organization.
Parallelization of pyMOR’s reduction algorithms¶
We have added a parallelization framework to pyMOR which allows
parallel execution of reduction algorithms based on a simple
WorkerPool interface [#14].
The greedy [#155]
and ei_greedy algorithms [#162]
have been refactored to utilize this interface.
Two WorkerPool implementations are shipped with pyMOR:
IPythonPool utilizes the parallel
computing features of IPython, allowing
parallel algorithm execution in large heterogeneous clusters of
computing nodes. MPIPool can be used
to benefit from existing MPI-based parallel HPC computing architectures
[#161].
Support classes for MPI distributed external PDE solvers¶
While pyMOR’s VectorArray, Operator and Discretization
interfaces are agnostic to the concrete (parallel) implementation
of the corresponding objects in the PDE solver, external solvers
are often integrated by creating wrapper classes directly corresponding
to the solvers data structures. However, when the solver is executed
in an MPI distributed context, these wrapper classes will then only
correspond to the rank-local data of a distributed VectorArray or
Operator.
To facilitate the integration of MPI parallel solvers, we have added
MPI helper classes [#163]
in pymor.vectorarrays.mpi, pymor.operators.mpi
and pymor.discretizations.mpi that allow an automatic
wrapping of existing sequential bindings for MPI distributed use.
These wrapper classes are based on a simple event loop provided
by pymor.tools.mpi, which is used in the interface methods of
the wrapper classes to dispatch into MPI distributed execution
of the corresponding methods on the underlying MPI distributed
objects.
The resulting objects can be used on MPI rank 0 (including interactive
Python sessions) without any further changes to pyMOR or the user code.
For an example, see pymordemos.thermalblock_simple.discretize_fenics.
New reduction algorithms¶
adaptive_greedyuses adaptive parameter training set refinement according to [HDO11] to prevent overfitting of the reduced model to the training set [#213].reduce_parabolicreduces linear parabolic problems usingreduce_generic_rband assembles an error estimator similar to [GP05], [HO08]. Theparabolic_mordemo contains a simple sample application using this reductor [#190].- The
estimate_imageandestimate_image_hierarchicalalgorithms can be used to find an as small as possible space in which the images of a given list of operators for a given source space are contained for all possible parametersmu. For possible applications, seereduce_residualwhich now usesestimate_image_hierarchicalfor Petrov-Galerkin projection of the residual operator [#223].
Copy-on-write semantics for VectorArrays¶
The copy method
of the VectorArray interface is now assumed to have copy-on-write
semantics. I.e., the returned VectorArray will contain a reference to the same
data as the original array, and the actual data will only be copied when one of
the arrays is changed. Both NumpyVectorArray and ListVectorArray have been
updated accordingly [#55].
As a main benefit of this approach, immutable objects having a VectorArray as
an attribute now can safely create copies of the passed VectorArrays (to ensure
the immutability of their state) without having to worry about unnecessarily
increased memory consumption.
Improvements to pyMOR’s discretizaion tookit¶
- An unstructured triangular
Gridis now provided byUnstructuredTriangleGrid. Such aGridcan be obtained using thediscretize_gmshmethod, which can parse Gmsh output files. Moreover, this method can generateGmshinput files to create unstructured meshes for an arbitraryPolygonalDomain[#9]. - Basic support for parabolic problems has been added.
The
discretize_parabolic_cganddiscretize_parabolic_fvmethods can be used to build continuous finite element or finite volumeDiscretizationsfrom a givenpymor.analyticalproblems.parabolic.ParabolicProblem. Theparabolicdemo demonstrates the use of these methods [#189]. - The
pymor.discretizers.diskmodule contains methods to create stationary and instationary affinely decomposedDiscretizationsfrom matrix data files and an.inifile defining the given problem. EllipticProblemscan now also contain advection and reaction terms in addition to the diffusion part.discretize_elliptic_cghas been extended accordingly [#211].- The
continuous Galerkinmodule has been extended to support Robin boundary conditions [#110]. BitmapFunctionallows to use grayscale image data as dataFunctions[#194].- For the visualization of time-dependent data, the colorbars can now be rescaled with each new frame [#91].
Caching improvements¶
- state id generation is now based on deterministic pickling.
In previous version of pyMOR, the state id of
immutableobjects was computed from the state ids of the parameters passed to the object’s__init__method. This approach was complicated and error-prone. Instead, we now compute the state id as a hash of a deterministic serialization of the object’s state. While this approach is more robust, it is also slightly more expensive. However, due to the object’s immutability, the state id only has to be computed once, and state ids are now only required for storing results in persistent cache regions (see below). Computing such results will usually be much more expensive than the state id calculation [#106]. CacheRegionsnow have apersistentattribute indicating whether the cache data will be kept between program runs. For persistent cache regions the state id of the object for which the cached method is called has to be computed to obtain a unique persistent id for the given object. For non-persistent regions the object’suidcan be used instead.pymor.core.cache_regionsnow by default contains'memory','disk'and'persistent'cache regions [#182], [#121] .defaultscan now be marked to not affect state id computation. In previous version of pyMOR, changing anydefaultvalue caused a change of the state id pyMOR’s defaults dictionary, leading to cache misses. While this in general is desirable, as, for instance, changed linear solver default error tolerances might lead to different solutions for the sameDiscretizationobject, it is clear for many I/O related defaults, that these will not affect the outcome of any computation. For these defaults, thedefaultsdecorator now accepts asid_ignoreparameter, to exclude these defaults from state id computation, preventing changes of these defaults causing cache misses [#81].- As an alternative to using the
@cacheddecorator,cached_method_callcan be used to cache the results of a function call. This is now used insolveto enable parsing of the input parameter before it enters the cache key calculation [#231].
Additional new features¶
apply_inverse_adjointhas been added to theOperatorinterface [#133].Support for complex values in
NumpyVectorArrayandNumpyMatrixOperator[#131].- New
ProductParameterFunctional. This
ParameterFunctionalrepresents the product of a given list ofParameterFunctionals.
- New
- New
SelectionOperator[#105]. This
Operatorrepresents oneOperatorof a given list ofOperators, depending on the evaluation of a providedParameterFunctional,
- New
- New block matrix operators [#215].
BlockOperatorandBlockDiagonalOperatorrepresent block matrices ofOperatorswhich can be applied to appropriately shapedBlockVectorArrays.
from_filefactory method forNumpyVectorArrayandNumpyMatrixOperator[#118].NumpyVectorArray.from_fileandNumpyMatrixOperator.from_filecan be used to construct such objects from data files of various formats (MATLAB, matrix market, NumPy data files, text).
ListVectorArray-basedNumpyMatrixOperator[#164].The
playgroundnow containsNumpyListVectorArrayMatrixOperatorwhich can applyNumPy/SciPymatrices to aListVectorArray. ThisOperatoris mainly intended for performance testing purposes. Thethermalblockdemo now has an option--list-vector-arrayfor using this operator instead ofNumpyMatrixOperator.
- Log indentation support [#230].
pyMOR’s log output can now be indented via the
logger.block(msg)context manger to reflect the hierarchy of subalgorithms.
- Default implementation of
as_vectorfor functionals [#107]. OperatorBase.as_vectornow contains a default implementation for functionals by callingapply_adjoint.
- Default implementation of
pycontractshas been removed as a dependency of pyMOR [#127].Test coverage has been raised to 80 percent.
Backward incompatible changes¶
VectorArrayimplementations have been moved to thepymor.vectorarrayssub-package [#89].- The
dotmethod of theVectorArrayinterface has been split intodotandpairwise_dot[#76]. The
pairwiseparameter ofdothas been removed, always assumingpairwise == False. The methodpairwise_dotcorresponds to thepairwise == Truecase. Similarly thepariwiseparameter of theapply2method of theOperatorinterface has been removed and apairwise_apply2method has been added.
- The
almost_equalhas been removed from theVectorArrayinterface [#143].As a replacement, the new method
pymor.algorithms.basic.almost_equalcan be used to compareVectorArraysfor almost equality by the norm of their difference.
lincombhas been removed from theOperatorinterface [#83].Instead, a
LincombOperatorshould be directly instantiated.
- Removal of the
optionsparameter ofapply_inversein favor ofsolver_optionsattribute [#122]. The
optionsparameter ofOperatorInterface.apply_inversehas been replaced by thesolver_optionsattribute. This attribute controls which fixed (linear) solver options are used whenapply_inverseis called. Seehere <https://github.com/pymor/pymor/pull/184>for more details.
- Removal of the
- Renaming of reductors for coercive problems [#224].
pymor.reductors.linear.reduce_stationary_affine_linearandpymor.reductors.stationary.reduce_stationary_coercivehave been renamed topymor.reductors.coercive.reduce_coerciveandpymor.reductors.coercive.reduce_coercive_simple. The old names are deprecated and will be removed in pyMOR 0.5.
Non-parametric objects have now
parameter_type{}instead ofNone[#84].Sampling methods of
ParameterSpacesnow return iterables instead of iterators [#108].- Caching of
solveis now disabled by default [#178]. Caching of
solvemust now be explicitly enabled by usingpymor.core.cache.CacheableInterface.enable_caching.
- Caching of
The default value for
extension_algorithmparameter ofgreedyhas been removed [#82].- Changes to
ei_greedy[#159], [#160]. The default for the
projectionparameter has been changed from'orthogonal'to'ei'to let the default algorithm agree with literature. In addition acopyparameter with defaultTruehas been added. WhencopyisTrue, the input data is copied before executing the algorithm, ensuring, that the originalVectorArrayis left unchanged. When possible,copyshould be set toFalsein order to reduce memory consumption.
- Changes to
The
copyparameter ofpymor.algorithms.gram_schmidt.gram_schmidtnow defaults toTrue[#123].with_has been moved fromBasicInterfacetoImmutableInterface[#154].BasicInterface.add_attributeshas been removed [#158].- Python fallbacks to Cython functions have been removed [#145].
In order to use pyMOR’s discretization toolkit, building of the
_unstructured,inplace,relationsCython extension modules is now required.
Further improvements¶
- [#78] update apply_inverse signature
- [#115] [algorithms.gram_schmidt] silence numpy warning
- [#144] L2ProductP1 uses wrong quadrature rule in 1D case
- [#147] Debian doc packages have weird title
- [#151] add tests for ‘almost_equal’ using different norms
- [#156] Let thermal block demo use error estimator by default
- [#195] Add more tests / fixtures for operators in pymor.operators.constructions
- [#197] possible problem in caching
- [#207] No useful error message in case PySide.QtOpenGL cannot be imported
- [#209] Allow ‘pip install pymor’ to work even when numpy/scipy are not installed yet
- [#219] add minimum versions for dependencies
- [#228] merge fixes in python3 branch back to master
- [#269] Provide a helpful error message when cython modules are missing
- [#276] Infinite recursion in apply for IdentityOperator * scalar
pyMOR 0.3 (March 2, 2015)¶
- Introduction of the vector space concept for even simpler integration with external solvers.
- Addition of a generic Newton algorithm.
- Support for Jacobian evaluation of empirically interpolated operators.
- Greatly improved performance of the EI-Greedy algorithm. Addition of the DEIM algorithm.
- A new algorithm for residual operator projection and a new, numerically stable a posteriori error estimator for stationary coercive problems based on this algorithm. (cf. A. Buhr, C. Engwer, M. Ohlberger, S. Rave, ‘A numerically stable a posteriori error estimator for reduced basis approximations of elliptic equations’, proceedings of WCCM 2014, Barcelona, 2014.)
- A new, easy to use mechanism for setting and accessing default values.
- Serialization via the pickle module is now possible for each class in pyMOR. (See the new ‘analyze_pickle’ demo.)
- Addition of generic iterative linear solvers which can be used in conjunction with any operator satisfying pyMOR’s operator interface. Support for least squares solvers and PyAMG (http://www.pyamg.org/).
- An improved SQLite-based cache backend.
- Improvements to the built-in discretizations: support for bilinear finite elements and addition of a finite volume diffusion operator.
- Test coverage has been raised from 46% to 75%.
Over 500 single commits have entered this release. A full list of all changes can be obtained under the following address: https://github.com/pymor/pymor/compare/0.2.2...0.3.0