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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ DOMAIN_CLASS_EXCEPTION.txt
log.txt
Amat.txt
*Pmat.txt

settings.json
.vscode/
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cmake.configureOnOpen": false,
}
1 change: 1 addition & 0 deletions src/modules/AbstractMesh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ target_sources(
${src_path}/NodeDataBinaryTree_Class.F90
${src_path}/ElemData_Class.F90
${src_path}/ElemDataList_Class.F90
${src_path}/ElemDataBinaryTree_Class.F90
${src_path}/FacetData_Class.F90
${src_path}/ElementShapeFunctionData_Class.F90)
33 changes: 33 additions & 0 deletions src/modules/AbstractMesh/src/ElemDataBinaryTree_Class.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
! This program is a part of EASIFEM library
! Copyright (C) Vikas Sharma, Ph.D
!
! This program is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program. If not, see <https: //www.gnu.org/licenses/>

#define Binary_Tree_Type_Name ElemDataBinaryTree_
#define Binary_Tree_Activate_SetID_Method

MODULE ElemDataBinaryTree_Class
USE ElemData_Class, ONLY: TreeData_ => ElemData_, &
& TreeData_Deallocate => ElemData_Deallocate, &
& TreeData_Display => ElemData_Display, &
& TreeData_lt => ElemData_lt, &
& TreeData_eq => ElemData_eq, &
& TreeData_SetID => ElemData_SetID

#include "../../BinaryTree/src/BinaryTree.inc"

END MODULE ElemDataBinaryTree_Class

#undef Binary_Tree_Type_Name
#undef Binary_Tree_Activate_SetID_Method
49 changes: 45 additions & 4 deletions src/modules/AbstractMesh/src/ElemData_Class.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
!

MODULE ElemData_Class
USE GlobalData, ONLY: I4B
USE GlobalData, ONLY: I4B, DFP, LGT
USE Display_Method, ONLY: Display
USE ReferenceElement_Method, ONLY: ElementName
IMPLICIT NONE
Expand All @@ -28,6 +28,11 @@ MODULE ElemData_Class
PUBLIC :: ElemDataDeallocate
PUBLIC :: ElemDataSet
PUBLIC :: ElemData_Pointer
PUBLIC :: ElemData_Deallocate
PUBLIC :: ElemData_Display
PUBLIC :: ElemData_lt
PUBLIC :: ElemData_eq
PUBLIC :: ElemData_SetID

INTEGER(I4B), PARAMETER, PUBLIC :: INTERNAL_ELEMENT = 1
INTEGER(I4B), PARAMETER, PUBLIC :: BOUNDARY_ELEMENT = -1
Expand All @@ -38,6 +43,10 @@ MODULE ElemData_Class
MODULE PROCEDURE ElemData_Display
END INTERFACE Display

INTERFACE ElemDataDeallocate
MODULE PROCEDURE ElemData_Deallocate
END INTERFACE ElemDataDeallocate

!----------------------------------------------------------------------------
! ElemData_
!----------------------------------------------------------------------------
Expand Down Expand Up @@ -169,15 +178,15 @@ END FUNCTION ElemData_ElemType2String
! ElemDataDeallocate
!----------------------------------------------------------------------------

SUBROUTINE ElemDataDeallocate(obj)
SUBROUTINE ElemData_Deallocate(obj)
TYPE(ElemData_), INTENT(INOUT) :: obj
obj%globalElemNum = 0
obj%localElemNum = 0
obj%elementType = INTERNAL_ELEMENT
IF (ALLOCATED(obj%globalNodes)) DEALLOCATE (obj%globalNodes)
IF (ALLOCATED(obj%globalElements)) DEALLOCATE (obj%globalElements)
IF (ALLOCATED(obj%boundaryData)) DEALLOCATE (obj%boundaryData)
END SUBROUTINE ElemDataDeallocate
END SUBROUTINE ElemData_Deallocate

