kip-hart / MicroStructPy

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

Troubleshooting "Missing library for pygmsh on Linux" doesn't work #84

Closed keisukeiwahori closed 1 year ago

keisukeiwahori commented 1 year ago

Describe the bug Troubleshooting "Missing library for pygmsh on Linux" doesn't work.

To Reproduce Steps to reproduce the behavior:

  1. To install MicroStructPy, download it from PyPI using: pip install microstructpy
  2. Next, run the file from the command line: microstructpy input.xml
  3. OSError: libXcursor.so.1: cannot open shared object file: No such file or directory
  4. The libGLU library is misssing from the computer. To add it, run: sudo apt-get install libglu1
  5. Same error appears. OSError: libXcursor.so.1: cannot open shared object file: No such file or directory

Expected behavior When Step.4.

[sudo] password for iwahori: Reading package lists... Done Building dependency tree... Done Reading state information... Done Note, selecting 'libglu1-mesa' instead of 'libglu1' libglu1-mesa is already the newest version (9.0.2-1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Selected 'libglu1-mesa' instead of 'libglu1' is possible cause...

Screenshots error

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

keisukeiwahori commented 1 year ago

I could installed on windows system.

kip-hart commented 1 year ago

Hi @keisukeiwahori I'm glad you were able to find a solution! I've installed MicroStructPy on a couple Linux machines without running into this issue. If you do find a fix, please feel free to submit a PR and I'll be happy to merge it.

keisukeiwahori commented 1 year ago

Hello kip.harthttps://pypi.org/user/kip.hart/.

I’m keisuke iwahori form Japan. I enjoy your MicrostructPy.

Now, I want to create 3D microstructures and export the mesh data in ABAQUS format (if can, geometry data in .x_t or .igs format). I found a very attractive sentence in output file format. But, I can’t know where to change “format = abaqus” indicated in bellow. Can you tell me where the example file of 3D microstructures is? I can’t find the example of 3D microstructures in example folder.

@.***

@.***

From: Kip Hart @.> Sent: Wednesday, February 15, 2023 12:30 PM To: kip-hart/MicroStructPy @.> Cc: Keisuke Iwahori (岩堀 恵介) @.>; Mention @.> Subject: Re: [kip-hart/MicroStructPy] Troubleshooting "Missing library for pygmsh on Linux" doesn't work (Issue #84)

@.*** からのメールを受け取る頻度は高くありません。このことが重要である理由https://aka.ms/LearnAboutSenderIdentification

Hi @keisukeiwahorihttps://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkeisukeiwahori&data=05%7C01%7Ckeisuke.iwahori.j7p%40jp.denso.com%7Ccb5d5d4fb08b48cc548108db0f04efc7%7C69405920b6734f7c8845e124e9d08af2%7C0%7C0%7C638120286115031074%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=E3zswNGRrq4HTl1fuSyNI7roMDYivOQo8Va0dy1u%2B2w%3D&reserved=0 I'm glad you were able to find a solution! I've installed MicroStructPy on a couple Linux machines without running into this issue. If you do find a fix, please feel free to submit a PR and I'll be happy to merge it.

- Reply to this email directly, view it on GitHubhttps://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkip-hart%2FMicroStructPy%2Fissues%2F84%23issuecomment-1430700306&data=05%7C01%7Ckeisuke.iwahori.j7p%40jp.denso.com%7Ccb5d5d4fb08b48cc548108db0f04efc7%7C69405920b6734f7c8845e124e9d08af2%7C0%7C0%7C638120286115031074%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2Bdh9kOQ81cugcOvSpmtQ8tb6oJZ9qxaGdeqCRg6n53U%3D&reserved=0, or unsubscribehttps://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FA2W54KOPCTFEOBH27I5M7BDWXRET5ANCNFSM6AAAAAAU2AYFAI&data=05%7C01%7Ckeisuke.iwahori.j7p%40jp.denso.com%7Ccb5d5d4fb08b48cc548108db0f04efc7%7C69405920b6734f7c8845e124e9d08af2%7C0%7C0%7C638120286115031074%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CM8AHZK3UtjdTS5OJwPET7PLJdqO6jEIUPTEGp1brwU%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

kip-hart commented 1 year ago

HI @keisukeiwahori,

Yes you can output 3D microstructures to abaqus inp files. The documentation for this function is here: https://docs.microstructpy.org/en/latest/api/meshing/trimesh.html#microstructpy.meshing.TriMesh.write.

There is a 3D example file here: https://github.com/kip-hart/MicroStructPy/blob/master/src/microstructpy/examples/two_phase_3D.xml. It doesn't generate an abaqus inp file, but if you modify it like this you'll get an inp file:

<?xml version="1.0" encoding="UTF-8"?>
<input>
    <material>
        <fraction> 1 </fraction>
        <volume>
            <dist_type> lognorm </dist_type>
            <scale> 1 </scale>
            <s> 0.95 </s>
        </volume>
        <shape> sphere </shape>
        <name> Phase 1 </name>
    </material>

    <material>
        <fraction> 3 </fraction>
        <volume>
            <dist_type> lognorm </dist_type>
            <scale> 0.5 </scale>
            <s> 1.01 </s>
        </volume>
        <name> Phase 2 </name>
    </material>

    <domain>
        <shape> cube </shape>
        <side_length> 7 </side_length>
        <corner> (0, 0, 0) </corner>
    </domain>

    <settings>
        <directory> two_phase_3D </directory>
        <verbose> True </verbose>

        <filetypes>
            <tri> abaqus </tri> <!--This setting outputs the mesh as an abaqus inp file-->
        </filetypes>

        <seeds_kwargs>
            <linewidths> 0.2 </linewidths>
        </seeds_kwargs>
        <poly_kwargs>
            <linewidths> 0.2 </linewidths>
        </poly_kwargs>
        <tri_kwargs>
            <linewidths> 0.2 </linewidths>
        </tri_kwargs>
    </settings>
</input>

Currently the output use the part/assembly options in Abaqus. I'm working on updating this to just be nodes and elements, but haven't pushed that to the repo yet. Let me know if I can help further.

keisukeiwahori commented 1 year ago

Hello kip.harthttps://pypi.org/user/kip.hart/.

Thank you for the quick reply. I can generate an abaqus inp file. I checked inp file directly. Maybe I think the information I want is contained. (Node, Element, Element set, surface・・)

Thank you!

From: Kip Hart @.> Sent: Tuesday, February 28, 2023 10:43 AM To: kip-hart/MicroStructPy @.> Cc: Keisuke Iwahori (岩堀 恵介) @.>; Mention @.> Subject: Re: [kip-hart/MicroStructPy] Troubleshooting "Missing library for pygmsh on Linux" doesn't work (Issue #84)

@.*** からのメールを受け取る頻度は高くありません。このことが重要である理由https://aka.ms/LearnAboutSenderIdentification

HI @keisukeiwahorihttps://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkeisukeiwahori&data=05%7C01%7Ckeisuke.iwahori.j7p%40jp.denso.com%7Cb3e25528478b44ae978c08db192d1155%7C69405920b6734f7c8845e124e9d08af2%7C0%7C0%7C638131453598715986%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=UqYgOS6lcfqedmW1ChM6%2FV2qTsE8fDsXNI3FE1g389Q%3D&reserved=0,

Yes you can output 3D microstructures to abaqus inp files. The documentation for this function is here: https://docs.microstructpy.org/en/latest/api/meshing/trimesh.html#microstructpy.meshing.TriMesh.writehttps://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microstructpy.org%2Fen%2Flatest%2Fapi%2Fmeshing%2Ftrimesh.html%23microstructpy.meshing.TriMesh.write&data=05%7C01%7Ckeisuke.iwahori.j7p%40jp.denso.com%7Cb3e25528478b44ae978c08db192d1155%7C69405920b6734f7c8845e124e9d08af2%7C0%7C0%7C638131453598715986%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=pChF9Ne29HKbNF9cy7oNbLoTW%2Bad9A%2FZsg5jhj4mhv8%3D&reserved=0.

There is a 3D example file here: https://github.com/kip-hart/MicroStructPy/blob/master/src/microstructpy/examples/two_phase_3D.xmlhttps://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkip-hart%2FMicroStructPy%2Fblob%2Fmaster%2Fsrc%2Fmicrostructpy%2Fexamples%2Ftwo_phase_3D.xml&data=05%7C01%7Ckeisuke.iwahori.j7p%40jp.denso.com%7Cb3e25528478b44ae978c08db192d1155%7C69405920b6734f7c8845e124e9d08af2%7C0%7C0%7C638131453598715986%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2FstcW7i0WT7xQph9fIbBk9SxyyrdP8QpXxEWCWY8qKA%3D&reserved=0. It doesn't generate an abaqus inp file, but if you modify it like this you'll get an inp file:

<?xml version="1.0" encoding="UTF-8"?>

<material>

    <fraction> 1 </fraction>

    <volume>

        <dist_type> lognorm </dist_type>

        <scale> 1 </scale>

        <s> 0.95 </s>

    </volume>

    <shape> sphere </shape>

    <name> Phase 1 </name>

</material>

<material>

    <fraction> 3 </fraction>

    <volume>

        <dist_type> lognorm </dist_type>

        <scale> 0.5 </scale>

        <s> 1.01 </s>

    </volume>

    <name> Phase 2 </name>

</material>

<domain>

    <shape> cube </shape>

    <side_length> 7 </side_length>

    <corner> (0, 0, 0) </corner>

</domain>

<settings>

    <directory> two_phase_3D </directory>

    <verbose> True </verbose>

    <filetypes>

        <tri> abaqus </tri> <!--This setting outputs the mesh as an abaqus inp file-->

    </filetypes>

    <seeds_kwargs>

        <linewidths> 0.2 </linewidths>

    </seeds_kwargs>

    <poly_kwargs>

        <linewidths> 0.2 </linewidths>

    </poly_kwargs>

    <tri_kwargs>

        <linewidths> 0.2 </linewidths>

    </tri_kwargs>

</settings>

Currently the output use the part/assembly options in Abaqus. I'm working on updating this to just be nodes and elements, but haven't pushed that to the repo yet. Let me know if I can help further.

- Reply to this email directly, view it on GitHubhttps://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkip-hart%2FMicroStructPy%2Fissues%2F84%23issuecomment-1447436718&data=05%7C01%7Ckeisuke.iwahori.j7p%40jp.denso.com%7Cb3e25528478b44ae978c08db192d1155%7C69405920b6734f7c8845e124e9d08af2%7C0%7C0%7C638131453598715986%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=I1o5nmmCLmqo%2FFGjMywR8e85mIVCAmd%2F8hFzcAGRoP4%3D&reserved=0, or unsubscribehttps://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FA2W54KMYBY23VXVSUNQHONLWZVJYTANCNFSM6AAAAAAU2AYFAI&data=05%7C01%7Ckeisuke.iwahori.j7p%40jp.denso.com%7Cb3e25528478b44ae978c08db192d1155%7C69405920b6734f7c8845e124e9d08af2%7C0%7C0%7C638131453598715986%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7xaJhOhBCTL596Jf1HtpALfwIDH6pBHb6BDSsz03gPw%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>