How to write different samplers into specific files?

已查看 31 次
跳至第一个未读帖子

Kiny Wan

未读,
2020年7月25日 03:10:062020/7/25
收件人 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

未读,
2020年7月25日 13:01:072020/7/25
收件人 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

未读,
2020年7月26日 03:54:502020/7/26
收件人 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

未读,
2020年7月27日 09:15:562020/7/27
收件人 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

未读,
2020年7月27日 09:37:552020/7/27
收件人 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

未读,
2020年7月27日 10:00:232020/7/27
收件人 PyFR Mailing List
Thanks for your kind reminding,  Freddie. The multiple sampler plugins indeed spend much time. Regards Kiny.
回复全部
回复作者
转发
0 个新帖子