Page 1 of 1

How to get the mesh elements on a specific boundary or plane?

Posted: Mon Oct 28, 2019 5:56 pm
by Mohammad
Hello,
I want to do a calculation only on a specific boundary (using a loop).
How can I set the loop that it only does the calculation for example on right boundary?
For example the following loop works on all mesh elements:

Code: Select all

for (cs_lnum_t i = 0; i < n_cells_ext; i++)
{
...
}
I want it to only work on specific boundaries or planes.

CS ver: 5.0.9
Thank you.

Re: How to get the mesh elements on a specific boundary or plane?

Posted: Tue Oct 29, 2019 1:28 pm
by joubanba
Hello,

See the following example on how to get the elements of a boundary and apply boundary conditions on them thanks to the FORTRAN function getfbr() :

https://www.code-saturne.org/cms/sites/ ... mples.html

Regards,

Jamal

Re: How to get the mesh elements on a specific boundary or plane?

Posted: Tue Oct 29, 2019 1:34 pm
by Mohammad
joubanba wrote: Tue Oct 29, 2019 1:28 pm Hello,

See the following example on how to get the elements of a boundary and apply boundary conditions on them thanks to the FORTRAN function getfbr() :

https://www.code-saturne.org/cms/sites/ ... mples.html

Regards,

Jamal
Thank you very much Jamal,

Is that the same as cs_selector_get_b_face_list() function in C?

https://www.code-saturne.org/cms/sites/ ... d2c7611084

Re: How to get the mesh elements on a specific boundary or plane?

Posted: Tue Oct 29, 2019 1:48 pm
by joubanba
Yes. It's the equivalent of the Fortran function.

Jamal