Hi,
I am writing a script that should read the output from different
processors, perform CollectMultiGrid and produce some images. The
problem I have is that the number of the processors may change from run
to run. I am looking for a construction that will combine the subgrids
and return a single grid object, something like:
for i=1,npartitions
if (i==1) {
data=Import(File(i));
else
d=Import(File(i));
data = ColectMultiGrid(data,d)
end
I tried to make a group or list object:
macro forallpartitions(run,npartitions) -> (data) {
i, last = ForEachN(1,npartitions);
fn=Format("%s%d%s%d%s","dir-00",i,"/",run,".dx");
d=Import(fn);
group = Append(group,d);
}
where run is an integer for the output to be processed and npartitions
is the number of processors used in this run, but it bumps. I also tried
to use "d[[i]]=Import(fn);" to store the subgrids into an array and then
to make ForEachN(2,npartitions) but it complains about d[[i]]
construction. I am missing something obvious. What is the right approach
to this kind of problems in the OpenDX scripting language?
Thanks,
Ted
Lloyd A Treinish wrote:
>
> You should use CollectMultiGrid not Collect. You should also add an
> invalid positions component if the grids overlap to identify which subgrids
> to use or not to use in those overlap regions.
>
> Use Statistics on the group and pass the min and max to Colormap and pass
> the output colormap to Colorbar.
>
>
> Hi,
>
> I use OpenDX to visualize the output from CRAFT CFD code running on a
> linux cluster. To be able to see how the solution converge/evolve I
> wrote a filter that reads the intermediate output from each process
> that works on a subdomain of the total grid and Collect them in a
> "single" set of fields:
>
> process1: Import -> Select -> |
> process2: Import -> Select -> |
> ... | -> Collect -> data ...
> process9: Import -> Select -> |
>
> I can see the subfields recombined by OpenDX as a single field over the
> whole grid. The problem I have is that ColorBar still remember that data
> are actually a group of subgrids and complains: "colormap must be a
> field, not a group". How can I recombine several subgrids into a single
> grid?
>
> Thanks in advance,
> Ted