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