  In this paper we explore the topological classes of thermodynamics of a
family of black holes. In particular we investigate the influence of distinct
fields, including the electric field, non-linear magnetic field, along with the
perfect fluid matter background that can mimic dark matter in large distances.
In light of these considerations, we shall henceforth denote this fluid as
perfect fluid dark matter (PFDM). Our analysis reveals that the winding and
topological numbers for the Schwarzschild and Kerr black holes in PFDM
background are the same as the Schwarzschild and Kerr black holes, however for
the Kerr-AdS background in PFDM we obtain a different topological number
compared to the Kerr black hole in PFDM. Furthermore, we explore in details the
interplay of electric charge and nonlinear magnetic charge, impacting the
topological classes of thermodynamics both in the absence and presence of PFDM.
Interestingly, it is demonstrated that the topological numbers associated with
the static Hayward black holes, both in the absence and presence of PFDM,
deviate from those of the Schwarzschild black hole. This observation shows that
the presence of a magnetic charge introduces an additional role and can alter
the topological numbers. Finally, our study culminates with the comprehensive
analysis of the topological numbers pertaining to the Hayward black hole,
considering the combined effects of PFDM and rotation.
