diff --git a/src/modules/AbstractMesh/src/ElemData_Class.F90 b/src/modules/AbstractMesh/src/ElemData_Class.F90 index 130720d69..1188ea384 100644 --- a/src/modules/AbstractMesh/src/ElemData_Class.F90 +++ b/src/modules/AbstractMesh/src/ElemData_Class.F90 @@ -33,6 +33,7 @@ MODULE ElemData_Class PUBLIC :: ElemData_lt PUBLIC :: ElemData_eq PUBLIC :: ElemData_SetID +PUBLIC :: ElemData_Copy INTEGER(I4B), PARAMETER, PUBLIC :: INTERNAL_ELEMENT = 1 INTEGER(I4B), PARAMETER, PUBLIC :: BOUNDARY_ELEMENT = -1 @@ -126,12 +127,13 @@ SUBROUTINE ElemData_Copy(obj1, obj2) obj1%globalElemNum = obj2%globalElemNum obj1%localElemNum = obj2%localElemNum - obj1%nodeType = obj2%nodeType + obj1%elementType = obj2%elementType + obj1%name = obj2%name IF (ALLOCATED(obj2%globalNodes)) obj1%globalNodes = obj2%globalNodes IF (ALLOCATED(obj2%globalElements)) obj1%globalElements & & = obj2%globalElements - IF (ALLOCATED(obj2%extraGlobalNodes)) obj1%extraGlobalNodes & - & = obj2%extraGlobalNodes + IF (ALLOCATED(obj2%boundaryData)) obj1%boundaryData& + & = obj2%boundaryData END SUBROUTINE ElemData_Copy diff --git a/src/modules/Mesh/src/Mesh_Class.F90 b/src/modules/Mesh/src/Mesh_Class.F90 index 2ace7c4ea..1ff39f4fa 100755 --- a/src/modules/Mesh/src/Mesh_Class.F90 +++ b/src/modules/Mesh/src/Mesh_Class.F90 @@ -20,20 +20,18 @@ MODULE Mesh_Class USE GlobalData -USE BaSetype +USE Basetype USE String_Class, ONLY: String USE ExceptionHandler_Class, ONLY: e USE FPL, ONLY: ParameterList_ USE HDF5File_Class USE VTKFile_Class USE NodeData_Class, ONLY: NodeData_, INTERNAL_NODE, BOUNDARY_NODE, & - & DOMAIN_BOUNDARY_NODE, GHOST_NODE, TypeNode, NodeData_Display + & DOMAIN_BOUNDARY_NODE, GHOST_NODE, TypeNode USE ElemData_Class, ONLY: ElemData_, INTERNAL_ELEMENT, BOUNDARY_ELEMENT, & - & DOMAIN_BOUNDARY_ELEMENT, GHOST_ELEMENT, TypeElem, & - & ElemData_Display => Display -USE FacetData_Class, ONLY: InternalFacetData_, BoundaryFacetData_, & - & InternalFacetData_Display, BoundaryFacetData_Display -USE AbstractMesh_Class, ONLY: AbstractMesh_, AbstractMeshDeallocate, & + & DOMAIN_BOUNDARY_ELEMENT, GHOST_ELEMENT, TypeElem +USE FacetData_Class, ONLY: InternalFacetData_, BoundaryFacetData_ +USE AbstractMesh_Class, ONLY: AbstractMesh_, AbstractMeshDeallocate, & & AbstractMeshDisplay, AbstractMeshGetQuery, AbstractMeshImport IMPLICIT NONE @@ -95,27 +93,11 @@ MODULE Mesh_Class !! Export mesh to a VTKfile PROCEDURE, PUBLIC, PASS(obj) :: Display => obj_display !! Display the mesh - PROCEDURE, PUBLIC, PASS(obj) :: DisplayNodeData => & - & obj_DisplayNodeData - !! Display node data - PROCEDURE, PUBLIC, PASS(obj) :: DisplayElementData => & - & obj_DisplayElementData - !! Display element data - PROCEDURE, PUBLIC, PASS(obj) :: DisplayInternalFacetData => & - & obj_DisplayInternalFacetData - !! Display internal facet data - PROCEDURE, PUBLIC, PASS(obj) :: DisplayBoundaryFacetData => & - & obj_DisplayBoundaryFacetData - !! Display mesh facet data - !! Display facet element shape data PROCEDURE, PUBLIC, PASS(obj) :: DisplayFacetElements => & & obj_DisplayFacetElements ! SET: ! @NodeDataMethods - PROCEDURE, PUBLIC, PASS(obj) :: InitiateNodeToElements => & - & obj_InitiateNodeToElements - !! Initiate node to node data PROCEDURE, PUBLIC, PASS(obj) :: InitiateNodeToNodes => & & obj_InitiateNodetoNodes !! Initiate Node to nodes mapping @@ -442,70 +424,6 @@ MODULE SUBROUTINE obj_Display(obj, msg, unitno) END SUBROUTINE obj_Display END INTERFACE MeshDisplay -!---------------------------------------------------------------------------- -! DisplayNodeData@IOMethods -!---------------------------------------------------------------------------- - -!> authors: Vikas Sharma, Ph. D. -! date: 13 April 2022 -! summary: Displays the Node data - -INTERFACE - MODULE SUBROUTINE obj_DisplayNodeData(obj, msg, unitno) - CLASS(Mesh_), INTENT(INOUT) :: obj - CHARACTER(*), INTENT(IN) :: msg - INTEGER(I4B), OPTIONAL, INTENT(IN) :: unitno - END SUBROUTINE obj_DisplayNodeData -END INTERFACE - -!---------------------------------------------------------------------------- -! DisplayElementData@IOMethods -!---------------------------------------------------------------------------- - -!> authors: Vikas Sharma, Ph. D. -! date: 13 April 2022 -! summary: Displays the element data - -INTERFACE - MODULE SUBROUTINE obj_DisplayElementData(obj, msg, unitno) - CLASS(Mesh_), INTENT(INOUT) :: obj - CHARACTER(*), INTENT(IN) :: msg - INTEGER(I4B), OPTIONAL, INTENT(IN) :: unitno - END SUBROUTINE obj_DisplayElementData -END INTERFACE - -!---------------------------------------------------------------------------- -! DisplayFacetData@IOMethods -!---------------------------------------------------------------------------- - -!> authors: Vikas Sharma, Ph. D. -! date: 13 April 2022 -! summary: Displays the element data - -INTERFACE - MODULE SUBROUTINE obj_DisplayInternalFacetData(obj, msg, unitno) - CLASS(Mesh_), INTENT(INOUT) :: obj - CHARACTER(*), INTENT(IN) :: msg - INTEGER(I4B), OPTIONAL, INTENT(IN) :: unitno - END SUBROUTINE obj_DisplayInternalFacetData -END INTERFACE - -!---------------------------------------------------------------------------- -! DisplayBoundaryFacetData@IOMethods -!---------------------------------------------------------------------------- - -!> authors: Vikas Sharma, Ph. D. -! date: 13 April 2022 -! summary: Displays the element data - -INTERFACE - MODULE SUBROUTINE obj_DisplayBoundaryFacetData(obj, msg, unitno) - CLASS(Mesh_), INTENT(INOUT) :: obj - CHARACTER(*), INTENT(IN) :: msg - INTEGER(I4B), OPTIONAL, INTENT(IN) :: unitno - END SUBROUTINE obj_DisplayBoundaryFacetData -END INTERFACE - !---------------------------------------------------------------------------- ! DisplayFacetElements@IOMethods !---------------------------------------------------------------------------- @@ -1188,39 +1106,6 @@ MODULE SUBROUTINE obj_GetQuery(obj, & END SUBROUTINE obj_GetQuery END INTERFACE -!---------------------------------------------------------------------------- -! InitiateNodeToElements@NodeDataMethods -!---------------------------------------------------------------------------- - -!> authors: Vikas Sharma, Ph. D. -! date: 15 June 2021 -! summary: generate Elements surrounding a node mapping -! -!# Introduction -! -! - This subroutine generates elements surrounding a node mapping, in other -! words it generates node to element -! - Element numbers returned by this routine are global element number. -! - This mapping is stored inside `obj%nodeData` array -! - For a local node number `ii`, `obj%nodeData(ii)%globalElements(:)` -! contains the global element numbers. -! -!@note -! Always use method called `GetNodeToElements()` to access this information. -! This methods requires global Node number -!@endnote -! -!@warning -! Always use the mapping between global node number and local node number to -! avoid segmentation fault -!@endwarning - -INTERFACE - MODULE SUBROUTINE obj_InitiateNodeToElements(obj) - CLASS(Mesh_), INTENT(INOUT) :: obj - END SUBROUTINE obj_InitiateNodeToElements -END INTERFACE - !---------------------------------------------------------------------------- ! InitiateNodeToNode@NodeDataMethods !---------------------------------------------------------------------------- diff --git a/src/submodules/AbstractMesh/src/AbstractMesh_Class@ConstructorMethods.F90 b/src/submodules/AbstractMesh/src/AbstractMesh_Class@ConstructorMethods.F90 index 09661ec2a..2bcb14245 100644 --- a/src/submodules/AbstractMesh/src/AbstractMesh_Class@ConstructorMethods.F90 +++ b/src/submodules/AbstractMesh/src/AbstractMesh_Class@ConstructorMethods.F90 @@ -16,6 +16,8 @@ ! SUBMODULE(AbstractMesh_Class) ConstructorMethods +USE Display_Method +USE GlobalData, ONLY: stdout IMPLICIT NONE CONTAINS @@ -115,10 +117,11 @@ !---------------------------------------------------------------------------- MODULE PROCEDURE obj_InitiateDynamicDataStructure -CHARACTER(*), PARAMETER :: myName = "obj_Import()" +CHARACTER(*), PARAMETER :: myName = "obj_InitiateDynamicDataStructure()" INTEGER(I4B) :: ii TYPE(ElemData_), POINTER :: elemdata_ptr TYPE(NodeData_), POINTER :: nodedata_ptr +TYPE(CPUTime_) :: TypeCPUTime #ifdef DEBUG_VER CALL e%RaiseInformation(modName//'::'//myName//' - '// & @@ -138,6 +141,13 @@ CALL obj%nodeDataList%Initiate() CALL obj%nodeDataBinaryTree%Initiate() +IF (obj%showTime) THEN + CALL Display("Showing Time States of InitiateDynamicDataStructure", & + & unitno=stdout) + CALL EqualLine(unitno=stdout) + CALL TypeCPUTime%SetStartTime() +END IF + DO ii = 1, obj%tElements elemdata_ptr => ElemData_Pointer() CALL ElemData_Copy(elemdata_ptr, obj%elementData(ii)) @@ -145,6 +155,15 @@ CALL obj%elementDataBinaryTree%Insert(elemdata_ptr) END DO +IF (obj%showTime) THEN + CALL TypeCPUTime%SetEndTime() + CALL Display(modName//" : "//myName// & + & " : time for making elementDataList: "// & + & tostring(TypeCPUTime%GetTime()), unitno=stdout) +END IF + +IF (obj%showTime) CALL TypeCPUTime%SetStartTime() + DO ii = 1, obj%tNodes nodedata_ptr => NodeData_Pointer() CALL NodeData_Copy(nodedata_ptr, obj%nodeData(ii)) @@ -152,6 +171,14 @@ CALL obj%nodeDataBinaryTree%Insert(nodedata_ptr) END DO +IF (obj%showTime) THEN + CALL TypeCPUTime%SetEndTime() + CALL Display(modName//" : "//myName// & + & " : time for making nodeDataList: "// & + & tostring(TypeCPUTime%GetTime()), unitno=stdout) + CALL EqualLine(unitno=stdout) +END IF + elemdata_ptr => NULL() nodedata_ptr => NULL() diff --git a/src/submodules/AbstractMesh/src/AbstractMesh_Class@IOMethods.F90 b/src/submodules/AbstractMesh/src/AbstractMesh_Class@IOMethods.F90 index ed12df02f..290a79920 100644 --- a/src/submodules/AbstractMesh/src/AbstractMesh_Class@IOMethods.F90 +++ b/src/submodules/AbstractMesh/src/AbstractMesh_Class@IOMethods.F90 @@ -473,9 +473,16 @@ !---------------------------------------------------------------------------- MODULE PROCEDURE obj_DisplayElementData -CHARACTER(*), PARAMETER :: myName = "obj_DisplayElementData()" -CALL e%RaiseError(modName//'::'//myName//' - '// & - & '[WIP ERROR] :: This routine is under development') +INTEGER(I4B) :: ii, telements + +CALL Display(msg, unitno=unitno) +telements = obj%GetTotalElements() + +DO ii = 1, telements + CALL elemData_Display(obj=obj%elementData(ii), & + & msg="elementData("//tostring(ii)//"): ", unitno=unitno) + CALL BlankLines(nol=1, unitno=unitno) +END DO END PROCEDURE obj_DisplayElementData !---------------------------------------------------------------------------- @@ -483,9 +490,14 @@ !---------------------------------------------------------------------------- MODULE PROCEDURE obj_DisplayNodeData -CHARACTER(*), PARAMETER :: myName = "obj_DisplayNodeData()" -CALL e%RaiseError(modName//'::'//myName//' - '// & - & '[WIP ERROR] :: This routine is under development') +INTEGER(I4B) :: ii, tNodes +tNodes = obj%GetTotalNodes() +CALL Display(msg, unitno=unitno) +DO ii = 1, tNodes + CALL nodeData_Display(obj%nodeData(ii), & + & msg="nodeData("//tostring(ii)//"): ", unitno=unitno) + CALL BlankLines(nol=1, unitno=unitno) +END DO END PROCEDURE obj_DisplayNodeData !---------------------------------------------------------------------------- @@ -493,9 +505,24 @@ !---------------------------------------------------------------------------- MODULE PROCEDURE obj_DisplayInternalFacetData -CHARACTER(*), PARAMETER :: myName = "obj_DisplayInternalFacetData()" -CALL e%RaiseError(modName//'::'//myName//' - '// & - & '[WIP ERROR] :: This routine is under development') +INTEGER(I4B) :: ii, n +LOGICAL(LGT) :: abool + +CALL Display(msg, unitno=unitno) + +abool = ALLOCATED(obj%internalFacetData) +IF (abool) THEN; n = SIZE(obj%internalFacetData); ELSE; n = 0; END IF + +CALL Display(abool, "internalFacetData ALLOCATED: ", unitno=unitno) + +DO ii = 1, n + + CALL InternalFacetData_Display(obj=obj%internalFacetData(ii), & + & msg="internalFacetData("//tostring(ii)//"): ", unitno=unitno) + + CALL BlankLines(nol=1, unitno=unitno) + +END DO END PROCEDURE obj_DisplayInternalFacetData !---------------------------------------------------------------------------- @@ -503,9 +530,23 @@ !---------------------------------------------------------------------------- MODULE PROCEDURE obj_DisplayBoundaryFacetData -CHARACTER(*), PARAMETER :: myName = "obj_DisplayBoundaryFacetData()" -CALL e%RaiseError(modName//'::'//myName//' - '// & - & '[WIP ERROR] :: This routine is under development') +INTEGER(I4B) :: ii, n +LOGICAL(LGT) :: abool + +abool = ALLOCATED(obj%boundaryFacetData) +IF (abool) THEN; n = SIZE(obj%boundaryFacetData); ELSE; n = 0; END IF + +CALL Display(msg, unitno=unitno) +CALL Display(abool, "boundaryFacetData ALLOCATED: ", unitno=unitno) + +DO ii = 1, n + + CALL BoundaryFacetData_Display(obj=obj%boundaryFacetData(ii), & + & msg="boundaryFacetData("//tostring(ii)//"): ", unitno=unitno) + + CALL BlankLines(nol=1, unitno=unitno) + +END DO END PROCEDURE obj_DisplayBoundaryFacetData !---------------------------------------------------------------------------- diff --git a/src/submodules/AbstractMesh/src/AbstractMesh_Class@NodeDataMethods.F90 b/src/submodules/AbstractMesh/src/AbstractMesh_Class@NodeDataMethods.F90 index 0675cdc9c..25522d42b 100644 --- a/src/submodules/AbstractMesh/src/AbstractMesh_Class@NodeDataMethods.F90 +++ b/src/submodules/AbstractMesh/src/AbstractMesh_Class@NodeDataMethods.F90 @@ -16,6 +16,9 @@ ! SUBMODULE(AbstractMesh_Class) NodeDataMethods +USE Display_Method +USE GlobalData, ONLY: stdout +USE AppendUtility IMPLICIT NONE CONTAINS @@ -25,8 +28,53 @@ MODULE PROCEDURE obj_InitiateNodeToElements CHARACTER(*), PARAMETER :: myName = "obj_InitiateNodeToElements()" -CALL e%RaiseError(modName//'::'//myName//' - '// & - & '[WIP ERROR] :: This routine is under development') +INTEGER(I4B) :: ii, jj, globalElemNum, nn, localNodeNum, & + & globalNodeNum +TYPE(CPUTime_) :: TypeCPUTime + +#ifdef DEBUG_VER +CALL e%RaiseInformation(modName//'::'//myName//' - '// & + & '[START] ') +#endif + +IF (obj%isNodeToElementsInitiated) THEN + CALL e%raiseWarning(modName//"::"//myName//" - "// & + & "[INTERNAL ERROR] :: NodeToElements is already initiated.") + RETURN +END IF + +IF (obj%showTime) CALL TypeCPUTime%SetStartTime() + +obj%isNodeToElementsInitiated = .TRUE. + +DO ii = 1, obj%tElements + globalElemNum = obj%elementData(ii)%globalElemNum + + nn = SIZE(obj%elementData(ii)%globalNodes) + + DO jj = 1, nn + globalNodeNum = obj%elementData(ii)%globalNodes(jj) + localNodeNum = obj%local_nptrs(globalNodeNum) + + CALL Append(obj%nodeData(localNodeNum)%globalElements, & + & globalElemNum) + + END DO + +END DO + +IF (obj%showTime) THEN + CALL TypeCPUTime%SetEndTime() + CALL Display(modName//" : "//myName// & + & " : time : "// & + & tostring(TypeCPUTime%GetTime()), unitno=stdout) +END IF + +#ifdef DEBUG_VER +CALL e%RaiseInformation(modName//'::'//myName//' - '// & + & '[END] ') +#endif + END PROCEDURE obj_InitiateNodeToElements !---------------------------------------------------------------------------- diff --git a/src/submodules/Mesh/src/Mesh_Class@IOMethods.F90 b/src/submodules/Mesh/src/Mesh_Class@IOMethods.F90 index 15c199be8..1c43c7eac 100644 --- a/src/submodules/Mesh/src/Mesh_Class@IOMethods.F90 +++ b/src/submodules/Mesh/src/Mesh_Class@IOMethods.F90 @@ -21,7 +21,12 @@ USE ReferenceElement_Method USE InputUtility USE HDF5File_Method, ONLY: HDF5ReadScalar, HDF5ReadVector, & -& HDF5ReadMatrix + & HDF5ReadMatrix + +USE NodeData_Class, ONLY: NodeData_Display +USE ElemData_Class, ONLY: ElemData_Display +USE FacetData_Class, ONLY: BoundaryFacetData_Display, & +& InternalFacetData_Display IMPLICIT NONE CONTAINS @@ -36,13 +41,10 @@ CALL Display(obj%xidim, "xidim: ", unitno=unitno) CALL Display(obj%elemType, "elemType: ", unitno=unitno) - abool = ASSOCIATED(obj%refElem) CALL Display(abool, "refElem ASSOCIATED: ", unitno=unitno) - abool = ALLOCATED(obj%facetElements) CALL Display(abool, "facetElements ALLOCATED: ", unitno=unitno) - END PROCEDURE obj_Display !---------------------------------------------------------------------------- @@ -161,88 +163,6 @@ IF (ALLOCATED(localNptrs)) DEALLOCATE (localNptrs) END PROCEDURE obj_ExportToVTK -!---------------------------------------------------------------------------- -! DisplayElementData -!---------------------------------------------------------------------------- - -MODULE PROCEDURE obj_DisplayElementData -INTEGER(I4B) :: ii, telements - -CALL Display(msg, unitno=unitno) -telements = obj%GetTotalElements() - -DO ii = 1, telements - CALL elemData_Display(obj=obj%elementData(ii), & - & msg="elementData("//tostring(ii)//"): ", unitno=unitno) - CALL BlankLines(nol=1, unitno=unitno) -END DO - -END PROCEDURE obj_DisplayElementData - -!---------------------------------------------------------------------------- -! DisplayNodeData -!---------------------------------------------------------------------------- - -MODULE PROCEDURE obj_DisplayNodeData -INTEGER(I4B) :: ii, tNodes -tNodes = obj%GetTotalNodes() -CALL Display(msg, unitno=unitno) -DO ii = 1, tNodes - CALL nodeData_Display(obj%nodeData(ii), & - & msg="nodeData("//tostring(ii)//"): ", unitno=unitno) - CALL BlankLines(nol=1, unitno=unitno) -END DO -END PROCEDURE obj_DisplayNodeData - -!---------------------------------------------------------------------------- -! DisplayInternalFacetData -!---------------------------------------------------------------------------- - -MODULE PROCEDURE obj_DisplayInternalFacetData -INTEGER(I4B) :: ii, n -LOGICAL(LGT) :: abool - -CALL Display(msg, unitno=unitno) -abool = ALLOCATED(obj%internalFacetData) -IF (abool) THEN; n = SIZE(obj%internalFacetData); ELSE; n = 0; END IF - -CALL Display(abool, "internalFacetData ALLOCATED: ", unitno=unitno) - -DO ii = 1, n - - CALL InternalFacetData_Display(obj=obj%internalFacetData(ii), & - & msg="internalFacetData("//tostring(ii)//"): ", unitno=unitno) - - CALL BlankLines(nol=1, unitno=unitno) - -END DO -END PROCEDURE obj_DisplayInternalFacetData - -!---------------------------------------------------------------------------- -! DisplayBoundaryFacetData -!---------------------------------------------------------------------------- - -MODULE PROCEDURE obj_DisplayBoundaryFacetData -INTEGER(I4B) :: ii, n -LOGICAL(LGT) :: abool - -abool = ALLOCATED(obj%boundaryFacetData) -IF (abool) THEN; n = SIZE(obj%boundaryFacetData); ELSE; n = 0; END IF - -CALL Display(msg, unitno=unitno) -CALL Display(abool, "boundaryFacetData ALLOCATED: ", unitno=unitno) - -DO ii = 1, n - - CALL BoundaryFacetData_Display(obj=obj%boundaryFacetData(ii), & - & msg="boundaryFacetData("//tostring(ii)//"): ", unitno=unitno) - - CALL BlankLines(nol=1, unitno=unitno) - -END DO - -END PROCEDURE obj_DisplayBoundaryFacetData - !---------------------------------------------------------------------------- ! DisplayFacetElements !---------------------------------------------------------------------------- @@ -265,7 +185,6 @@ CALL BlankLines(nol=1, unitno=unitno) END DO - END PROCEDURE obj_DisplayFacetElements END SUBMODULE IOMethods diff --git a/src/submodules/Mesh/src/Mesh_Class@NodeDataMethods.F90 b/src/submodules/Mesh/src/Mesh_Class@NodeDataMethods.F90 index be27a48e5..bf46b352f 100644 --- a/src/submodules/Mesh/src/Mesh_Class@NodeDataMethods.F90 +++ b/src/submodules/Mesh/src/Mesh_Class@NodeDataMethods.F90 @@ -20,36 +20,6 @@ IMPLICIT NONE CONTAINS -!---------------------------------------------------------------------------- -! InitiateNodeToElements -!---------------------------------------------------------------------------- - -MODULE PROCEDURE obj_InitiateNodeToElements -! Define internal variables -INTEGER(I4B) :: ii, jj, globalElemNum -INTEGER(I4B), ALLOCATABLE :: local_nptrs(:) -CHARACTER(*), PARAMETER :: myName = "obj_InitiateNodeToElements()" - -IF (obj%elemType .EQ. 0 .OR. obj%elemType .EQ. Point1) RETURN -IF (obj%isNodeToElementsInitiated) THEN - CALL e%raiseWarning(modName//"::"//myName//" - "// & - & "NodeToElements information is already initiated. If you want to & - & Reinitiate it then deallocate nodeData, first!!") - RETURN -END IF - -obj%isNodeToElementsInitiated = .TRUE. -DO ii = 1, obj%tElements - globalElemNum = obj%getGlobalElemNumber(ii) - local_nptrs = obj%getLocalNodeNumber(obj%getConnectivity(globalElemNum)) - DO jj = 1, SIZE(local_nptrs) - CALL Append(obj%nodeData(local_nptrs(jj))%globalElements, & - & globalElemNum) - END DO -END DO -IF (ALLOCATED(local_nptrs)) DEALLOCATE (local_nptrs) -END PROCEDURE obj_InitiateNodeToElements - !---------------------------------------------------------------------------- ! InitiateNodeToNodes !----------------------------------------------------------------------------