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,
85 template <
typename INT>
93 switch (parent_topo->
shape()) {
95 static int hex_map[] = {0, 5, 1, 2, 3, 4, 6};
96 for (
size_t i = 0; i < num_to_get; i++) {
97 idata[2 * i + 1] = hex_map[idata[2 * i + 1]];
102 static int tet_map[] = {0, 4, 1, 2, 3};
103 for (
size_t i = 0; i < num_to_get; i++) {
104 idata[2 * i + 1] = tet_map[idata[2 * i + 1]];
109 static int pyr_map[] = {0, 5, 1, 2, 3, 4};
110 for (
size_t i = 0; i < num_to_get; i++) {
111 idata[2 * i + 1] = pyr_map[idata[2 * i + 1]];
117 static int wed_map[] = {0, 1, 2, 3, 4, 5};
119 for (
size_t i=0; i < num_to_get; i++) {
120 idata[2*i+1] = wed_map[idata[2*i+1]];
129 std::vector<cgsize_t> &
data)
135 switch (parent_topo->
shape()) {
137 static int hex_map[] = {0, 2, 3, 4, 5, 1, 6};
138 for (
size_t i = 0; i < num_to_get; i++) {
139 data[num_to_get * 2 + i] = hex_map[data[num_to_get * 2 + i]];
144 static int tet_map[] = {0, 2, 3, 4, 1};
145 for (
size_t i = 0; i < num_to_get; i++) {
146 data[num_to_get * 2 + i] = tet_map[data[num_to_get * 2 + i]];
151 static int pyr_map[] = {0, 2, 3, 4, 5, 1};
152 for (
size_t i = 0; i < num_to_get; i++) {
153 data[num_to_get * 2 + i] = pyr_map[data[num_to_get * 2 + i]];
159 static int wed_map[] = {0, 1, 2, 3, 4, 5};
161 for (
size_t i=0; i < num_to_get; i++) {
162 data[num_to_get * 2 + i] = wed_map[data[num_to_get * 2 + i]];
171 int *vertex_solution_index,
172 int *cell_center_solution_index);
174 CG_GridLocation_t location);
177 std::vector<size_t> &zone_offset,
bool is_parallel);
179 static std::vector<std::vector<std::pair<size_t, size_t>>>
186 static void finalize_database(
int cgnsFilePtr,
const std::vector<double> ×teps,
189 double timeScaleFactor,
int myProcessor);
192 char suffix_separator,
int myProcessor);
194 static size_t pre_split(std::vector<Iocgns::StructuredZoneData *> &zones,
double avg_work,
195 double load_balance,
int proc_rank,
int proc_count);
197 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:128
Represents an element topology.
Definition: Ioss_ElementTopology.h:72
static CG_ElementType_t map_topology_to_cgns(const std::string &name)
Definition: Iocgns_Utils.C:793
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:1137
static size_t resolve_nodes(Ioss::Region ®ion, int my_processor, bool is_parallel)
Definition: Iocgns_Utils.C:1020
A namespace for the CGNS database format.
Definition: Iocgns_DatabaseIO.C:89
static int get_step_times(int cgnsFilePtr, std::vector< double > ×teps, Ioss::Region *region, double timeScaleFactor, int myProcessor)
Definition: Iocgns_Utils.C:1476
static void cgns_error(int cgnsid, const char *file, const char *function, int lineno, int processor)
Definition: Iocgns_Utils.C:203
static bool is_cell_field(const Ioss::Field &field)
Definition: Iocgns_Utils.C:267
static void add_structured_boundary_conditions(int cgnsFilePtr, Ioss::StructuredBlock *block)
Definition: Iocgns_Utils.C:1201
static size_t index(const Ioss::Field &field)
Definition: Iocgns_Utils.C:253
A structured zone – i,j,k.
Definition: Ioss_StructuredBlock.h:98
static const size_t CG_CELL_CENTER_FIELD_ID
Definition: Iocgns_Utils.h:74
static std::string map_cgns_to_topology_type(CG_ElementType_t type)
Definition: Iocgns_Utils.C:762
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:533
virtual ElementShape shape() const =0
static void map_cgns_face_to_ioss(const Ioss::ElementTopology *parent_topo, size_t num_to_get, INT *idata)
Definition: Iocgns_Utils.h:86
static void assign_zones_to_procs(std::vector< Iocgns::StructuredZoneData *> &zones, std::vector< size_t > &work_vector)
Definition: Iocgns_Utils.C:1507
int INT
Definition: Ioss_StructuredBlock.h:53
A grouping entity that contains other grouping entities.
Definition: Ioss_Region.h:98
std::string name(Ioss::GroupingEntity *entity)
Definition: io_info.C:71
static void set_field_index(const Ioss::Field &field, size_t index, CG_GridLocation_t location)
Definition: Iocgns_Utils.C:255
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 void add_transient_variables(int cgnsFilePtr, const std::vector< double > ×teps, Ioss::Region *region, bool enable_field_recognition, char suffix_separator, int myProcessor)
Definition: Iocgns_Utils.C:1392
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:1583
static void add_sidesets(int cgnsFilePtr, Ioss::DatabaseIO *db)
Definition: Iocgns_Utils.C:961
static int find_solution_index(int cgnsFilePtr, int base, int zone, int step, CG_GridLocation_t location)
Definition: Iocgns_Utils.C:907
std::vector< char > data
Definition: Ioss_Utils.C:78
static void finalize_database(int cgnsFilePtr, const std::vector< double > ×teps, Ioss::Region *region, int myProcessor)
Definition: Iocgns_Utils.C:1314
static CG_ZoneType_t check_zone_type(int cgnsFilePtr)
Definition: Iocgns_Utils.C:225
static void write_flow_solution_metadata(int file_ptr, Ioss::Region *region, int state, int *vertex_solution_index, int *cell_center_solution_index)
Definition: Iocgns_Utils.C:860
Definition: Iocgns_Utils.h:68