Skip to content

Commit

Permalink
WRITE DATA TO HDF5 FILE.
Browse files Browse the repository at this point in the history
  • Loading branch information
project-fluxo-old committed Nov 24, 2023
1 parent 88ab9da commit 0378f54
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 3 deletions.
38 changes: 38 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 22,
"patch": 0
},
"configurePresets": [
{
"name": "hopr_config_debug_nohdf5_nocgns",
"displayName": "hopr configure: default debug build no cgns no hdf5",
"hidden": false,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"LIBS_BUILD_HDF5": "Off",
"LIBS_USE_CGNS": "Off"
}
},
{
"name": "hopr_config_release_nohdf5_nocgns",
"displayName": "hopr configure: default release build no cgns no hdf5",
"hidden": false,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"LIBS_BUILD_HDF5": "Off",
"LIBS_USE_CGNS": "Off"
}
}
],
"testPresets": [
{
"name": "HOPR_ctest",
"displayName": "Test HOPR running ctest ",
"configurePreset": "HOPR_config_release",
"output": {"outputOnFailure": true}
}
]
}
20 changes: 17 additions & 3 deletions src/io_hdf5.f90
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,17 @@ MODULE MOD_IO_HDF5
INTEGER :: nDims
INTEGER(HSIZE_T),POINTER :: HSize(:)

INTEGER,PARAMETER :: ElemInfoSize=6 !number of entry in each line of ElemInfo
INTEGER,PARAMETER :: ElemInfoSize=10 !number of entry in each line of ElemInfo
INTEGER,PARAMETER :: ELEM_Type=1 !entry position in ElemInfo
INTEGER,PARAMETER :: ELEM_Zone=2
INTEGER,PARAMETER :: ELEM_FirstSideInd=3
INTEGER,PARAMETER :: ELEM_LastSideInd=4
INTEGER,PARAMETER :: ELEM_FirstNodeInd=5
INTEGER,PARAMETER :: ELEM_LastNodeInd=6
INTEGER,PARAMETER :: ELEM_FirstEdeEInd=7
INTEGER,PARAMETER :: ELEM_LastEdeeInd=8
INTEGER,PARAMETER :: ELEM_FirstVertexInd=9
INTEGER,PARAMETER :: ELEM_LastVertexeInd=10

INTEGER,PARAMETER :: SideInfoSize=5
INTEGER,PARAMETER :: SIDE_Type=1 !entry position in SideInfo
Expand All @@ -72,15 +76,25 @@ MODULE MOD_IO_HDF5
0,0,0,0,0,0,0,0, & !nothing
1,2,4,3,5,6,8,7/),(/8,5/)) !Hex

INTEGER,ALLOCATABLE :: ElemInfo(:,:),SideInfo(:,:)

INTEGER,PARAMETER :: EDGEInfoSize=3
INTEGER,PARAMETER :: EDGE_FEMEdgeID=1 !entry position in SideInfo
INTEGER,PARAMETER :: EDGE_offsetIndEdgeConnect=2
INTEGER,PARAMETER :: EDGE_lastIndEdgeConnect=3

INTEGER,PARAMETER :: EDGEConnectInfoSize=2
INTEGER,PARAMETER :: EDGEConnect_nbElemID=1 !entry position in SideInfo
INTEGER,PARAMETER :: EDGEConnect_nbLocEdgeID=2

INTEGER,ALLOCATABLE :: ElemInfo(:,:),SideInfo(:,:), EdgeInfo(:,:),EdgeConnectInfo(:,:)
REAL,ALLOCATABLE :: ElemWeight(:)
REAL,ALLOCATABLE :: ElemBarycenters(:,:)
INTEGER,ALLOCATABLE :: GlobalNodeIDs(:)
REAL,ALLOCATABLE :: NodeCoords(:,:)
INTEGER,ALLOCATABLE :: Elem_IJK(:,:)
INTEGER :: nElems_IJK(3)
INTEGER :: nGlobalElems
INTEGER :: nElems,nSides,nNodes
INTEGER :: nElems,nSides,nNodes,nEdges,nFEMEdges
INTEGER :: ElemCounter(2,11)
INTEGER :: nSideIDs,nNodeIDs
INTEGER :: nBCs
Expand Down
2 changes: 2 additions & 0 deletions src/mesh/mesh_basis.f90
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ SUBROUTINE buildEdges()
lEdge%edge=>aEdge
lEdge%elem=>aElem
NULLIFY(lEdge%next_connected)
lEdge%ind=-1
lEdge%tmp=1
END IF! aedge%firstlocalEdge not associated
bEdge%FirstLocalEdge=>aEdge%FirstLocalEdge
Expand Down Expand Up @@ -943,6 +944,7 @@ SUBROUTINE buildEdges()
ALLOCATE(aElem%LocalEdge(iEdge)%ledp)
lEdge=>aElem%LocalEdge(iEdge)%ledp
NULLIFY(ledge%next_connected)
lEdge%ind=-1
lEdge%tmp=0
lEdge%elem=>aElem
!find edge from aNode->bNode (same orientation) / from bNode->aNode (opposite orientation)
Expand Down
42 changes: 42 additions & 0 deletions src/mesh/mesh_vars.f90
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ MODULE MOD_Mesh_Vars
TYPE(tEdgePtr),POINTER :: MortarEdge(:) ! array of edge pointers to slave mortar edges
TYPE(tEdge),POINTER :: parentEdge ! parentEdge in case of non-conforming meshes
TYPE(tLocalEdge),POINTER :: FirstLocalEdge ! pointer to local edge of first connected element
INTEGER :: ind
END TYPE tEdge


Expand Down Expand Up @@ -500,9 +501,50 @@ SUBROUTINE getNewEdge(Edge,Node1,Node2)
NULLIFY(Edge%MortarEdge)
NULLIFY(Edge%parentEdge)
NULLIFY(Edge%FirstLocalEdge)
Edge%ind=0
END SUBROUTINE getNewEdge


SUBROUTINE getNewLocalEdge(lEdge,Elem_in,edge_in)
!===================================================================================================================================
! Create "Edge" with nodes "Node1" and "Node2"
!===================================================================================================================================
! MODULES
! IMPLICIT VARIABLE HANDLING
IMPLICIT NONE
!-----------------------------------------------------------------------------------------------------------------------------------
! INPUT VARIABLES
TYPE(tElem),POINTER,INTENT(IN),OPTIONAL :: Elem_in
TYPE(tEdge),POINTER,INTENT(IN),OPTIONAL :: edge_in
!-----------------------------------------------------------------------------------------------------------------------------------
! OUTPUT VARIABLES
TYPE(tLocalEdge),POINTER,INTENT(INOUT) :: Edge ! New edge
!-----------------------------------------------------------------------------------------------------------------------------------
! LOCAL VARIABLES
!===================================================================================================================================
ALLOCATE(lEdge)
lEdge%ind=0
lEdge%tmp=0
NULLIFY(lEdge%next_connected)
IF(PRESENT(elem_in))THEN
lEdge%elem=>elem_in
ELSE
NULLIFY(lEdge%elem)
END IF
IF(PRESENT(elem_in))THEN
lEdge%elem=>elem_in
ELSE
NULLIFY(lEdge%elem)
END IF
IF(PRESENT(edge_in))THEN
lEdge%edge=>edge_in
ELSE
NULLIFY(lEdge%edge)
END IF

END SUBROUTINE getNewLocalEdge


SUBROUTINE getNewNode(Node,refCount,ind)
!===================================================================================================================================
! Allocate and initialize new node "Node"
Expand Down

0 comments on commit 0378f54

Please sign in to comment.