ImportFromToml
Import the content of LinearElasticModel_
form a toml-file.
Interface
- ܀ Interface
- example
- example 2
- example 3
- ↢ close
INTERFACE
MODULE SUBROUTINE ImportFromToml(obj, tomlName, afile, filename, &
& printToml)
CLASS(AbstractMaterialModel_), INTENT(INOUT) :: obj
CHARACTER(*), INTENT(IN) :: tomlName
TYPE(TxtFile_), OPTIONAL, INTENT(INOUT) :: afile
CHARACTER(*), OPTIONAL, INTENT(IN) :: filename
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: printToml
END SUBROUTINE ImportFromToml
END INTERFACE
info
This program initiates an instance of LinearElasticModel by reading config from toml.
The config is given below. It is for isotropic elasticity type.
[linearElasticModel1]
name = "linearElasticModel"
# name of the model
elasticityType = "ISO"
# elasticity type, default is "ISO".
poissonRatio = 0.1
# Poisson's Ratio, it is necessary when elasticityType is ISO
youngsModulus = 1.0
# Young's Modulus, it is necessary when elasticityType is ISO
See program
PROGRAM main
USE easifemBase
USE easifemClasses
USE easifemMaterials
TYPE(LinearElasticModel_) :: obj
CHARACTER(*), PARAMETER :: filename = "./LinearElasticModel.toml"
CHARACTER(*), PARAMETER :: tomlName = "linearElasticModel1"
CALL FPL_Init
CALL obj%ImportFromToml2(tomlName=tomlName, filename=filename, &
& printToml=.TRUE.)
CALL obj%Display("[1]"//CHAR_LF)
CALL FPL_Finalize
END PROGRAM main
info
This program initiates an instance of LinearElasticModel by reading config from toml.
The config is given below. It is for isotropic elasticity type and plane-stress.
[linearElasticModel2]
name = "linearElasticModel"
# name of the model
isPlaneStress = true
# set it to true for plane-stress formulation
# the default is false
elasticityType = "ISO"
# elasticity type, default is "ISO".
poissonRatio = 0.1
# Poisson's Ratio, it is necessary when elasticityType is ISO
youngsModulus = 1.0
# Young's Modulus, it is necessary when elasticityType is ISO
See program
PROGRAM main
USE easifemBase
USE easifemClasses
USE easifemMaterials
TYPE(LinearElasticModel_) :: obj
CHARACTER(*), PARAMETER :: filename = "./LinearElasticModel.toml"
CHARACTER(*), PARAMETER :: tomlName = "linearElasticModel2"
CALL FPL_Init
CALL obj%ImportFromToml2(tomlName=tomlName, filename=filename, &
& printToml=.TRUE.)
CALL obj%Display("[2]"//CHAR_LF)
CALL FPL_Finalize
END PROGRAM main
info
This program initiates an instance of LinearElasticModel by reading config from toml.
The config is given below. It is for isotropic elasticity type and plane-strain.
[linearElasticModel3]
name = "linearElasticModel"
# name of the model
isPlaneStrain = true
# set it to true for plane-stress formulation
# the default is false
elasticityType = "ISO"
# elasticity type, default is "ISO".
poissonRatio = 0.1
# Poisson's Ratio, it is necessary when elasticityType is ISO
youngsModulus = 1.0
# Young's Modulus, it is necessary when elasticityType is ISO
See program
PROGRAM main
USE easifemBase
USE easifemClasses
USE easifemMaterials
TYPE(LinearElasticModel_) :: obj
CHARACTER(*), PARAMETER :: filename = "./LinearElasticModel.toml"
CHARACTER(*), PARAMETER :: tomlName = "linearElasticModel3"
CALL FPL_Init
CALL obj%ImportFromToml2(tomlName=tomlName, filename=filename, &
& printToml=.TRUE.)
CALL obj%Display("[3]"//CHAR_LF)
CALL FPL_Finalize
END PROGRAM main
You can see more example here