wiki:InterfaceObjects

Version 2 (modified by trac, 12 years ago) ( diff )

Interface Objects

  TYPE InterfaceDef
     REAL(KIND=qPREC) :: Position(3)=(/0,0,0/)
     REAL(KIND=qPREC) :: phi=0
     REAL(KIND=qPREC) :: theta=0
     REAL(KIND=qPREC) :: RotationMatrix(3,3)=RESHAPE((/1d0,0d0,0d0,0d0,1d0,0d0,0d0,0d0,1d0/),(/3,3/))    
     REAL(KIND=qPREC), ALLOCATABLE, DIMENSION(:,:) :: WaveVector
     REAL(KIND=qPREC), ALLOCATABLE, DIMENSION(:) :: Amplitude
     REAL(KIND=qPREC), ALLOCATABLE, DIMENSION(:) :: phase
     REAL(KIND=qPREC) :: HalfWidth=1e30
     INTEGER :: nWaves=0
     INTEGER :: iWaves=0
  END TYPE InterfaceDef

To setup an interface object you need to do the following.

 InterfaceObj%Position=position
 CALL SetInterfaceOrientation(InterfaceObj, theta, phi)
 CALL InitInterfaceWaves(InterfaceObj, nWaves)
 DO j=1,nWaves
    READ(PROBLEM_DATA_HANDLE, NML=WaveData)
    CALL AddInterfaceWave(InterfaceObj, wavevector, phase, amplitude)
 END DO

Once an interface is created you can check if any position is above or below the interface by calling

FUNCTION IsAboveInterface(InterfaceObj, pos)

See the CollidingFlows problem module for an example that uses an interface with a shape object to initialize the grid.

Note: See TracWiki for help on using the wiki.