Import
Import the field from an external file.
Interface
- ܀ Interface
- ️܀ example 1
- ️܀ example 2
- ↢
INTERFACE
SUBROUTINE Import( obj, hdf5, group, dom )
CLASS( BlockMatrixField_ ), INTENT( INOUT ) :: obj
TYPE( HDF5File_ ), INTENT( INOUT ) :: hdf5
CHARACTER( LEN = * ), INTENT( IN ) :: group
TYPE( Domain_ ), TARGET, INTENT( IN ) :: dom
END SUBROUTINE Import
END INTERFACE
BlockMatrixField example 6
This example shows the use of BlockMatrixField
Usage
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE( BlockMatrixField_ ) :: obj
TYPE( ParameterList_ ) :: param
TYPE( Domain_ ), TARGET :: pressureDomain
TYPE( Domain_ ), TARGET :: velocityDomain
TYPE( DomainPointer_ ) :: domains( 2 )
TYPE( HDF5File_ ) :: pressureMeshFile
TYPE( HDF5File_ ) :: velocityMeshFile
TYPE( HDF5File_ ) :: blockMatrixOutfile
CHARACTER( LEN = * ), PARAMETER :: pressureMeshFilename="./mesh_tri3.h5"
CHARACTER( LEN = * ), PARAMETER :: velocityMeshFilename="./mesh_tri6.h5"
CHARACTER( LEN = * ), PARAMETER :: blockMatrixOutfileName= &
& "./blockMatrixOutfile.h5"
CALL pressureMeshfile%Initiate( FileName=pressureMeshFilename, MODE="READ" )
CALL velocityMeshfile%Initiate( FileName=velocityMeshFilename, MODE="READ" )
CALL pressureMeshfile%Open()
CALL velocityMeshfile%Open()
CALL pressureDomain%Initiate( pressureMeshfile, "")
CALL velocityDomain%Initiate( velocityMeshfile, "")
CALL pressureMeshfile%Deallocate()
CALL velocityMeshfile%Deallocate()
domains(1)%ptr => velocityDomain
domains(2)%ptr => pressureDomain
CALL blockMatrixOutfile%Initiate( blockMatrixOutfileName, "READWRITE" )
CALL blockMatrixOutfile%open()
CALL obj%Import(blockMatrixOutfile, "/BlockMatrixField", domains=domains)
CALL obj%Export(blockMatrixOutfile, "/BlockMatrixFieldState" )
CALL blockMatrixOutfile%Deallocate()
CALL obj%Deallocate()
!> cleanup
NULLIFY(domains(1)%ptr, domains(2)%ptr)
CALL pressureDomain%Deallocate()
CALL velocityDomain%Deallocate()
CALL obj%Deallocate()
END PROGRAM main
BlockMatrixField example 8
This example shows the use of BlockMatrixField
Usage
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE( BlockMatrixField_) :: obj
TYPE( Domain_ ) :: dom
TYPE( HDF5File_) :: meshfile
TYPE( HDF5File_ ) :: blockMatrixOutfile
CHARACTER( LEN = *), PARAMETER :: meshFilename="./mesh_tri3.h5"
CHARACTER( LEN =* ), PARAMETER :: blockMatrixOutfileName= &
& "./bmf_outfile_common_domain.h5"
!> main
! #HDF5File/#Initiate
CALL meshfile%Initiate( FileName=meshFilename, MODE="READ" )
! #HDF5File/#Open
CALL meshfile%Open()
! #Domain/Initiate
CALL dom%Initiate( meshfile, "")
CALL blockMatrixOutfile%Initiate( blockMatrixOutfileName, "READWRITE" )
CALL blockMatrixOutfile%open()
CALL obj%Import(blockMatrixOutfile, "/BlockMatrixField", dom=dom)
CALL obj%Export(blockMatrixOutfile, "/BlockMatrixFieldState" )
CALL blockMatrixOutfile%Deallocate()
! #BlockMatrixField/Deallocate
CALL obj%Deallocate( )
!> cleanup
CALL meshfile%Deallocate()
CALL dom%Deallocate()
CALL obj%Deallocate()
END PROGRAM main