Electrothermal model of switching in amorphous boron and silicon thin films