How to Manage Separate Monitoring Outputs with Multiple Probe Files

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
ximeng
Posts: 32
Joined: Sun Jan 22, 2023 3:28 pm

How to Manage Separate Monitoring Outputs with Multiple Probe Files

Post by ximeng »

Hi Team,

I'm currently using the cs_user_postprocess_monitors.c file to set up probes and collect their data, as I have a large number of monitors (please see the attached screenshot for reference).

I was wondering if it's possible to use multiple cs_user_postprocess_monitors.c files to generate separate outputs to different Monitoring folders. I tried creating another file named cs_user_postprocess_monitors2.c, and updated the relevant lines to use "Monitoring2" instead of "Monitoring" :
cs_probe_set_t *pset = cs_probe_set_create("Monitoring2");
cs_probe_set_t *pset = cs_probe_set_get("Monitoring2");

However, it doesn’t seem to work at compiling stage. Is there a recommended way to achieve this separation of outputs using multiple monitoring files?

Thanks in advance for your support!

Best regards,
Attachments
cs_user_postprocess_monitors.c
(4.04 KiB) Downloaded 697 times
Yvan Fournier
Posts: 4226
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to Manage Separate Monitoring Outputs with Multiple Probe Files

Post by Yvan Fournier »

Hello,

You cannot define the same function in multiple files, but you can define multiple probe sets in a single cs_user_postprocess_probes function.

If you have many similar probe sets, I recommend declaring them in a loop rather than copy/pasting the same instructions.

Best regards,

Yvan
ximeng
Posts: 32
Joined: Sun Jan 22, 2023 3:28 pm

Re: How to Manage Separate Monitoring Outputs with Multiple Probe Files

Post by ximeng »

Hi Yvan,

Thanks.

I can use a single cs_user_postprocess_probes function, but the issue is that I want the outputs to be separate files. Since the number of probes is very large, combining all the data into one file results in a huge output, making postprocessing difficult and inefficient.

Best regards,
Yvan Fournier
Posts: 4226
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to Manage Separate Monitoring Outputs with Multiple Probe Files

Post by Yvan Fournier »

Hello,

To use different directories, you need to create one writer per directory, using cs_post_define_writer (where you can define a separate directory for each writer) , then use "cs_probe_set_associate_writers" to assign a different writer for each probe set.

In any case, if you really have a huge amount of probes, computing/interpolating values and outputting the results may not be very efficient. In this case, outputting volumic data or doing at least some partial filtering with in-situ postprocessing (possibly using Catalyst) may be a good choice.

Best regards,

Yvan
Post Reply