Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src_conformal/cell_map.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module cell_map_mod

use geometry_mod, only: triangle_t, side_t, interval_t, FACE_X, FACE_Y, FACE_Z, isNewSide
use fhash, only: fhash_tbl_t, key=>fhash_key
use NFDETypes, only: rkind, ConformalPECElements
use NFDETypes, only: rkind, ConformalPECElement
implicit none


Expand Down Expand Up @@ -130,8 +130,6 @@ subroutine addTriangleToSide(this, side, triangle)
allocate(this%keys(size(aux_keys)))
this%keys = aux_keys
end if


end subroutine

subroutine buildSideMap(res, triangles)
Expand All @@ -152,7 +150,7 @@ subroutine buildSideMap(res, triangles)

subroutine buildCellMap(res, volume)
type(cell_map_t), intent(inout) :: res
type(ConformalPECElements), intent(in) :: volume
type(ConformalPECElement), intent(in) :: volume
type(triangle_map_t) :: tri_map
type(interval_map_t) :: interval_map
type(side_map_t) :: side_map, side_map_on
Expand Down
41 changes: 27 additions & 14 deletions src_conformal/conformal.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module conformal_mod

use geometry_mod
use cell_map_mod
use NFDETypes, only: ConformalPECRegions, ConformalPECElements, ConformalMedia_t, &
use NFDETypes, only: ConformalPECRegions, ConformalPECElement, ConformalMedia_t, &
edge_t, face_t, &
conformal_face_media_t, conformal_edge_media_t, rkind

Expand All @@ -21,28 +21,41 @@ function buildSideMaps(regions) result(res)
end do
end function

function buildConformalMedia(regions) result(res)
type(ConformalPECRegions), intent(in) :: regions
subroutine buildConformalMedia(conformalRegs, volumes, surfaces)
type(ConformalPECRegions), pointer, intent(in) :: conformalRegs
type(ConformalMedia_t), allocatable, dimension(:), intent(inout) :: volumes, surfaces
if (associated(conformalRegs%volumes)) then
volumes = buildMedia(conformalRegs%volumes)
else
allocate(volumes(0))
end if
if (associated(conformalRegs%surfaces)) then
surfaces = buildMedia(conformalRegs%surfaces)
else
allocate(surfaces(0))
end if
end subroutine

function buildMedia(elements) result(res)
type(ConformalPECElement), dimension(:), pointer :: elements
type(ConformalMedia_t), dimension(:), allocatable :: res
integer :: i
allocate(res(size(regions%volumes)))
do i = 1, size(regions%volumes)
res(i) = buildConformalVolume(regions%volumes(i))
allocate(res(size(elements)))
do i = 1, size(elements)
res(i) = buildMediaFromElement(elements(i))
end do
end function


function buildConformalVolume(volume) result(res)
type(ConformalPECElements), intent(in) :: volume
function buildMediaFromElement(element) result(res)
type(ConformalPECElement), intent(in) :: element
type(ConformalMedia_t) :: res

type(cell_map_t) :: cell_map
real (kind=rkind), dimension(:), allocatable :: edge_ratios, face_ratios
type(edge_t), dimension(:), allocatable :: edges, filtered_edges
type(face_t), dimension(:), allocatable :: faces, filtered_faces
integer :: i
type(edge_t), dimension(:), allocatable :: edges
type(face_t), dimension(:), allocatable :: faces

call buildCellMap(cell_map, volume)
call buildCellMap(cell_map, element)
call fillElements(cell_map, faces, edges)
call addNewRatios(edges, faces, edge_ratios, face_ratios)
res%edge_media => addEdgeMedia(edges, edge_ratios)
Expand All @@ -52,7 +65,7 @@ function buildConformalVolume(volume) result(res)
res%n_faces_media = size(res%face_media)

res%time_step_scale_factor = computeTimeStepScalingFactor(res%edge_media, res%face_media)
res%tag = volume%tag
res%tag = element%tag
end function

subroutine addNewRatios(edges, faces, edge_ratios, face_ratios)
Expand Down
Loading
Loading