vtk - Visualization of 3-dimensional grid from X_Y_Z(seperate datasets) on Paraview without using xdmf -


reading netcdf files paraview using xdmf

i used parse netcdf files xdmf script in order create 3dsmesh on paraview. on top of it, adding scalar or vector fields. (so 3dsmesh provides physical coordinates).

i never though if best way actually. works, ok. please let me know if there more convenient way.

i able create 3-dimensional grid following script.

<?xml version="1.0" ?> <!doctype xdmf system "xdmf.dtd" []> <xdmf xmlns:xi="http://www.w3.org/2001/xinclude" version="2.0">    <domain>       <grid name="gridxyz">         <topology topologytype="3dsmesh" numberofelements="0032 0032 0063">         </topology> <!-- read coordinates -->         <geometry geometrytype="x_y_z">            <dataitem name="x" format="hdf" numbertype="float" precision="8" dimensions="0032 0032 0063">                        grid_x.nc:/gridx            </dataitem>            <dataitem name="y" format="hdf" numbertype="float" precision="8" dimensions="0032 0032 0063">                        grid_y.nc:/gridy            </dataitem>            <dataitem name="z" format="hdf" numbertype="float" precision="8" dimensions="0032 0032 0063">                        grid_z.nc:/gridz            </dataitem>         </geometry> <!-- read scalar --> <!-- here have bunch of scalars stored in different netcdf files -->      </grid>    </domain> </xdmf> 

pros

  • xdmf scripts great when needs repetitive tasks.

cons

  • this script(s) needs generated somehow, or typed hand. , required updated, when dimensions or variable names changed

  • if want read scalar, need add line

  • grid can uniform in 2 directions , not uniform on third one, no need create 3d grid files, geometry type dx_dy_dz not enough achieve that.

what looking for

recently realize, can open netcdf files paraview clicking open(paraview4.3). so, not need these xdmf scripts anymore (few years ago not able open netcdf files on paraview).

how can create 3dsmesh via paraview gui. possible? or there other simple/faster way (instead of writing python script) ? there way read 1d coordinates , create 3d geometry using them ?

that's how manage that. it's not fastest way, works me.

when open netcdf file, paraview asks choose reader, use netcdf files generic , cf conventions .

after that, before hitting "apply" button have select appropriate "dimensions" in dropdown menu.

your data must displayed uniformgrid, data(x,y,z) scalars fields must transform grid more specific structuredgrid. in order that, apply "imagedatatopointset" filter.

after that, apply "calculator" filter check "coordinate results" field , following:

if data appears x, y , z colummns put in calculator field expression

(x * ihat) + (y * jhat) + (z * khat)

if data appears other names, substitute x, y, z names

the expression means x in direction of î vector, y in direction of j vector , on

hope helped!


Comments