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_routines.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 IF (table(n)%NOTABLE == 0) cycle
60 len = 1
61 CALL read_i_c(ndim,len)
62 table(n)%NDIM = ndim
63 ALLOCATE(table(n)%X(ndim),stat=stat)
64c
65 DO k=1,ndim
66 CALL read_i_c(npt,len)
67 ALLOCATE(table(n)%X(k)%VALUES(npt) ,stat=stat)
68 CALL read_db(table(n)%X(k)%VALUES,npt)
69 ldim(k) = npt
70 END DO
71 npt = ldim(1)
72 IF (ndim == 1) THEN
73 ALLOCATE(table(n)%Y1D(npt) ,stat=stat)
74 CALL read_db(table(n)%Y1D,npt)
75 ELSE IF (ndim == 2) THEN
76 len = ldim(1)*ldim(2)
77 ALLOCATE(ytmp(len))
78 ALLOCATE(table(n)%Y2D(ldim(1),ldim(2)) ,stat=stat)
79 CALL read_db(ytmp,len)
80 m = 0
81 DO j=1,ldim(2)
82 DO i=1,npt
83 m = m+1
84 table(n)%Y2D(i,j) = ytmp(m)
85 END DO
86 END DO
87 ELSE IF (ndim == 3) THEN
88 len = ldim(1)*ldim(2)*ldim(3)
89 ALLOCATE(ytmp(len))
90 ALLOCATE(table(n)%Y3D(ldim(1),ldim(2),ldim(3)),stat=stat)
91 CALL read_db(ytmp,len)
92 m = 0
93 DO k=1,ldim(3)
94 DO j=1,ldim(2)
95 DO i=1,npt
96 m = m+1
97 table(n)%Y3D(i,j,k) = ytmp(m)
98 END DO
99 END DO
100 END DO
101 ELSE IF (ndim == 4) THEN
102 len = ldim(1)*ldim(2)*ldim(3)*ldim(4)
103 ALLOCATE(ytmp(len))
104 ALLOCATE(table(n)%Y4D(ldim(1),ldim(2),ldim(3),ldim(4)),stat=stat)
105 CALL read_db(ytmp,len)
106 m = 0
107 DO l=1,ldim(4)
108 DO k=1,ldim(3)
109 DO j=1,ldim(2)
110 DO i=1,npt
111 m = m+1
112 table(n)%Y4D(i,j,k,l) = ytmp(m)
113 END DO
114 END DO
115 END DO
116 END DO
117 END IF
118 IF (ALLOCATED(ytmp)) DEALLOCATE(ytmp)
119 END DO
120c-----------
121 RETURN
122 END SUBROUTINE read_mat_table
#define my_real
Definition cppsort.cpp:32
subroutine read_db(a, n)
Definition read_db.F:90
subroutine read_mat_table(table, numtabl)
subroutine read_viscparam(visc)
void read_i_c(int *w, int *len)