kip-hart / MicroStructPy

Microstructure modeling, mesh generation, analysis, and visualization.
https://docs.microstructpy.org
MIT License
68 stars 19 forks source link

how to export the abaqus files? #43

Closed xiaomintongxue closed 2 years ago

xiaomintongxue commented 2 years ago

I have used "pip install" the module and run the example but the export all txt file. the document show let the ‘format=“abaqus” ’ and i do this in the installed file that the path“Lib\site-packages\microstructpy\meshing\trimesh.py”. After that i re-run the example there haven't export abaqus file,whats the problem? i need your advice. Or i should change the compiled file of the trimesh.py? Really thanks~ Looking forward to your reply!

kip-hart commented 2 years ago

Sorry to hear you are having issues with the abaqus formatted output files.

For an XML example, create a file (debug_input.xml) that contains this:

<input>
    <material>
        <shape> circle </shape>
        <size> 0.09 </size>
    </material>

    <domain>
        <shape> square </shape>
    </domain>

    <settings>
        <mesher> gmsh </mesher>
        <filetypes>
            <tri> abaqus </tri>
        </filetypes>
    </settings>
</input>

then run microstructpy debug_input.xml. When I run this on my computer, I get an Abaqus .inp file.

If you are using MicroStructPy in a Python script, you can add the option format='abaqus' to the TriMesh.write() function call.

The XML usage is explained on the Settings page of the documentation and the script usage is explained on the TriMesh page.

Please let me know if this helps resolve your issue. Also let me know if you have any feature requests related to the output Abaqus .inp file. I developed this for my own use case, so if there is a feature you would like to see please let me know.

xiaomintongxue commented 2 years ago

very thanks. i am sorry for my careless fault to disturb you. In the help of you i have run the example successful. Well, i have another question that when i get the inp file and import to the abaqus, how to render the grid or the Voronoi in different color?

xiaomintongxue commented 2 years ago

continue to the last question. In the abaqus shows by Sets the grid are rendered in different color. Thanks~

kip-hart commented 2 years ago

I'm glad to hear it's working. I'm going to close this issue. If there is an issue with the Abaqus inp files created by MicroStructPy, please create another issue and I will look into it. Thanks!