Page 1 of 1

Differenciating hexa cells from tetra cells for user subroutines

Posted: Mon Jan 16, 2023 4:34 pm
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

Re: Differenciating hexa cells from tetra cells for user subroutines

Posted: Wed Jan 18, 2023 11:09 am
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