How to create a result in DPF with deformed mesh whose scaling is different for each axis ?

Options
Adrien Vet
Adrien Vet Member Posts: 10
Name Dropper Photogenic First Comment

Hello,

As the title suggests, I want to create a result in DPF with deformed mesh whose scaling is different for each axis.

When you normally create a result in ansys mechanical, you can adjust the scaling :

But I want the scaling to be different for each axis, for example 1 in X, 3 in Y and 10 in Z.

Does anyone know how to do that ?

Thanks,

Adrien

Answers

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 280
    First Anniversary First Comment 5 Likes Ansys Employee
    Options

    I don't think you will be able to use a different scaling factor in terms of the graphical representation, but you can definitely scale the actual displacement results in the given directions.

    In this short example the field data is just dummy data, but you can apply it in the same way to a field of displacements for XYZ of all nodes:

    import mech_dpf
    import Ans.DataProcessing as dpf F = dpf.Field()
    F.Data=[2.,2.,2.] ScaleData = [0.5,1.1,2.5]
    F.Data = [x*y for x,y in zip(F.Data, ScaleData)]
    print F.Data

  • Adrien Vet
    Adrien Vet Member Posts: 10
    Name Dropper Photogenic First Comment
    Options

    Hello,

    Thank you for your response.

    So there isn't any way to plot deformed mesh with dpf ?

    Regards,

    Adrien

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 280
    First Anniversary First Comment 5 Likes Ansys Employee
    Options

    @Adrien Vet ,

    It really depends on what you mean by "plot". We can plot the dpf mesh. In plotting a mesh there are two sets of data.

    1. The starting locations of the nodes
    2. The displacements of the nodes

    On top of this we have a visual scale factor for the "warping" (displacement) of the mesh. We can't (as far as I know) modify the visual scale factor per direction. We CAN modify the displacement field values in any way we want (per my original post). By doing this you can scale the actual displacement (not the visualization) in any way you want.

    To plot this you would use a python result in mechanical. By default when you create a python result it will have an example of getting the displacement. You need to take that displacement field and scale it by your desired factors (in XYZ independently). After this the scaled-displacement field will be displaying in the graphics and the graphics scale factor will be applied to all directions equally.

    Alternatively:

    You could modify the base mesh locations by moving the nodes of the dpf mesh around. The "displacement" is simply the difference from the start point to the final point, so you could leave the displacement values as is, and manually modify the mesh in the XYZ-independent scaling of your choosing. This will make your displacement values stay accurate, but will visually give the different scale impression.

    It really all again depends on the desired goal and you you interpret the start vs. end locations. Do you morph the mesh then apply the displacement, or do you scale the displacement and not morph the mesh.

  • Adrien Vet
    Adrien Vet Member Posts: 10
    Name Dropper Photogenic First Comment
    Options

    @Mike.Thompson

    Your alternative is interessant and I think it will answer my question. How can I modify the base mesh locations by moving the nodes in dpf ?

    Regards,

    Adrien