Skip to main content

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 nameData typeValueComment
nameStringLinearElasticModelIt is constant, which denotes the name of the class.
elasticityTypeStringISO, ANISO, ORTHO, TRANSIt denotes the linear elasticity type
isPlaneStressStringTor FIf the problem is 2D, and plane stress then set it to .TRUE.
isPlaneStrainStringT or FIf the problem is 2D, and plane strain , then set it to .FALSE.
lambdaREALThis is required when ISO option is selected
ShearModulusREALThis is required when ISO option is selected
YoungsModulusREALThis is required when ISO option is selected
PoissonRatioREALThis is required when ISO option is selected
CREAL(6,6)This is necessary when ANISO option is selected.
invCREAL(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