changing bfam_domain_p4est to use base instead of d
energy calculations plus changing some ints to bfam_loc_idx