The gravity model (GM) analogous to Newtons law of universal gravitation has successfully described the flow between different spatial regions, such as human migration, traffic flows, international economic trades, etc. This simple but powerful approach relies only on the mass factor represented by the scale of the regions and the geometrical factor represented by the geographical distance. However, when the population has a subpopulation structure distinguished by different attributes, the estimation of the flow solely from the coarse-grained geographical factors in the GM causes the loss of differential geographical information for each attribute. To exploit the full information contained in the geographical information of subpopulation structure, we generalize the GM for population flow by explicitly harnessing the subpopulation properties characterized by both attributes and geography. As a concrete example, we examine the marriage patterns between the bride and the groom clans of Korea in the past. By exploiting more refined geographical and clan information, our generalized GM properly describes the real data, a part of which could not be explained by the conventional GM. Therefore, we would like to emphasize the necessity of using our generalized version of the GM, when the information on such nongeographical subpopulation structures is available.