Modeling of amorphous carbon structures with arbitrary structural constraints