Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions src/modules/AbstractMaterial/src/AbstractMaterial_Class.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ MODULE AbstractMaterial_Class
USE FPL, ONLY: ParameterList_
USE TxtFile_Class
USE tomlf, ONLY: toml_table
USE tomlf, ONLY: toml_array
USE Fhash, ONLY: FhashTable_ => fhash_tbl_t
IMPLICIT NONE
PRIVATE
Expand Down Expand Up @@ -104,10 +105,10 @@ MODULE AbstractMaterial_Class
PROCEDURE, PUBLIC, PASS(obj) :: IMPORT => am_Import
PROCEDURE, PUBLIC, PASS(obj) :: ImportFromToml1 => &
& am_ImportFromToml1
PROCEDURE, PUBLIC, PASS(obj) :: ImportFromToml2 => &
& am_ImportFromToml2
GENERIC, PUBLIC :: ImportFromTom => ImportFromToml1, &
& ImportFromToml2
PROCEDURE, PUBLIC, PASS(obj) :: ImportFromToml2 => am_ImportFromToml2
PROCEDURE, PUBLIC, PASS(obj) :: ImportFromToml3 => am_ImportFromToml3
GENERIC, PUBLIC :: ImportFromToml => ImportFromToml1, ImportFromToml2, &
& ImportFromToml3

! GET:
! @GetMethods
Expand Down Expand Up @@ -336,19 +337,34 @@ END SUBROUTINE am_ImportFromToml1
! ImportFromToml@IOMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2023-11-08
! summary: Initiate param from the toml file

INTERFACE AbstractMaterialImportFromToml
MODULE SUBROUTINE am_ImportFromToml2(obj, array)
CLASS(AbstractMaterial_), INTENT(INOUT) :: obj
TYPE(toml_array), POINTER, INTENT(INOUT) :: array
END SUBROUTINE am_ImportFromToml2
END INTERFACE AbstractMaterialImportFromToml

!----------------------------------------------------------------------------
! ImportFromToml@IOMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2023-11-08
! summary: Initiate kernel from the toml file

