Help with vtkInterpolateDataSetAttributes

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with vtkInterpolateDataSetAttributes

David E DeMarle via vtkusers

I am attempting to interpolate between two ExodusII (vtkExodusIIReader) results using the vtkInterpolateDataSetAttributes, but am having trouble getting it to work. I was able to perform an interpolation that mimics the behavior with calls to vtkAbstractArray::InterpolateTuple, but this doesn’t seem like the correct solution.

 

I have attached a script that show what I am trying to do, including what is working and what is not. I know that for this problem I could use vtkTemporalInterpolator, but for the actual problem I am trying to solve it isn’t appropriate. I am using python bindings with VTK7.1 on MacOS.

 

I would appreciate any help I can get making this work.

 

Thanks,

Andrew

 

 


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers

input_no_adapt_out.e (48K) Download Attachment
interpolate_data_set.py (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help with vtkInterpolateDataSetAttributes

Bill Lorensen
I suspect that vtkInterpolateDataSetAttributes may be buggy. The are no tests that interpolate scalar data. I'm looking into it.

On Thu, Nov 29, 2018, 8:13 AM Andrew E. Slaughter via vtkusers <[hidden email] wrote:

I am attempting to interpolate between two ExodusII (vtkExodusIIReader) results using the vtkInterpolateDataSetAttributes, but am having trouble getting it to work. I was able to perform an interpolation that mimics the behavior with calls to vtkAbstractArray::InterpolateTuple, but this doesn’t seem like the correct solution.

 

I have attached a script that show what I am trying to do, including what is working and what is not. I know that for this problem I could use vtkTemporalInterpolator, but for the actual problem I am trying to solve it isn’t appropriate. I am using python bindings with VTK7.1 on MacOS.

 

I would appreciate any help I can get making this work.

 

Thanks,

Andrew

 

 

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Help with vtkInterpolateDataSetAttributes

Bill Lorensen
Andrew, please post further comments to the mailing list.

On Mon, Dec 17, 2018, 2:07 PM Andrew E. Slaughter <[hidden email] wrote:
The interpolation for point data is working great, I am working on making my script more robust before posting by including cell and global data to the interpolation. I also am interpolating all active data into a vtkMultiBlockDataSetAlgorithm so the end product will behave similarly as a vtkExodusIIReader object.

Anyway, I can't get the cell data to interpolate. The point data is working fine (change the variable to 'point') to show this result.

I was hoping you could take a look and see what I am missing, I images it is something to do with the vtkPointInterpolator, but I can't seem to find the solution.

Thanks,
Andrew


On 12/10/18, 8:46 AM, "Andrew E. Slaughter" <[hidden email]> wrote:

    Feel free to add this an example with the data, when I get the python version fixed up I will add it to the examples wiki as well.

    Thank you for your help.

    - Andrew

    On 12/5/18, 5:20 PM, "Bill Lorensen" <[hidden email]> wrote:

        I found the problems with your script.

        vtkPointInterpolator: The point arrays will not be interpolated unless
        PassPointArrays is off. And the source and input data must add the
        field data as the active scalar.
        vtkInterpolateDataSetAttibutes does not interpolate field data. To
        interpolate field data each input must add the field data as the
        active scalar.

        Neither of these are obvious. I have attached a c++ example that is
        based on your script. I changed a lot of the names to help me debug
        the problems.

        I would like to ass this c++ code as an example, once I make a few
        more changes. Is that OK with you? I would also need to add your
        datasets.

        Bill
        On Tue, Dec 4, 2018 at 3:40 PM Andrew E. Slaughter
        <[hidden email]> wrote:
        >
        > Thank you, feel free to email me directly if you need anything more from my end.
        >
        >
        >
        > From: Bill Lorensen <[hidden email]>
        > Date: Monday, December 3, 2018 at 7:20 PM
        > To: "Andrew E. Slaughter" <[hidden email]>
        > Cc: VTK Users <[hidden email]>
        > Subject: Re: [vtkusers] Help with vtkInterpolateDataSetAttributes
        >
        >
        >
        > I suspect that vtkInterpolateDataSetAttributes may be buggy. The are no tests that interpolate scalar data. I'm looking into it.
        >
        >
        >
        > On Thu, Nov 29, 2018, 8:13 AM Andrew E. Slaughter via vtkusers <[hidden email] wrote:
        >
        > I am attempting to interpolate between two ExodusII (vtkExodusIIReader) results using the vtkInterpolateDataSetAttributes, but am having trouble getting it to work. I was able to perform an interpolation that mimics the behavior with calls to vtkAbstractArray::InterpolateTuple, but this doesn’t seem like the correct solution.
        >
        >
        >
        > I have attached a script that show what I am trying to do, including what is working and what is not. I know that for this problem I could use vtkTemporalInterpolator, but for the actual problem I am trying to solve it isn’t appropriate. I am using python bindings with VTK7.1 on MacOS.
        >
        >
        >
        > I would appreciate any help I can get making this work.
        >
        >
        >
        > Thanks,
        >
        > Andrew
        >
        >
        >
        >
        >
        > _______________________________________________
        > Powered by www.kitware.com
        >
        > Visit other Kitware open-source projects at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_opensource_opensource.html&d=DwIFaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=CZ-fngNdgJgN52g8AviZCojUB3AwTUttziM040_wM1g&s=E2eeqfO0l7aGQzYt_-DT6zLV6ALe0sCfFm6z4kfA2vE&e=
        >
        > Please keep messages on-topic and check the VTK FAQ at: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.vtk.org_Wiki_VTK-5FFAQ&d=DwIFaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=CZ-fngNdgJgN52g8AviZCojUB3AwTUttziM040_wM1g&s=cZQZE8xkatSI9xZ8-19BijAzdZZhpEzqBD5JiCsyQZk&e=
        >
        > Search the list archives at: https://urldefense.proofpoint.com/v2/url?u=http-3A__markmail.org_search_-3Fq-3Dvtkusers&d=DwIFaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=CZ-fngNdgJgN52g8AviZCojUB3AwTUttziM040_wM1g&s=4EuYM4upr3Tp4Rakv_UjS9KZk1TyOLER92KgxprLfv4&e=
        >
        > Follow this link to subscribe/unsubscribe:
        > https://urldefense.proofpoint.com/v2/url?u=https-3A__public.kitware.com_mailman_listinfo_vtkusers&d=DwIFaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=CZ-fngNdgJgN52g8AviZCojUB3AwTUttziM040_wM1g&s=smX4duzcBydAraDbmtpSZRONXDLCSc4MycG_F_Jw5I0&e=



        --
        Unpaid intern in BillsParadise at noware dot com





_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Help with vtkInterpolateDataSetAttributes

David E DeMarle via vtkusers
In reply to this post by Bill Lorensen
The interpolation for point data is working great, I am working on making my script more robust before posting by including cell and global data to the interpolation. I also am interpolating all active data into a vtkMultiBlockDataSetAlgorithm so the end product will behave similarly as a vtkExodusIIReader object.

Anyway, I can't get the cell data to interpolate. The point data is working fine (change the variable to 'point') to show this result.

I was hoping you could take a look and see what I am missing, I images it is something to do with the vtkPointInterpolator, but I can't seem to find the solution.

Thanks,
Andrew

On 12/5/18, 5:20 PM, "Bill Lorensen" <[hidden email]> wrote:

    I found the problems with your script.
   
    vtkPointInterpolator: The point arrays will not be interpolated unless
    PassPointArrays is off. And the source and input data must add the
    field data as the active scalar.
    vtkInterpolateDataSetAttibutes does not interpolate field data. To
    interpolate field data each input must add the field data as the
    active scalar.
   
    Neither of these are obvious. I have attached a c++ example that is
    based on your script. I changed a lot of the names to help me debug
    the problems.
   
    I would like to ass this c++ code as an example, once I make a few
    more changes. Is that OK with you? I would also need to add your
    datasets.
   
    Bill
    On Tue, Dec 4, 2018 at 3:40 PM Andrew E. Slaughter
    <[hidden email]> wrote:
    >
    > Thank you, feel free to email me directly if you need anything more from my end.
    >
    >
    >
    > From: Bill Lorensen <[hidden email]>
    > Date: Monday, December 3, 2018 at 7:20 PM
    > To: "Andrew E. Slaughter" <[hidden email]>
    > Cc: VTK Users <[hidden email]>
    > Subject: Re: [vtkusers] Help with vtkInterpolateDataSetAttributes
    >
    >
    >
    > I suspect that vtkInterpolateDataSetAttributes may be buggy. The are no tests that interpolate scalar data. I'm looking into it.
    >
    >
    >
    > On Thu, Nov 29, 2018, 8:13 AM Andrew E. Slaughter via vtkusers <[hidden email] wrote:
    >
    > I am attempting to interpolate between two ExodusII (vtkExodusIIReader) results using the vtkInterpolateDataSetAttributes, but am having trouble getting it to work. I was able to perform an interpolation that mimics the behavior with calls to vtkAbstractArray::InterpolateTuple, but this doesn’t seem like the correct solution.
    >
    >
    >
    > I have attached a script that show what I am trying to do, including what is working and what is not. I know that for this problem I could use vtkTemporalInterpolator, but for the actual problem I am trying to solve it isn’t appropriate. I am using python bindings with VTK7.1 on MacOS.
    >
    >
    >
    > I would appreciate any help I can get making this work.
    >
    >
    >
    > Thanks,
    >
    > Andrew
    >
    >
    >
    >
    >
    > _______________________________________________
    > Powered by www.kitware.com
    >
    > Visit other Kitware open-source projects at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_opensource_opensource.html&d=DwIFaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=CZ-fngNdgJgN52g8AviZCojUB3AwTUttziM040_wM1g&s=E2eeqfO0l7aGQzYt_-DT6zLV6ALe0sCfFm6z4kfA2vE&e=
    >
    > Please keep messages on-topic and check the VTK FAQ at: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.vtk.org_Wiki_VTK-5FFAQ&d=DwIFaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=CZ-fngNdgJgN52g8AviZCojUB3AwTUttziM040_wM1g&s=cZQZE8xkatSI9xZ8-19BijAzdZZhpEzqBD5JiCsyQZk&e=
    >
    > Search the list archives at: https://urldefense.proofpoint.com/v2/url?u=http-3A__markmail.org_search_-3Fq-3Dvtkusers&d=DwIFaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=CZ-fngNdgJgN52g8AviZCojUB3AwTUttziM040_wM1g&s=4EuYM4upr3Tp4Rakv_UjS9KZk1TyOLER92KgxprLfv4&e=
    >
    > Follow this link to subscribe/unsubscribe:
    > https://urldefense.proofpoint.com/v2/url?u=https-3A__public.kitware.com_mailman_listinfo_vtkusers&d=DwIFaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=CZ-fngNdgJgN52g8AviZCojUB3AwTUttziM040_wM1g&s=smX4duzcBydAraDbmtpSZRONXDLCSc4MycG_F_Jw5I0&e=
   
   
   
    --
    Unpaid intern in BillsParadise at noware dot com
   


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers

input_out.e (63K) Download Attachment
input_out.e-s002 (40K) Download Attachment
interpolate2.py (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help with vtkInterpolateDataSetAttributes

VTK - Users mailing list
Hi Andrew,

> The interpolation for point data is working great, I am working on making my script more robust before posting by including cell and global data to the interpolation. I also am interpolating all active data into a vtkMultiBlockDataSetAlgorithm so the end product will behave similarly as a vtkExodusIIReader object.
>
> Anyway, I can't get the cell data to interpolate. The point data is working fine (change the variable to 'point') to show this result.

It would help to know more about what you hope to accomplish with the interpolation. If you are trying to compare field values (or differences between them) on different meshes, then maybe it would be appropriate as a first pass to use vtkCellCenters to get a location for each cell.

You might also be interested in the vtkProbeFilter for projecting points (whether they are cell centers or original input points) from one dataset to another without writing a Python script that iterates over tuples.

        David
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers