OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
write_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!|| write_mat_table ../engine/source/materials/tools/write_mat_table.F
25!||--- called by ------------------------------------------------------
26!|| write_eosparam ../engine/source/output/restart/write_eosparam.F90
27!|| write_matparam ../engine/source/output/restart/write_matparam.F
28!|| write_viscparam ../engine/source/output/restart/write_viscparam.F
29!||--- calls -----------------------------------------------------
30!|| write_db ../common_source/tools/input_output/write_db.F
31!|| write_i_c ../common_source/tools/input_output/write_routtines.c
32!||--- uses -----------------------------------------------------
33!|| table4d_mod ../common_source/modules/table4d_mod.F
34!||====================================================================
35 SUBROUTINE write_mat_table(TABLE, NUMTABL)
36C-----------------------------------------------
37 USE table4d_mod
38C-----------------------------------------------
39C I m p l i c i t T y p e s
40C-----------------------------------------------
41#include "implicit_f.inc"
42C-----------------------------------------------
43C D u m m y A r g u m e n t s
44C-----------------------------------------------
45 INTEGER ,INTENT(IN) :: NUMTABL
46 TYPE(table_4d_) ,INTENT(IN) :: TABLE(NUMTABL)
47C-----------------------------------------------
48C L o c a l V a r i a b l e s
49C-----------------------------------------------
50 INTEGER I,J,K,L,M,N,LEN,NPT,NDIM
51 INTEGER LDIM(4)
52 my_real, DIMENSION(:) ,ALLOCATABLE :: ytmp
53c===============================================
54 DO n=1,numtabl
55 len = 1
56 CALL write_i_c(table(n)%NOTABLE,len)
57 ndim = table(n)%NDIM
58 CALL write_i_c(ndim,len)
59 DO i=1,ndim
60 npt = SIZE(table(n)%X(i)%VALUES)
61 CALL write_i_c(npt , len)
62 CALL write_db(table(n)%X(i)%VALUES,npt)
63 ldim(i) = npt
64 END DO
65c
66 npt = ldim(1)
67 IF (ndim == 1) THEN
68 CALL write_db(table(n)%Y1D,npt)
69 len = npt
70 ELSE IF (ndim == 2) THEN
71 len = ldim(1)*ldim(2)
72 ALLOCATE(ytmp(len))
73 m = 0
74 DO j=1,ldim(2)
75 DO i=1,npt
76 m = m+1
77 ytmp(m) = table(n)%Y2D(i,j)
78 END DO
79 END DO
80 CALL write_db(ytmp, len)
81 ELSE IF (ndim == 3) THEN
82 len = ldim(1)*ldim(2)*ldim(3)
83 ALLOCATE(ytmp(len))
84 m = 0
85 DO k=1,ldim(3)
86 DO j=1,ldim(2)
87 DO i=1,npt
88 m = m+1
89 ytmp(m) = table(n)%Y3D(i,j,k)
90 END DO
91 END DO
92 END DO
93 CALL write_db(ytmp, len)
94 ELSE IF (ndim == 4) THEN
95 len = ldim(1)*ldim(2)*ldim(3)*ldim(4)
96 ALLOCATE(ytmp(len))
97 m = 0
98 DO l=1,ldim(4)
99 DO k=1,ldim(3)
100 DO j=1,ldim(2)
101 DO i=1,npt
102 m = m+1
103 ytmp(m) = table(n)%Y4D(i,j,k,l)
104 END DO
105 END DO
106 END DO
107 END DO
108 CALL write_db(ytmp, len)
109 END IF
110 IF (ALLOCATED(ytmp)) DEALLOCATE(ytmp)
111 END DO
112c-----------
113 RETURN
114 END SUBROUTINE write_mat_table
#define my_real
Definition cppsort.cpp:32
subroutine write_mat_table(table, numtabl)
subroutine write_db(a, n)
Definition write_db.F:140
void write_i_c(int *w, int *len)