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

Bug Report #2

Closed
cloneorcopy opened this issue Mar 26, 2024 · 2 comments
Closed

Bug Report #2

cloneorcopy opened this issue Mar 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@cloneorcopy
Copy link
Contributor

Dear Yihao-Shi:

I got some trouble in import material file when using mpm model.

Funtion MPM.add_body_from_file error

MPM.add_body_from_file()->self.generator.read_body_file()->generator.begin()->self.add_txt_body()
->fix_v = DictIO.GetEssential(self.FIX, fix_v_str) 

In src\mpm\generator\LoadFromFile.py line146 may fix as follow (the same as BodyGenerator):

fix_v = vec3u8([DictIO.GetEssential(self.FIX, is_fix) for is_fix in fix_v_str])

Trackback is as follows:

unhashable type: 'list'
  File "E:\EX_library\GeoTaichi-fork\GeoTaichi\src\utils\ObjectIO.py", line 39, in GetEssential
    if keyWord in dict:
  File "E:\EX_library\GeoTaichi-fork\GeoTaichi\src\mpm\generator\LoadFromFile.py", line 146, in add_txt_body
    fix_v = DictIO.GetEssential(self.FIX, fix_v_str)
  File "E:\EX_library\GeoTaichi-fork\GeoTaichi\src\mpm\generator\LoadFromFile.py", line 69, in begin
    self.add_txt_body(scene, self.myTemplate)
  File "E:\EX_library\GeoTaichi-fork\GeoTaichi\src\mpm\GenerateManager.py", line 69, in read_body_file
    generator.begin(scene)
  File "E:\EX_library\GeoTaichi-fork\GeoTaichi\src\mpm\mainMPM.py", line 146, in add_body_from_file
    self.generator.read_body_file(body, self.sims, self.scene)
  File "E:\EX_library\GeoTaichi-fork\GeoTaichi\DGb.py", line 75, in <module>
    mpm.add_body_from_file(body={"FileType":'TXT',
TypeError: unhashable type: 'list'

Thank you for your reply.

Yihao-Shi added a commit that referenced this issue Mar 27, 2024
@Yihao-Shi
Copy link
Owner

Thank you! We have fixed it.

@cloneorcopy
Copy link
Contributor Author

Thank you for your reply! There are other problems in funtion MPM.add_body_from_file. I tried to fix them by myself. The detail I made change is in my pull requests. I have test it and it can works.

@Yihao-Shi Yihao-Shi added the bug Something isn't working label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants