| 1 |
C Copyright(C) 1999-2020, 2023, 2024 National Technology & Engineering Solutions |
| 2 |
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 3 |
C NTESS, the U.S. Government retains certain rights in this software. |
| 4 |
C |
| 5 |
C See packages/seacas/LICENSE for details |
| 6 |
C======================================================================= |
| 7 |
SUBROUTINE DBSBEL (NELBLK, NUMEL, LENE, INEL, NLISEL, LISEL, ADD) |
| 8 |
C======================================================================= |
| 9 |
|
| 10 |
C --*** DBSBEL *** (BLOT) Select elements given list of elements |
| 11 |
C -- |
| 12 |
C --DBSBEL creates the element block selection array and the element |
| 13 |
C --selection array (by block) given a list of selected elements. |
| 14 |
C -- |
| 15 |
C --Parameters: |
| 16 |
C -- NELBLK - IN - the number of element blocks |
| 17 |
C -- NUMEL - IN - the number of elements |
| 18 |
C -- LENE - IN - the cumulative element counts by element block |
| 19 |
C -- INEL - IN - the indices of the selected elements |
| 20 |
C -- NLISEL - IN/OUT - the number of selected elements for each block |
| 21 |
|
| 22 |
INTEGER LENE(0:NELBLK) |
| 23 |
INTEGER INEL(0:*) |
| 24 |
INTEGER NLISEL(0:NELBLK) |
| 25 |
INTEGER LISEL(0:*) |
| 26 |
LOGICAL ADD |
| 27 |
|
| 28 |
if (.NOT. ADD) THEN |
| 29 |
do ielb = 1, nelblk |
| 30 |
nlisel(ielb) = 0 |
| 31 |
end do |
| 32 |
nlisel(0) = 0 |
| 33 |
do i = 1, numel |
| 34 |
lisel(i) = 0 |
| 35 |
end do |
| 36 |
end if |
| 37 |
|
| 38 |
DO IELB = 1, NELBLK |
| 39 |
IEL = LENE(IELB-1)+1 |
| 40 |
LEL = LENE(IELB) |
| 41 |
NEL = NLISEL(IELB) |
| 42 |
DO I = 1, INEL(0) |
| 43 |
IF ((INEL(I) .GE. IEL) .AND. (INEL(I) .LE. LEL)) THEN |
| 44 |
ISEL = INEL(I) |
| 45 |
IF (lisel(isel) .eq. 0) then |
| 46 |
NEL = NEL + 1 |
| 47 |
lisel(isel) = isel |
| 48 |
end if |
| 49 |
END IF |
| 50 |
end do |
| 51 |
NLISEL(IELB) = NEL |
| 52 |
IF (NEL .GT. 0) NLISEL(0) = NLISEL(0) + 1 |
| 53 |
end do |
| 54 |
|
| 55 |
END |