Imported from https://github.com/arnauldnzegha/deep2pde_Berg_Nystrom