OpenRadioss Reader (Radioss Block Format)

 

 

Introduction and Workflow :

Introduction

 

An external Library ( ‘Reader’ in the picture hereafter) is used to build an input database that Radioss starter can querry to fill internal structures.

This library is using .cfg files that are defining the syntax of the different options.

Workflow

 

 

Tools and Resources :

TOOL: FORTRAN FUNCTIONS

RESOURCES: CFG FILES

GET INFORMATION IN MODEL

GENERIC ROUTINES

 

 

DEFINE OPTION FORMAT

TXT FILES

 

 

 

Available Fortran Functions

Limited number of routines for reading in Database

Easy to use : Automatically apply //SUBMODEL OFFSETs to IDs & apply unit systems

NEED

FUNCTION TO USE

COUNT NUMBER OF OPTION

HM_OPTION_COUNT

START READING OPTION

HM_OPTION_START

NEXT OPTION

HM_OPTION_NEXT

NEXT OPTION + READ /KEY1/KEY2/KEY3/KEY4/Id/Uid + Title

HM_OPTION_READ_KEY

GET INTEGER VALUE

HM_GET_INTV

GET INTEGER VALUES IN LIST/ARRAY

HM_GET_INTV_ARRAY_INDEX

GET INTEGER VALUES IN 2D LIST/ARRAY

HM_GET_INTV_ARRAY_2INDEXES

GET FLOAT VALUE

HM_GET_FLOATV

GET FLOAT VALUES IN LIST/ARRAY

HM_GET_FLOATV_ARRAY_INDEX

GET FLOAT VALUES IN 2D LIST/ARRAY

HM_GET_FLOATV_ARRAY_2INDEXES

GET PHYSICAL DIMENSION

HM_GET_FLOATV_DIM

GET STRING

HM_GET_STRING

GET STRING IN LIST/ARRAY

HM_GET_STRING_INDEX

GET BOOLEAN VALUE

HM_GET_BOOLV

 

.cfg Files

 

 

What inside CFG Files :

 

Where

Organisation of CFG Directories

 

 

How an option is read in Database : Examples

Simple Example : /PART reading

Input to read :

.cfg file :

 

Count number of options ( cf source/starter/control.F) :

Reading routine ( cf source/model/assembling/hm_read_part.F ) :

 

Other Example : /DAMP reading

 

Input to read :

 

Activate/Deactivate Reading Using .CFG File :

If Commented ( with /* */) , /DAMP is not recognized during reading

Removing ‘/*’ Before & ‘*/’ after the brackets to activate the reading

 

 

Count number of /DAMP :

 

Read Each Occurrence Of A Given Option :

Get Data From The Cards Of The Option:

 

How to read a new option : /NEWTYPE1

Card to read

 

Writing cfg file

Simple example of a card including 1 integer value :

Put option in input Database

Need to modify data_hierarchy.cfg file of the last available directory for OpenRadioss input :

paste following block at the end of this file to consider this option in the Database :

 

Count number of /NEWTYPE1 in OpenRadioss starter

If needed, to predim structures for this option, you can count option in source/starter/contrl.F

Read Each Occurrence of /NEWTYPE1 in OpenRadioss starter

Creation of a reading routine for a new option

