We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
Electronics

Electronics

Topics related to HFSS, Maxwell, SIwave, Icepak, Electronics Enterprise and more.

Ansys Maxwell Mesh Element Access

    • c-milke
      Subscriber

      Within an Ansys Maxwell python macro, I want to identify the Electric Field strength of a named object (be it a surface or volume object) on a per-element basis. Specifically, for a given named object, I want to obtain a list of each mesh element, in which I have the average E-field for that element and the area/volume of that element.

       

      I have determined how to decode an aedtplt file to achieve this goal, but this requires manually aggregating individual nodes to create a shape, then calculating the area/volume of that shape. Given the wide variety of shapes that the meshes can take (and the esoteric way they are defined) I would much rather just use an API call to directly obtain the area of the mesh element. I'm sure one must exist, but I have been unable to find documentation for this is the Ansys scripting guide.

       

      To reiterate, the python script API functions I need are:

      1. A way to select a named object and retrieve a list of mesh elements from that object (be it a volume or surface object)
      2. For each element, a function to retrieve the electric field strength of the element
      3. And also for each element, a function to retrieve the area/volume of the element

       

    • GLUO
      Ansys Employee

      Hi,

      We do not provide scripting information here. But for 1 and 2, you can do it directly in Maxwell field calculator and record a script. In field calculator, Quantity>>E, Geometry>>object, Output>>Value>>Write. It exports a .fld/txt that lists the mesh node positions and E field of the object. 

      GL

    • c-milke
      Subscriber

      Hello,

      Thank you for the response. This seems helpful, but still leaves a problem: the individual points provided in the output from this command have no "area" information associated with them. I had hoped I could assume they were spaced uniformly, but some quick testing has shown that this does not seem to be true. Is there a way to output this information alongside the relative area of each data point?

      I am also confused about your statement that this fld file produces a list of the mesh node positions. From my earlier decoding of the mesh aedtplt file it is clear that there are only 9121 mesh nodes, yet the fld file produced lists 26,484 points. The field calculator is clearly performing an interpolation over the mesh, rather than providing the mesh itself.

      Clarity on both these points would be deeply appreciated.

      Regards,

      Chris

    • GLUO
      Ansys Employee

      Hi,

      1. Is there a way to output this information alongside the relative area of each data point?

      No, field calculator cannot do that. This requires post processing of the data out of Maxwell.

      2. The field calculator is clearly performing an interpolation over the mesh, rather than providing the mesh itself.

      For 2D Maxwell FEA is second order, there are nodes on the mid points of the edge of each triangle mesh element. It is not interpolation.

      GL

       

    • c-milke
      Subscriber

      Hello,

      I'm looking more closely at the output file and I see what you mean. For my surface mesh there are 6 nodes per mesh element. The reason I saw a mismatch in node count is because the mesh elements share nodes and the nodes are listed per mesh. Apologies for my confusion, and thank you for the clarification. It is unfortunate that there is no way to get element area within Ansys, but I can work with this. Thank you for you help!

      Chris

Viewing 4 reply threads
  • The topic ‘Ansys Maxwell Mesh Element Access’ is closed to new replies.