code-saturne / code_saturne

code_saturne public mirror
https://www.code-saturne.org
GNU General Public License v2.0
218 stars 81 forks source link

[6.0] Overlay of boundary zones defined in the GUI #61

Closed mathrack closed 4 years ago

mathrack commented 4 years ago

Hello,

Trying to set up a case with version 6.0. I have defined boundary zones in the GUI and in cs_user_zones. However, when trying to set overlay for a boundary zone defined in the GUI from cs_user_zones, cs_boundary_zone_by_name returns a random number for the zone id. Using directly the zone id available in the GUI works like a charm. Is this the expected behavior ? See code below.

Thanks, Cédric

cs_user_zones(void)
{
    int z_id = 1;//cs_boundary_zone_by_name("Sol");
    cs_boundary_zone_set_overlay(z_id, true);
    [...]
}
YvanFournier commented 4 years ago

Hello,

cs_boundary_zone_by_name should directly return a pointer to the zone, not its id, so you can try:

cs_zone_t *z = cs_boundary_zone_by_name("Sol");
cs_boundary_zone_set_overlay(z->id, true);
mathrack commented 4 years ago

Then, this is the expected behavior, thank you for the reminder.