Copyright> OpenRadioss Copyright> Copyright (C) 1986-2022 Altair Engineering Inc. Copyright> Copyright> This program is free software: you can redistribute it and/or modify Copyright> it under the terms of the GNU Affero General Public License as published by Copyright> the Free Software Foundation, either version 3 of the License, or Copyright> (at your option) any later version. Copyright> Copyright> This program is distributed in the hope that it will be useful, Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Copyright> GNU Affero General Public License for more details. Copyright> Copyright> You should have received a copy of the GNU Affero General Public License Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>. Copyright> Copyright> Copyright> Commercial Alternative: Altair Radioss Software Copyright> Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss Copyright> software under a commercial license. Contact Altair to discuss further if the Copyright> commercial version may interest you: https://www.altair.com/radioss/. Chd|==================================================================== Chd| HM_READ_NEW_TYPE1 source/newtype1/hm_read_new_type1.F Chd|-- called by ----------- Chd| LECTUR source/starter/lectur.F Chd|-- calls --------------- Chd| HM_GET_INTV source/devtools/hm_reader/hm_get_intv.F Chd| HM_OPTION_READ_KEY source/devtools/hm_reader/hm_option_read_key.F Chd| HM_OPTION_START source/devtools/hm_reader/hm_option_start.F Chd| HM_OPTION_READ_MOD share/modules1/hm_option_read_mod.F Chd| SUBMODEL_MOD share/modules1/submodel_mod.F Chd|==================================================================== SUBROUTINE HM_READ_NEW_TYPE1(LSUBMODEL) C============================================================================ C----------------------------------------------- C ROUTINE DESCRIPTION : C =================== C READ /NEWTYPE1 OPTION C----------------------------------------------- C DUMMY ARGUMENTS DESCRIPTION: C =================== C C NAME DESCRIPTION C C LSUBMODEL SUBMODEL STRUCTURE C----------------------------------------------- C M o d u l e s C----------------------------------------------- USE SUBMODEL_MOD USE HM_OPTION_READ_MOD C----------------------------------------------- C I m p l i c i t T y p e s C----------------------------------------------- #include "implicit_f.inc" C----------------------------------------------- C C o m m o n B l o c k s C----------------------------------------------- #include "nchar_c.inc" #include "submod_c.inc" #include "units_c.inc" C----------------------------------------------- C D u m m y A r g u m e n t s C----------------------------------------------- C INPUT ARGUMENTS TYPE(SUBMODEL_DATA),INTENT(IN)::LSUBMODEL(NSUBMOD) C OUTPUT ARGUMENTS C MODIFIED ARGUMENTS C----------------------------------------------- C A n a l y s e M o d u l e C----------------------------------------------- C----------------------------------------------- C L o c a l V a r i a b l e s C----------------------------------------------- INTEGER ITEST,ID,I INTEGER N_NEWTYPE1 CHARACTER*nchartitle, . TITR LOGICAL IS_AVAILABLE C----------------------------------------------- C E x t e r n a l F u n c t i o n s C----------------------------------------------- C======================================================================= IS_AVAILABLE = .FALSE. C CALL HM_OPTION_COUNT('/NEWTYPE1',N_NEWTYPE1) WRITE(IOUT,1000)N_NEWTYPE1 C CALL HM_OPTION_START('/NEWTYPE1') C-------------------------------------------------- DO I=1,N_NEWTYPE1 TITR = '' CALL HM_OPTION_READ_KEY(LSUBMODEL, . OPTION_ID = ID, . OPTION_TITR = TITR) C CALL HM_GET_INTV('Itest',ITEST,IS_AVAILABLE,LSUBMODEL) C WRITE(IOUT,2000)ID,TRIM(TITR),ITEST ENDDO C RETURN C 1000 FORMAT(// . ' NEWTYPE1 OPTIONS'/ . ' -------------'/, . ' NUMBER OF NEWTYPE1 OPTIONS . . . . . =',I10//) 2000 FORMAT(/ & 5X,' NEWTYPE1 ',/, & 5X,' ---------------- ',/, & 5X,'OPTION ID . . . . . . . . . . . . . . . . . . =',I10/, & 5X,'OPTION TITLE . . . . . . . . . . . . . . . . =',A/, & 5X,'ITEST . . . . . . . . . . . . . . . . . . . . =',I10/) END

Output in 0.out file :

 

 

 Related articles

OpenRadioss Coding Standards

OpenRadioss Coding Recommendations

OpenRadioss Performance Aspects: Vectorization and Optimization

OpenRadioss HMPP Development Insights