Differenciating hexa cells from tetra cells for user subroutines

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Boone11
Posts: 20
Joined: Fri Jan 13, 2023 10:47 am

Differenciating hexa cells from tetra cells for user subroutines

Post by Boone11 »

Hi all,

To run a 3D simulation I use a mesh that is composed of both hexa cells and tetra cells.
I would like to create a .f90 user subroutine to compute the longest edge of each cells for modelling purpose. I have code that permits to perform this computation with hexa cells and I have to do the one that works for tetra cells.

I plan to do something like this:

Code: Select all

if(cell_type==hexa) then
	code to compute the longest edge of hexa cells
	else
		code to compute the longest edge of tetra cells
endif
Is there a variable that permits differenciating hexa cells from tetra cell? If not, is there a means to differenciate them?

Thanks for your help,
Sincerely
Boone11
Posts: 20
Joined: Fri Jan 13, 2023 10:47 am

Re: Differenciating hexa cells from tetra cells for user subroutines

Post by Boone11 »

I found a solution to my question. I post it if it can help someone. The point is to use: ipnfbr(ifac).

Code: Select all

if (ipnfbr(ifac+1)-ipnfbr(ifac).eq.4) then
	print*, "Hexa"
	else if (ipnfbr(ifac+1)-ipnfbr(ifac).eq.3) then
		print*, "Tetra"
endif
Post Reply