This gist provides an example of how to only include parts of others' repository as submodule in your project.
What is more, it will also show how to "put" the folders of submodule to desired location (e.g. under your project's root), without breaking the submodule.
Consider we have a repository
Simulation
- README.md
There is one another repository we want to use, but only the algorithm folder is needed.