Initiate
Initiate an instance of SolidMaterial_
.
Interface
- Interface
- example
- example
- ↢ close
INTERFACE
MODULE SUBROUTINE Initiate(obj, param, prefix)
CLASS(SolidMaterial_), INTENT(INOUT) :: obj
TYPE(ParameterList_), INTENT(IN) :: param
CHARACTER(*), OPTIONAL, INTENT(IN) :: prefix
END SUBROUTINE Initiate
END INTERFACE
info
Initiate an instance of SolidMaterial_
.
PROGRAM main
USE easifemBase
USE easifemClasses
USE easifemMaterials
CHARACTER(*), PARAMETER :: myName = "main"
CHARACTER(*), PARAMETER :: modName = "main"
TYPE(SolidMaterial_) :: obj
TYPE(ParameterList_) :: param
CLASS(UserFunction_), POINTER :: func => NULL()
INTEGER(I4B) :: ierr
CALL FPL_Init(); CALL param%Initiate()
! Set parameter
CALL SetSolidMaterialParam(param=param, name="SolidMaterial")
! Initiate an instance of `SolidMaterial_`
CALL obj%Initiate(param)
CALL obj%AddMaterial("massDensity")
func => obj%GetMaterialPointer("massDensity")
IF (.NOT. ASSOCIATED(func)) THEN
CALL e%RaiseError(modName//'::'//myName//' - '// &
& '[error 1]')
END IF
CALL SetUserFunctionParam(param=param, name="massDensity", &
& returnType=Scalar, argType=Constant)
CALL func%Initiate(param)
CALL func%Set(scalarValue=1.0_DFP)
CALL obj%Display(msg="SolidMaterial")
CALL FPL_FINALIZE; CALL param%DEALLOCATE()
END PROGRAM main
Introduction
In this example we test following methods.
- SetSolidMaterialParam
- SetLinearElasticModelParam
- Initiate
- Display
PROGRAM main
USE easifemBase
USE easifemClasses
USE easifemMaterials
USE FPL
TYPE(SolidMaterial_) :: obj
TYPE(ParameterList_) :: param
INTEGER(I4B) :: ierr
! main
CALL FPL_Init(); CALL param%Initiate()
! Call `SetSolidMaterialParam` to set the material properties.
CALL SetSolidMaterialParam(param=param, name="SolidMaterial", &
& stressStrainModel="LinearElasticModel")
! Call `SetLinearElasticModelParam` to set the properties of
! LinearElasticModel
CALL SetLinearElasticModelParam( &
& param=param, &
& elasticityType=TypeElasticity%Isotropic, &
& isPlaneStress=.FALSE., &
& isPlaneStrain=.TRUE., &
& poissonRatio=0.3_DFP, &
& youngsModulus=1.0D+6)
! Initiate an instance of `SolidMaterial_`
CALL obj%Initiate(param)
! Display the content of `SolidMaterial_`
CALL obj%Display(msg="Testing setSolidMaterialParam")
CALL obj%DEALLOCATE()
CALL FPL_FINALIZE; CALL param%DEALLOCATE()
END PROGRAM main