Export
Export the abstract field to an external file.
Interface
- ܀ Interface
- ️܀ example 1
- ️܀ example 2
- ↢
INTERFACE
SUBROUTINE Export( obj, hdf5, group )
CLASS( BlockMatrixField_ ), INTENT( INOUT ) :: obj
TYPE( HDF5File_ ), INTENT( INOUT ) :: hdf5
CHARACTER( LEN = * ), INTENT( IN ) :: group
END SUBROUTINE Export
END INTERFACE
BlockMatrixField example 5
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 FPL_INIT(); CALL param%Initiate()
CALL SetBlockMatrixFieldParam(param=param, name="K", &
& physicalVarNames=["V", "P"], spaceCompo=[2, 1], &
& timeCompo=[1,1], fieldType=FIELD_TYPE_NORMAL, &
& matrixProp="UNSYM" )
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 obj%Initiate(param=param, dom=domains)
CALL blockMatrixOutfile%Initiate( blockMatrixOutfileName, "NEW" )
CALL blockMatrixOutfile%open()
CALL obj%Export(blockMatrixOutfile, "/BlockMatrixField")
CALL blockMatrixOutfile%Deallocate()
CALL obj%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
NULLIFY(domains(1)%ptr, domains(2)%ptr)
CALL pressureDomain%Deallocate()
CALL velocityDomain%Deallocate()
CALL obj%Deallocate()
END PROGRAM main
BlockMatrixField example 7
This example shows the use of BlockMatrixField
Usage
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
!
! [[ParameterList_]], [[BlockMatrixField_]]
!
TYPE( BlockMatrixField_ ) :: obj
TYPE( ParameterList_ ) :: param
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
CALL FPL_INIT(); CALL param%Initiate()
! #BlockMatrixField/SetBlockMatrixFieldParam
CALL SetBlockMatrixFieldParam(param=param, name="K", &
& physicalVarNames=["V", "P"], spaceCompo=[2, 1], &
& timeCompo=[1,1], fieldType=FIELD_TYPE_NORMAL, &
& matrixProp="UNSYM" )
! #HDF5File/#Initiate
CALL meshfile%Initiate( FileName=meshFilename, MODE="READ" )
! #HDF5File/#Open
CALL meshfile%Open()
! #Domain/Initiate
CALL dom%Initiate( meshfile, "")
! #BlockMatrixField/Initiate
CALL obj%Initiate(param=param, dom=dom)
! #BlockMatrixField/Export
CALL blockMatrixOutfile%Initiate( blockMatrixOutfileName, "NEW" )
CALL blockMatrixOutfile%open()
CALL obj%Export(blockMatrixOutfile, "/BlockMatrixField")
CALL blockMatrixOutfile%Deallocate()
! #BlockMatrixField/Deallocate
CALL obj%Deallocate( )
!> cleanup
CALL param%Deallocate(); CALL FPL_FINALIZE()
CALL meshfile%Deallocate()
CALL dom%Deallocate()
CALL obj%Deallocate()
END PROGRAM main