33 #ifndef IOSS_IOCGNS_UTILS_H 34 #define IOSS_IOCGNS_UTILS_H 49 #define CGCHECK(funcall) \ 50 if ((funcall) != CG_OK) { \ 51 Iocgns::Utils::cgns_error(cgnsFilePtr, __FILE__, __func__, __LINE__, myProcessor); \ 54 #define CGCHECKNP(funcall) \ 55 if ((funcall) != CG_OK) { \ 56 Iocgns::Utils::cgns_error(cgnsFilePtr, __FILE__, __func__, __LINE__, -1); \ 60 #define CGCHECK2(funcall) \ 61 if ((funcall) != CG_OK) { \ 62 Iocgns::Utils::cgns_error(filePtr, __FILE__, __func__, __LINE__, m_decomposition.m_processor); \ 66 class StructuredZoneData;
79 static void cgns_error(
int cgnsid,
const char *file,
const char *
function,
int lineno,
86 template <
typename INT>
94 switch (parent_topo->
shape()) {
96 static int hex_map[] = {0, 5, 1, 2, 3, 4, 6};
97 for (
size_t i = 0; i < num_to_get; i++) {
98 idata[2 * i + 1] = hex_map[idata[2 * i + 1]];
103 static int tet_map[] = {0, 4, 1, 2, 3};
104 for (
size_t i = 0; i < num_to_get; i++) {
105 idata[2 * i + 1] = tet_map[idata[2 * i + 1]];
110 static int pyr_map[] = {0, 5, 1, 2, 3, 4};
111 for (
size_t i = 0; i < num_to_get; i++) {
112 idata[2 * i + 1] = pyr_map[idata[2 * i + 1]];
118 static int wed_map[] = {0, 1, 2, 3, 4, 5};
120 for (
size_t i=0; i < num_to_get; i++) {
121 idata[2*i+1] = wed_map[idata[2*i+1]];
130 std::vector<cgsize_t> &
data)
136 switch (parent_topo->
shape()) {
138 static int hex_map[] = {0, 2, 3, 4, 5, 1, 6};
139 for (
size_t i = 0; i < num_to_get; i++) {
140 data[num_to_get * 2 + i] = hex_map[
data[num_to_get * 2 + i]];
145 static int tet_map[] = {0, 2, 3, 4, 1};
146 for (
size_t i = 0; i < num_to_get; i++) {
147 data[num_to_get * 2 + i] = tet_map[
data[num_to_get * 2 + i]];
152 static int pyr_map[] = {0, 2, 3, 4, 5, 1};
153 for (
size_t i = 0; i < num_to_get; i++) {
154 data[num_to_get * 2 + i] = pyr_map[
data[num_to_get * 2 + i]];
160 static int wed_map[] = {0, 1, 2, 3, 4, 5};
162 for (
size_t i=0; i < num_to_get; i++) {
163 data[num_to_get * 2 + i] = wed_map[
data[num_to_get * 2 + i]];
172 int *vertex_solution_index,
173 int *cell_center_solution_index,
bool is_parallel_io);
175 CG_GridLocation_t location);
178 std::vector<size_t> &zone_offset,
bool is_parallel);
180 static std::vector<std::vector<std::pair<size_t, size_t>>>
187 bool is_parallel_io);
193 static void finalize_database(
int cgnsFilePtr,
const std::vector<double> ×teps,
194 Ioss::Region *region,
int myProcessor,
bool is_parallel_io);
196 double timeScaleFactor,
int myProcessor);
199 char suffix_separator,
int myProcessor,
200 bool is_parallel_io);
202 static size_t pre_split(std::vector<Iocgns::StructuredZoneData *> &zones,
double avg_work,
203 double load_balance,
int proc_rank,
int proc_count);
205 std::vector<size_t> & work_vector);
static void map_ioss_face_to_cgns(const Ioss::ElementTopology *parent_topo, size_t num_to_get, std::vector< cgsize_t > &data)
Definition: Iocgns_Utils.h:129
Represents an element topology.
Definition: Ioss_ElementTopology.h:72
static void add_transient_variables(int cgnsFilePtr, const std::vector< double > ×teps, Ioss::Region *region, bool enable_field_recognition, char suffix_separator, int myProcessor, bool is_parallel_io)
Definition: Iocgns_Utils.C:1723
static CG_ElementType_t map_topology_to_cgns(const std::string &name)
Definition: Iocgns_Utils.C:1019
An input or output Database.
Definition: Ioss_DatabaseIO.h:80
static std::vector< std::vector< std::pair< size_t, size_t > > > resolve_processor_shared_nodes(Ioss::Region ®ion, int my_processor)
Definition: Iocgns_Utils.C:1371
static size_t resolve_nodes(Ioss::Region ®ion, int my_processor, bool is_parallel)
Definition: Iocgns_Utils.C:1254
static int get_db_zone(const Ioss::EntityBlock *block)
Definition: Iocgns_Utils.C:448
A namespace for the CGNS database format.
Definition: Iocgns_DatabaseIO.C:392
static int get_step_times(int cgnsFilePtr, std::vector< double > ×teps, Ioss::Region *region, double timeScaleFactor, int myProcessor)
Definition: Iocgns_Utils.C:1814
static void cgns_error(int cgnsid, const char *file, const char *function, int lineno, int processor)
Definition: Iocgns_Utils.C:398
static void add_structured_boundary_conditions_pio(int cgnsFilePtr, Ioss::StructuredBlock *block)
Definition: Iocgns_Utils.C:1449
static bool is_cell_field(const Ioss::Field &field)
Definition: Iocgns_Utils.C:473
static void add_structured_boundary_conditions_fpp(int cgnsFilePtr, Ioss::StructuredBlock *block)
Definition: Iocgns_Utils.C:1573
static void finalize_database(int cgnsFilePtr, const std::vector< double > ×teps, Ioss::Region *region, int myProcessor, bool is_parallel_io)
Definition: Iocgns_Utils.C:1643
static size_t index(const Ioss::Field &field)
Definition: Iocgns_Utils.C:459
A structured zone – i,j,k.
Definition: Ioss_StructuredBlock.h:103
static const size_t CG_CELL_CENTER_FIELD_ID
Definition: Iocgns_Utils.h:74
Base class for all 'block'-type grouping entities, which means all members of the block are similar o...
Definition: Ioss_EntityBlock.h:61
static std::string map_cgns_to_topology_type(CG_ElementType_t type)
Definition: Iocgns_Utils.C:988
static size_t common_write_meta_data(int file_ptr, const Ioss::Region ®ion, std::vector< size_t > &zone_offset, bool is_parallel)
Definition: Iocgns_Utils.C:729
virtual ElementShape shape() const =0
static void add_structured_boundary_conditions(int cgnsFilePtr, Ioss::StructuredBlock *block, bool is_parallel_io)
Definition: Iocgns_Utils.C:1435
static void map_cgns_face_to_ioss(const Ioss::ElementTopology *parent_topo, size_t num_to_get, INT *idata)
Definition: Iocgns_Utils.h:87
static void assign_zones_to_procs(std::vector< Iocgns::StructuredZoneData *> &zones, std::vector< size_t > &work_vector)
Definition: Iocgns_Utils.C:1845
static void write_flow_solution_metadata(int file_ptr, Ioss::Region *region, int state, int *vertex_solution_index, int *cell_center_solution_index, bool is_parallel_io)
Definition: Iocgns_Utils.C:1086
int INT
Definition: Ioss_StructuredBlock.h:53
std::vector< char > data
Definition: cth_pressure_map.C:73
A grouping entity that contains other grouping entities.
Definition: Ioss_Region.h:98
std::string name(Ioss::GroupingEntity *entity)
Definition: io_info.C:88
static void set_field_index(const Ioss::Field &field, size_t index, CG_GridLocation_t location)
Definition: Iocgns_Utils.C:461
static const size_t CG_VERTEX_FIELD_ID
Definition: Iocgns_Utils.h:75
Holds metadata for bulk data associated with a GroupingEntity.
Definition: Ioss_Field.h:47
static size_t pre_split(std::vector< Iocgns::StructuredZoneData *> &zones, double avg_work, double load_balance, int proc_rank, int proc_count)
Definition: Iocgns_Utils.C:1904
static void add_sidesets(int cgnsFilePtr, Ioss::DatabaseIO *db)
Definition: Iocgns_Utils.C:1191
static int find_solution_index(int cgnsFilePtr, int base, int zone, int step, CG_GridLocation_t location)
Definition: Iocgns_Utils.C:1136
static CG_ZoneType_t check_zone_type(int cgnsFilePtr)
Definition: Iocgns_Utils.C:420
Definition: Iocgns_Utils.h:68