Closed skavou1 closed 8 years ago
I am not sure what your question is. Do you want to split the output file from Phon into one per grain?
Not exactly. I want to create cohesive element from neper output. In phon documentation you said:
in Phon documentation in insert interface elements you said: " The function requires some element sets with specific names to exist.
In a mesh each grain should have its own element set with the bulk elements. These should for a 3D mesh be called POLYx and for a 2D mesh be called FACEx where x is the grain id.
Each grain boundary should have its own element with the elements in the grain boundary. These elements will have a dimension one lower than the one of the bulk elements. The name for these sets should for a 3D mesh be called FACEx and for a 2D mesh be called EDGEx.
"
Because in the .msh file we just have information about nodes and elements, it does not give any information about polygonals. In the attachment, the .msh file is the output of neper, and I do not know how should I split it out.
Regards,
Sepideh
From: Kristoffer Carlsson notifications@github.com Sent: Wednesday, March 16, 2016 4:17 PM To: KristofferC/Phon Cc: Sepideh Kavousi Subject: Re: [Phon] create cohesive element from .msh format (#9)
I am not sure what your question is. Do you want to split the output file from Phon into one per grain?
You are receiving this because you authored the thread. Reply to this email directly or view it on GitHubhttps://github.com/KristofferC/Phon/issues/9#issuecomment-197552878
Dear Kristoffer beside the problem I have above, I also tried to use phon on your test files in " mesh_test_files/surface_mesh_stlGrain_1.msh,surface_mesh_stlGrain_2.msh,surface_mesh_stlGrain_3.msh"
I wrote my python script as
"
from phon.io.read.read_from_gmsh import read_from_gmsh
from phon.mesh_tools.create_cohesive_elements import create_cohesive_elements
from phon.io.write.export_to_abaqus import export_to_abaqus
basename='surface_meshstlGrain'
n_grain=3
mesh=read_from_gmsh(basename,n_grain)
create_cohesive_elements(mesh,mesh_dimension=3)
export_to_abaqus("cohesive_n10.inp", mesh, write_2d_elements=True )
"
when I run the script it gives an error which says:
File "cohesive-gmesh.py", line 7, in
File "/home/skavou1/anaconda3/lib/python3.5/site-packages/phon-0.1.0-py3.5.egg/phon/mesh_tools/create_cohesive_elements.py", line 62, in create_cohesive_elements
RuntimeError: OrderedDict mutated during iteration
Interesting. I will look at it.
Thanks. I also had the same problem with the my .inp output file from neper. it says :
line 62, in create_cohesive_elements RuntimeError: OrderedDict mutated during iteration
I attach the python script and my .inp files.
Regards,
Sepideh
From: Kristoffer Carlsson notifications@github.com Sent: Thursday, March 17, 2016 7:09 AM To: KristofferC/Phon Cc: Sepideh Kavousi Subject: Re: [Phon] create cohesive element from .msh format (#9)
Interesting. I will look at it.
You are receiving this because you authored the thread. Reply to this email directly or view it on GitHubhttps://github.com/KristofferC/Phon/issues/9#issuecomment-197850769
Yes, I see that I modify a dict that I am looping over which is not allowed. It should be simple to fix. Will get to it tomorrow or in the weekend.
Dear Kristoffer, Were you able to solve the problem? and would you please post the output of the phon for the th test example n10-id1.inp? Best, Sepideh
Sorry, I am quite busy now. The problem is that I modify the dictionary when I loop over it. The correct way to do it would be to copy the dictionary before looping and modify the copy. If you want you can attempt it yourself. I will try fix this but currently as I said, I am a bit too busy.
If you don't want to wait, try running Phon with Python 2.7. It should work ok there.
Dear Kristodder, Thank you for your help, But I could not solve the problem yet. I ran it with python 2.7.11 and try to add cohesive element to the file Phon/test/mesh_test_files/n10-id1.inp. It gave the error:
from phon.io.read.read_from_abaqus_inp import read_from_abaqus_inp from phon.mesh_tools.create_cohesive_elements import create_cohesive_elements from phon.io.write.export_to_abaqus import export_to_abaqus mesh=read_from_abaqus_inp("mesh.inp") create_cohesive_elements(mesh,mesh_dimension=3) Traceback (most recent call last): File "
", line 1, in File "build/bdist.linux-x86_64/egg/phon/mesh_tools/create_cohesive_elements.py", line 60, in create_cohesive_elements File "build/bdist.linux-x86_64/egg/phon/mesh_tools/create_cohesive_elements.py", line 331, in get_node_id_grain_lut KeyError: 20681
I also ran for the file Phon/test/mesh_test_files/n10_id1_from_abaq.inp too. It did not give any error but no cohesive element was imported.
Are you sure you have the latest version? I just ran this:
from phon.io.read.read_from_abaqus_inp import read_from_abaqus_inp
from phon.mesh_tools.create_cohesive_elements import create_cohesive_elements
from phon.io.write.export_to_abaqus import export_to_abaqus
from phon.io.write.export_to_abaqus import export_to_abaqus
mesh=read_from_abaqus_inp("../test/mesh_test_files/n10-id1.inp")
create_cohesive_elements(mesh, mesh_dimension=3)
export_to_abaqus("testmesh.inp", mesh, False)
And I get output with cohesive elements.
Thank you very much for your help. I re installed my phon on python and it worked out. using this method is it still needed to define contact between the cohesive element and the grains, as the nodes are in commen between the grains and the cohesive elements.
From: Kristoffer Carlsson notifications@github.com Sent: Thursday, April 14, 2016 2:09 AM To: KristofferC/Phon Cc: Sepideh Kavousi Subject: Re: [KristofferC/Phon] create cohesive element from .msh format (#9)
Are you sure you have the latest version? I just ran this:
from phon.io.read.read_from_abaqus_inp import read_from_abaqus_inp from phon.mesh_tools.create_cohesive_elements import create_cohesive_elements from phon.io.write.export_to_abaqus import export_to_abaqus from phon.io.write.export_to_abaqus import export_to_abaqus mesh=read_from_abaqus_inp("../test/mesh_test_files/n10-id1.inp") create_cohesive_elements(mesh, mesh_dimension=3) export_to_abaqus("testmesh.inp", mesh, False)
And I get output with cohesive elements.
You are receiving this because you authored the thread. Reply to this email directly or view it on GitHubhttps://github.com/KristofferC/Phon/issues/9#issuecomment-209794046
@KristofferC, @skavou1 The easiest way to make it run in Python 3.7 is to
OrderedDict
with dict
in phon/mesh_objects/mesh.py:
https://github.com/KristofferC/Phon/blob/1b09eb2af26151e6d5cb36f74c4de8c83a103bf4/phon/mesh_objects/mesh.py#L61-L79for element_set_name in list(mesh.element_sets):
For the example file n10-id1_2d.inp, it works in Python 3.7. Since Phon is not meant to be an Abaqus plugin (in which case the Python 2 support would be vital), I think the Python 2 support could be dropped.
Hello kristoffer Firt I want to thank you for your great software, Phon. For using phon I faces a problem. I used Neper to model grains inside the micro structure, next I used Phon Package in python to create cohesive element, but the problem is I have to split my mesh to files,the nodes and elements in each grain need to be written in separate file. . But in the .msh file I can not understand which file is related to which grain. Would you please help me to see in .msh file how should I define nodes for each grain or tessellation? Best Sepideh