Construct by using import
In this section you can learn how construct an instance of LinearElasticModel_
by reading data from the HDF5File and Import
command. You can learn more about the Import here.
We need following data in the HDF5File
.
Template of HDF5File
Variable name | Data type | Value | Comment |
---|---|---|---|
name | String | LinearElasticModel | It is constant, which denotes the name of the class. |
elasticityType | String | ISO , ANISO , ORTHO , TRANS | It denotes the linear elasticity type |
isPlaneStress | String | T or F | If the problem is 2D, and plane stress then set it to .TRUE. |
isPlaneStrain | String | T or F | If the problem is 2D, and plane strain , then set it to .FALSE. |
lambda | REAL | This is required when ISO option is selected | |
ShearModulus | REAL | This is required when ISO option is selected | |
YoungsModulus | REAL | This is required when ISO option is selected | |
PoissonRatio | REAL | This is required when ISO option is selected | |
C | REAL(6,6) | This is necessary when ANISO option is selected. | |
invC | REAL(6,6) | This is necessary when ANISO option is selected. |
caution
Before using these examples, make sure to export the data as shown here.
Example 1
info
In this example we initiate an instance of LinearElasticModel_
by importing data from hdf5File_
.
PROGRAM main
USE easifemBase
USE easifemClasses
USE easifemMaterials
IMPLICIT NONE
TYPE( LinearElasticModel_ ) :: obj
TYPE( hdf5File_ ) :: hdf5file
TYPE( ParameterList_ ) :: param
CALL FPL_INIT; CALL param%initiate()
CALL hdf5file%initiate( "./TemplateLinearElasticModel1.hdf5", &
& mode="READ" ); CALL hdf5file%open()
CALL obj%import( hdf5file, "" )
CALL obj%display(msg="")
CALL hdf5file%close(); CALL hdf5file%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE
END PROGRAM main
Example 2
info
In this example we initiate an instance of LinearElasticModel_
by importing data from the HDF5File.
PROGRAM main
USE easifemBase
USE easifemClasses
USE easifemMaterials
IMPLICIT NONE
TYPE( LinearElasticModel_ ) :: obj
TYPE( hdf5File_ ) :: hdf5file
TYPE( ParameterList_ ) :: param
CALL FPL_INIT; CALL param%Initiate()
CALL hdf5file%Initiate( "./TemplateLinearElasticModel2.hdf5", &
& mode="READ" ); CALL hdf5file%Open()
CALL obj%Import( hdf5file, "" )
CALL obj%Display(msg="")
CALL hdf5file%Close(); CALL hdf5file%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE
END PROGRAM main
Example 3
info
In this case we will initiate an instance of LinearElasticModel_
by importing the data from an HDF5File_
. The HDF5File_
was created in the previous examples.
PROGRAM main
USE easifemBase
USE easifemClasses
USE easifemMaterials
IMPLICIT NONE
TYPE(LinearElasticModel_) :: obj
TYPE(HDF5File_) :: hdf5file
TYPE(ParameterList_) :: param
CALL FPL_INIT; CALL param%Initiate()
CALL hdf5file%Initiate("./TemplateLinearElasticModel3.hdf5", &
& mode="READ"); CALL hdf5file%OPEN()
CALL obj%IMPORT(hdf5file, "")
CALL obj%Display(msg="")
CALL hdf5file%CLOSE(); CALL hdf5file%DEALLOCATE()
CALL param%DEALLOCATE(); CALL FPL_FINALIZE
END PROGRAM main