EquidistanceInPoint
This subroutine returns the equidistance points in the Hexahedron.
The points are strictly inside the Hexahedron.
Interface
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE PURE FUNCTION EquidistanceInPoint_Hexahedron(order, xij) &
& RESULT(ans)
INTEGER(I4B), INTENT(IN) :: order
!! order
REAL(DFP), OPTIONAL, INTENT(IN) :: xij(:, :)
!! number of rows = 3
!! number of cols = 8
REAL(DFP), ALLOCATABLE :: ans(:, :)
!! returned coordinates in $x_{iJ}$ format
END FUNCTION EquidistanceInPoint_Hexahedron
END INTERFACE
program main
use easifembase
implicit none
integer( i4b ) :: i1, i2, order
real( dfp ), allocatable :: x(:,:)
type(String) :: astr
order=2
x = EquidistanceInPoint_Hexahedron( order=order )
astr = "| no | $x_1$ | $x_2$ | $x_3$ |" // char_lf
astr = astr // mdencode( arange(1.0_DFP, (order-1.0_DFP)**3) .colconcat. TRANSPOSE(x))
call display( astr%chars(), "xij (order="//tostring(order)//")=" // char_lf // char_lf )
end program main
xij (order=2)=
no | |||
---|---|---|---|
1 | 0 | 0 | 0 |
Interface 2
INTERFACE EquidistanceInPoint_Hexahedron
MODULE PURE FUNCTION EquidistanceInPoint_Hexahedron2(p, q, r, xij) &
& RESULT(ans)
INTEGER(I4B), INTENT(IN) :: p, q, r
!! order in x, y, and z direction
REAL(DFP), OPTIONAL, INTENT(IN) :: xij(:, :)
!! number of rows = 3
!! number of cols = 8
REAL(DFP), ALLOCATABLE :: ans(:, :)
!! returned coordinates in $x_{iJ}$ format
END FUNCTION EquidistanceInPoint_Hexahedron2
END INTERFACE EquidistanceInPoint_Hexahedron
Results
Order 1
None
Order 2
no | |||
---|---|---|---|
1 | 0 | 0 | 0 |
Order 3
See results
no | |||
---|---|---|---|
1 | -0.33333 | -0.33333 | -0.33333 |
2 | 0.33333 | -0.33333 | -0.33333 |
3 | 0.33333 | 0.33333 | -0.33333 |
4 | -0.33333 | 0.33333 | -0.33333 |
5 | -0.33333 | -0.33333 | 0.33333 |
6 | 0.33333 | -0.33333 | 0.33333 |
7 | 0.33333 | 0.33333 | 0.33333 |
8 | -0.33333 | 0.33333 | 0.33333 |