Go to the documentation of this file.
33 #ifndef IOSS_IOCGNS_UTILS_H
34 #define IOSS_IOCGNS_UTILS_H
50 #define CGCHECK(funcall) \
51 if ((funcall) != CG_OK) { \
52 Iocgns::Utils::cgns_error(cgns_file_ptr, __FILE__, __func__, __LINE__, myProcessor); \
56 #define CGCHECKM(funcall) \
57 if ((funcall) != CG_OK) { \
58 Iocgns::Utils::cgns_error(m_cgnsFilePtr, __FILE__, __func__, __LINE__, myProcessor); \
61 #define CGCHECKNP(funcall) \
62 if ((funcall) != CG_OK) { \
63 Iocgns::Utils::cgns_error(cgns_file_ptr, __FILE__, __func__, __LINE__, -1); \
67 #define CGCHECK2(funcall) \
68 if ((funcall) != CG_OK) { \
69 Iocgns::Utils::cgns_error(filePtr, __FILE__, __func__, __LINE__, m_decomposition.m_processor); \
73 class StructuredZoneData;
86 static void cgns_error(
int cgnsid,
const char *file,
const char *
function,
int lineno,
90 int myProcessor,
bool is_parallel,
bool is_parallel_io);
95 template <
typename INT>
103 switch (parent_topo->
shape()) {
105 static int hex_map[] = {0, 5, 1, 2, 3, 4, 6};
106 for (
size_t i = 0; i < num_to_get; i++) {
107 idata[2 * i + 1] = hex_map[idata[2 * i + 1]];
112 static int tet_map[] = {0, 4, 1, 2, 3};
113 for (
size_t i = 0; i < num_to_get; i++) {
114 idata[2 * i + 1] = tet_map[idata[2 * i + 1]];
119 static int pyr_map[] = {0, 5, 1, 2, 3, 4};
120 for (
size_t i = 0; i < num_to_get; i++) {
121 idata[2 * i + 1] = pyr_map[idata[2 * i + 1]];
127 static int wed_map[] = {0, 1, 2, 3, 4, 5};
129 for (
size_t i=0; i < num_to_get; i++) {
130 idata[2*i+1] = wed_map[idata[2*i+1]];
139 std::vector<cgsize_t> &
data)
145 switch (parent_topo->
shape()) {
147 static int hex_map[] = {0, 2, 3, 4, 5, 1, 6};
148 for (
size_t i = 0; i < num_to_get; i++) {
149 data[num_to_get * 2 + i] = hex_map[
data[num_to_get * 2 + i]];
154 static int tet_map[] = {0, 2, 3, 4, 1};
155 for (
size_t i = 0; i < num_to_get; i++) {
156 data[num_to_get * 2 + i] = tet_map[
data[num_to_get * 2 + i]];
161 static int pyr_map[] = {0, 2, 3, 4, 5, 1};
162 for (
size_t i = 0; i < num_to_get; i++) {
163 data[num_to_get * 2 + i] = pyr_map[
data[num_to_get * 2 + i]];
169 static int wed_map[] = {0, 1, 2, 3, 4, 5};
171 for (
size_t i=0; i < num_to_get; i++) {
172 data[num_to_get * 2 + i] = wed_map[
data[num_to_get * 2 + i]];
181 int *vertex_solution_index,
182 int *cell_center_solution_index,
bool is_parallel_io);
184 CG_GridLocation_t location);
187 std::vector<size_t> &zone_offset,
bool is_parallel);
189 static std::vector<std::vector<std::pair<size_t, size_t>>>
196 bool is_parallel_io);
202 static void finalize_database(
int cgns_file_ptr,
const std::vector<double> ×teps,
203 Ioss::Region *region,
int myProcessor,
bool is_parallel_io);
204 static int get_step_times(
int cgns_file_ptr, std::vector<double> ×teps,
205 Ioss::Region *region,
double timeScaleFactor,
int myProcessor);
208 char suffix_separator,
int myProcessor,
209 bool is_parallel_io);
212 std::vector<Iocgns::StructuredZoneData *> &zones,
int rank,
214 static void decompose_model(std::vector<Iocgns::StructuredZoneData *> &zones,
int proc_count,
215 int rank,
double load_balance_threshold,
bool verbose);
216 static size_t pre_split(std::vector<Iocgns::StructuredZoneData *> &zones,
double avg_work,
217 double load_balance,
int proc_rank,
int proc_count,
bool verbose);
219 std::vector<size_t> &work_vector,
bool verbose);
static int get_db_zone(const Ioss::GroupingEntity *entity)
Definition: Iocgns_Utils.C:512
static void finalize_database(int cgns_file_ptr, const std::vector< double > ×teps, Ioss::Region *region, int myProcessor, bool is_parallel_io)
Definition: Iocgns_Utils.C:1767
MeshType
The mesh type – structured, unstructured, hybrid (future), or unknown.
Definition: Ioss_MeshType.h:39
static void update_db_zone_property(int cgns_file_ptr, const Ioss::Region *region, int myProcessor, bool is_parallel, bool is_parallel_io)
Definition: Iocgns_Utils.C:450
static void show_config()
Definition: Iocgns_Utils.C:2511
static Ioss::MeshType check_mesh_type(int cgns_file_ptr)
Definition: Iocgns_Utils.C:409
Holds metadata for bulk data associated with a GroupingEntity.
Definition: Ioss_Field.h:47
static void decompose_model(std::vector< Iocgns::StructuredZoneData * > &zones, int proc_count, int rank, double load_balance_threshold, bool verbose)
Definition: Iocgns_Utils.C:2102
static void assign_zones_to_procs(std::vector< Iocgns::StructuredZoneData * > &zones, std::vector< size_t > &work_vector, bool verbose)
Definition: Iocgns_Utils.C:2230
static bool is_cell_field(const Ioss::Field &field)
Definition: Iocgns_Utils.C:544
static void add_structured_boundary_conditions_fpp(int cgns_file_ptr, Ioss::StructuredBlock *block)
Definition: Iocgns_Utils.C:1696
static void set_line_decomposition(int cgns_file_ptr, const std::string &line_decomposition, std::vector< Iocgns::StructuredZoneData * > &zones, int rank, bool verbose)
Definition: Iocgns_Utils.C:1980
A grouping entity that contains other grouping entities.
Definition: Ioss_Region.h:98
static size_t resolve_nodes(Ioss::Region ®ion, int my_processor, bool is_parallel)
Definition: Iocgns_Utils.C:1436
A structured zone – i,j,k.
Definition: Ioss_StructuredBlock.h:103
int INT
Definition: Ioss_StructuredBlock.h:53
static const size_t CG_VERTEX_FIELD_ID
Definition: Iocgns_Utils.h:82
int rank
Definition: Iocgns_DecompositionData.C:55
Definition: Iocgns_Utils.h:75
static int get_step_times(int cgns_file_ptr, std::vector< double > ×teps, Ioss::Region *region, double timeScaleFactor, int myProcessor)
Definition: Iocgns_Utils.C:1949
An input or output Database.
Definition: Ioss_DatabaseIO.h:82
static void set_field_index(const Ioss::Field &field, size_t index, CG_GridLocation_t location)
Definition: Iocgns_Utils.C:532
static void add_structured_boundary_conditions(int cgns_file_ptr, Ioss::StructuredBlock *block, bool is_parallel_io)
Definition: Iocgns_Utils.C:1617
static std::string map_cgns_to_topology_type(CG_ElementType_t type)
Definition: Iocgns_Utils.C:1155
static CG_ElementType_t map_topology_to_cgns(const std::string &name)
Definition: Iocgns_Utils.C:1186
static void add_transient_variables(int cgns_file_ptr, 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:1858
virtual ElementShape shape() const =0
Represents an element topology.
Definition: Ioss_ElementTopology.h:72
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:1259
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:826
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:1553
static const size_t CG_CELL_CENTER_FIELD_ID
Definition: Iocgns_Utils.h:81
std::vector< char > data
Definition: cth_pressure_map.C:74
static void cgns_error(int cgnsid, const char *file, const char *function, int lineno, int processor)
Definition: Iocgns_Utils.C:387
static size_t index(const Ioss::Field &field)
Definition: Iocgns_Utils.C:530
static void map_cgns_face_to_ioss(const Ioss::ElementTopology *parent_topo, size_t num_to_get, INT *idata)
Definition: Iocgns_Utils.h:96
std::string name(const Ioss::GroupingEntity *entity)
Definition: io_info.C:89
static size_t pre_split(std::vector< Iocgns::StructuredZoneData * > &zones, double avg_work, double load_balance, int proc_rank, int proc_count, bool verbose)
Definition: Iocgns_Utils.C:2302
A namespace for the CGNS database format.
Definition: Iocgns_DatabaseIO.C:444
static void add_sidesets(int cgns_file_ptr, Ioss::DatabaseIO *db)
Definition: Iocgns_Utils.C:1371
static int find_solution_index(int cgns_file_ptr, int base, int zone, int step, CG_GridLocation_t location)
Definition: Iocgns_Utils.C:1309
Base class for all 'grouping' entities. The following derived classes are typical:
Definition: Ioss_GroupingEntity.h:93
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:138
static void add_structured_boundary_conditions_pio(int cgns_file_ptr, Ioss::StructuredBlock *block)
Definition: Iocgns_Utils.C:1631