I am trying to construct a 2D surface from a series of data files that each contain a portion of the structure rectangular mesh. I’d like paraview to read in each of the files and merge them into a single surface mesh. My data sets are large (TB-PB), so I’m not able to generate a new single data file containing the entire mesh/field. I’ve made an xdmf file which describes each of the data files. When I load one file, everything works. When I have ParaView load the group of xdmf files, it only displays the last file. I’m not sure what is wrong with what I’m doing. I made a Matlab script which represents what I’m trying to do (shown below).
In this sample problem, the total mesh is split between three regions with separate mesh/data files. For each region, the script creates an hdf5 domain file which stores the grid points along each axis of my mesh and an hdf5 solution file which holds the 2D field data. I’m trying to set this up in xdmf by defining a uniform grid type with 3DRectMesh topology. Since I only have the mesh nodes along each axis stored in the file(as opposed to full 2D arrays for each coordinate), I set GeometryType=“VXVYVZ” and read in the grid vectors in each direction (but have the z-direction only contain one value set to 0). Each of the three regions have a separate xdmf file associated with it and I load them as a group in paraview.
The cluster that I’m running on has ParaView 5.2 (it is the only version that the systems have installed and all I have to work with for now). When I load the three xdmf files, it only shows the data/properties corresponding to region 3(domain_3.h5 and field_data_3.h5). It is as though it overwrites the mesh each time it loads a new file rather than adding to the field. Does anyone have any suggestions on how I can get ParaView to build a single mesh from the separate data files?
Thanks,
Bryce
for ind=1:3
% Define dimension of the 2D-array
Lx = 1.0; nx = 2000;
Lt = 10.0; nt = 5000;
% Build axis of the mesh
dx = Lx/(nx-1); x = 0:dx:Lx;
dt = Lt/(nt-1); t = (ind-1)*Lt:dt:ind*Lt;
% Build mesh rectangular grid
[X,T] = meshgrid(t,x);
% sample solution field: (changes direction for each file to make it easy to confirm that it loads correctly)
if(rem(ind, 2) == 0)
solution = sin(2*pi*X - 4*pi*T);
else
solution = sin(2*pi*X + 4*pi*T);
end
% Create geometry file
% x-axis
h5create(char("domain_"+ind+".h5"),'/x_nodes',nx);
h5write(char("domain_"+ind+".h5"),'/x_nodes',x);
% y-axis
h5create(char("domain_"+ind+".h5"),'/t_nodes',nt);
h5write(char("domain_"+ind+".h5"),'/t_nodes',t);
% z-axis
h5create(char("domain_"+ind+".h5"),'/z_nodes',1);
h5write(char("domain_"+ind+".h5"),'/z_nodes',0);
% Create data file
h5create(char("field_data_"+ind+".h5"),'/solution',[nx,nt]);
h5write(char("field_data_"+ind+".h5"),'/solution',solution);
% write associated XDMF file:
fileID = fopen("openWithParaView_"+ind+".xmf",'w');
fprintf(fileID,'<?xml version="1.0" ?>\n');
fprintf(fileID,'<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>\n');
fprintf(fileID,'<Xdmf Version="2.0">\n');
fprintf(fileID,' <Domain>\n');
fprintf(fileID,' <Grid Name="mesh" GridType="Uniform">\n');
fprintf(fileID,' <Topology TopologyType="3DRectMesh" NumberOfElements="%d %d %d"/>\n',1,nt,nx);
fprintf(fileID,' <Geometry GeometryType="VXVYVZ">\n');
fprintf(fileID,' <DataItem Name="coordx" Dimensions="%g" NumberType="Float" Precision="%g" Format="HDF">\n',nx,8);
fprintf(fileID," "+char("domain_"+ind+".h5:")+"/x_nodes\n");
fprintf(fileID,' </DataItem>\n');
fprintf(fileID,' <DataItem Name="coordy" Dimensions="%g" NumberType="Float" Precision="%g" Format="HDF">\n',nt,8);
fprintf(fileID," "+char("domain_"+ind+".h5:")+"/t_nodes\n");
fprintf(fileID,' </DataItem>\n');
fprintf(fileID,' <DataItem Name="coordz" Dimensions="%g" NumberType="Float" Precision="%g" Format="HDF">\n',1,8);
fprintf(fileID," "+char("domain_"+ind+".h5:")+"/z_nodes\n");
fprintf(fileID,' </DataItem>\n');
fprintf(fileID,' </Geometry>\n');
% I seem to need this TimeType line or it loads each file as a different time step in an animation
fprintf(fileID,' <Time TimeType="Single" Value="%g"/>\n',0.0);
fprintf(fileID,' <Attribute Name="solution" AttributeType="Scalar" Center="Node">\n');
fprintf(fileID,' <DataItem Dimensions="%d %d %d" NumberType="Float" Precision="%d" Format="HDF">\n',1,nt,nx,8);
fprintf(fileID," "+char("field_data_"+ind+".h5")+":/solution\n");
fprintf(fileID,' </DataItem>\n');
fprintf(fileID,' </Attribute>\n');
fprintf(fileID,' </Grid>\n');
fprintf(fileID,' </Domain>\n');
fprintf(fileID,'</Xdmf>\n');
fclose(fileID);
end