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_routines.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 IF (table(n)%NOTABLE <= 0) cycle
58 ndim = table(n)%NDIM
59 CALL write_i_c(ndim,len)
60 DO i=1,ndim
61 npt = SIZE(table(n)%X(i)%VALUES)
62 CALL write_i_c(npt , len)
63 CALL write_db(table(n)%X(i)%VALUES,npt)
64 ldim(i) = npt
65 END DO
66c
67 npt = ldim(1)
68 IF (ndim == 1) THEN
69 CALL write_db(table(n)%Y1D,npt)
70 len = npt
71 ELSE IF (ndim == 2) THEN
72 len = ldim(1)*ldim(2)
73 ALLOCATE(ytmp(len))
74 m = 0
75 DO j=1,ldim(2)
76 DO i=1,npt
77 m = m+1
78 ytmp(m) = table(n)%Y2D(i,j)
79 END DO
80 END DO
81 CALL write_db(ytmp, len)
82 ELSE IF (ndim == 3) THEN
83 len = ldim(1)*ldim(2)*ldim(3)
84 ALLOCATE(ytmp(len))
85 m = 0
86 DO k=1,ldim(3)
87 DO j=1,ldim(2)
88 DO i=1,npt
89 m = m+1
90 ytmp(m) = table(n)%Y3D(i,j,k)
91 END DO
92 END DO
93 END DO
94 CALL write_db(ytmp, len)
95 ELSE IF (ndim == 4) THEN
96 len = ldim(1)*ldim(2)*ldim(3)*ldim(4)
97 ALLOCATE(ytmp(len))
98 m = 0
99 DO l=1,ldim(4)
100 DO k=1,ldim(3)
101 DO j=1,ldim(2)
102 DO i=1,npt
103 m = m+1
104 ytmp(m) = table(n)%Y4D(i,j,k,l)
105 END DO
106 END DO
107 END DO
108 END DO
109 CALL write_db(ytmp, len)
110 END IF
111 IF (ALLOCATED(ytmp)) DEALLOCATE(ytmp)
112 END DO
113c-----------
114 RETURN
115 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:142
void write_i_c(int *w, int *len)