How to write different samplers into specific files?

31 views
Skip to first unread message

Kiny Wan

unread,
Jul 25, 2020, 3:10:06 AM7/25/20
to PyFR Mailing List
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

Freddie Witherden

unread,
Jul 25, 2020, 1:01:07 PM7/25/20
to pyfrmai...@googlegroups.com
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.
> --
> You received this message because you are subscribed to the Google
> Groups "PyFR Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pyfrmailingli...@googlegroups.com
> <mailto:pyfrmailingli...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pyfrmailinglist/6bf63767-9f35-45d2-a3bc-91120fd9d682n%40googlegroups.com
> <https://groups.google.com/d/msgid/pyfrmailinglist/6bf63767-9f35-45d2-a3bc-91120fd9d682n%40googlegroups.com?utm_medium=email&utm_source=footer>.


Kiny Wan

unread,
Jul 26, 2020, 3:54:50 AM7/26/20
to PyFR Mailing List
Thank you,  Freddie. I adopt '[soln-plugin-sampler]' and '[soln-plugin-sampler-1]' to get multiple instances of the sampler plugin.

Kiny Wan

unread,
Jul 27, 2020, 9:15:56 AM7/27/20
to PyFR Mailing List
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)

Freddie Witherden

unread,
Jul 27, 2020, 9:37:55 AM7/27/20
to Kiny Wan, PyFR Mailing List
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.

On 27 Jul 2020, at 08:15, Kiny Wan <wlc...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "PyFR Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyfrmailingli...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pyfrmailinglist/ebeece9f-cb89-4f89-ab57-d8e8f496b5bcn%40googlegroups.com.

Kiny Wan

unread,
Jul 27, 2020, 10:00:23 AM7/27/20
to PyFR Mailing List
Thanks for your kind reminding,  Freddie. The multiple sampler plugins indeed spend much time. Regards Kiny.
Reply all
Reply to author
Forward
0 new messages