Does martial law = UCMJ?

Martial law cannot be instituted within the United States if civilian courts are able to function, correct? So if there was a catastrophe (multiple nuclear attacks for example) and the military took over the judicial system would civilians be tried under the Uniform Code of Military Justice, the state’s penal code, or a combination of the two? Would courts-martial operate like they do for military personel?

Constitutional Topic - Martial Law

Martial Law - Wikipedia