KristofferC / Phon

Insert cohesive elements between grains in microstructures
MIT License
29 stars 19 forks source link

Error while using phon.mesh_tools.create_matrix.create_matrix(mesh, thickness, order) #13

Closed SagarChandra closed 8 years ago

SagarChandra commented 8 years ago

Dear Proff. Kristoffer,

Thanks for such a nice code. I recently encountered an error while trying to give a finite thickness to cohesive (hexahedral) elements using Phon 0.4. I used the following set of commands. in order:-

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("sample_10grains.inp") create_cohesive_elements(mesh, mesh_dimension=3) phon.mesh_tools.create_matrix.create_matrix(mesh, 0.0001, 3)

Traceback (most recent call last): File "", line 1, in NameError: name 'phon' is not defined

The last statement was taken as-a hint from

http://web.student.chalmers.se/~kricarl/phon/_build/html/library/mesh_tools.html

where, at last, it says that to create cohesive elements with finite width, the com sample_10grains.txt

mand is:-

_phon.mesh_tools.create_matrix.creatematrix(mesh, thickness, order)

Where am i doing wrong? Could you please guide me on this front? I am attaching the .inp file (.txt format) exported from Neper.

Thanks for your help.

Sincerely

SagarChandra commented 8 years ago

Dear Proff. Kristoffer,

I seem to make some progress, and used the following command for create_matrix.

from phon.mesh_tools.create_matrix import create_matrix

The error of "name 'phon' is not defined" was gone, but when i entered the following command to give thickness to cohesive elements,

create_matrix(mesh, 0.0001, 3)

following was the screen output:-

WARNING:phon.mesh_tools.create_matrix:Method does currently only move the nodes in the interface between the grains. This means that excessive thickness will lead to bad mesh quality. Traceback (most recent call last): File "", line 1, in File "phon/mesh_tools/create_matrix.py", line 62, in create_matrix create_cohesive_elements(mesh, mesh_dimension) File "phon/mesh_tools/create_cohesive_elements.py", line 74, in create_cohesive_elements grain_id_1 = grains_connected_to_face[0] IndexError: list index out of range

I searched the archives, and this issue seems similar to the one reported here:- https://github.com/KristofferC/Phon/issues/5

Please guide as to what needs to be done. I am using Phon 0.4.

Thank you.

SagarChandra commented 8 years ago

Dear Proff. Kristoffer,

The issue is resolved now. I am pasting the set of commands that should be used, in order, so that other users can take a note of it:-

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("n10-id1.inp") from phon.mesh_tools.create_matrix import create_matrix create_matrix(mesh, 0.0001, 3) export_to_abaqus("cohesive_file.inp", mesh, write_2d_elements=False)

The issue will now be closed.