Initiate
This method constructs an instance of AbstractField.
Interface 1
- Initiate
- ️܀ See example
- ↢
INTERFACE
SUBROUTINE Initiate( obj, param, dom )
CLASS( ScalarField_), INTENT( INOUT ) :: obj
TYPE( ParameterList_), INTENT( IN ) :: param
TYPE( Domain_ ), TARGET, INTENT( IN ) :: dom
END SUBROUTINE Initiate
END INTERFACE
In this example we test following methods:
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( ScalarField_ ) :: obj
TYPE( HDF5File_ ) :: meshfile, resultFile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
CHARACTER(*), PARAMETER :: engine = "NATIVE_SERIAL"
setScalarFieldParam
CALL FPL_INIT()
CALL param%initiate()
CALL SetScalarFieldParam( param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine)
Initiate
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
CALL obj%initiate( param, dom )
Let's display the scalar field.
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,
.
.
.
Export
CALL resultFile%initiate( filename="./result.h5", mode="NEW" )
CALL resultFile%open()
CALL obj%export( hdf5=resultFile, group="/scalarField1")
Cleanup
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL meshfile%Deallocate()
CALL resultFile%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
Interface 2
- Initiate
Initiate by copying from other fields
INTERFACE
SUBROUTINE Initiate( obj, obj2, copyFull, copyStructure, &
& usePointer )
CLASS( ScalarField_ ), INTENT( INOUT ) :: obj
CLASS( AbstractField_ ), INTENT( INOUT ) :: obj2
LOGICAL( LGT ), OPTIONAL, INTENT( IN ) :: copyFull
LOGICAL( LGT ), OPTIONAL, INTENT( IN ) :: copyStructure
LOGICAL( LGT ), OPTIONAL, INTENT( IN ) :: usePointer
END SUBROUTINE Initiate
END INTERFACE
Interface 3
- Initiate
Initiate by reading from parameters. This is used for block data structure.
INTERFACE
SUBROUTINE Initiate(obj, param, dom)
CLASS(ScalarField_), INTENT(INOUT) :: obj
TYPE(ParameterList_), INTENT(IN) :: param
TYPE(DomainPointer_), TARGET, INTENT(IN) :: dom(:)
END SUBROUTINE Initiate
END INTERFACE