OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_func2d.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!|| hm_read_func2d ../starter/source/tools/curve/hm_read_func2d.F
25!||--- called by ------------------------------------------------------
26!|| lectur ../starter/source/starter/lectur.F
27!||--- calls -----------------------------------------------------
28!|| hm_get_float_array_index ../starter/source/devtools/hm_reader/hm_get_float_array_index.F
29!|| hm_get_intv ../starter/source/devtools/hm_reader/hm_get_intv.F
30!|| hm_option_read_key ../starter/source/devtools/hm_reader/hm_option_read_key.F
31!|| hm_option_start ../starter/source/devtools/hm_reader/hm_option_start.F
32!||--- uses -----------------------------------------------------
33!|| func2d_mod ../starter/share/modules1/func2d_mod.F
34!|| hm_option_read_mod ../starter/share/modules1/hm_option_read_mod.F
35!|| message_mod ../starter/share/message_module/message_mod.F
36!|| submodel_mod ../starter/share/modules1/submodel_mod.F
37!||====================================================================
38 SUBROUTINE hm_read_func2d(FUNC2D, LSUBMODEL, UNITAB)
39C-----------------------------------------------
40C M o d u l e s
41C-----------------------------------------------
42 USE func2d_mod
43 USE message_mod
44 USE submodel_mod
45 USE unitab_mod
48C-----------------------------------------------
49C I m p l i c i t T y p e s
50C-----------------------------------------------
51#include "implicit_f.inc"
52C-----------------------------------------------
53C C o m m o n B l o c k s
54C-----------------------------------------------
55C NFUNCT
56#include "com04_c.inc"
57C-----------------------------------------------
58C D u m m y A r g u m e n t s
59C-----------------------------------------------
60 TYPE(func2d_struct), DIMENSION(NFUNC2D), INTENT(INOUT) :: FUNC2D
61 TYPE(submodel_data), DIMENSION(NSUBMOD), INTENT(IN) :: LSUBMODEL
62 TYPE(unit_type_), INTENT(IN) :: UNITAB
63C-----------------------------------------------
64C L o c a l V a r i a b l e s
65C-----------------------------------------------.
66 INTEGER :: KK, ID, UID, NPT, IPT, DIM, REC_START
67 CHARACTER(LEN=NCHARLINE) :: TITR
68 LOGICAL :: IS_AVAILABLE
69
70 CALL hm_option_start('/FUNC_2D')
71
72 DO kk = 1, nfunc2d
73 CALL hm_option_read_key(lsubmodel, option_titr = titr, option_id = id)
74 CALL hm_get_intv('dim', dim, is_available, lsubmodel)
75
76
77 func2d(kk)%ID = id
78 npt = 0
79 func2d(kk)%DIM = dim
80
81 CALL hm_get_intv('FUNC_size', npt, is_available, lsubmodel)
82 func2d(kk)%NPT = npt
83 ALLOCATE(func2d(kk)%XVAL(2, npt), func2d(kk)%FVAL(dim, npt))
84
85 SELECT CASE (dim)
86 CASE(1)
87 DO ipt = 1, npt
88 CALL hm_get_float_array_index('X', func2d(kk)%XVAL(1, ipt), ipt, is_available, lsubmodel, unitab)
89 CALL hm_get_float_array_index('Y', func2d(kk)%XVAL(2, ipt), ipt, is_available, lsubmodel, unitab)
90 CALL hm_get_float_array_index('Z1', func2d(kk)%FVAL(1, ipt), ipt, is_available, lsubmodel, unitab)
91 ENDDO
92 CASE (2)
93 DO ipt = 1, npt
94 CALL hm_get_float_array_index('X', func2d(kk)%XVAL(1, ipt), ipt, is_available, lsubmodel, unitab)
95 CALL hm_get_float_array_index('Y', func2d(kk)%XVAL(2, ipt), ipt, is_available, lsubmodel, unitab)
96 CALL hm_get_float_array_index('Z1', func2d(kk)%FVAL(1, ipt), ipt, is_available, lsubmodel, unitab)
97 CALL hm_get_float_array_index('Z2', func2d(kk)%FVAL(2, ipt), ipt, is_available, lsubmodel, unitab)
98 ENDDO
99 CASE (3)
100 DO ipt = 1, npt
101 CALL hm_get_float_array_index('X', func2d(kk)%XVAL(1, ipt), ipt, is_available, lsubmodel, unitab)
102 CALL hm_get_float_array_index('Y', func2d(kk)%XVAL(2, ipt), ipt, is_available, lsubmodel, unitab)
103 CALL hm_get_float_array_index('Z1', func2d(kk)%FVAL(1, ipt), ipt, is_available, lsubmodel, unitab)
104 CALL hm_get_float_array_index('Z2', func2d(kk)%FVAL(2, ipt), ipt, is_available, lsubmodel, unitab)
105 CALL hm_get_float_array_index('z3', FUNC2D(KK)%FVAL(3, IPT), IPT, IS_AVAILABLE, LSUBMODEL, UNITAB)
106 ENDDO
107 CASE DEFAULT
108C TODO(DC) : Throw error here
109 END SELECT
110 ENDDO
111 RETURN
112 END SUBROUTINE HM_READ_FUNC2D
subroutine hm_get_float_array_index(name, rval, index, is_available, lsubmodel, unitab)
subroutine hm_get_intv(name, ival, is_available, lsubmodel)
subroutine hm_option_start(entity_type)
subroutine hm_read_func2d(func2d, lsubmodel, unitab)
integer, parameter ncharline