We report the development of a real-space approach to electronic-struc
ture calculations which utilizes adaptive curvilinear coordinates. A r
egular real-space mesh would be desirable from computational considera
tions because it produces a sparse, local, and highly structured Hamil
tonian, which enables the effective use of iterative numerical methods
and parallel-computer architectures. However, a regular real-space me
sh has equal resolution everywhere. This results in an inefficient dis
tribution of mesh points, since actual physical systems are inhomogene
ous. To remedy this inherent inefficiency without losing the computati
onal advantages of a regular mesh, we use a regular mesh in curvilinea
r coordinates, which is mapped by a change of coordinates to an adapti
ve mesh in Cartesian coordinates. We discuss in detail the choices inv
olved in the implementation of the method, including the form and opti
mization of the coordinate transformation, the expression for the disc
retized Laplacian, the regularization of the ionic potential for all-e
lectron calculations, the method of calculating the forces, and the al
gorithms used. Band-structure calculations have been implemented by ad
ding a phase shift at periodic boundary conditions. We report all-elec
tron calculations for atoms and molecules with 1s and 2p valence elect
rons, and pseudopotential calculations for molecules and solids.