Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .lgtm.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
extraction:
cpp:
prepare:
packages:
- libboost-all-dev
configure:
command:
- ./meson.py build --optimization=1
index:
build_command:
- ./ninja -C build

path_classifiers:
test:
- TestCases/*
Expand Down
2 changes: 1 addition & 1 deletion externals/cgns/README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**********************************************************************
https://github.com/CGNS/CGNS/releases,
the source files for CGNS v3.3.0 are bundled and build directly into SU2
the source files for CGNS v4.2.0 are bundled and build directly into SU2

From the CGNS webpage:

Expand Down
3 changes: 3 additions & 0 deletions externals/cgns/adf/ADF.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ File: ADF.h
ADF core code. These sizes are provided for reference only!
***********************************************************************/
#define ADF_DATA_TYPE_LENGTH 32
#define ADF_CGIO_DATA_TYPE_LENGTH 2
#define ADF_DATE_LENGTH 32
#define ADF_FILENAME_LENGTH 1024
#define ADF_FORMAT_LENGTH 20
Expand Down Expand Up @@ -249,6 +250,7 @@ EXTERN void ADF_Put_Name(

EXTERN void ADF_Read_All_Data(
const double ID,
const char *m_data_type,
char *data,
int *error_return ) ;

Expand All @@ -269,6 +271,7 @@ EXTERN void ADF_Read_Data(
const cgsize_t m_start[],
const cgsize_t m_end[],
const cgsize_t m_stride[],
const char *m_data_type,
char *data,
int *error_return ) ;

Expand Down
21 changes: 20 additions & 1 deletion externals/cgns/adf/ADF_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ ADFI_chase_link( ID, &LID, &file_index, &block_offset, &node, error_return ) ;
CHECK_ADF_ABORT( *error_return ) ;

/** Copy the blank-filled data-type into a C string **/
ADFI_string_2_C_string( node.data_type, ADF_DATA_TYPE_LENGTH, data_type,
ADFI_string_2_C_string( node.data_type, ADF_CGIO_DATA_TYPE_LENGTH, data_type,
error_return ) ;
CHECK_ADF_ABORT( *error_return ) ;

Expand Down Expand Up @@ -2601,6 +2601,7 @@ output: int *error_return Error return.
***********************************************************************/
void ADF_Read_All_Data(
const double ID,
const char *m_data_type,
char *data,
int *error_return )
{
Expand Down Expand Up @@ -2629,7 +2630,16 @@ if( data == NULL ) {
ADFI_chase_link( ID, &LID, &file_index, &block_offset, &node, error_return ) ;
CHECK_ADF_ABORT( *error_return ) ;

/* if it was provided, check to make sure the data types match */
if( m_data_type != NULL ) {
if(strncmp(m_data_type, node.data_type, 2) != 0){
*error_return = INVALID_DATA_TYPE;
CHECK_ADF_ABORT( *error_return );
}
}

/** Get datatype size **/

ADFI_evaluate_datatype( file_index, node.data_type, &file_bytes, &memory_bytes,
tokenized_data_type, &file_format, &machine_format, error_return ) ;
CHECK_ADF_ABORT( *error_return ) ;
Expand Down Expand Up @@ -2916,6 +2926,7 @@ void ADF_Read_Data(
const cgsize_t m_start[],
const cgsize_t m_end[],
const cgsize_t m_stride[],
const char *m_data_type,
char *data,
int *error_return )
{
Expand Down Expand Up @@ -2952,6 +2963,14 @@ if( (s_start == NULL) || (s_end == NULL) || (s_stride == NULL) ||
ADFI_chase_link( ID, &LID, &file_index, &block_offset, &node, error_return ) ;
CHECK_ADF_ABORT( *error_return ) ;

/* if it was provided, check to make sure the data types match */
if( m_data_type != NULL ) {
if(strncmp(m_data_type, node.data_type, 2) != 0){
*error_return = INVALID_DATA_TYPE;
CHECK_ADF_ABORT( *error_return );
}
}

/** Get datatype length **/
ADFI_evaluate_datatype( file_index, node.data_type, &file_bytes, &memory_bytes,
tokenized_data_type, &disk_format, &machine_format, error_return ) ;
Expand Down
2 changes: 1 addition & 1 deletion externals/cgns/adf/ADF_internals.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ static void ADFI_convert_integers(
}
}
else {
memcpy(to_data, from_data, size * count);
memcpy(to_data, from_data, (size_t)size * (size_t)count);
}
}
/*------------------------------------------------------------------------------------*/
Expand Down
54 changes: 54 additions & 0 deletions externals/cgns/adfh/ADF.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*-------------------------------------------------------------------
* this is a replacement for ADF.h for HDF5 implementation
*-------------------------------------------------------------------*/

#ifndef _ADF_H_
#define _ADF_H_

/* map ADF calls to ADFH calls */

#define ADF_Children_Names ADFH_Children_Names
#define ADF_Children_IDs ADFH_Children_IDs
#define ADF_Create ADFH_Create
#define ADF_Database_Close ADFH_Database_Close
#define ADF_Database_Delete ADFH_Database_Delete
#define ADF_Database_Garbage_Collection ADFH_Database_Garbage_Collection
#define ADF_Database_Get_Format ADFH_Database_Get_Format
#define ADF_Database_Open ADFH_Database_Open
#define ADF_Database_Valid ADFH_Database_Valid
#define ADF_Database_Set_Format ADFH_Database_Set_Format
#define ADF_Database_Version ADFH_Database_Version
#define ADF_Delete ADFH_Delete
#define ADF_Error_Message ADFH_Error_Message
#define ADF_Flush_to_Disk ADFH_Flush_to_Disk
#define ADF_Get_Data_Type ADFH_Get_Data_Type
#define ADF_Get_Dimension_Values ADFH_Get_Dimension_Values
#define ADF_Get_Error_State ADFH_Get_Error_State
#define ADF_Get_Label ADFH_Get_Label
#define ADF_Get_Link_Path ADFH_Get_Link_Path
#define ADF_Get_Name ADFH_Get_Name
#define ADF_Get_Node_ID ADFH_Get_Node_ID
#define ADF_Get_Number_of_Dimensions ADFH_Get_Number_of_Dimensions
#define ADF_Get_Root_ID ADFH_Get_Root_ID
#define ADF_Is_Link ADFH_Is_Link
#define ADF_Library_Version ADFH_Library_Version
#define ADF_Link ADFH_Link
#define ADF_Move_Child ADFH_Move_Child
#define ADF_Number_of_Children ADFH_Number_of_Children
#define ADF_Put_Dimension_Information ADFH_Put_Dimension_Information
#define ADF_Put_Name ADFH_Put_Name
#define ADF_Read_All_Data ADFH_Read_All_Data
#define ADF_Read_Block_Data ADFH_Read_Block_Data
#define ADF_Read_Data ADFH_Read_Data
#define ADF_Set_Error_State ADFH_Set_Error_State
#define ADF_Set_Label ADFH_Set_Label
#define ADF_Write_All_Data ADFH_Write_All_Data
#define ADF_Write_Block_Data ADFH_Write_Block_Data
#define ADF_Write_Data ADFH_Write_Data
#define ADF_Release_ID ADFH_Release_ID

/* include ADFH.h */

#include "ADFH.h"

#endif
Loading