包含基于射线追踪的任意复杂界面计算
这个提交包含在:
@@ -0,0 +1,15 @@
|
||||
!Copyright (c) 2022 by LEEE under guide of Huaifeng Sun(sunhuaifeng@gmail.com)
|
||||
!written by Qi Zhao(zhaoqi_326326@163.com)
|
||||
MODULE Precision
|
||||
USE ISO_FORTRAN_ENV, ONLY : i1k => INT8, i2k => INT16, i4k => INT32, i8k => INT64, &
|
||||
& r4k => REAL32, r8k => REAL64, r16k => REAL128
|
||||
IMPLICIT NONE
|
||||
!! Author: Qi Zhao
|
||||
!! Date: 03/11/2024
|
||||
!!
|
||||
!! This module contains the Precision used for specifying the precision of variables
|
||||
!!
|
||||
PRIVATE
|
||||
PUBLIC :: i1k, i2k, i4k, i8k, r4k, r8k, r16k
|
||||
|
||||
END MODULE Precision
|
||||
@@ -0,0 +1,21 @@
|
||||
!Copyright (c) 2022 by LEEE under guide of Huaifeng Sun(sunhuaifeng@gmail.com)
|
||||
!written by Qi Zhao(zhaoqi_326326@163.com)
|
||||
MODULE vtk_fix_header
|
||||
USE Precision, ONLY : i4k
|
||||
IMPLICIT NONE
|
||||
!! Author: Qi Zhao
|
||||
!! Date: 03/11/2024
|
||||
!!
|
||||
!! This module contains fix header information for the vtk file
|
||||
!!
|
||||
PRIVATE
|
||||
PUBLIC :: version, default_title, vtkfilename, vtktitle,default_filename,vtk_form !! Selected file type
|
||||
|
||||
CHARACTER(LEN=*), PARAMETER :: version = '# vtk DataFile Version 3.0' !! VTK datafile version
|
||||
CHARACTER(LEN=*), PARAMETER :: default_title = 'Version 3.0 VTK file' !! Title card
|
||||
CHARACTER(LEN=*), PARAMETER :: default_filename = 'zhaoqi.vtk' !! Default filename
|
||||
CHARACTER(LEN=*), PARAMETER :: vtk_form = 'ASCII' !! Default filename
|
||||
CHARACTER(LEN=:), ALLOCATABLE :: vtkfilename !! Supplied filename
|
||||
CHARACTER(LEN=:), ALLOCATABLE :: vtktitle !! Supplied title
|
||||
|
||||
END MODULE vtk_fix_header
|
||||
@@ -0,0 +1,323 @@
|
||||
!Copyright (c) 2022 by LEEE under guide of Huaifeng Sun(sunhuaifeng@gmail.com)
|
||||
!written by Qi Zhao(zhaoqi_326326@163.com)
|
||||
|
||||
! --------------------------------Subroutine part---------------------------------------------!
|
||||
Module VTK_Fortran
|
||||
USE Precision, ONLY : i4k, r8k
|
||||
USE vtk_fix_header
|
||||
IMPLICIT NONE
|
||||
!! Author: Qi Zhao
|
||||
!! Date: 03/11/2024
|
||||
!!
|
||||
!! This module contains the dataset formats for vtk format, referencing https://blog.sina.com.cn/s/blog_6d5f47470102yi7g.html
|
||||
!!
|
||||
!! There are availble dataset formats as follow:
|
||||
!! 1) Structured grids
|
||||
!!
|
||||
private
|
||||
public :: Struct_grid
|
||||
|
||||
TYPE :: struct_grid
|
||||
!! Structured grids
|
||||
PRIVATE
|
||||
INTEGER(i4k), PUBLIC :: error
|
||||
CHARACTER(25) :: dataset_structure = 'DATASET UNSTRUCTURED_GRID'
|
||||
INTEGER(i4k) :: num_of_point_each_element = 8
|
||||
|
||||
INTEGER(i4k) :: unit
|
||||
|
||||
INTEGER(i4k), DIMENSION(3) :: dims
|
||||
REAL(r8k), DIMENSION(:), ALLOCATABLE :: Coord_x,Coord_y,Coord_z
|
||||
|
||||
CONTAINS
|
||||
PROCEDURE, PUBLIC :: init
|
||||
PROCEDURE, PUBLIC :: write => struct_grid_write
|
||||
PROCEDURE, PUBLIC :: add => struct_grid_add
|
||||
PROCEDURE, PUBLIC :: close => struct_grid_close
|
||||
|
||||
END TYPE struct_grid
|
||||
|
||||
CONTAINS
|
||||
|
||||
SUBROUTINE init (self, title, filename, dims, Coord_x, Coord_y, Coord_z)
|
||||
!! author: Qi Zhao
|
||||
!! date: 03/11/2024
|
||||
!!
|
||||
!! This subtoutine is used to initialize the basic parameters
|
||||
!!
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS (struct_grid), INTENT(OUT) :: self
|
||||
CHARACTER(*), INTENT(IN), OPTIONAL :: title
|
||||
CHARACTER(*), INTENT(IN), OPTIONAL :: filename
|
||||
INTEGER(i4k), DIMENSION(3), INTENT(IN) :: dims
|
||||
REAL(r8k), DIMENSION(:), INTENT(IN) :: Coord_x, Coord_y, Coord_z
|
||||
|
||||
|
||||
self%dims = dims
|
||||
|
||||
ALLOCATE(self%Coord_x(SIZE(Coord_x)))
|
||||
ALLOCATE(self%Coord_y(SIZE(Coord_y)))
|
||||
ALLOCATE(self%Coord_z(SIZE(Coord_z)))
|
||||
|
||||
self%Coord_x = Coord_x
|
||||
self%Coord_y = Coord_y
|
||||
self%Coord_z = Coord_z
|
||||
|
||||
IF (PRESENT(title)) THEN
|
||||
ALLOCATE( vtktitle, source=title) !! Calling program provided a title
|
||||
ELSE
|
||||
ALLOCATE(vtktitle, source=default_title) !! Calling program did not provide a title. Use default
|
||||
END IF
|
||||
|
||||
IF (PRESENT(filename)) THEN
|
||||
ALLOCATE( vtkfilename, source=filename) !! Calling program provided a filename
|
||||
ELSE
|
||||
ALLOCATE(vtkfilename, source=default_filename) !! Calling program did not provide a filename. Use default
|
||||
END IF
|
||||
|
||||
END SUBROUTINE init
|
||||
|
||||
SUBROUTINE struct_grid_write (self)
|
||||
!! author: Qi Zhao
|
||||
!! date: 03/11/2024
|
||||
!!
|
||||
!! This subtoutine is used to write the data to the .vtk file
|
||||
!!
|
||||
!! The following programs will be executed
|
||||
!! 1) Write the header key
|
||||
!! 2) Write the points key and data
|
||||
!! 3) Write the cells key and data
|
||||
!!
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS (struct_grid) :: self
|
||||
INTEGER(i4k) ::unit
|
||||
INTEGER(i4k):: error
|
||||
|
||||
unit = open_file( vtkfilename )
|
||||
|
||||
self%unit = unit
|
||||
|
||||
error = write_header_to_file( unit,version )
|
||||
error = write_header_to_file( unit,vtktitle )
|
||||
error = write_header_to_file( unit,vtk_form )
|
||||
error = write_header_to_file( unit,self%dataset_structure )
|
||||
|
||||
error = write_point_to_file( unit, self%Coord_x, self%Coord_y, self%Coord_z, self%dims )
|
||||
error = write_cell_to_file ( unit, self%num_of_point_each_element, self%dims )
|
||||
|
||||
END SUBROUTINE struct_grid_write
|
||||
|
||||
SUBROUTINE struct_grid_add(self, names,values)
|
||||
!! author: Qi Zhao
|
||||
!! date: 03/11/2024
|
||||
!!
|
||||
!! This subroutine is used to write the data value with name to the .vtk file
|
||||
!!
|
||||
IMPLICIT NONE
|
||||
CLASS (struct_grid), INTENT(IN) :: self
|
||||
CHARACTER(*), INTENT(IN) :: names
|
||||
REAL(r8k), DIMENSION(:,:,:), INTENT(IN) :: values
|
||||
INTEGER(i4k):: error
|
||||
|
||||
error = write_value_to_file ( self%unit, names, values, self%dims )
|
||||
|
||||
END SUBROUTINE struct_grid_add
|
||||
|
||||
SUBROUTINE struct_grid_close(self)
|
||||
!! author: Qi Zhao
|
||||
!! date: 03/11/2024
|
||||
!!
|
||||
!! --------------------------------------------------------------------------------------------------------
|
||||
!!
|
||||
!! This subroutine is used to write the data value with name to the .vtk file
|
||||
!!
|
||||
IMPLICIT NONE
|
||||
CLASS (struct_grid), INTENT(IN) :: self
|
||||
|
||||
close(self%unit)
|
||||
|
||||
END SUBROUTINE struct_grid_close
|
||||
|
||||
FUNCTION open_file( filename ) result(unit)
|
||||
!! author: Qi Zhao
|
||||
!! date: 03/11/2024
|
||||
!!
|
||||
!! This function is used to open the .vtk file
|
||||
!!
|
||||
character(*), intent(in):: filename
|
||||
integer(i4k):: error
|
||||
integer(i4k):: unit
|
||||
|
||||
open(newunit=unit, &
|
||||
file=trim(adjustl(filename)), &
|
||||
!form='UNFORMATTED', &
|
||||
!access='STREAM', &
|
||||
action='WRITE', &
|
||||
status='REPLACE', &
|
||||
iostat=error)
|
||||
|
||||
END FUNCTION open_file
|
||||
|
||||
FUNCTION write_header_to_file( unit, header ) result(error)
|
||||
!! author: Qi Zhao
|
||||
!! date: 03/11/2024
|
||||
!!
|
||||
!! This function is used to write the key to the .vtk file
|
||||
!!
|
||||
character(*), intent(in):: header
|
||||
integer(i4k) :: error
|
||||
integer(i4k):: unit
|
||||
|
||||
write(unit=unit,fmt='(a)', iostat=error) header
|
||||
|
||||
|
||||
END FUNCTION write_header_to_file
|
||||
|
||||
FUNCTION write_point_to_file( unit, Coord_x, Coord_y, Coord_z, dims ) result(error)
|
||||
!! author: Qi Zhao
|
||||
!! date: 03/11/2024
|
||||
!!
|
||||
!! This function is used to write the point key and data to the .vtk file
|
||||
!!
|
||||
INTEGER(i4k), DIMENSION(3), INTENT(IN) :: dims
|
||||
REAL(r8k), INTENT(IN) :: Coord_x( dims(1)+1 ), Coord_y( dims(2)+1 ), Coord_z( dims(3)+1 )
|
||||
|
||||
INTEGER(i4k) :: error
|
||||
INTEGER(i4k) :: unit
|
||||
INTEGER(i4k) :: points
|
||||
INTEGER(i4k) :: temp,I,J,K
|
||||
INTEGER(i4k)::NXB,NYB,NZB
|
||||
|
||||
NXB=dims(1)+1
|
||||
NYB=dims(2)+1
|
||||
NZB=dims(3)+1
|
||||
|
||||
points =NXB * NYB * NZB
|
||||
temp = 0
|
||||
|
||||
write(unit=unit,fmt='(A,I0,A)', iostat=error) "POINTS ", points, " double"
|
||||
|
||||
do k=1,NZB
|
||||
do j=1,NYB
|
||||
do i=1,NXB
|
||||
|
||||
temp = temp + 1
|
||||
write(unit, fmt='(3f)', iostat=error) Coord_x(i), Coord_y(j), Coord_z(k)
|
||||
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
|
||||
END FUNCTION write_point_to_file
|
||||
|
||||
FUNCTION write_cell_to_file( unit, nums, dims ) result(error)
|
||||
!! author: Qi Zhao
|
||||
!! date: 03/11/2024
|
||||
!!
|
||||
!! This function is used to write the cell key and data to the .vtk file
|
||||
!!
|
||||
CHARACTER(9) :: Value_site_cell="CELL_DATA"
|
||||
INTEGER(i4k), DIMENSION(3), INTENT(IN) :: dims
|
||||
INTEGER(i4k), INTENT(IN) :: nums
|
||||
INTEGER(i4k), PARAMETER :: num_cell_types = 11
|
||||
|
||||
INTEGER(i4k) :: error
|
||||
INTEGER(i4k) :: unit
|
||||
INTEGER(i4k) :: cells
|
||||
INTEGER(i4k) :: total_cells
|
||||
|
||||
INTEGER(i4k) :: temp,I,J,K
|
||||
INTEGER(i4k)::NX,NY,NZ,NXB,NYB,NZB
|
||||
|
||||
NX = dims(1)
|
||||
NY = dims(2)
|
||||
NZ = dims(3)
|
||||
|
||||
NXB = NX+1
|
||||
NYB = NY+1
|
||||
NZB = NZ+1
|
||||
|
||||
cells = NX*NY*NZ
|
||||
total_cells = (nums+1)*cells
|
||||
|
||||
temp = 0
|
||||
|
||||
write(unit=unit,fmt='(A,I0,A,I0)', iostat=error) "CELLS ", cells," ",total_cells
|
||||
|
||||
do k=1, NZ
|
||||
do j=1, NY
|
||||
do i=1,NX
|
||||
temp = temp + 1
|
||||
write(unit, fmt='(9i)', iostat=error)nums,&
|
||||
((i ) + (j-1)*NXB + (k-1)*NXB*NYB) -1, &
|
||||
((i+1) + (j-1)*NXB + (k-1)*NXB*NYB) -1, &
|
||||
((i ) + (j )*NXB + (k-1)*NXB*NYB) -1, &
|
||||
((i+1) + (j )*NXB + (k-1)*NXB*NYB) -1, &
|
||||
((i ) + (j-1)*NXB + (k )*NXB*NYB) -1, &
|
||||
((i+1) + (j-1)*NXB + (k )*NXB*NYB) -1, &
|
||||
((i ) + (j )*NXB + (k )*NXB*NYB) -1, &
|
||||
((i+1) + (j )*NXB + (k )*NXB*NYB) -1
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
|
||||
write(unit=unit,fmt='(A,I0,A,I0)', iostat=error) "CELL_TYPES ", cells
|
||||
|
||||
do i=1, temp
|
||||
write(unit, fmt='(i)', iostat=error)num_cell_types
|
||||
end do
|
||||
write(unit=unit,fmt='(2A,I0)', iostat=error) Value_site_cell," ", cells
|
||||
|
||||
END FUNCTION write_cell_to_file
|
||||
|
||||
FUNCTION write_value_to_file( unit, data_name,values, dims ) result(error)
|
||||
!! author: Qi Zhao
|
||||
!! date: 03/11/2024
|
||||
!!
|
||||
!! This function is used to write the cell key and data to the .vtk file
|
||||
!!
|
||||
INTEGER(i4k), DIMENSION(3), INTENT(IN) :: dims
|
||||
REAL(r8k), INTENT(IN) :: values( dims(1), dims(2), dims(3))
|
||||
|
||||
|
||||
CHARACTER(10) :: Value_site_point="POINT_DATA"
|
||||
CHARACTER(7) :: Value_type_scalars = "SCALARS"
|
||||
CHARACTER(6) :: Value_type_vector = "VECTOR"
|
||||
CHARACTER(6) :: Value_type_tensor = "TENSOR"
|
||||
CHARACTER(5) :: table_name = "Table"
|
||||
CHARACTER(6) :: data_type_double = "double"
|
||||
INTEGER(i4k) :: numComp
|
||||
CHARACTER(12) :: table_name_dict = "LOOKUP_TABLE"
|
||||
|
||||
CHARACTER(*), INTENT(IN) :: data_name
|
||||
|
||||
INTEGER(i4k) :: error
|
||||
INTEGER(i4k) :: unit
|
||||
|
||||
INTEGER(i4k) :: temp,I,J,K
|
||||
INTEGER(i4k)::NX,NY,NZ,NXB,NYB,NZB
|
||||
|
||||
NX = dims(1)
|
||||
NY = dims(2)
|
||||
NZ = dims(3)
|
||||
numComp = 1
|
||||
|
||||
write(unit=unit,fmt='(6A,I0)', iostat=error) Value_type_scalars, " ", data_name, " ", data_type_double, " ", numComp
|
||||
write(unit=unit,fmt='(3A)', iostat=error) table_name_dict," ",table_name
|
||||
|
||||
do k=1, NZ
|
||||
do j=1, NY
|
||||
do i=1,NX
|
||||
temp = temp + 1
|
||||
write(unit, fmt='(f)', iostat=error)values(i,j,k)
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
|
||||
|
||||
END FUNCTION write_value_to_file
|
||||
|
||||
|
||||
end Module VTK_Fortran
|
||||
@@ -2,26 +2,27 @@
|
||||
!written by Huaifeng Sun(sunhuaifeng@gmail.com) and Xushan Lu(luxushan@gmail.com)
|
||||
!Code distribution @ tdem.org or sunhuaifeng.com
|
||||
|
||||
MODULE CONSTANTPARAMETERS
|
||||
MODULE CONSTANTPARAMETERS
|
||||
INTEGER NX,NY,NZ
|
||||
! Nx,Ny,Nz is the number of grid in x, y and z directions respectively;
|
||||
REAL*8 SourceLength ! The length of source
|
||||
INTEGER SourceGridNum ! The number of grids in source area (x direction)
|
||||
INTEGER NXB,NYB,NZB !Nxb=Nx+1, Nyb=Ny+1, Nzb=Nz+1
|
||||
INTEGER NXS,NYS,NZS !This parameter mostly represents the middle grid's number, Nxs=Nx/2 or Nxs=Nxb/2, Nys=Ny/2 or Nys=Nyb/2, Nzs=Nz/2
|
||||
REAL*8 BACKGROUND_CONDUCTIVITY,TUNNEL_LENGTH !The conductivity of background; the length of tunnel
|
||||
CHARACTER*8 CAL_TYPE !The type of Calculation, in this case, it is semi which represents semi_airborne
|
||||
REAL*8 BACKGROUND_CONDUCTIVITY,TUNNEL_LENGTH !The conductivity���絼�ʣ� of background; the length of tunnel
|
||||
INTEGER CAL_TYPE !The type of Calculation�����㣩, in this case, it is semi which represents semi_airborne
|
||||
REAL*8 SIGMA_MIN !The minimum value of sigma
|
||||
REAL(KIND=8) TIME_MAX !The maximum value of iteration time step
|
||||
REAL(KIND=8) TIME_MAX !The maximum value of iteration�������� time step
|
||||
INTEGER NSTOP !The number of total iteration steps
|
||||
REAL*8 MAX_OFF_TIME !The maximum calculation time, in ms
|
||||
INTEGER LOOP !Iteration step
|
||||
REAL*8, PARAMETER:: CC=2.99792458D8 !The velocity of light
|
||||
INTEGER TEMP_II
|
||||
REAL*8, PARAMETER:: CC=2.99792458D8 !The velocity of light�����٣�
|
||||
REAL*8, PARAMETER:: PI=3.141592653589793238462643383276D0 !PI
|
||||
REAL*8, PARAMETER:: SCALE_PAR=1.05d0 !The ratio of adjacent grid's length
|
||||
REAL*8, PARAMETER:: MAX_RATIO=50.0D0 !The maximum value of scale_par
|
||||
REAL*8 GridSize !The size of a single grid, it represents the size of uniform grid.
|
||||
REAL(KIND=8), DIMENSION(:),ALLOCATABLE:: CDELX !The array of all grid size in x direction, designed for the recording of ununiform meshing.
|
||||
REAL*8, PARAMETER:: SCALE_PAR=1.3d0 !The ratio of adjacent grid's length �������ȱ���
|
||||
REAL*8, PARAMETER:: MAX_RATIO=50.0D0 !The maximum value of scale_par���߶Ȳ�����
|
||||
REAL*8 GridSize, GridSize_MAX !The size of a single grid, it represents the size of uniform grid.
|
||||
REAL(KIND=8), DIMENSION(:),ALLOCATABLE:: CDELX !The array�����飩 of all grid size in x direction, designed for the recording of ununiform meshing.
|
||||
REAL(KIND=8), DIMENSION(:),ALLOCATABLE:: CDELY !The array of all grid size in y direction, designed for the recording of ununiform meshing.
|
||||
REAL(KIND=8), DIMENSION(:),ALLOCATABLE:: CDELZ !The array of all grid size in z direction, designed for the recording of ununiform meshing.
|
||||
integer::mstop(100000),mstart(100000),num_fra_com !
|
||||
@@ -33,8 +34,9 @@
|
||||
! --fractions in some certain computing task.
|
||||
! mstart is used to store the value of the beginning iteration step number of the entire iteration process. It has the same length with mstop.
|
||||
! num_fra_com is the number of computation fractions of the entire computation process.
|
||||
REAL*8, PARAMETER:: MU0=4.0*PI*1.0D-7 !The permeability of vaccum.
|
||||
REAL*8, PARAMETER:: EPS0=1.0/(CC*CC*MU0) !The dielectric constant of vaccum.
|
||||
REAL*8, PARAMETER:: MU0=4.0*PI*1.0D-7 !The permeability of vaccum.����մŵ�ϵ����
|
||||
REAL*8, PARAMETER:: EPS0=1.0/(CC*CC*MU0) !The dielectric constant of vaccum.����ս�糣����
|
||||
REAL*8, PARAMETER:: AIR_CONDUCTIVITY=1.0D-6
|
||||
CHARACTER(LEN=20) SOURCE_TYPE !The type of source, most commonly used one is tixing_upcos.
|
||||
character*30,allocatable::RecHzFile(:,:),RecHEFile(:,:),RecFile(:,:) !The filename of Recording file, RecHzFile for the Hz mode which only record the value of Hz--
|
||||
! --RecHEFile for HE mode which record every component of electromagnetic filed, RecFile is used in the filename distribution process.
|
||||
@@ -46,6 +48,10 @@
|
||||
!An array used in GetSourcePosition subroutine, the dimension of it is (Nx,Ny), in the source area, the value of this array is 1, else it is 0.
|
||||
integer,allocatable::is_ey_in_source(:,:)
|
||||
!The same as above.
|
||||
integer UniGridNumZ1,UniGridNumZ2,UniGridNumX1,UniGridNumX2,UniGridNumY1,UniGridNumY2
|
||||
INTEGER Logic_PML !Boundary condition switch read from input.dat: 1=CPML absorbing boundary, 0=original Dirichlet (zero field) boundary on the non-uniform grid
|
||||
INTEGER PML_X,PML_Y,PML_Z !PML thickness read from input.dat (only valid when Logic_PML=1)
|
||||
INTEGER PML_X1,PML_X2,PML_Y1,PML_Y2,PML_Z1,PML_Z2 !PML thickness of the two sides of each direction, set as PML_X1=PML_X, PML_X2=PML_X, etc.
|
||||
integer RecPointMin,RecPointMax
|
||||
integer,allocatable::RecLine(:),RecPoint(:)
|
||||
!Two dimensional array which stores the value of grid number as (x,y) at which the value of EM filed need to be recorded.
|
||||
@@ -66,5 +72,83 @@
|
||||
REAL*8 RAISETIME,RAMP,WAVE,AMP !The time of raising edge, ramp edge and duration in trapezoidal waveform, amp is the amplitude of source
|
||||
REAL*8 RAISESTEP,WAVESTEP,RAMPSTEP,TIMESTEP
|
||||
! The iteration time step in raise, duration, ramp and cutoff period.
|
||||
real*8,allocatable::Coordix3(:),Coordiy3(:),Coordiz3(:) !This is used to store the coordination of each grid in x,y and z direction.
|
||||
|
||||
real*8,allocatable::Coordix(:),Coordiy(:),Coordiz(:)
|
||||
!===================================================================================================
|
||||
REAL*8, DIMENSION( : ), ALLOCATABLE :: CoordinatesX, CoordinatesY, CoordinatesZ
|
||||
INTEGER, DIMENSION( : ), ALLOCATABLE :: Element_Node1, Element_Node2, Element_Node3
|
||||
|
||||
REAL*8, DIMENSION( : ), ALLOCATABLE :: Element_Label1_Coordx, Element_Label1_Coordy, Element_Label1_Coordz
|
||||
REAL*8, DIMENSION( : ), ALLOCATABLE :: Element_Label2_Coordx, Element_Label2_Coordy, Element_Label2_Coordz
|
||||
REAL*8, DIMENSION( : ), ALLOCATABLE :: Element_Label3_Coordx, Element_Label3_Coordy, Element_Label3_Coordz
|
||||
REAL*8, DIMENSION(:,:), ALLOCATABLE :: Normal !Save the normal of Triangle
|
||||
|
||||
REAL*8, DIMENSION( : ), ALLOCATABLE :: V1X, V1Y, V1Z !Save the vertor of Edge1 from Triangle
|
||||
REAL*8, DIMENSION( : ), ALLOCATABLE :: V2X, V2Y, V2Z !Save the vertor of Edge2 from Triangle
|
||||
|
||||
REAL(KIND=8):: eps105 = 1.0e-5
|
||||
INTEGER, ALLOCATABLE :: Node_Label( : )
|
||||
INTEGER, ALLOCATABLE :: Element_Label( : )
|
||||
|
||||
INTEGER :: n_face,n_point
|
||||
|
||||
REAL*8, DIMENSION( : ), ALLOCATABLE :: Node_Coordx, Node_Coordy, Node_Coordz
|
||||
INTEGER(KIND=4) :: mm,mmx,mmy,mmz,mmmz,mmmx,mmmy
|
||||
INTEGER(KIND=4) :: X_max,X_min,Y_max,Y_min,Z_max,Z_min
|
||||
INTEGER(KIND=4) :: KIdx_1,KIdx_2
|
||||
INTEGER(KIND=4) :: Rx,Ry,Rz
|
||||
INTEGER(KIND=4) :: idx_start,idx_end
|
||||
INTEGER(KIND=4), DIMENSION(:), ALLOCATABLE :: mmz_per,mmy_per,mmx_per
|
||||
REAL(KIND=8) :: tao_abnormal
|
||||
REAL(KIND=8) :: max_coord_x,min_coord_x
|
||||
REAL(KIND=8) :: max_coord_y,min_coord_y
|
||||
REAL(KIND=8) :: max_coord_z,min_coord_z
|
||||
REAL(KIND=8) :: verts_Dotmultp
|
||||
REAL(KIND=8) :: dir_z(3),dir_x(3),dir_y(3) !direction vector
|
||||
REAL(KIND=8), DIMENSION(:), ALLOCATABLE :: coordinates_x,coordinates_y,coordinates_z !Yee grid node coordinates
|
||||
REAL(KIND=8), DIMENSION(:), ALLOCATABLE :: Coord_HZ_X,Coord_HZ_Y,Coord_HZ_Z
|
||||
REAL(KIND=8), DIMENSION(:), ALLOCATABLE :: det_x,det_y,det_z
|
||||
REAL(KIND=8), DIMENSION(:), ALLOCATABLE :: u_x,u_z,u_y,v_z,v_x,v_y,t_z,t_x,t_y
|
||||
REAL(KIND=8), DIMENSION(:,:), ALLOCATABLE :: vert0,vert1,vert2 !Vertex coordinates of triangular elements
|
||||
REAL(KIND=8), DIMENSION(:,:), ALLOCATABLE :: edge1,edge2 !Triangular element vector
|
||||
REAL(KIND=8), DIMENSION(:,:), ALLOCATABLE :: Face_Triangle_NormVect
|
||||
REAL(KIND=8), DIMENSION(:,:), ALLOCATABLE :: orig_z,orig_x,orig_y !Ray origin coordinate
|
||||
REAL(KIND=8), DIMENSION(:,:), ALLOCATABLE :: pvec_z,pvec_x,pvec_y
|
||||
REAL(KIND=8), DIMENSION(:,:), ALLOCATABLE :: tvec_x,tvec_y,tvec_z
|
||||
REAL(KIND=8), DIMENSION(:,:,:), ALLOCATABLE :: LenRatio_CCSIGX, LenRatio_CCSIGY, LenRatio_CCSIGZ
|
||||
LOGICAL :: Logic_1,Logic_2,Logi_Sourcelenth
|
||||
LOGICAL :: Logic_AnomalousDat,Logic_AnomalousStl
|
||||
!Logic_AnomalousDat is .TRUE. when Complex_anomalous.dat (the original text format) exists;
|
||||
!Logic_AnomalousStl is .TRUE. when Complex_anomalous.stl (the ASCII STL format) exists.
|
||||
!They are detected in GETDATA, and used by RES_CONFIGURE and anomalous_conformal to choose
|
||||
!the proper reader. Only one of the two files should exist in the working folder.
|
||||
LOGICAL :: Logic_TerrainDat,Logic_TerrainStl
|
||||
!Logic_TerrainDat is .TRUE. when Complex_Terrain.dat (the original text format) exists;
|
||||
!Logic_TerrainStl is .TRUE. when Complex_Terrain.stl (the ASCII STL format) exists.
|
||||
!They are detected in GETDATA, and used by RES_CONFIGURE and terrain_conformal to choose
|
||||
!the proper reader. Only one of the two files should exist in the working folder.
|
||||
TYPE Coordinates !coordinates represents the coordinate
|
||||
REAL(KIND=8):: Coord_X,Coord_Y,Coord_Z
|
||||
END TYPE Coordinates
|
||||
TYPE CrossPoint_Property
|
||||
TYPE(coordinates):: Global_Coord
|
||||
LOGICAL:: Log_In
|
||||
END TYPE CrossPoint_Property
|
||||
TYPE(CrossPoint_Property), DIMENSION(:,:), ALLOCATABLE :: crosspoint_XX,crosspoint_YY,crosspoint_ZZ
|
||||
TYPE(CrossPoint_Property), DIMENSION(:,:,:), ALLOCATABLE :: coor_z,coor_x,coor_y
|
||||
|
||||
INTEGER(KIND=4):: Point_Num
|
||||
TYPE Coordmesh !coordmesh represents coordinates in terms of grids
|
||||
INTEGER(KIND=4):: Coordmesh_X,Coordmesh_Y,Coordmesh_Z
|
||||
END TYPE Coordmesh
|
||||
|
||||
TYPE Observers
|
||||
TYPE(Coordinates):: Local_Coord_To_Source !This array is used to record the position of the inversion point relative to the source.
|
||||
TYPE(Coordmesh):: Global_Coordmesh(8)
|
||||
TYPE(coordinates):: Global_Coord !coordinates represents the coordinate
|
||||
REAL(KIND=8):: Coeff(8)
|
||||
INTEGER(KIND=4):: Idx_Num
|
||||
END TYPE Observers
|
||||
TYPE(observers), DIMENSION(:), ALLOCATABLE:: Points_Observer
|
||||
|
||||
ENDMODULE CONSTANTPARAMETERS
|
||||
@@ -3,6 +3,17 @@
|
||||
!Code distribution @ tdem.org or sunhuaifeng.com
|
||||
|
||||
MODULE ELECTROMAGNETIC_VARIABLES
|
||||
REAL(KIND=8), DIMENSION(:,:,:), ALLOCATABLE:: EX,EY,EZ !The x,y and z component of electric field in 3 dimensions
|
||||
REAL(KIND=8), DIMENSION(:,:,:), ALLOCATABLE:: EX,EY,EZ !The x,y and z component of electric field in 3 dimensions
|
||||
REAL(KIND=8), DIMENSION(:,:,:), ALLOCATABLE:: HX,HY,HZ !The x,y and z component of magnetic field in 3 dimensions
|
||||
!>Memory variables of the CPML absorbing boundary (Roden & Gedney 2000).
|
||||
!! psi_Eab_m: memory variable of the electric field Ea associated with the
|
||||
!! curl term in direction b; psi_Hab_m: the same for the magnetic field.
|
||||
!! _1 / _2 denote the lower/upper (or left/right) boundary of that direction.
|
||||
REAL(KIND=8), DIMENSION(:,:,:), ALLOCATABLE:: psi_Exy_1, psi_Exy_2, psi_Exz_1, psi_Exz_2, &
|
||||
psi_Eyx_1, psi_Eyx_2, psi_Eyz_1, psi_Eyz_2, &
|
||||
psi_Ezx_1, psi_Ezx_2, psi_Ezy_1, psi_Ezy_2, &
|
||||
psi_Hxy_1, psi_Hxy_2, psi_Hxz_1, psi_Hxz_2, &
|
||||
psi_Hyx_1, psi_Hyx_2, psi_Hyz_1, psi_Hyz_2, &
|
||||
psi_Hzx_1, psi_Hzx_2, psi_Hzy_1, psi_Hzy_2, &
|
||||
psi_Hzz_1, psi_Hzz_2
|
||||
ENDMODULE ELECTROMAGNETIC_VARIABLES
|
||||
@@ -0,0 +1,33 @@
|
||||
!Copyright (c) 2013 by tdem.org under guide of Xiu Li(lixiu@chd.edu.cn)
|
||||
!written by Huaifeng Sun(sunhuaifeng@gmail.com) and Xushan Lu(luxushan@gmail.com)
|
||||
!Code distribution @ tdem.org or sunhuaifeng.com
|
||||
!The PML part follows the CPML scheme of Roden & Gedney (2000), integrated by the
|
||||
!author of the PML version (tem3dfdtd_第二版), with tuned parameters:
|
||||
!sig_x_max=1.0D2, alpha_x_max=1.0D-1, kappa_x_max=1.0 (RESTORED to the EXACT
|
||||
!values of the reference tem3dfdtd_第二版 which stays stable in the off phase;
|
||||
!alpha=1e-1 absorbs low-frequency diffusion fields much better than 1e-2 and
|
||||
!prevented the reflection feedback that made the CPML diverge)
|
||||
|
||||
MODULE PML_PARAMETER
|
||||
INTEGER, PARAMETER :: ma = 3, mb = 1
|
||||
REAL*8, PARAMETER ::sig_x_max = 1.0D2,sig_y_max =sig_x_max,sig_z_max = sig_x_max, &
|
||||
alpha_x_max = 1.0D-1,alpha_y_max = alpha_x_max, alpha_z_max = alpha_x_max, &
|
||||
kappa_x_max = 1.0,kappa_y_max = kappa_x_max, kappa_z_max = kappa_x_max
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: b_e_x1,c_e_x1,alpha_PML_e_x1,sig_PML_e_x1,kappa_PML_e_x1
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: b_h_x1,c_h_x1,alpha_PML_h_x1,sig_PML_h_x1,kappa_PML_h_x1
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: b_e_x2,c_e_x2,alpha_PML_e_x2,sig_PML_e_x2,kappa_PML_e_x2
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: b_h_x2,c_h_x2,alpha_PML_h_x2,sig_PML_h_x2,kappa_PML_h_x2
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: b_e_y1,c_e_y1,alpha_PML_e_y1,sig_PML_e_y1,kappa_PML_e_y1
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: b_h_y1,c_h_y1,alpha_PML_h_y1,sig_PML_h_y1,kappa_PML_h_y1
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: b_e_y2,c_e_y2,alpha_PML_e_y2,sig_PML_e_y2,kappa_PML_e_y2
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: b_h_y2,c_h_y2,alpha_PML_h_y2,sig_PML_h_y2,kappa_PML_h_y2
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: b_e_z1,c_e_z1,alpha_PML_e_z1,sig_PML_e_z1,kappa_PML_e_z1
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: b_h_z1,c_h_z1,alpha_PML_h_z1,sig_PML_h_z1,kappa_PML_h_z1
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: b_e_z2,c_e_z2,alpha_PML_e_z2,sig_PML_e_z2,kappa_PML_e_z2
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: b_h_z2,c_h_z2,c_h_zz,alpha_PML_h_z2,sig_PML_h_z2,kappa_PML_h_z2
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: inv_hz_den !1/(den_hz+c_h_zz), precomputed per step for the Hz recursion
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: den_ex,den_hx
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: den_ey,den_hy
|
||||
REAL*8 ,DIMENSION(:),ALLOCATABLE :: den_ez,den_hz
|
||||
|
||||
ENDMODULE PML_PARAMETER
|
||||
@@ -3,5 +3,5 @@
|
||||
!Code distribution @ tdem.org or sunhuaifeng.com
|
||||
|
||||
MODULE RES_MODEL_PARAMETER
|
||||
REAL(KIND=8), DIMENSION(:,:,:), ALLOCATABLE:: CCSIG !The conductivity in each grid
|
||||
REAL(KIND=8), DIMENSION(:,:,:), ALLOCATABLE:: CCSIG,CCSIGX,CCSIGY,CCSIGZ !The conductivity in each grid
|
||||
ENDMODULE RES_MODEL_PARAMETER
|
||||
在新工单中引用
屏蔽一个用户