IOSS 2.0
Loading...
Searching...
No Matches
Ut_ioad.C File Reference
#include <catch2/catch_session.hpp>
#include <catch2/catch_test_macros.hpp>
#include "Ioss_CodeTypes.h"
#include "Ioss_SubSystem.h"
#include "init/Ionit_Initializer.h"
#include "adios/Ioad_Constants.h"
#include "adios/Ioad_Helper.h"
#include "adios/Ioad_TemplateToValue.h"
#include <algorithm>
#include <iostream>
#include <ostream>
#include <stddef.h>
#include <stdlib.h>
#include <string>
#include <vector>
Include dependency graph for Ut_ioad.C:

Macros

#define COMPARE_POINTERS_AND_THROW_WITH_INDEX(obj_type, obj1, obj2, meth, index)
 
#define COMPARE_VALUES_AND_THROW(obj_type, obj1, obj2, meth)
 
#define COMPARE_VECTORS_AND_THROW(name, vec1, vec2)
 

Functions

int main (int argc, char *argv[])
 
void CompareVariableType (const Ioss::VariableType *var1, const Ioss::VariableType *var2)
 
template<typename T >
bool CompareVectors (const std::vector< T > &v1, const std::vector< T > &v2)
 
void CompareFields (const Ioss::Field &field1, const Ioss::Field &field2)
 
void CompareProperties (const Ioss::Property &prop1, const Ioss::Property &prop2)
 
template<typename T , typename TF >
void CompareFieldData (const T entity_block1, const T entity_block2, const std::string &field_name)
 
template<typename T >
void CompareFieldData (const T entity_block1, const T entity_block2, const std::string &field_name)
 
template<typename T >
void CompareAllProperties (const T &obj1, const T &obj2)
 
template<typename T >
void CompareContainers (const T &entity_blocks1, const T &entity_blocks2, Ioss::State state)
 
void CompareRegions (Ioss::Region *region1, Ioss::Region *region2)
 
void CompareDB (Ioss::DatabaseIO *db1, Ioss::DatabaseIO *db2)
 
template<typename Entity , typename T >
void put_field_data (std::string field_name, int local_size, size_t component_count, Entity *e)
 
template<typename Entity >
void write_fields (Entity *e, Ioss::Field::RoleType role)
 
void create_phantom (Ioss::DatabaseIO *db)
 
void create_database (std::string type, std::string file_name)
 
 TEST_CASE ("Ioad")
 
template<typename T >
const std::string get_entity_type_test ()
 
template<>
const std::string get_entity_type_test< Ioss::NodeBlock > ()
 
template<>
const std::string get_entity_type_test< Ioss::SideSet > ()
 
template<>
const std::string get_entity_type_test< Ioss::SideBlock > ()
 
 TEST_CASE ("Ioad_BlockNames")
 

Variables

std::vector< std::string > ignored_properties = {"database_name", "base_filename", "database_type"}
 
std::vector< std::string > ignored_fields = {"implicit_ids"}
 
std::vector< std::string > ignore_errors = {"owning_processor"}
 

Macro Definition Documentation

◆ COMPARE_POINTERS_AND_THROW_WITH_INDEX

#define COMPARE_POINTERS_AND_THROW_WITH_INDEX ( obj_type,
obj1,
obj2,
meth,
index )
Value:
if (obj1->meth(index) != obj2->meth(index)) { \
std::ostringstream error; \
error << #obj_type " " #meth " do not match:\n" \
<< "1:" #index " - " << obj1->meth(index) << "\n" \
<< "2:" #index " - " << obj2->meth(index) << "\n"; \
throw(error.str()); \
}

◆ COMPARE_VALUES_AND_THROW

#define COMPARE_VALUES_AND_THROW ( obj_type,
obj1,
obj2,
meth )
Value:
if (obj1.meth() != obj2.meth()) { \
std::ostringstream error; \
error << #obj_type " " #meth " do not match:\n" \
<< "1: " << obj1.meth() << "\n" \
<< "2: " << obj2.meth() << "\n"; \
throw(error.str()); \
}

◆ COMPARE_VECTORS_AND_THROW

#define COMPARE_VECTORS_AND_THROW ( name,
vec1,
vec2 )
Value:
if (!CompareVectors(vec1, vec2)) { \
std::ostringstream error; \
error << "Vectors " << name << " do not match:\n"; \
throw(error.str()); \
}
bool CompareVectors(const std::vector< T > &v1, const std::vector< T > &v2)
Definition Ut_ioad.C:75

Function Documentation

◆ CompareAllProperties()

template<typename T >
void CompareAllProperties ( const T & obj1,
const T & obj2 )

◆ CompareContainers()

template<typename T >
void CompareContainers ( const T & entity_blocks1,
const T & entity_blocks2,
Ioss::State state )

◆ CompareDB()

void CompareDB ( Ioss::DatabaseIO * db1,
Ioss::DatabaseIO * db2 )

◆ CompareFieldData() [1/2]

template<typename T , typename TF >
void CompareFieldData ( const T entity_block1,
const T entity_block2,
const std::string & field_name )

◆ CompareFieldData() [2/2]

template<typename T >
void CompareFieldData ( const T entity_block1,
const T entity_block2,
const std::string & field_name )

◆ CompareFields()

void CompareFields ( const Ioss::Field & field1,
const Ioss::Field & field2 )

◆ CompareProperties()

void CompareProperties ( const Ioss::Property & prop1,
const Ioss::Property & prop2 )

◆ CompareRegions()

void CompareRegions ( Ioss::Region * region1,
Ioss::Region * region2 )

◆ CompareVariableType()

void CompareVariableType ( const Ioss::VariableType * var1,
const Ioss::VariableType * var2 )

◆ CompareVectors()

template<typename T >
bool CompareVectors ( const std::vector< T > & v1,
const std::vector< T > & v2 )

◆ create_database()

void create_database ( std::string type,
std::string file_name )

◆ create_phantom()

void create_phantom ( Ioss::DatabaseIO * db)

◆ get_entity_type_test()

template<typename T >
const std::string get_entity_type_test ( )

◆ get_entity_type_test< Ioss::NodeBlock >()

template<>
const std::string get_entity_type_test< Ioss::NodeBlock > ( )

◆ get_entity_type_test< Ioss::SideBlock >()

template<>
const std::string get_entity_type_test< Ioss::SideBlock > ( )

◆ get_entity_type_test< Ioss::SideSet >()

template<>
const std::string get_entity_type_test< Ioss::SideSet > ( )

◆ main()

int main ( int argc,
char * argv[] )

◆ put_field_data()

template<typename Entity , typename T >
void put_field_data ( std::string field_name,
int local_size,
size_t component_count,
Entity * e )

◆ TEST_CASE() [1/2]

TEST_CASE ( "Ioad" )

◆ TEST_CASE() [2/2]

TEST_CASE ( "Ioad_BlockNames" )

◆ write_fields()

template<typename Entity >
void write_fields ( Entity * e,
Ioss::Field::RoleType role )

Variable Documentation

◆ ignore_errors

std::vector<std::string> ignore_errors = {"owning_processor"}

◆ ignored_fields

std::vector<std::string> ignored_fields = {"implicit_ids"}

◆ ignored_properties

std::vector<std::string> ignored_properties = {"database_name", "base_filename", "database_type"}