How to write different samplers into specific files?

Dear all,
I want to use ‘[soln-plugin-sampler]’ for sampling, but sometimes there are more than three sampling points and each accompanies with long data series. I would like to ask about how to write different samplers into specific files in PyFR?

[soln-plugin-sampler]
nsteps = 1
samp-pts = [(0.0, 0.0),(0.0, 0.1),(0.0, 0.2)]
format = primative
file = point-data.csv
header = true

Regards
Kiny

The sampler plugin supports any number of sample points. There is no
need to limit yourself to just three points.

If you want different samples to go into different files you can have
multiple instances of the sampler plugin.

Regards, Freddie.

Thank you, Freddie. I adopt ‘[soln-plugin-sampler]’ and ‘[soln-plugin-sampler-1]’ to get multiple instances of the sampler plugin.

Hi Freddie, I wrote a matlab function to generate sampler plugin in batches. Hope this can help those in need. Regards, Kiny.

clear all; close all;clc
fid = fopen(‘PyFR_sample.dat’, ‘w’);
x = linspace(0,30.64,200);
y = -30*ones(1,length(x));
nstep = 1 ;
format = ‘primative’;
header = ‘true’;

for i =1:length(x)
fprintf (fid, ‘[soln-plugin-sampler-%d] \n’, i);
fprintf (fid, ‘nsteps = %d \n’, nstep);
fprintf (fid, ‘samp-pts = [( %f, %f)] \n’, x(i),y(i));
fprintf (fid, ‘format = %s \n’, format);
fprintf (fid, ‘file = ./data/pyfr_%d.csv \n’, i);
fprintf (fid, ‘header = %s \n’, header);
fprintf (fid, ‘\n’);
end
fclose(fid)

This is not something you want to do.

The only time it is sensible to use multiple instances of the point sampler plugin is if you wish to sample certain points at a different frequency. Otherwise, you’re trashing your run-time performance by introducing a large amount of unnecessary overhead.

Regards, Freddie.

Thanks for your kind reminding, Freddie. The multiple sampler plugins indeed spend much time. Regards Kiny.