Development of a topological model for solar flares