We developed a frequency-domain finite-element method (FFEM) in conjunction with a complex-frequency-shifted perfectly matched layer (CFS-PML) boundary to effectively study the wavefield generated by acoustic multipole logging-while-drilling (LWD) tools in horizontal and highly deviated wells. With such an FFEM, the sources and receivers can be easily set symmetrically in the simulation to model the real tools exactly, while this is very difficult to deal with in the finite-difference method. In addition, the CFS-PML boundaries can be implemented more efficiently in this algorithm. We applied this method to study the effects of tool eccentricity on the measurements in slow formations that most likely need 3D solutions for LWD in horizontal and highly deviated wells. We found that because the tool cannot be centralized in these wells, some nonmonopole modes could appear in monopole measurements and the Stoneley mode could appear in dipole measurements; the flexural collar wave could become increasingly strong with an increase of tool eccentricity, and the Stoneley mode may be the later arriving event, especially in the case of a severely eccentric quadrupole tool. Based on these studies, we introduced a method to quantify the extent and the angle of the tool eccentricity with the phase difference in eccentric dipole measurements. These parameters are very useful for the analysis of the bottom-hole assembly performance in geosteering.