!----------------------------------------------------------------------------
! ElemDataInitiate
Expand All @@ -202,12 +211,44 @@ SUBROUTINE ElemDataSet(obj, globalElemNum, localElemNum, &
END SUBROUTINE ElemDataSet

!----------------------------------------------------------------------------
! ElemData_Pointer
! ElemData_Pointer
!----------------------------------------------------------------------------

FUNCTION ElemData_Pointer() RESULT(ans)
CLASS(ElemData_), POINTER :: ans
ALLOCATE (ElemData_ :: ans)
END FUNCTION ElemData_Pointer

!----------------------------------------------------------------------------
! ElemData_lt
!----------------------------------------------------------------------------

FUNCTION ElemData_lt(obj, obj2) RESULT(ans)
TYPE(ElemData_), INTENT(IN) :: obj
TYPE(ElemData_), INTENT(IN) :: obj2
LOGICAL(LGT) :: ans
ans = obj%globalElemNum .GT. obj2%globalElemNum
END FUNCTION ElemData_lt

!----------------------------------------------------------------------------
! ElemData_eq
!----------------------------------------------------------------------------

FUNCTION ElemData_eq(obj, obj2) RESULT(ans)
TYPE(ElemData_), INTENT(IN) :: obj
TYPE(ElemData_), INTENT(IN) :: obj2
LOGICAL(LGT) :: ans
ans = obj%globalElemNum .EQ. obj2%globalElemNum
END FUNCTION ElemData_eq

!----------------------------------------------------------------------------
! ElemData_SetID
!----------------------------------------------------------------------------

SUBROUTINE ElemData_SetID(obj, id)
TYPE(ElemData_), INTENT(INOUT) :: obj
INTEGER(I4B), INTENT(IN) :: id
obj%localElemNum = id
END SUBROUTINE ElemData_SetID

END MODULE ElemData_Class
18 changes: 18 additions & 0 deletions src/modules/HashTable/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This program is a part of EASIFEM library Copyright (C) Vikas Sharma, Ph.D
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https: //www.gnu.org/licenses/>
#

set(src_path "${CMAKE_CURRENT_LIST_DIR}/src/")
target_sources(${PROJECT_NAME} PRIVATE ${src_path}/IntIntDict_Class.F90)
76 changes: 76 additions & 0 deletions src/modules/HashTable/src/IntIntDict_Class.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
! This program is a part of EASIFEM library
! Copyright (C) (Since 2020) Vikas Sharma, Ph.D
!
! This program is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program. If not, see <https: //www.gnu.org/licenses/>
!

!> author: Vikas Sharma, Ph. D.
! date:
! summary: Module for HashTable for Integers

! Define the module for the key type.
! Override the hash_value and == operator interface.

MODULE IntIntDictUtility
USE GlobalData, ONLY: I4B, LGT
IMPLICIT NONE

INTERFACE hash_value
MODULE PROCEDURE int_hash_value
END INTERFACE

CONTAINS

FUNCTION int_hash_value(int) RESULT(hash)
INTEGER(I4B), INTENT(in) :: int
INTEGER(I4B) :: hash
hash = int
END FUNCTION int_hash_value

END MODULE IntIntDictUtility

!----------------------------------------------------------------------------
! IntIntDict_Class
!----------------------------------------------------------------------------

#define FHASH_MODULE_NAME IntIntDict_Class
#define FHASH_TYPE_NAME IntIntDict_
#define FHASH_TYPE_ITERATOR_NAME IntIntDictIterator_

! Define the macros needed by fhash and include fhash.f90
#define KEY_USE USE IntIntDictUtility
!! This is the name of the module where hash_value function for key is
!! defined

#define KEY_TYPE INTEGER(I4B)
!! The data type for key

! #define VALUE_USE use GlobalData, ONLY: I4B, DFP, LGT
!! This is the name of the module where value is defined

#define VALUE_TYPE INTEGER(I4B)
!! This is the data type for value

#define VALUE_TYPE_INIT 0
!! Initial value of data type

#ifndef __GFORTRAN__
#define VALUE_POINTER
#endif

#ifdef VALUE_TYPE_INIT
#define CHECK_ITERATOR_VALUE
#endif

#include "./fhash.f90"
Loading