Is it possible to automate the inspire auto-mesh?

Bocaj22
Bocaj22 Altair Community Member
edited November 2022 in Community Q&A

I've generally found the Inspire 3D automatic mesh settings to be pretty good. I'd like to be able to initiate this from a script. Is this possible? I know I can do tetra volume mesh in Hypermesh. If that's what Inspire is doing in the background, what settings does it use? I assume it calculates many of the parameters automatically (like mesh size), which sounds like the tricky part.

 

Thanks,

Jacob

Answers

  • Adriano A. Koga
    Adriano A. Koga
    Altair Employee
    edited January 2022

    Inspire uses SimLab automation for its 3D mesh. Have you tried SimLab?

    There is a SimLab learning center where you can take a look at some nice videos there.

     

    Also inside HyperMesh you have the Mesh Controls, inherited from SL. It would be another option.

  • Bocaj22
    Bocaj22 Altair Community Member
    edited January 2022

    Adriano,

    Thanks for your reply. I will look into SimLab.

     

    What exactly do you mean that Hypermesh inherits the mesh controls from SimLab? Are you referring to something other than what's available under the "tetramesh" panel?

  • Adriano A. Koga
    Adriano A. Koga
    Altair Employee
    edited January 2022
    bocaj22 said:

    Adriano,

    Thanks for your reply. I will look into SimLab.

     

    What exactly do you mean that Hypermesh inherits the mesh controls from SimLab? Are you referring to something other than what's available under the "tetramesh" panel?

    image

  • Bocaj22
    Bocaj22 Altair Community Member
    edited February 2022

    Thanks again for your help. I just now discovered the Inspire Python API introduced in 2021.2. This appears to be the most efficient solution. So to pivot a little bit, any tips for running Inspire in batch mode? I'd like to run one of the demo scripts, which I've modified below. This script appears to run correctly in the GUI, but I cannot get it to run in batch mode, when following the directions below.

    from hwx import inspire from hwx.inspire.demo import openDemoFile openDemoFile('ThreeBlocks.stmod') # Customize params params = inspire.LatticeOptimization.Params(gravity=True) params.massTargets = {"percent": 60} setting = "Inspire/Run Options/Run Options/Run history path" file = inspire.getSettings(setting) + "/demo.fem" # Save the fem file inspire.LatticeOptimization.export(file, params)

     

    image

  • Julien Dufrenne
    Julien Dufrenne New Altair Community Member
    edited November 2022
    bocaj22 said:

    Thanks again for your help. I just now discovered the Inspire Python API introduced in 2021.2. This appears to be the most efficient solution. So to pivot a little bit, any tips for running Inspire in batch mode? I'd like to run one of the demo scripts, which I've modified below. This script appears to run correctly in the GUI, but I cannot get it to run in batch mode, when following the directions below.

    from hwx import inspire from hwx.inspire.demo import openDemoFile openDemoFile('ThreeBlocks.stmod') # Customize params params = inspire.LatticeOptimization.Params(gravity=True) params.massTargets = {"percent": 60} setting = "Inspire/Run Options/Run Options/Run history path" file = inspire.getSettings(setting) + "/demo.fem" # Save the fem file inspire.LatticeOptimization.export(file, params)

     

    image

    Same issue here with -b option... nothing appends. @bocaj22 Have you fixed your issue with batch mode ?

  • Bocaj22
    Bocaj22 Altair Community Member
    edited November 2022

    Same issue here with -b option... nothing appends. @bocaj22 Have you fixed your issue with batch mode ?

    Hi Julien,

    I was able to fix my issue. I don't recall exactly what I changed, but it stemmed from some of my commands not working or available in batch mode. I added a logger to the Python script (suggested by Altair support), to determine which line of the script fails and worked from there.

    def logger(msg="",file="D:\\delete\\log.log"):      with open(file,"a+") as f1:           f1.write(msg+"/n")

     

    Use with: logger("YOUR MESSAGE")