Skip to content

XDMFWRITE is a Matlab function that can be used to create an XDMF text file for an associated 3D H5 file. This is useful when attempting to visualize a 3D matrix in ParaView.

Notifications You must be signed in to change notification settings

imadhanhan/xdmfwrite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

xdmfwrite

XDMFWRITE is a Matlab function that can be used to create an XDMF text file for an associated 3D H5 file. This is useful when attempting to visualize a 3D matrix in ParaView. As of January 2020, this function accepts an h5 file with multiple datasets (scalars only, no vector capability yet).

Installation instructions

  1. Download the contents of this depository.
  2. Move the file "xdmfwrite.m" to the following location in your computer's directory:
  • My Documents / MATLAB (For PC)
  • Documents / MATLAB (For Mac)
  1. Installation complete. The function can now be accessed in Matlab from any directory.

Function instructions

The inputs are as follows: XDMFWRITE(FILENAME,SIZE,DATATYPE) creates an XDMF file with 3D extents given by SIZE and with an attribute dataset given by the h5 FILENAME with the datatype specified by DATATYPE. If DATATYPE is not specified, the default is double.

Example: create an XDMF file for 'myfile.h5' that contains a fixed-size 100x200x300 dataset.

  • xdmfwrite('myfile.h5', [100 200 300], 'double');

Example: create an XDMF file for a 3D matrix of ones in single single precision with a fized-size of 100x200x300.

  • mydata=single(ones(100,200,300));
  • h5create('myfile.h5','/myDataset',size(mydata), 'Datatype','single');
  • h5write('myfile.h5','/myDataset', mydata);
  • xdmfwrite('myfile.h5',size(mydata),'single');

Written by Imad Hanhan, 2019.

About

XDMFWRITE is a Matlab function that can be used to create an XDMF text file for an associated 3D H5 file. This is useful when attempting to visualize a 3D matrix in ParaView.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages