[Paraview] XDMF and structured grid in cylindrical coordinates (curvilinear)

Nikolaos Beratlis nikos.beratlis at gmail.com
Tue Apr 2 21:28:36 EDT 2013


I am currently trying the Function itemtype approach. In all of the
examples for the function itemtype it is assumed that arrays are all of the
same size. In my case I have three 1D arrays of different sizes: x(nx),
y(ny), and z(nz). The operation I need to do to convert to cylindrical
coordinates is:

do k=1,nz
do j=1,ny
do i=1,nx
  x(i)*sin(y(j)), x(i)*cos(y(j)), z(k)
enddo
enddo
enddo

I know that function has the operations SIN and COS but can the nested
looping be achieved with a function operation?

Thank you,

Nikos


On Wed, Mar 20, 2013 at 10:57 AM, David E DeMarle
<dave.demarle at kitware.com>wrote:

> See if XDMF's Function itemtype will do the trick. (If so please consider
> posting an example to the xdmf.org wiki).
>
> Otherwise you'll have to apply a filter to do the geometry transformation
> after you load the RectMesh into ParaView.
>
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
>
>
> On Wed, Mar 20, 2013 at 10:52 AM, Nikolaos Beratlis <
> nikos.beratlis at gmail.com> wrote:
>
>> Hi David,
>>
>> I looked at your examples and I noticed that you changed the GeometryType
>> to XYZ in order to plot a curvilinear grid. So it can't be done by
>> specifying three separate 1D arrays instead (GeometryType=VXVYVZ)? My only
>> concern is storage as I use grids with sizes of 2000x2000x2000. Writing
>> that to a file will be huge compared to writing only three 1D arrays as I
>> do for the cartesian case. Or is there a way to convert a grid read in
>> cartesian coordinates to cylindrical the way it's done in Tecplot?
>>
>> Thank you.
>>
>> Nikos
>>
>>
>> On Wed, Mar 20, 2013 at 10:18 AM, David E DeMarle <
>> dave.demarle at kitware.com> wrote:
>>
>>> XDMF's 3DRectMesh == VTK's vtkRectilinearGrid, in which you case you
>>> specify an X array, Y array and a Z array.
>>>
>>> 3DSMesh == vtkStructuredGrid, in which case you specify X,Y,Z for every
>>> node. Once you do that you're example will work.
>>>
>>> Examples of both (produced in ParaView via Data Object Generator (RG1 |
>>> SG1)->Write as XDMF) are attached.
>>>
>>>
>>>
>>> David E DeMarle
>>> Kitware, Inc.
>>> R&D Engineer
>>> 21 Corporate Drive
>>> Clifton Park, NY 12065-8662
>>> Phone: 518-881-4909
>>>
>>>
>>> On Tue, Mar 19, 2013 at 11:04 PM, Nikolaos Beratlis <
>>> nikos.beratlis at gmail.com> wrote:
>>>
>>>> I am using a 3D structured orthogonal grid in cylindrical coordinates.
>>>> I can read the grid as a cartesian grid using the following XDMF file by
>>>> specifying TopologyType "3DRectMesh" and GeometryType="VXVYVZ" (see
>>>> attached image):
>>>>
>>>> <?xml version="1.0" ?>
>>>> <!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
>>>> <Xdmf Version="2.0">
>>>> <Domain>
>>>> <Grid Name="mesh" GridType="Uniform">
>>>> <Topology TopologyType="3DRectMesh" NumberOfElements="10 4 6"/>
>>>> <Geometry GeometryType="VXVYVZ">
>>>> <DataItem Dimensions="6" NumberType="Float" Precision="4" Format="XML">
>>>> 0.0 1.0 2.0 3.0 4.0 5.0
>>>> </DataItem>
>>>> <DataItem Dimensions="4" NumberType="Float" Precision="4" Format="XML">
>>>> 0.0 1.5708 3.1415 4.7124
>>>> </DataItem>
>>>> <DataItem Dimensions="10" NumberType="Float" Precision="4" Format="XML">
>>>> 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
>>>> </DataItem>
>>>> </Geometry>
>>>> </Grid>
>>>> </Domain>
>>>> </Xdmf>
>>>>
>>>> When I try to read the grid as 3DSMesh which I think corresponds to
>>>> curvilinear Paraview crashes.
>>>>
>>>> <?xml version="1.0" ?>
>>>> <!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
>>>> <Xdmf Version="2.0">
>>>> <Domain>
>>>> <Grid Name="mesh" GridType="Uniform">
>>>> <Topology TopologyType="3DSMesh" NumberOfElements="10 4 6"/>
>>>> <Geometry GeometryType="VXVYVZ">
>>>> <DataItem Dimensions="6" NumberType="Float" Precision="4" Format="XML">
>>>> 0.0 1.0 2.0 3.0 4.0 5.0
>>>> </DataItem>
>>>> <DataItem Dimensions="4" NumberType="Float" Precision="4" Format="XML">
>>>> 0.0 1.5708 3.1415 4.7124
>>>> </DataItem>
>>>> <DataItem Dimensions="10" NumberType="Float" Precision="4" Format="XML">
>>>> 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
>>>> </DataItem>
>>>> </Geometry>
>>>> </Grid>
>>>> </Domain>
>>>> </Xdmf>
>>>>
>>>>  Is there any way to read a 3D cylindrical grid using three 1D arrays
>>>> for the coordinates in each direction?
>>>>
>>>> Thank you,
>>>>
>>>> Nikos
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> 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 ParaView Wiki at:
>>>> http://paraview.org/Wiki/ParaView
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://www.paraview.org/mailman/listinfo/paraview
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130402/7e0b3c11/attachment-0001.htm>


More information about the ParaView mailing list