  We study planar clusters consisting of loops including a Josephson
$\pi$-junction ($\pi$-rings). Each $\pi$-ring carries a persistent current and
behaves as a classical orbital moment. The type of particular state associated
with the orientation of orbital moments at the cluster depends on the
interaction between these orbital moments and can be easily controlled, i.e. by
a bias current or by other means. We show that these systems can be described
by the two-dimensional Ising model with competing nearest-neighbor and diagonal
interactions and investigate the phase diagram of this model. The
characteristic features of the model are analyzed based on the exact solutions
for small clusters such as a 5-site square plaquette as well as on a mean-field
type approach for the infinite square lattice of Ising spins. The results are
compared with spin patterns obtained by Monte Carlo simulations for the 100
$\times$ 100 square lattice and with experiment. We show that the $\pi$-ring
clusters may be used as a new type of superconducting memory elements. The
obtained results may be verified in experiments and are applicable to adiabatic
quantum computing where the states are switched adiabatically with the slow
change of coupling constants.
