added write function to Topology class, changed name from TopologyInput to Topology