IOSS 2.0
Loading...
Searching...
No Matches
Iocatalyst_BlockMeshSet.h
Go to the documentation of this file.
1// Copyright(C) 1999-2020 National Technology & Engineering Solutions
2// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3// NTESS, the U.S. Government retains certain rights in this software.
4//
5// See packages/seacas/LICENSE for details
6
7#pragma once
8
9#include "iocatalyst_export.h"
10
11#include <Ioss_Region.h>
12#include <catalyst.hpp>
14#include <cstddef>
15#include <vector>
16
17namespace Iocatalyst {
18
19 class IOCATALYST_EXPORT BlockMeshSet
20 {
21
22 public:
23 inline static const std::string CATALYST_DATABASE_TYPE = "catalyst";
24 inline static const std::string CATALYST_DUMMY_DATABASE = "dummy.db";
25
27 {
28 public:
29 IOSSparams(const std::string &fileName, const std::string &dbType,
30 Ioss::PropertyManager dbProps = {})
31 : fileName(fileName), dbType(dbType), databaseIO(nullptr), isCatalyst(false),
32 dbProps(dbProps)
33 {
34 }
35 bool isStructured() { return dbType == CGNS_DATABASE_TYPE; }
36 void printCatalystConduitNode() { conduitNode.print_detailed(); }
37 void *getCatalystConduitNode() { return conduit_cpp::c_node(&conduitNode); }
38 std::string fileName;
39 std::string dbType;
42 std::unique_ptr<Ioss::Region> region;
43 conduit_cpp::Node conduitNode;
45
46 private:
48 };
49
50 void addBlockMesh(const BlockMesh &blockMesh);
51 void writeIOSSFile(IOSSparams &iop);
52 void writeCatalystIOSSFile(IOSSparams &iop);
53 Ioss::DatabaseIO *getCatalystDatabase(IOSSparams &iop);
54
55 int getNumLocalPointsInMeshSet();
56
57 std::string getStructuredBlockName(int index);
58 std::string getStructuredNodeBlockName(int index);
59
60 std::string getUnstructuredBlockName(int index);
61
62 private:
63 std::vector<BlockMesh> bms;
64
65 void openIOSSDatabase(IOSSparams &iop);
66 void closeIOSSDatabase(IOSSparams &iop);
67
68 void switchStateDefineModel(IOSSparams &iop);
69 void switchStateModel(IOSSparams &iop);
70 void switchStateDefineTransient(IOSSparams &iop);
71 void switchStateTransient(IOSSparams &iop);
72
73 void writeStructuredBlockDefinitions(IOSSparams &iop);
74 void writeStructuredBlockBulkData(IOSSparams &iop);
75 void writeStructuredTransientFieldDefinitions(IOSSparams &iop);
76 void writeStructuredTransientBulkData(IOSSparams &iop);
77
78 void writeUnstructuredBlockDefinitions(IOSSparams &iop);
79 void writeUnstructuredBlockBulkData(IOSSparams &iop);
80 void writeUnstructuredTransientFieldDefinitions(IOSSparams &iop);
81 void writeUnstructuredAddedTransientFields(BlockMesh bm, IOSSparams &iop);
82 void writeUnstructuredAddedCellTransientFields(BlockMesh bm, IOSSparams &iop);
83 void writeUnstructuredAddedPointTransientFields(BlockMesh bm, IOSSparams &iop);
84 void writeUnstructuredTransientBulkData(IOSSparams &iop);
85 void writeUnstructuredAddedTransientFieldsBulkData(BlockMesh bm, IOSSparams &iop);
86 void writeUnstructuredAddedCellTransientFieldsBulkData(BlockMesh bm, IOSSparams &iop);
87 void writeUnstructuredAddedPointTransientFieldsBulkData(BlockMesh bm, IOSSparams &iop);
88
89 void saveConduitNode(IOSSparams &iop);
90
91 inline static const std::string CGNS_DATABASE_TYPE = "cgns";
92 inline static const std::string EXODUS_DATABASE_TYPE = "exodus";
93 inline static const std::string IOSS_CELL_FIELD = "cell";
94 inline static const std::string IOSS_POINT_FIELD = "point";
95 inline static const std::string IOSS_GLOBAL_FIELD = "global";
96 inline static const std::string IOSS_SCALAR_STORAGE = "scalar";
97 };
98
99} // namespace Iocatalyst
Definition Iocatalyst_BlockMeshSet.h:27
bool isStructured()
Definition Iocatalyst_BlockMeshSet.h:35
std::string dbType
Definition Iocatalyst_BlockMeshSet.h:39
Ioss::DatabaseIO * databaseIO
Definition Iocatalyst_BlockMeshSet.h:40
std::string fileName
Definition Iocatalyst_BlockMeshSet.h:38
conduit_cpp::Node conduitNode
Definition Iocatalyst_BlockMeshSet.h:43
Ioss::PropertyManager dbProps
Definition Iocatalyst_BlockMeshSet.h:44
void * getCatalystConduitNode()
Definition Iocatalyst_BlockMeshSet.h:37
IOSSparams(const std::string &fileName, const std::string &dbType, Ioss::PropertyManager dbProps={})
Definition Iocatalyst_BlockMeshSet.h:29
std::unique_ptr< Ioss::Region > region
Definition Iocatalyst_BlockMeshSet.h:42
bool isCatalyst
Definition Iocatalyst_BlockMeshSet.h:41
void printCatalystConduitNode()
Definition Iocatalyst_BlockMeshSet.h:36
Definition Iocatalyst_BlockMeshSet.h:20
std::vector< BlockMesh > bms
Definition Iocatalyst_BlockMeshSet.h:63
Definition Iocatalyst_BlockMesh.h:16
An input or output Database.
Definition Ioss_DatabaseIO.h:63
A collection of Ioss::Property objects.
Definition Ioss_PropertyManager.h:36
A namespace for the Catalyst 2.0 database format.
Definition Iocatalyst_CatalystLogging.C:13