OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
read_mat_table.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| read_mat_table ../engine/source/materials/tools/read_mat_table.F
25!||--- called by ------------------------------------------------------
26!|| read_eosparam ../engine/source/output/restart/read_eosparam.F90
27!|| read_matparam ../engine/source/output/restart/read_matparam.F
28!|| read_viscparam ../engine/source/output/restart/read_viscparam.F
29!||--- calls -----------------------------------------------------
30!|| read_db ../common_source/tools/input_output/read_db.F
31!|| read_i_c ../common_source/tools/input_output/write_routtines.c
32!||--- uses -----------------------------------------------------
33!|| table4d_mod ../common_source/modules/table4d_mod.F
34!||====================================================================
35 SUBROUTINE read_mat_table(TABLE, NUMTABL)
36C-----------------------------------------------
37C M o d u l e s
38C-----------------------------------------------
39 USE table4d_mod
40C-----------------------------------------------
41C I m p l i c i t T y p e s
42C-----------------------------------------------
43#include "implicit_f.inc"
44C-----------------------------------------------
45C D u m m y A r g u m e n t s
46C-----------------------------------------------
47 INTEGER ,INTENT(IN) :: NUMTABL
48 TYPE(table_4d_) ,INTENT(INOUT) :: TABLE(NUMTABL)
49C-----------------------------------------------
50C L o c a l V a r i a b l e s
51C-----------------------------------------------
52 INTEGER I,J,K,L,M,N,LEN,NPT,NDIM,STAT
53 INTEGER LDIM(4)
54 my_real, DIMENSION(:) ,ALLOCATABLE :: ytmp
55c===============================================
56 DO n=1,numtabl
57 len = 1
58 CALL read_i_c(table(n)%NOTABLE,len)
59 len = 1
60 CALL read_i_c(ndim,len)
61 table(n)%NDIM = ndim
62 ALLOCATE(table(n)%X(ndim),stat=stat)
63c
64 DO k=1,ndim
65 CALL read_i_c(npt,len)
66 ALLOCATE(table(n)%X(k)%VALUES(npt) ,stat=stat)
67 CALL read_db(table(n)%X(k)%VALUES,npt)
68 ldim(k) = npt
69 END DO
70 npt = ldim(1)
71 IF (ndim == 1) THEN
72 ALLOCATE(table(n)%Y1D(npt) ,stat=stat)
73 CALL read_db(table(n)%Y1D,npt)
74 ELSE IF (ndim == 2) THEN
75 len = ldim(1)*ldim(2)
76 ALLOCATE(ytmp(len))
77 ALLOCATE(table(n)%Y2D(ldim(1),ldim(2)) ,stat=stat)
78 CALL read_db(ytmp,len)
79 m = 0
80 DO j=1,ldim(2)
81 DO i=1,npt
82 m = m+1
83 table(n)%Y2D(i,j) = ytmp(m)
84 END DO
85 END DO
86 ELSE IF (ndim == 3) THEN
87 len = ldim(1)*ldim(2)*ldim(3)
88 ALLOCATE(ytmp(len))
89 ALLOCATE(table(n)%Y3D(ldim(1),ldim(2),ldim(3)),stat=stat)
90 CALL read_db(ytmp,len)
91 m = 0
92 DO k=1,ldim(3)
93 DO j=1,ldim(2)
94 DO i=1,npt
95 m = m+1
96 table(n)%Y3D(i,j,k) = ytmp(m)
97 END DO
98 END DO
99 END DO
100 ELSE IF (ndim == 4) THEN
101 len = ldim(1)*ldim(2)*ldim(3)*ldim(4)
102 ALLOCATE(ytmp(len))
103 ALLOCATE(table(n)%Y4D(ldim(1),ldim(2),ldim(3),ldim(4)),stat=stat)
104 CALL read_db(ytmp,len)
105 m = 0
106 DO l=1,ldim(4)
107 DO k=1,ldim(3)
108 DO j=1,ldim(2)
109 DO i=1,npt
110 m = m+1
111 table(n)%Y4D(i,j,k,l) = ytmp(m)
112 END DO
113 END DO
114 END DO
115 END DO
116 END IF
117 IF (ALLOCATED(ytmp)) DEALLOCATE(ytmp)
118 END DO
119c-----------
120 RETURN
121 END SUBROUTINE read_mat_table
#define my_real
Definition cppsort.cpp:32
subroutine read_db(a, n)
Definition read_db.F:88
subroutine read_mat_table(table, numtabl)
void read_i_c(int *w, int *len)