Import
Import the field from an external file.
Inherited from AbstractField_
Interface
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
SUBROUTINE Import( obj, hdf5, group, dom )
CLASS( ScalarField_ ), INTENT( INOUT ) :: obj
TYPE( HDF5File_ ), INTENT( INOUT ) :: hdf5
CHARACTER( LEN = * ), INTENT( IN ) :: group
TYPE( Domain_ ), TARGET, INTENT( IN ) :: dom
END SUBROUTINE Import
END INTERFACE
In this example we initiate an instance of Scalar field by importing data from HDF5 file.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( ScalarField_ ) :: obj
TYPE( HDF5File_ ) :: meshfile, resultFile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
Open file for import
CALL FPL_INIT()
CALL param%initiate()
CALL resultFile%initiate( filename="./result.h5", mode="READ" )
CALL resultFile%open()
read domain
!> start creating domain
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
!> end creating domain
import
!> start import
CALL obj%import( hdf5=resultFile, group="/scalarField1", dom=dom )
!> end start import
CALL obj%Display("obj = ")
results
#obj =
# isInitiated : TRUE
# name :U
# fieldType : NORMAL
# engine :NATIVE_SERIAL
# comm: 0
# myRank: 0
# numProcs: 1
# global_n: 0
# local_n: 0
# is: 0
# ie: 0
# lis_ptr: 0
# domain : ASSOCIATED
# domains : NOT ALLOCATED
# tSize : 102
# # DOF data :
# Total Physical Variables :1
# Name : U
# Space Components : 1
# Time Components : 1
# Total Nodes : 102
# Storage Format : Nodes
# Value Map :
--------------
1
103
# VAR :U
DOF-1 ,
-------,
0.00000,
0.00000,
0.00000,
0.00000,
0.00000,
0.00000,
Cleanup
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL meshfile%Deallocate()
CALL resultFile%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
The Schema of HDF5File_, which is used for import and export calls, is given below.
Variable | Data type | Value | Comment |
---|---|---|---|
name | String | Name of the scalar field | |
fieldType | String | NORMAL , CONSTANT | |
engine | String | NATIVE_SERIAL | This is constant variable, it tells constructor about the engine name |
dof | DOF_ | Group(/) | See DOF_ class for more details |
realVec | RealVector_ | Group(/) | See RealVector_ class for more details |