OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
nbfunc.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!|| nbfunct ../starter/source/tools/curve/nbfunc.f
25!||--- called by ------------------------------------------------------
26!|| lectur ../starter/source/starter/lectur.F
27!||--- calls -----------------------------------------------------
28!|| hm_get_intv ../starter/source/devtools/hm_reader/hm_get_intv.F
29!|| hm_option_count ../starter/source/devtools/hm_reader/hm_option_count.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!|| hm_option_read_mod ../starter/share/modules1/hm_option_read_mod.F
34!|| submodel_mod ../starter/share/modules1/submodel_mod.F
35!||====================================================================
36 SUBROUTINE nbfunct(NFUNCT,NTABLE,NPTS, LSUBMODEL)
37C-----------------------------------------------
38C M o d u l e s
39C-----------------------------------------------
40 USE submodel_mod
42 USE python_funct_mod, ONLY : funct_python_nsamples
44C-----------------------------------------------
45C I m p l i c i t T y p e s
46C-----------------------------------------------
47#include "implicit_f.inc"
48C-----------------------------------------------
49C D u m m y A r g u m e n t s
50C-----------------------------------------------
51 INTEGER NFUNCT, NTABLE, NPTS
52 TYPE(submodel_data), DIMENSION(NSUBMOD), INTENT(IN) :: LSUBMODEL
53C-----------------------------------------------
54C C o m m o n B l o c k s
55C-----------------------------------------------
56C-----------------------------------------------
57C L o c a l V a r i a b l e s
58C-----------------------------------------------
59 INTEGER I,ID,NPARAM,NPT,NFUNCT0,NTABLE0,NTABLE1
60 CHARACTER(LEN=NCHARTITLE) :: TITR
61 CHARACTER :: KEY*20,MESS*40
62 DATA mess/' FUNCTION COUNTING '/
63 INTEGER :: IFUN,N1
64 INTEGER :: IPYTHON
65 LOGICAL :: IS_AVAILABLE
66C======================================================================|
67
68! Get number of functions, and total number of points
69 nfunct0 = 0
70 CALL hm_option_count('/FUNCT', nfunct0)
71 npts = 0
72 ntable = 0
73 IF (nfunct0 > 0) THEN
74 CALL hm_option_start('/FUNCT')
75 DO ifun = 1, nfunct0
76 CALL hm_option_read_key(lsubmodel,
77 . keyword1 = key)
78 ipython = 0
79 IF(key(6:12) == '_PYTHON') ipython = 1
80 IF( ipython == 0 ) THEN
81 ntable = ntable + 1
82 CALL hm_get_intv('numberofpoints', npt, is_available, lsubmodel)
83 npts = npts + npt
84 ELSE
85 ntable = ntable + 1
86 npts = npts + funct_python_nsamples
87 ENDIF
88 ENDDO
89 ENDIF
90
91! Read tables
92 nfunct = nfunct0
93c NTABLE = NFUNCT0
94
95
96 CALL hm_option_count('/TABLE/0', ntable0)
97 CALL hm_option_count('/TABLE/1', ntable1)
98
99
100
101
102 IF (ntable0 > 0) THEN
103 CALL hm_option_start('/TABLE/0')
104 DO i = 1, ntable0
105 CALL hm_option_read_key(lsubmodel,
106 . option_id = id,
107 . option_titr = titr)
108 CALL hm_get_intv('ORDER', nparam, is_available, lsubmodel) !dimension of table
109 IF (nparam == 1) THEN
110 CALL hm_get_intv('N1', n1, is_available, lsubmodel) !size of X
111 npts = npts + n1
112 nfunct=nfunct+1
113 ENDIF
114 ENDDO
115 ENDIF
116
117
118 IF (ntable1 > 0) THEN
119 CALL hm_option_start('/TABLE/1')
120 DO i = 1, ntable1
121 CALL hm_option_read_key(lsubmodel,
122 . option_id = id,
123 . option_titr = titr)
124 CALL hm_get_intv('ORDER', nparam, is_available, lsubmodel) !dimension of table
125 IF (nparam == 1) THEN
126 CALL hm_get_intv('curverows', n1, is_available, lsubmodel) !size of X
127 npts = npts + n1
128 nfunct=nfunct+1
129 ENDIF
130 ENDDO
131 ENDIF
132 ntable=ntable+ntable1 + ntable0
133
134C NFUNCT0 = 0
135C CALL HM_OPTION_COUNT('/PYTHON_FUNCT', NFUNCT0)
136C NFUNCT = NFUNCT0 + NFUNCT
137
138
139C
140 npts=2*npts
141C
142 RETURN
143C-------------------------------------
144 END
subroutine hm_get_intv(name, ival, is_available, lsubmodel)
subroutine hm_option_count(entity_type, hm_option_number)
subroutine hm_option_start(entity_type)
integer, parameter nchartitle
subroutine nbfunct(nfunct, ntable, npts, lsubmodel)
Definition nbfunc.F:37
program starter
Definition starter.F:39