geometry Module

The geometry module calculates various geometrical quantities like face-normals, face-areas and cell-volumes to be used in computations.


Uses

  • module~~geometry~~UsesGraph module~geometry geometry module~utils utils module~geometry->module~utils module~vartypes vartypes module~geometry->module~vartypes iso_fortran_env iso_fortran_env module~vartypes->iso_fortran_env

Used by

  • module~~geometry~~UsedByGraph module~geometry geometry module~solver solver module~solver->module~geometry program~main main program~main->module~solver

Contents


Variables

TypeVisibility AttributesNameInitial
integer, private :: imx
integer, private :: jmx
integer, private :: kmx

Functions

private function vol_tetrahedron(p1, p2, p3, p4)

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

Arguments

Type IntentOptional AttributesName
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

Return Value real(kind=wp)

private function vol_hexahedron(p_list)

Compute the volume of a hexahedron, given a list of points

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(1:3, 1:8):: p_list

Return Value real(kind=wp)


Subroutines

private subroutine allocate_memory(cells, Ifaces, Jfaces, Kfaces)

Allocate memory for the required variables.

Read more…

Arguments

Type IntentOptional AttributesName
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

private subroutine normalize_face_normals(Ifaces, Jfaces, Kfaces, bc)

Normalize the face normal vectors computed to get unit vectors

Arguments

Type IntentOptional AttributesName
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

private subroutine compute_face_areas(Ifaces, Jfaces, Kfaces, bc)

Compute face areas based on area vectors

Read more…

Arguments

Type IntentOptional AttributesName
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

private subroutine compute_face_area_vectors(Ifaces, Jfaces, Kfaces, nodes)

Compute face area vectors

Read more…

Arguments

Type IntentOptional AttributesName
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

private subroutine compute_face_areas_and_normals(Ifaces, Jfaces, Kfaces, nodes, bc)

Compute the face areas and normals

Read more…

Arguments

Type IntentOptional AttributesName
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

private subroutine compute_volumes(cells, nodes)

Compute the grid cell volumes Each grid is a hexahedron, whose volume is calculated by splitting it into 5 tetrahedrons, whose volume is known

Arguments

Type IntentOptional AttributesName
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

private subroutine compute_ghost_cell_centroid(cells, nodes)

Compute cell center of all cell including ghost cells

Arguments

Type IntentOptional AttributesName
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

public subroutine setup_geometry(cells, Ifaces, Jfaces, Kfaces, nodes, bc, dims)

Make the geometry module useful

Read more…

Arguments

Type IntentOptional AttributesName
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