5 ways to select geometry in Abaqus using Python scripts

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024

Комментарии • 51

  • @arashkhanegol
    @arashkhanegol Год назад +1

    I just came across your channel when I was searching for methods of selecting geometry. Your channel and website are amazing. Thank you.

  • @hosseinfallahi7306
    @hosseinfallahi7306 5 месяцев назад +1

    I couldn't find better than your explanation regarding this problem. Thank you!

  • @mauriciocantalapiedrasanmi6757
    @mauriciocantalapiedrasanmi6757 2 года назад +3

    Very useful to avoid errors!

  • @mohamadhoseinghatrenabi5601
    @mohamadhoseinghatrenabi5601 2 года назад +2

    Awsome Material. Gave me the idea how to fix my code for better performance. Really appreciate this content, since it's very scarce to come by.

  • @behzadhashemisoudmand9814
    @behzadhashemisoudmand9814 2 года назад +2

    very practical and useful 👌👌👌

  • @imaneferradj9606
    @imaneferradj9606 Месяц назад

    awesome video! Thank you so much!

  • @aryaamiri710
    @aryaamiri710 8 месяцев назад +1

    This video was super helpful for me. It is amazing. Thanks so much.

  • @lucasgiglistre3429
    @lucasgiglistre3429 2 года назад +2

    WOW, thank you, that helped me a lot

    • @tecnodigitalschool
      @tecnodigitalschool  2 года назад

      Glad it helped!

    • @lucasgiglistre3429
      @lucasgiglistre3429 2 года назад +1

      @@tecnodigitalschool Just a question, is there other attribute than size that we can get with the driect selection ? The orientation for example.

    • @tecnodigitalschool
      @tecnodigitalschool  2 года назад

      @@lucasgiglistre3429 Sure! For instance, if you select a face, you can obtain the normal vector using "getNormal()", you can also "getCentroid()" of a face. In the case of an edge, you could get its vertices with "getVertices()" and then determine its direction from the positions of these vertices (p.vertices[someindex].pointOn).

  • @engineering_software
    @engineering_software Год назад +1

    Wonderful explanation!

  • @danialbiazar6647
    @danialbiazar6647 Год назад +1

    thank you very much for this helpful video, keep going

  • @FernandoGarcia-wx1ib
    @FernandoGarcia-wx1ib Год назад +1

    Thank you very much, excellent video, and very well explained. Is there a simple way to select all visible cells on screen? (something like select=all)... thanks!

    • @tecnodigitalschool
      @tecnodigitalschool  Год назад

      Thank you very much!!
      I'm not sure if there is some selection that depends on the viewport. At least, I haven't seen that in the documentation.
      If you only need all the cells of a part you can just write:
      p.cells
      Or you can use one of the "getByBounding..." methods, like:
      p.getByBoundingBox
      I am not sure if this answers your question.
      Best regards!

    • @FernandoGarcia-wx1ib
      @FernandoGarcia-wx1ib Год назад +1

      @@tecnodigitalschool Thanks again! I tried what you told me and it works perfectly. (Saved me a lot of work). Best regards.

    • @tecnodigitalschool
      @tecnodigitalschool  Год назад

      Awesome!!
      Cheers!

  • @jumpshot-zz1uy
    @jumpshot-zz1uy 8 месяцев назад +1

    Hello!thanks for your tutorial, I just have a question about how to select elements in abaqus using the"getsequencemask"?

    • @tecnodigitalschool
      @tecnodigitalschool  8 месяцев назад +1

      The "getSequenceFromMask" method is internally used by Abaqus. In fact, it's the default recorded in the rpy and jnl files.
      However, I don't recommend using it since it's opaque for the user. FindAt, and getByBounding methods are a lot more intuitive and easy to use.
      Anyways, I'll be happy to clarify your questions about it.

  • @Daniel-gv9gr
    @Daniel-gv9gr 2 месяца назад +1

    Hi, great video thank you!
    I am trying something similar like you in this case, the difference is, that I want to create the sets after meshing/on an orphan mesh. Do you have a video for that as well?

    • @tecnodigitalschool
      @tecnodigitalschool  2 месяца назад +1

      Hello Daniel,
      Dealing with orphan meshes, you can apply the same methods excepting findAt.
      You can use getByBounding functions (for nodes and elements), booleans (with sets), and direct selection.
      If you use direct selection, you will be iterating through your elements (or nodes) and picking them based on some preferences. Like this you'll end up with a list of elements, however this list is not valid to create a set because you need a sequence (as with geometry, you don't use a list of faces, but a sequence of faces). You have to convert the list of elements into a sequence with the function:
      import mesh
      mesh.MeshElementArray(list_of_faces)
      In the case of nodes, the function is mesh.MeshNodeArray(list_of_nodes).
      Best regards!
      Miguel

    • @Daniel-gv9gr
      @Daniel-gv9gr 2 месяца назад +1

      @@tecnodigitalschool Hi Miguel,
      Thank you for your reply!
      I generated a MeshFaceArray based on my mesh faces that I need, but now struggle to create a surface in the part as I receive Type errors

    • @tecnodigitalschool
      @tecnodigitalschool  2 месяца назад +1

      @@Daniel-gv9gr Creating a surface based on face elements is a bit trickier:
      1) You have to identify the face number within the element.
      2) Group those faces with the same numbers (e.g. all FACE1 together)
      3) Create a MeshElementArray with the elements of each group of faces (e.g. elemsFace1, elemsFace2...)
      4) Create the surface using the corresponding arguments (e.g. p.Surface(face1Elements=elemsFace1, face2Elements=elemsFace2))
      You can find all the details about the arguments of the Surface() function in the docs. Scripting reference > Python commands > Region commands > Surface object

    • @Daniel-gv9gr
      @Daniel-gv9gr 2 месяца назад

      @@tecnodigitalschool Hi Miguel,
      thank you so much for your Help. Regarding step 3 I think this should be MeshFaceArrays ? If I use that it creates a surface :)
      Alternatively one can create surfaces with MeshNodeArrays but those look like a regular set not like a surface.

    • @tecnodigitalschool
      @tecnodigitalschool  2 месяца назад +1

      ​@@Daniel-gv9gr ok, that's great!
      I missed that in the docs, Surface also accepts MeshFaces which makes complete sense 😅.
      Congrats @Daniel-gv9gr !

  • @hosseinghorbani_menghari2956
    @hosseinghorbani_menghari2956 Год назад +1

    hello, Thank you for your great video. I am trying to simulate multi-particle FEM using abaqus . I wrote a script and generate the particle and other parts. Using your video I managed to define edge or surface of my box. and now I want to cutoff some element which are outside of my box But I did not solve this problem. Could you please help me?

    • @tecnodigitalschool
      @tecnodigitalschool  Год назад

      Hello Hossein.
      You're welcome!
      If the elements that you want to remove belong to an orphan mesh, you can delete them directly.
      However, if the mesh of your model comes from meshing the geometry (in most cases is like that), then you should cut your part before meshing to get the final geometry.
      Best regards!

  • @benferguson1669
    @benferguson1669 Год назад +1

    Thanks, this is very useful. What would happen if we had an orphan mesh and we wanted to use select a series of faces by angle with script?

    • @tecnodigitalschool
      @tecnodigitalschool  Год назад

      Hello Ben,
      Absolutely! If you have one face selected, for instance:
      >> elem1 = p.elements[0]
      >> face1 = elem1.faces[0]
      Then, you can use the method 'getElemFacesByLimitingAngle' of the face. This will return the neighboring faces given an angle (tangency tolerance):
      >> faces = face1.getElemFacesByLimitingAngle(5)
      In this way, faces will contain all the faces which are approximmately tangent to face1 (within a tolerance of 10º).
      I recommend you to explore all the methods provided not only by purely geometrical objects, (vertices, edges, faces and cells) and mesh objects (elements and nodes), but also "hybrid" mesh-geometry objects (elementFaces, elementEdges...). They provide hundreds of possibilties and combinations which save tons of time.
      Quick tip: you can use the 'highlight' function to visualize the faces (or whatever) selected. For instance:
      >> highlight(face1) # This will highlight face1 in the viewport
      >> unhighlight(face1) # This will unhighlight face1
      This is extremely practical for debugging purposes.
      Best regards!

    • @benferguson1669
      @benferguson1669 Год назад +1

      @@tecnodigitalschool Wow, thank you Miguel for this detailed explanation. I will explore your school further

  • @ADILJAN723
    @ADILJAN723 6 месяцев назад +1

    how to select elements or cell to in link "Interaction with "Time Steps" . I mean at the first step has to activate one elements in the bar element to link in the "interaction steps" like Welding or Additive Manufacturing process simulation , and second step has to select second element to activate to second elment to link second "Interaction steps" . Thanks.

    • @tecnodigitalschool
      @tecnodigitalschool  6 месяцев назад +1

      Hi ADILJAN,
      I guess you are talking about activating different regions of your model at different steps, right?
      If so, you can create different sets for the regions that you want to activate using any of the methods described in this video, and then create an interaction of type "Model change". In the definition of this interaction you can refer to the sets created previously.
      Best regards!
      Miguel

    • @ADILJAN723
      @ADILJAN723 6 месяцев назад

      @@tecnodigitalschool Thank you very much for your quick replay. as I new beginner, I have some difficulty to do it by myself , I would be very much appreciated if you could help me with following example, first I created "Step " as such : mdb.models['Model-1'].StaticStep(name='Step-1', previous='Initial',
      maxNumInc=10000, initialInc=0.01, maxInc=0.1)
      this is the in the case of selecting cell :
      c1 = a.instances['Part-1-1'].cells
      cells1 = c1.getSequenceFromMask(mask=('[#1 ]', ), )
      region =a.Set(cells=cells1, name='Set-1')
      mdb.models['Model-1'].ModelChange(name='Int-1', createStepName='Step-1',
      region=region, activeInStep=False, includeStrain=False)
      and this one is in the case of selecting element
      e1 = a.instances['Part-1-1'].elements
      elements1 = e1.getSequenceFromMask(mask=(
      '[#80200 #0:5 #8020000 #0:2 #80200000 #0:5 #20000000',
      ' #80 #0:2 #802 #0:5 #80200 ]', ), )
      region =a.Set(elements=elements1, name='Set-2')
      how to change "Mask" to select cell , or in the second case select element ? Thanks

  • @tarhouniw
    @tarhouniw Год назад +1

    thank you very much for this useful video.
    I found a problem to select the external surface of a cylinder with the getByBoundingCylinder function. all surfaces of the cylinder are selected.
    >>> external_radius=30
    >>> highlight(f.getByBoundingCylinder(center1=(0,0,0.),center2=(0,0,80),radius=external_radius))
    how to select only the external surfaces with the getByBoundingCylinder function?

    • @tecnodigitalschool
      @tecnodigitalschool  Год назад +1

      Selecting only the external surface (without the lids) is not possible just with the getByBoundingCylinder.
      I find 2 approaches for this:
      1) If the cylindrical surface is made of a single face, I would simply use the findAt function.
      2) If the cylindrical surface is made of many faces, then I would follow these steps:
      i - Set-1. Create a set of faces with all the faces: external surface + lids.
      ii - Set-2. Create a set of faces only with the lids.
      iii - Use a boolean substraction between both sets.
      p.SetByBoolean(name='SURF_EXT', operation=DIFFERENCE, sets=(p.sets['Set-1'], p.sets['Set-2'], ))
      I hope you find this useful!

    • @tarhouniw
      @tarhouniw Год назад +1

      @@tecnodigitalschool Thank you very much for your reply

  • @maxmin111
    @maxmin111 10 месяцев назад +1

    How to get intellisense for abacus key word in notepad++ or VisualStudio, Thanks for your answer

    • @tecnodigitalschool
      @tecnodigitalschool  10 месяцев назад

      Hi!
      Apparently there isn't a native way to do it just with Abaqus.
      However, I found a Github repo to solve this issue, so that we can have autocompletion and read the docs directly from VisualStudio or any other IDE.
      This is the link to that repo:
      github.com/haiiliin/abqpy
      It's very promising and who knows, maybe with Abaqus 2024 and Python 3.10, we could see some major improvements in terms of interaction and debugging (Abaqus PDE).
      Best regards!
      Miguel

    • @maxmin111
      @maxmin111 10 месяцев назад +1

      @@tecnodigitalschool May you please let me know intellisense setup about notepad++

    • @tecnodigitalschool
      @tecnodigitalschool  10 месяцев назад

      @@maxmin111 This will work in a Python IDE like Visual Studio Code, PyCharm, Spyder... A Python IDE is able to communicate with the Python interpreter and libraries, whereas Notepad++ is a text editor and the autocompletion works very differently (npp-user-manual.org/docs/auto-completion/#create-auto-completion-definition-files).
      I recommend you use one of the Python IDEs that I mentioned above, it is the most convenient for deveopers.
      Best regards!

  • @TrinhBinhThienAn
    @TrinhBinhThienAn 2 года назад +1

    Hello, I'm learning and working on Python on this Abaqus, but there are a few problems I haven't found solutions to fix yet, I think it's quite interesting. Could you help me with this? If possible, we can exchange via email to make it easier to communicate. Thank you very much!

    • @tecnodigitalschool
      @tecnodigitalschool  2 года назад +1

      Hi, I am happy to see so many people using these tools.
      You can contact me through email: contact@tecnodigitalschool.com