Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign an initial velocity to the entity. #279

Open
Xujxyang opened this issue Dec 24, 2024 · 2 comments
Open

Assign an initial velocity to the entity. #279

Xujxyang opened this issue Dec 24, 2024 · 2 comments

Comments

@Xujxyang
Copy link

Xujxyang commented Dec 24, 2024

Thank you for the excellent work! I would like to use the MPM solver organized here to perform some simulations. However, I noticed that it doesn't seem possible to directly set the initial velocity for an entity in add_entity()

def add_entity(
or gs.morphs
class Morph(Options):

How should I achieve this?
(A more specific question is: Can I use particles for initialization and assign them an initial velocity?)

@zhenjia-xu
Copy link
Collaborator

You can manually set velocity after the scene is built.
Please use this function: link
Here is an example: link

@Xujxyang
Copy link
Author

Xujxyang commented Dec 24, 2024

Thank you very much for your response! However, I’ve encountered another tricky issue.

I am running the example on a server with a single NVIDIA 4090 GPU. When executing this line of code

, the method here
num_devices = egl.EGLint()
returns a count of 0, which causes this section
devices = query_devices()
to fail in retrieving the GPU ID. As a result, the program cannot proceed further. Do you have any suggestions or solutions for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants