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