Calculate centroid of mesh with DPF

Mike.Thompson
Mike.Thompson Member, Employee Posts: 342
25 Answers 100 Comments 25 Likes First Anniversary
✭✭✭✭
edited June 18 in Structures

How can I calculate efficiently the centroid of a 2D mesh (like a dpf skin mesh). I want to get the centroid in the deformed condition, ending up with a DPF fields container of all time points from the input deformation fields container that contains XYZ centroid point of the mesh scoping.

Tagged:

Answers

  • Mike Rife
    Mike Rife Member, Employee Posts: 50
    10 Comments First Answer 5 Likes First Anniversary
    ✭✭✭✭

    Hi @Mike.Thompson
    Mech DPF or PyDPF? PyDPF has a operator "compute_element_centroids" that will return these. It also returns the element measure...a fancy way of saying the elements length, area, or volume depending on the type of element. Multiply the two outputs and divide by the total measure and you have the centroid of the entire mesh.
    Mike

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

    @Mike Rife ,
    This seems to have the same issue as the normals provider in the sense that it works on the mesh and does not get a fields container for the deformed states. I can manually update the coordinates of the mesh per the displacement fields for each time point and then re-run the operator to get the data across time, but I was hoping there may be a way to get the element centroids based on instantaneous deformed state across time.

    Thanks,

  • Mike Rife
    Mike Rife Member, Employee Posts: 50
    10 Comments First Answer 5 Likes First Anniversary
    ✭✭✭✭

    @Mike.Thompson Isn't what you are asking for "anti-pattern" of the DPF design intent? In my (simplistic?) understanding DPF is meant to be a "you can do anything but one step/function at a time" as opposed to operators that perform multiple "functions". Also are you asking about Mech DPF or PyDPF?

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 342
    25 Answers 100 Comments 25 Likes First Anniversary
    ✭✭✭✭
    edited June 19

    @Mike Rife ,
    I get what you are saying, but for example there is this operator that functions exactly how I want: elements facets surfaces over time

    This operator will get the element areas per the deformed states across multiple time points. I understand the DPF concept of having individual operators do tasks, and chaining these tasks together to form more complex workflows, but what I am asking is about the same "task" just done efficiently across all time points. I think the idea of operators intrinsically working across time points is very in line with DPF concepts.

    What I would like is to have: Element centroids across time and Element normals across time

    Again, I can do all of this, but the best way I know to do it would be a for loop where I use the existing operators after updating the mesh coordinates (centroids and normals) to produce a single field, then compile the fields together in my own fields container.