The geometry module calculates various geometrical quantities like face-normals, face-areas and cell-volumes to be used in computations.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private | :: | imx | ||||
integer, | private | :: | jmx | ||||
integer, | private | :: | kmx |
Compute the volume of a tetrahedron, given 4 points which are 1-D arrays Since we know that the determinant is to be evaluated of a 3x3 matrix, we write the expression itself
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | p1 | ||
real(kind=wp), | intent(in), | dimension(:) | :: | p2 | ||
real(kind=wp), | intent(in), | dimension(:) | :: | p3 | ||
real(kind=wp), | intent(in), | dimension(:) | :: | p4 |
Compute the volume of a hexahedron, given a list of points
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(1:3, 1:8) | :: | p_list |
Allocate memory for the required variables.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(celltype), | intent(out), | dimension(:,:,:), allocatable | :: | cells | Store cell center quantities: volume, cell center coordinate |
|
type(facetype), | intent(out), | dimension(:,:,:), allocatable | :: | Ifaces | Store face quantites for I faces: normal and area |
|
type(facetype), | intent(out), | dimension(:,:,:), allocatable | :: | Jfaces | Store face quantites for J faces: normal and area |
|
type(facetype), | intent(out), | dimension(:,:,:), allocatable | :: | Kfaces | Store face quantites for K faces: normal and area |
Normalize the face normal vectors computed to get unit vectors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(facetype), | intent(inout), | dimension(-2:imx+3,-2:jmx+2,-2:kmx+2) | :: | Ifaces | Store face quantites for I faces: normal and area |
|
type(facetype), | intent(inout), | dimension(-2:imx+2,-2:jmx+3,-2:kmx+2) | :: | Jfaces | Store face quantites for J faces: normal and area |
|
type(facetype), | intent(inout), | dimension(-2:imx+2,-2:jmx+2,-2:kmx+3) | :: | Kfaces | Store face quantites for K faces: normal and area |
|
type(boundarytype), | intent(in) | :: | bc |
Compute face areas based on area vectors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(facetype), | intent(inout), | dimension(-2:imx+3,-2:jmx+2,-2:kmx+2) | :: | Ifaces | Store face quantites for I faces: normal and area |
|
type(facetype), | intent(inout), | dimension(-2:imx+2,-2:jmx+3,-2:kmx+2) | :: | Jfaces | Store face quantites for J faces: normal and area |
|
type(facetype), | intent(inout), | dimension(-2:imx+2,-2:jmx+2,-2:kmx+3) | :: | Kfaces | Store face quantites for K faces: normal and area |
|
type(boundarytype), | intent(in) | :: | bc |
Compute face area vectors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(facetype), | intent(inout), | dimension(-2:imx+3,-2:jmx+2,-2:kmx+2) | :: | Ifaces | Store face quantites for I faces: normal and area |
|
type(facetype), | intent(inout), | dimension(-2:imx+2,-2:jmx+3,-2:kmx+2) | :: | Jfaces | Store face quantites for J faces: normal and area |
|
type(facetype), | intent(inout), | dimension(-2:imx+2,-2:jmx+2,-2:kmx+3) | :: | Kfaces | Store face quantites for K faces: normal and area |
|
type(nodetype), | intent(in), | dimension(-2:imx+3,-2:jmx+3,-2:kmx+3) | :: | nodes | Grid points |
Compute the face areas and normals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(facetype), | intent(inout), | dimension(-2:imx+3,-2:jmx+2,-2:kmx+2) | :: | Ifaces | Store face quantites for I faces: normal and area |
|
type(facetype), | intent(inout), | dimension(-2:imx+2,-2:jmx+3,-2:kmx+2) | :: | Jfaces | Store face quantites for J faces: normal and area |
|
type(facetype), | intent(inout), | dimension(-2:imx+2,-2:jmx+2,-2:kmx+3) | :: | Kfaces | Store face quantites for K faces: normal and area |
|
type(nodetype), | intent(in), | dimension(-2:imx+3,-2:jmx+3,-2:kmx+3) | :: | nodes | Grid points |
|
type(boundarytype), | intent(in) | :: | bc | boundary condition and fixed values |
Compute the grid cell volumes Each grid is a hexahedron, whose volume is calculated by splitting it into 5 tetrahedrons, whose volume is known
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(celltype), | intent(out), | dimension(-2:imx+2,-2:jmx+2,-2:kmx+2) | :: | cells | Cell center quanties: volume and coordiantes of cell center |
|
type(nodetype), | intent(in), | dimension(-2:imx+3,-2:jmx+3,-2:kmx+3) | :: | nodes | Grid points |
Compute cell center of all cell including ghost cells
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(celltype), | intent(out), | dimension(-2:imx+2,-2:jmx+2,-2:kmx+2) | :: | cells | Cell center quanties: volume and coordiantes of cell center |
|
type(nodetype), | intent(in), | dimension(-2:imx+3,-2:jmx+3,-2:kmx+3) | :: | nodes | Grid points |
Make the geometry module useful
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(celltype), | intent(inout), | dimension(:,:,:), allocatable | :: | cells | Cell center quanties: volume and coordiantes of cell center |
|
type(facetype), | intent(inout), | dimension(:,:,:), allocatable | :: | Ifaces | Store face quantites for I faces: normal and area |
|
type(facetype), | intent(inout), | dimension(:,:,:), allocatable | :: | Jfaces | Store face quantites for J faces: normal and area |
|
type(facetype), | intent(inout), | dimension(:,:,:), allocatable | :: | Kfaces | Store face quantites for K faces: normal and area |
|
type(nodetype), | intent(in), | dimension(-2:imx+3,-2:jmx+3,-2:kmx+3) | :: | nodes | Grid points |
|
type(boundarytype), | intent(in) | :: | bc | boundary conditions and fixed values |
||
type(extent), | intent(in) | :: | dims |