A numerical algorithm for computing the runup of a solitary tsunami wave in the case of complex shoreline topography is proposed. The algorithm involves the construction of coordinate mappings that transform a uniform rectangular grid over a reference computational domain into a grid over a physical domain with mesh refinement near the shoreline. The application of such coordinate mappings makes it possible to substantially reduce the number of grid points and save computation time. The mathematical model is based on the shallow water equations, and the problem is solved using the large particle method. An actual example is used to illustrate the computation of a curvilinear grid and the inundation area configuration.