  Using a statistical - mechanics approach, we study the effects of geometry
and entropy on the ordering of slender filaments inside non-isotropic
containers, considering cortical microtubules in plant cells, and packing of
genetic material inside viral capsids as concrete examples. Working in a mean -
field approximation, we show analytically how the shape of container, together
with self avoidance, affects the ordering of stiff rods. We find that the
strength of the self-avoiding interaction plays a significant role in the
preferred packing orientation, leading to a first-order transition for oblate
cells, where the preferred orientation changes from azimuthal, along the
equator, to a polar one, when self avoidance is strong enough. While for
prolate spheroids the ground state is always a polar like order, strong self
avoidance result with a deep meta-stable state along the equator. We compute
the critical surface describing the transition between azimuthal and polar
ordering in the three dimensional parameter space (persistence length,
container shape, and self avoidance) and show that the critical behavior of
this systems, in fact, relates to the butterfly catastrophe model. We compare
these results to the pure mechanical study in arXiv:1910.08171, and discuss
similarities and differences. We calculate the pressure and shear stress
applied by the filament on the surface, and the injection force needed to be
applied on the filament in order to insert it into the volume
