Ansys DPF - Mapping to Coordinates

Matt L
Matt L Member Posts: 3
First Comment
**

I am writing a script using DPF to map results to coordinates along a path. For a given path, I am discritizing it by 49 points. I then use these coordinates with FieldsFactory.Create3DVectorField to create the field. Then, using this field, I pass it to dpf.operators.mapping.on_coordinates() (see picture below, field_coords has a length of 147, which makes sense since 49 points * 3 coordinates = 147). When I get the tempMapped data, it is only giving me 5 coordinates which it mapped to; I would expect to see 49 results for the 49 points along the Path it should be mapping to.

The odd thing is that it only happens to some paths, most of them work fine, but then there are several which this happens to. Anyone have any idea what is it doing and if there's a way to force the mapping operator to map to all coordinates that were passed to it?

Tagged:

Answers

  • James Derrick
    James Derrick Administrator, Employee Posts: 323
    Ancient Membership 100 Comments 100 Likes 25 Answers
    admin

    Hello! @Structures-Scripting-Team might be able to answer this one.

  • Matt L
    Matt L Member Posts: 3
    First Comment
    **

    As opposed to "mapping.on_coordinates", I tried to use "mapping.on_reduced_coordinates", and it seems like it is now doing it correctly. Though, I do not know why or what the difference is between the two. If someone could explain that, I would appreciate it.

  • Jimmy He
    Jimmy He Member, Employee Posts: 27
    10 Comments 5 Likes First Answer First Anniversary
    ✭✭✭✭

    Hi Matt, for the "mapping.on_coordinates", it will only return the results on points that fall within the parent mesh. Did you check that all the paths are within the boundaries of the original mesh?

    I don't think you should be using "mapping.on_reduced_coordinates" since you are likely providing the coordinates of the path points in the global X,Y and Z coordinates. The reduced_coordinates operator takes in reduced/isoparametric coordinates (https://teachbooks.tudelft.nl/computational-modelling/introduction/isoparametric_mapping.html) of points in reference to the reference element, which are calculated from the global X,Y,Z point coordinates via the "find_reduced_coordinates" operator.

  • Jim Kosloski
    Jim Kosloski Member, Employee Posts: 34
    Second Anniversary 10 Comments 5 Likes Name Dropper
    ✭✭✭✭

    I have the same issue, and it is indeed because some of the points fall outside the model. The question is how do you deal with this? How do I know what points data was returned for? How do I correlate the returned data to the input data?

  • Matt L
    Matt L Member Posts: 3
    First Comment
    **

    All of the paths I have are through the thickness of the component I'm analyzing, and I've 'snapped to the node' so they should all be within the mesh. Some of these are showing the correct 49 mapped points, some 47, some 5, etc. I shortened the paths so the two ends are clearly within the mesh and still results in not the correct mapped number.

    Is it incorrect to use the mapped.on_reduced_coordinates operator? It's odd that that one works but the on_coordinates operator does not.

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 393
    100 Likes 25 Answers 100 Comments Second Anniversary
    ✭✭✭✭