Computes a filtered quantity on the Eulerian grid.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(marker_set), | intent(inout) | :: | this |
A collection of tessellation elements |
||
| character(len=*), | intent(in) | :: | var |
Variable to compute |
||
| type(eulerian_obj_r), | intent(inout) | :: | field |
Filtered quantity |
impure subroutine marker_set_Filter(this,var,field) !> Computes a filtered quantity on the Eulerian grid. implicit none class(marker_set), intent(inout) :: this !! A collection of tessellation elements character(len=*), intent(in) :: var !! Variable to compute type(eulerian_obj_r), intent(inout) :: field !! Filtered quantity ! Work variables real(wp), allocatable :: bump(:,:,:) real(wp):: coef integer :: slo(3),shi(3) integer :: n,i,j,k ! Initialize field field%cell=0.0_wp select type(markers=>this%p) type is (marker_obj) select case(trim(adjustl(var))) case ('SA') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('V1') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*markers(n)%v(1) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('V2') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*markers(n)%v(2) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('V3') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*markers(n)%v(3) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('F1') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*markers(n)%f(1) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('F2') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*markers(n)%f(2) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('F3') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*markers(n)%f(3) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('N1') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*markers(n)%n(1) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('N2') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*markers(n)%n(2) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('N3') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*markers(n)%n(3) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('V.N') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*sum(markers(n)%v(:)*markers(n)%n(:)) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('VISC11') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*(markers(n)%v(1)*markers(n)%n(1)+markers(n)%v(1)*markers(n)%n(1)) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('VISC22') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*(markers(n)%v(2)*markers(n)%n(2)+markers(n)%v(2)*markers(n)%n(2)) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('VISC33') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*(markers(n)%v(3)*markers(n)%n(3)+markers(n)%v(3)*markers(n)%n(3)) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('VISC12') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*(markers(n)%v(1)*markers(n)%n(2)+markers(n)%v(2)*markers(n)%n(1)) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('VISC13') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*(markers(n)%v(1)*markers(n)%n(3)+markers(n)%v(3)*markers(n)%n(1)) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('VISC23') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=markers(n)%c-this%stib/2 shi=markers(n)%c+this%stib/2 call markers(n)%Extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=markers(n)%SA*(markers(n)%v(2)*markers(n)%n(3)+markers(n)%v(3)*markers(n)%n(2)) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do end select end select ! Free memory if (allocated(bump)) deallocate(bump) ! Update ghostcells call field%AddUpGhostCells return end subroutine marker_set_Filter