  Dark energy (DE) is not necessarily uniform when other sources of gravity are
present: interaction with matter leads to its variation in space and time. We
study cosmological implications of this fact by analyzing cosmological models
in which DE density interacts with matter and thus changes with time. We model
the DE--matter interaction by specifying the rate of change of the DE density
as an arbitrary function of it and the density of matter, in a single--phase
case. In the case of several matter components interacting with dark energy we
assume the rate of every interacting phase density to be an arbitrary function
of this density and the DE density. We describe some properties of cosmological
solutions valid for a general law of DE--matter interaction, and discuss
physical admissibility of the interaction laws. We study numerous families of
exact solutions, both singular, non-singular, and mixed. Some of them exhibit
interesting properties, such as, for instance, absence of the horizon problem
due to the initial fast growth of the scale factor (any power of time
possible); non-singular evolution from one de Sitter universe (pure DE with no
matter) to the other one with a different DE density; DE dominating either from
some moment of time on, or throughout the expansion; dark matter dominating
normal matter at large times without any parameter tuning, and so on. All the
results are obtained strictly within the framework of general relativity,
Einstein's theory of gravity, without modifying it in any way.