INTERFACE AbstractMaterialImportFromToml
MODULE SUBROUTINE am_ImportFromToml2(obj, tomlName, afile, filename, &
MODULE SUBROUTINE am_ImportFromToml3(obj, tomlName, afile, filename, &
& printToml)
CLASS(AbstractMaterial_), 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 am_ImportFromToml2
END SUBROUTINE am_ImportFromToml3
END INTERFACE AbstractMaterialImportFromToml

END MODULE AbstractMaterial_Class
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,29 @@ MODULE AbstractMaterialModel_Class
TYPE(String) :: name
CONTAINS
PRIVATE

! CONSTRUCTOR:
! @ConstructorMethods
PROCEDURE(amb_CheckEssentialParam), DEFERRED, PUBLIC, PASS(obj) :: &
& CheckEssentialParam
PROCEDURE(amb_Initiate), DEFERRED, PUBLIC, PASS(obj) :: Initiate
PROCEDURE(amb_Deallocate), DEFERRED, PUBLIC, PASS(obj) :: &
& DEALLOCATE
PROCEDURE, PUBLIC, PASS(obj) :: isInitiated => amb_isInitiated

! IO:
! @IOMethods
PROCEDURE(amb_Import), DEFERRED, PUBLIC, PASS(obj) :: IMPORT
PROCEDURE(amb_Export), DEFERRED, PUBLIC, PASS(obj) :: Export
PROCEDURE(amb_Display), DEFERRED, PUBLIC, PASS(obj) :: Display

! GET:
! @GetMethods
PROCEDURE(amb_GetPrefix), DEFERRED, PUBLIC, PASS(obj) :: GetPrefix
PROCEDURE, PUBLIC, PASS(obj) :: isInitiated => amb_isInitiated
PROCEDURE, PUBLIC, PASS(obj) :: GetName => amb_GetName

! SET:
! @SetMethods
PROCEDURE, PUBLIC, PASS(obj) :: SetIsInitiated => amb_SetIsInitiated
PROCEDURE, PUBLIC, PASS(obj) :: SetName => amb_SetName
END TYPE AbstractMaterialModel_
Expand Down Expand Up @@ -208,4 +220,38 @@ SUBROUTINE amb_SetName(obj, VALUE)
obj%name = VALUE
END SUBROUTINE amb_SetName

!----------------------------------------------------------------------------
! ImportFromToml@IOMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2023-11-08
! summary: Initiate param from the toml file

INTERFACE AbstractMaterialImportFromToml
MODULE SUBROUTINE am_ImportFromToml1(obj, table)
CLASS(AbstractMaterial_), INTENT(INOUT) :: obj
TYPE(toml_table), INTENT(INOUT) :: table
END SUBROUTINE am_ImportFromToml1
END INTERFACE AbstractMaterialImportFromToml

!----------------------------------------------------------------------------
! ImportFromToml@IOMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2023-11-08
! summary: Initiate kernel from the toml file

INTERFACE AbstractMaterialImportFromToml
MODULE SUBROUTINE am_ImportFromToml3(obj, tomlName, afile, filename, &
& printToml)
CLASS(AbstractMaterial_), 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 am_ImportFromToml3
END INTERFACE AbstractMaterialImportFromToml

END MODULE AbstractMaterialModel_Class
125 changes: 68 additions & 57 deletions src/modules/SolidMaterial/src/SolidMaterial_Class.F90
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,32 @@ MODULE SolidMaterial_Class
!! Pointer to stress strain material behavior of solids
CONTAINS
PRIVATE

! CONSTRUCTOR:
! @ConstructorMethods
PROCEDURE, PUBLIC, PASS(obj) :: CheckEssentialParam => &
& solid_CheckEssentialParam
PROCEDURE, PUBLIC, PASS(obj) :: Initiate => solid_Initiate
PROCEDURE, PUBLIC, PASS(obj) :: DEALLOCATE => solid_Deallocate
FINAL :: solid_Final

! IO:
! @IOMethods
PROCEDURE, PUBLIC, PASS(obj) :: IMPORT => solid_Import
PROCEDURE, PUBLIC, PASS(obj) :: Export => solid_Export
PROCEDURE, PUBLIC, PASS(obj) :: Display => solid_Display

! GET:
! @GetMethods
PROCEDURE, PUBLIC, PASS(obj) :: GetStressStrainModelPointer => &
& solid_GetStressStrainModelPointer
PROCEDURE, PUBLIC, PASS(obj) :: GetPrefix => solid_GetPrefix
END TYPE SolidMaterial_

!----------------------------------------------------------------------------
! TypeSolidMaterial
!----------------------------------------------------------------------------

TYPE(SolidMaterial_), PARAMETER :: TypeSolidMaterial = SolidMaterial_()

!----------------------------------------------------------------------------
Expand All @@ -88,34 +101,6 @@ MODULE SolidMaterial_Class
CLASS(SolidMaterial_), POINTER :: ptr => NULL()
END TYPE SolidMaterialPointer_

!----------------------------------------------------------------------------
! Deallocate@ConstructorMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2023-09-09
! summary: Deallocate the vector

INTERFACE DEALLOCATE
MODULE SUBROUTINE Deallocate_Vector(obj)
TYPE(SolidMaterial_), ALLOCATABLE :: obj(:)
END SUBROUTINE Deallocate_Vector
END INTERFACE DEALLOCATE

!----------------------------------------------------------------------------
! Deallocate@ConstructorMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2023-09-09
! summary: Deallocate the vector of pointer

INTERFACE DEALLOCATE
MODULE SUBROUTINE Deallocate_Ptr_Vector(obj)
TYPE(SolidMaterialPointer_), ALLOCATABLE :: obj(:)
END SUBROUTINE Deallocate_Ptr_Vector
END INTERFACE DEALLOCATE

!----------------------------------------------------------------------------
! SetSolidMaterialParam@ConstructorMethods
!----------------------------------------------------------------------------
Expand Down Expand Up @@ -158,7 +143,6 @@ END SUBROUTINE SetSolidMaterialParam
! It Checks the existance of
!
! - `SolidMaterial/name`
! - `SolidMaterial/massDensity`
! - `SolidMaterial/stresStrainModel`

INTERFACE
Expand All @@ -181,7 +165,6 @@ END SUBROUTINE solid_CheckEssentialParam
! It reads the options from `param`, and sets the options of `SolidMaterial`
!
!- `SolidMaterial/name`
!- `SolidMaterial/massDensity`
!- `SolidMaterial/stresStrainModel`
!
! This routine calls the [[MaterialFactory:SolidMechanicsModelFactory]] to
Expand All @@ -201,6 +184,33 @@ MODULE SUBROUTINE solid_Initiate(obj, param, prefix)
END SUBROUTINE solid_Initiate
END INTERFACE

!----------------------------------------------------------------------------
! AddSolidMaterial@ConstructorMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2023-09-11
! summary: Add a solid material to the vector of SolidMaterialPointer_

INTERFACE AddSolidMaterial
MODULE SUBROUTINE solid_AddSolidMaterial( &
& obj, &
& tMaterials, &
& materialNo, &
& materialName, &
& solidMaterialToMesh, &
& param, &
& region)
TYPE(SolidMaterialPointer_), INTENT(INOUT) :: obj(:)
INTEGER(I4B), INTENT(IN) :: tMaterials
INTEGER(I4B), INTENT(IN) :: materialNo
CHARACTER(*), OPTIONAL, INTENT(IN) :: materialName
TYPE(ParameterList_), OPTIONAL, INTENT(IN) :: param
TYPE(MeshSelection_), OPTIONAL, INTENT(IN) :: region
TYPE(MeshSelection_), OPTIONAL, INTENT(INOUT) :: solidMaterialToMesh(:)
END SUBROUTINE solid_AddSolidMaterial
END INTERFACE AddSolidMaterial

!----------------------------------------------------------------------------
! Deallocate@ConstructorMethods
!----------------------------------------------------------------------------
Expand All @@ -225,6 +235,34 @@ MODULE SUBROUTINE solid_Deallocate(obj)
END SUBROUTINE solid_Deallocate
END INTERFACE

!----------------------------------------------------------------------------
! Deallocate@ConstructorMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2023-09-09
! summary: Deallocate the vector

INTERFACE DEALLOCATE
MODULE SUBROUTINE Deallocate_Vector(obj)
TYPE(SolidMaterial_), ALLOCATABLE :: obj(:)
END SUBROUTINE Deallocate_Vector
END INTERFACE DEALLOCATE

!----------------------------------------------------------------------------
! Deallocate@ConstructorMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2023-09-09
! summary: Deallocate the vector of pointer

INTERFACE DEALLOCATE
MODULE SUBROUTINE Deallocate_Ptr_Vector(obj)
TYPE(SolidMaterialPointer_), ALLOCATABLE :: obj(:)
END SUBROUTINE Deallocate_Ptr_Vector
END INTERFACE DEALLOCATE

!----------------------------------------------------------------------------
! Final@ConstructorMethods
!----------------------------------------------------------------------------
Expand Down Expand Up @@ -307,33 +345,6 @@ MODULE FUNCTION solid_GetStressStrainModelPointer(obj) RESULT(ans)
END FUNCTION solid_GetStressStrainModelPointer
END INTERFACE

!----------------------------------------------------------------------------
! AddSolidMaterial@SetMethod
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2023-09-11
! summary: Add a solid material to the vector of SolidMaterialPointer_

INTERFACE AddSolidMaterial
MODULE SUBROUTINE solid_AddSolidMaterial( &
& obj, &
& tMaterials, &
& materialNo, &
& materialName, &
& solidMaterialToMesh, &
& param, &
& region)
TYPE(SolidMaterialPointer_), INTENT(INOUT) :: obj(:)
INTEGER(I4B), INTENT(IN) :: tMaterials
INTEGER(I4B), INTENT(IN) :: materialNo
CHARACTER(*), OPTIONAL, INTENT(IN) :: materialName
TYPE(ParameterList_), OPTIONAL, INTENT(IN) :: param
TYPE(MeshSelection_), OPTIONAL, INTENT(IN) :: region
TYPE(MeshSelection_), OPTIONAL, INTENT(INOUT) :: solidMaterialToMesh(:)
END SUBROUTINE solid_AddSolidMaterial
END INTERFACE AddSolidMaterial

!----------------------------------------------------------------------------
! GetPrefix@GetMethods
!----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion src/modules/easifemClasses/src/easifemClasses.F90
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,4 @@ MODULE easifemClasses

USE TomlUtility

USE easifemMaterials
END MODULE easifemClasses
Loading