@@ -332,6 +332,45 @@ SUBROUTINE MeshImportNodeData(obj, connectivity, internalNptrs)
332
332
333
333
END SUBROUTINE MeshImportNodeData
334
334
335
+ !- ---------------------------------------------------------------------------
336
+ ! MeshImportNodeData
337
+ !- ---------------------------------------------------------------------------
338
+
339
+ SUBROUTINE MeshImportNodeDataFromDim (obj , connectivity )
340
+ CLASS(AbstractMesh_), INTENT (INOUT ) :: obj
341
+ INTEGER (I4B), INTENT (IN ) :: connectivity(:, :)
342
+
343
+ ! Internal veriables
344
+ INTEGER (I4B) :: ii, jj, aint, dummy
345
+
346
+ aint = SIZE (connectivity, 1 )
347
+ CALL Reallocate(obj% local_nptrs, obj% maxNptrs)
348
+
349
+ DO ii = 1 , obj% tElements
350
+ DO jj = 1 , aint
351
+ dummy = connectivity(jj, ii)
352
+ IF (dummy .NE. 0 ) THEN
353
+ obj% local_nptrs(dummy) = dummy
354
+ END IF
355
+ END DO
356
+ END DO
357
+
358
+ obj% tNodes = COUNT (obj% local_nptrs .NE. 0 )
359
+ ALLOCATE (obj% nodeData(obj% tNodes))
360
+
361
+ dummy = 0
362
+ DO ii = 1 , obj% maxNptrs
363
+ IF (obj% local_nptrs(ii) .EQ. 0 ) CYCLE
364
+
365
+ dummy = dummy + 1
366
+ obj% nodeData(dummy)% globalNodeNum = obj% local_nptrs(ii)
367
+ obj% nodeData(dummy)% localNodeNum = dummy
368
+ obj% nodeData(dummy)% nodeType = INTERNAL_NODE
369
+ obj% local_nptrs(ii) = dummy
370
+ END DO
371
+
372
+ END SUBROUTINE MeshImportNodeDataFromDim
373
+
335
374
!- ---------------------------------------------------------------------------
336
375
! MeshImportFromGroup
337
376
!- ---------------------------------------------------------------------------
@@ -429,10 +468,10 @@ SUBROUTINE MeshImportFromDim(obj, hdf5, group, dim, entities, tEntities)
429
468
! internal variables
430
469
CHARACTER (* ), PARAMETER :: myName = " MeshImportFromDim()"
431
470
INTEGER (I4B), ALLOCATABLE :: connectivity(:, :), elemNumber(:), &
432
- & internalNptrs(:), temp_int_2d(:, :), temp_int_1d (:)
433
- INTEGER (I4B) :: ii, tElements(tEntities), tIntNodes(tEntities), &
471
+ & temp_int_2d(:, :), temp_int_1d( :), boundingEntity (:)
472
+ INTEGER (I4B) :: ii, jj, kk, tElements(tEntities), tIntNodes(tEntities), &
434
473
& nsd(tEntities), uid(tEntities), elemType(tEntities), nne(tEntities), &
435
- & aint, bint
474
+ & aint, bint, maxBoundingEntities
436
475
! TYPE(CPUTime_) :: TypeCPUTime
437
476
CHARACTER (:), ALLOCATABLE :: dsetname, prefix
438
477
REAL (DFP), DIMENSION (3 , tEntities) :: xyz, min_xyz, max_xyz
@@ -447,6 +486,7 @@ SUBROUTINE MeshImportFromDim(obj, hdf5, group, dim, entities, tEntities)
447
486
SELECT CASE (dim)
448
487
CASE (0_I4B )
449
488
prefix = group// " /pointEntities_"
489
+ maxBoundingEntities = 0_I4B
450
490
CASE (1_I4B )
451
491
prefix = group// " /curveEntities_"
452
492
CASE (2_I4B )
@@ -478,6 +518,19 @@ SUBROUTINE MeshImportFromDim(obj, hdf5, group, dim, entities, tEntities)
478
518
xyz(2 , ii) = obj% y
479
519
xyz(3 , ii) = obj% z
480
520
521
+ aint = GetElementIndex(elemType(ii))
522
+ obj% tElements_topology_wise(aint) = obj% tElements_topology_wise(aint) + &
523
+ & tElements(ii)
524
+
525
+ END DO
526
+
527
+ DO ii = 1 , SIZE (obj% tElements_topology_wise)
528
+ aint = obj% tElements_topology_wise(ii)
529
+ IF (aint .GT. 0 ) THEN
530
+ obj% tElemTopologies = obj% tElemTopologies + 1
531
+ obj% elemTopologies(obj% tElemTopologies) = &
532
+ & ReferenceElementInfo% elemTopologyName(ii)
533
+ END IF
481
534
END DO
482
535
483
536
obj% maxNNE = MAXVAL (nne)
@@ -486,6 +539,15 @@ SUBROUTINE MeshImportFromDim(obj, hdf5, group, dim, entities, tEntities)
486
539
CALL Reallocate(connectivity, obj% maxNNE, obj% tElements)
487
540
CALL Reallocate(elemNumber, obj% tElements)
488
541
542
+ IF (dim .GT. 0 ) THEN
543
+ CALL HDF5GetEntities(hdf5= hdf5, group= group, dim= dim - 1 , &
544
+ & tEntities= maxBoundingEntities, myName= myName, modName= modName)
545
+ ELSE
546
+ maxBoundingEntities = 0
547
+ END IF
548
+
549
+ CALL Reallocate(boundingEntity, maxBoundingEntities)
550
+
489
551
aint = 0
490
552
bint = 0
491
553
DO ii = 1 , tEntities
@@ -496,6 +558,26 @@ SUBROUTINE MeshImportFromDim(obj, hdf5, group, dim, entities, tEntities)
496
558
connectivity(1 :nne(ii), aint:bint) = &
497
559
& temp_int_2d(1 :nne(ii), 1 :tElements(ii))
498
560
elemNumber(aint:bint) = temp_int_1d(1 :tElements(ii))
561
+
562
+ DO jj = 1 , SIZE (obj% boundingEntity)
563
+ kk = ABS (obj% boundingEntity(jj))
564
+ boundingEntity(kk) = boundingEntity(kk) + obj% boundingEntity(jj)
565
+ END DO
566
+ END DO
567
+
568
+ aint = 0
569
+ DO ii = 1 , SIZE (boundingEntity)
570
+ IF (boundingEntity(ii) .NE. 0 ) aint = aint + 1
571
+ END DO
572
+
573
+ CALL Reallocate(obj% boundingEntity, aint)
574
+
575
+ aint = 0
576
+ DO ii = 1 , SIZE (boundingEntity)
577
+ IF (boundingEntity(ii) .NE. 0 ) THEN
578
+ aint = aint + 1
579
+ obj% boundingEntity(aint) = boundingEntity(ii)
580
+ END IF
499
581
END DO
500
582
501
583
obj% maxElemNum = MAXVAL (elemNumber)
@@ -521,11 +603,13 @@ SUBROUTINE MeshImportFromDim(obj, hdf5, group, dim, entities, tEntities)
521
603
& nne= nne(ii))
522
604
END DO
523
605
524
- ! CALL MeshImportNodeData(obj, connectivity, internalNptrs)
525
- !
526
- ! IF (ALLOCATED(elemNumber)) DEALLOCATE (elemNumber)
527
- ! IF (ALLOCATED(connectivity)) DEALLOCATE (connectivity)
528
- ! IF (ALLOCATED(internalNptrs)) DEALLOCATE (internalNptrs)
606
+ CALL MeshImportNodeDataFromDim(obj, connectivity)
607
+
608
+ IF (ALLOCATED (connectivity)) DEALLOCATE (connectivity)
609
+ IF (ALLOCATED (elemNumber)) DEALLOCATE (elemNumber)
610
+ IF (ALLOCATED (temp_int_2d)) DEALLOCATE (temp_int_2d)
611
+ IF (ALLOCATED (temp_int_1d)) DEALLOCATE (temp_int_1d)
612
+ IF (ALLOCATED (boundingEntity)) DEALLOCATE (boundingEntity)
529
613
530
614
#ifdef DEBUG_VER
531
615
CALL e% RaiseInformation(modName// ' ::' // myName// ' - ' // &
0 commit comments