A novel method to simulate ion cyclotron wave coupling in the edge of a tokamak plasma with the finite element technique is presented. It is applied in the commercial software COMSOL Multiphysics. Its main features include the perfectly matched layer (PML) technique to emulate radiating boundary conditions beyond a critical cutoff layer for the fast wave (FW), full-wave propagation across the inhomogeneous cold peripheral plasma and a detailed description of the wave launcher geometry. The PML technique, while widely used in numerical simulations of wave propagation, has scarcely been used for magnetized plasmas, due to specificities of this gyrotropic material. A versatile PML formulation, valid for full dielectric tensors, is summarized and interpreted as wave propagation in an artificial medium. The behavior of this technique has been checked for plane waves on homogeneous plasmas. Wave reflection has been quantified and compared to analytical predictions. An incompatibility issue for adapting the PML for forward (FW) and backward (slow wave (SW)) propagating waves simultaneously has been evidenced. In a tokamak plasma, this critical issue is overcome by taking advantage of the inhomogeneous density profile to reflect the SW before it reaches the PML. The simulated coupling properties of a Tore Supra ion cyclotron resonance heating (ICRH) antenna have been compared to experimental values in a situation of good single-pass absorption. The necessary antenna elements to include in the geometry to recover the coupling properties obtained experimentally are also discussed.