9#include "iocatalyst_export.h"
11#include "gtest/gtest.h"
26 bool regionsAreEqual(
const std::string &fileName,
const std::string &catFileName,
27 const std::string &iossDatabaseType);
30 const std::string &iossDatabaseType);
32 void runStructuredTest(
const std::string &testName);
34 void runUnstructuredTest(
const std::string &testName);
36 Ioss::DatabaseIO *writeAndGetExodusDatabaseOnRead(
const std::string &testName,
41 conduit_cpp::Node getConduitFromExodusFile(std::string &filename,
43 Ioss::DatabaseIO *getCatalystDatabaseFromConduit(conduit_cpp::Node &conduitNode,
47 const std::string &iossDatabaseType,
50 Ioss::DatabaseIO *getCatalystDatabaseFromConduitFiles(
const std::string &dirName,
55 template <
typename EntityContainer>
59 auto nameList = g->field_describe();
60 for (
auto name : nameList) {
61 auto field = g->get_fieldref(name);
62 if (field.zero_copy_enabled()) {
63 std::vector<std::byte> dcBuffer(field.get_size());
64 g->get_field_data(name,
Data(dcBuffer), dcBuffer.size());
67 g->get_field_data(name, &data, &dataSize);
68 ASSERT_GT(dataSize, 0) <<
"DataSize is not greater than 0 for field " << name
70 std::byte *b =
static_cast<std::byte *
>(data);
71 std::vector<std::byte> zcBuffer(b, b + field.get_size());
72 EXPECT_EQ(dcBuffer, zcBuffer);
78 void setBlockMeshSize(
unsigned int i,
unsigned int j,
unsigned int k);
79 void setOrigin(
unsigned int i,
unsigned int j,
unsigned int k);
82 const std::string CGNS_DATABASE_TYPE =
"cgns";
83 const std::string CGNS_FILE_EXTENSION =
".cgns";
84 const std::string EXODUS_DATABASE_TYPE =
"exodus";
85 const std::string EXODUS_FILE_EXTENSION =
".ex2";
86 const std::string CATALYST_TEST_FILE_PREFIX =
"catalyst_";
87 const std::string CATALYST_TEST_FILE_NP =
"_np_";
88 inline static const std::string CATALYST_DATABASE_TYPE =
"catalyst";
89 inline static const std::string CATALYST_DUMMY_DATABASE =
"dummy.db";
IOSS_NODISCARD constexpr T * Data(std::vector< T > &vec)
Definition Ioss_Utils.h:56
Definition Iocatalyst_BlockMeshSet.h:27
Definition Iocatalyst_BlockMeshSet.h:20
Definition Iocatalyst_BlockMesh.h:16
Definition Iocatalyst_DatabaseIOTest.h:16
Iocatalyst::BlockMesh::Extent origin
Definition Iocatalyst_DatabaseIOTest.h:21
Ioss::ParallelUtils putils
Definition Iocatalyst_DatabaseIOTest.h:22
Iocatalyst::BlockMeshSet bmSet
Definition Iocatalyst_DatabaseIOTest.h:18
bool regionsAreEqualCatalystAndIoss(const std::string &fileName, Ioss::DatabaseIO &cat_d, const std::string &iossDatabaseType)
Iocatalyst::BlockMesh::Extent blockMeshSize
Definition Iocatalyst_DatabaseIOTest.h:20
Iocatalyst::BlockMesh::Partition part
Definition Iocatalyst_DatabaseIOTest.h:19
void checkEntityContainerZeroCopyFields(const EntityContainer &ge)
Definition Iocatalyst_DatabaseIOTest.h:56
An input or output Database.
Definition Ioss_DatabaseIO.h:63
Definition Ioss_ParallelUtils.h:32
A collection of Ioss::Property objects.
Definition Ioss_PropertyManager.h:36
Definition Iocatalyst_BlockMesh.h:32
Definition Iocatalyst_BlockMesh.h:19