Skip to content

Commit

Permalink
Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 14, 2024
1 parent 6154e49 commit 27d3203
Show file tree
Hide file tree
Showing 28 changed files with 14,214 additions and 13,056 deletions.
15 changes: 8 additions & 7 deletions packages/seacas/applications/epu/epu.C
Original file line number Diff line number Diff line change
Expand Up @@ -1452,13 +1452,14 @@ int epu(SystemInterface &interFace, int start_part, int part_count, int cycle, T
}
for (int ig = 0; ig < global_vars.count(InOut::IN); ig++) {
if (proc_global_values[ig] != global_values[ig]) {
fmt::print(stderr,
fmt::runtime("At step {:{}}, Global Variable {:{}}, P{:0{}} = {:15.8g}, P{:0{}} = "
"{:15.8g}\n"),
time_step + 1, ts_max + 1, ig + 1,
get_width(global_vars.count(InOut::IN)), start_part,
get_width(interFace.processor_count()), start_part + p,
get_width(interFace.processor_count()), proc_global_values[ig]);
fmt::print(
stderr,
fmt::runtime(
"At step {:{}}, Global Variable {:{}}, P{:0{}} = {:15.8g}, P{:0{}} = "
"{:15.8g}\n"),
time_step + 1, ts_max + 1, ig + 1, get_width(global_vars.count(InOut::IN)),
start_part, get_width(interFace.processor_count()), start_part + p,
get_width(interFace.processor_count()), proc_global_values[ig]);
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions packages/seacas/applications/exodiff/edge_block.C
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ template <typename INT> void Edge_Block<INT>::entity_load_params()

if (num_edges_per_elmt < 0 || num_attr < 0) {
Error(fmt::format(
fmt::runtime("Edge_Block<INT>::entity_load_params(): Data appears corrupt for edge block {}!\n"
"\tnum elmts = {}\n"
"\tnum edges per elmt = {}\n"
"\tnum attributes = {}\n"
" ... Aborting...\n"),
fmt::group_digits(numEntity), num_edges_per_elmt, num_attr));
fmt::runtime(
"Edge_Block<INT>::entity_load_params(): Data appears corrupt for edge block {}!\n"
"\tnum elmts = {}\n"
"\tnum edges per elmt = {}\n"
"\tnum attributes = {}\n"
" ... Aborting...\n"),
fmt::group_digits(numEntity), num_edges_per_elmt, num_attr));
}
}

Expand Down
13 changes: 7 additions & 6 deletions packages/seacas/applications/exodiff/exo_block.C
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ template <typename INT> void Exo_Block<INT>::entity_load_params()
elmt_type = block.topology;

if (num_nodes_per_elmt < 0 || num_attr < 0) {
Error(fmt::format(fmt::runtime("Exo_Block<INT>::entity_load_params(): Data appears corrupt for block {}!\n"
"\tnum elmts = {}\n"
"\tnum nodes per elmt = {}\n"
"\tnum attributes = {}\n"
" ... Aborting...\n"),
fmt::group_digits(numEntity), num_nodes_per_elmt, num_attr));
Error(fmt::format(
fmt::runtime("Exo_Block<INT>::entity_load_params(): Data appears corrupt for block {}!\n"
"\tnum elmts = {}\n"
"\tnum nodes per elmt = {}\n"
"\tnum attributes = {}\n"
" ... Aborting...\n"),
fmt::group_digits(numEntity), num_nodes_per_elmt, num_attr));
}
}

Expand Down
11 changes: 6 additions & 5 deletions packages/seacas/applications/exodiff/face_block.C
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ template <typename INT> void Face_Block<INT>::entity_load_params()

if (num_faces_per_elmt < 0 || num_attr < 0) {
Error(fmt::format(
fmt::runtime("Face_Block<INT>::entity_load_params(): Data appears corrupt for face block {}!\n"
"\tnum elmts = {}\n"
"\tnum faces per elmt = {}\n"
"\tnum attributes = {}\n"
" ... Aborting...\n"),
fmt::runtime(
"Face_Block<INT>::entity_load_params(): Data appears corrupt for face block {}!\n"
"\tnum elmts = {}\n"
"\tnum faces per elmt = {}\n"
"\tnum attributes = {}\n"
" ... Aborting...\n"),
fmt::group_digits(numEntity), num_faces_per_elmt, num_attr));
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/applications/exomatlab/exomatlab.C
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace {
// ========================================================================

namespace {
std::string codename;
std::string codename;
} // namespace

int main(int argc, char *argv[])
Expand Down
5 changes: 3 additions & 2 deletions packages/seacas/libraries/ioss/src/Ioss_Utils.C
Original file line number Diff line number Diff line change
Expand Up @@ -940,9 +940,10 @@ void Ioss::Utils::calculate_sideblock_membership(IntVector &face_is_
}
}

int64_t Ioss::Utils::get_side_offset(const Ioss::ElementTopology * parent_topo, const Ioss::ElementTopology * side_topo)
int64_t Ioss::Utils::get_side_offset(const Ioss::ElementTopology *parent_topo,
const Ioss::ElementTopology *side_topo)
{
int64_t side_offset = 0;
int64_t side_offset = 0;
if ((side_topo != nullptr) && (parent_topo != nullptr)) {
int side_topo_dim = side_topo->parametric_dimension();
int elem_topo_dim = parent_topo->parametric_dimension();
Expand Down
3 changes: 2 additions & 1 deletion packages/seacas/libraries/ioss/src/Ioss_Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,8 @@ namespace Ioss {
* \param[in] sb Compute the offset for element sides in this SideBlock
* \returns The offset.
*/
IOSS_NODISCARD static int64_t get_side_offset(const Ioss::ElementTopology * parent_topo, const Ioss::ElementTopology * side_topo);
IOSS_NODISCARD static int64_t get_side_offset(const Ioss::ElementTopology *parent_topo,
const Ioss::ElementTopology *side_topo);

IOSS_NODISCARD static int64_t get_side_offset(const Ioss::SideBlock *sb);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,24 +291,24 @@ namespace Iocatalyst {
return (extents.i + offset) * (extents.j + offset) * (extents.k + offset);
}

std::map<std::string, double>* BlockMesh::getTransientCellFieldMap()
std::map<std::string, double> *BlockMesh::getTransientCellFieldMap()
{
return &(this->transientCellFields);
}

std::map<std::string, double>* BlockMesh::getTransientPointFieldMap()
std::map<std::string, double> *BlockMesh::getTransientPointFieldMap()
{
return &(this->transientPointFields);
}

void BlockMesh::addTransientCellField(std::string f_name, double f_value)
{
this->transientCellFields.insert({ f_name, f_value });
this->transientCellFields.insert({f_name, f_value});
}

void BlockMesh::addTransientPointField(std::string f_name, double f_value)
{
this->transientPointFields.insert({ f_name, f_value });
this->transientPointFields.insert({f_name, f_value});
}

} // namespace Iocatalyst
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ namespace Iocatalyst {
static Extent getCoordsForID(ID id, Extent bounds);
static ID getIDfromCoords(Extent coords, Extent bounds);

void addTransientCellField(std::string f_name, double f_value);
void addTransientPointField(std::string f_name, double f_value);
void addTransientCellField(std::string f_name, double f_value);
void addTransientPointField(std::string f_name, double f_value);

std::map<std::string, double>* getTransientCellFieldMap();
std::map<std::string, double>* getTransientPointFieldMap();
std::map<std::string, double> *getTransientCellFieldMap();
std::map<std::string, double> *getTransientPointFieldMap();

private:
Partition partition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <Ioss_NodeBlock.h>
#include <Ioss_StructuredBlock.h>
#include <Ioss_Utils.h>
#include <catalyst/Iocatalyst_DatabaseIO.h>
#include <catalyst/Iocatalyst_CatalystManager.h>
#include <catalyst/Iocatalyst_DatabaseIO.h>
#include <catalyst_tests/Iocatalyst_BlockMeshSet.h>
#include <unordered_set>

Expand Down Expand Up @@ -41,12 +41,12 @@ namespace Iocatalyst {
CatalystManager::getInstance().reset();
iop.isCatalyst = true;

//Cat Writes
// Cat Writes
writeIOSSFile(iop);
Ioss::PropertyManager cdbProps = Ioss::PropertyManager(iop.dbProps);
cdbProps.add(Ioss::Property("CATALYST_CONDUIT_NODE", iop.getCatalystConduitNode()));

//Cat Reads here
// Cat Reads here
Ioss::DatabaseIO *cdbi =
Ioss::IOFactory::create(CATALYST_DATABASE_TYPE, CATALYST_DUMMY_DATABASE, Ioss::READ_RESTART,
Ioss::ParallelUtils::comm_world(), cdbProps);
Expand All @@ -70,20 +70,20 @@ namespace Iocatalyst {
Ioss::copy_database(cir, cor, options);
}

Ioss::DatabaseIO* BlockMeshSet::getCatalystDatabase(IOSSparams &iop)
Ioss::DatabaseIO *BlockMeshSet::getCatalystDatabase(IOSSparams &iop)
{
CatalystManager::getInstance().reset();
iop.isCatalyst = true;
//Write to Cat database

// Write to Cat database
writeIOSSFile(iop);

Ioss::PropertyManager cdbProps = Ioss::PropertyManager(iop.dbProps);

//Get Conduit
// Get Conduit
cdbProps.add(Ioss::Property("CATALYST_CONDUIT_NODE", iop.getCatalystConduitNode()));

//Read to Cat Database
// Read to Cat Database
Ioss::DatabaseIO *cdbi =
Ioss::IOFactory::create(CATALYST_DATABASE_TYPE, CATALYST_DUMMY_DATABASE, Ioss::READ_RESTART,
Ioss::ParallelUtils::comm_world(), cdbProps);
Expand All @@ -107,7 +107,7 @@ namespace Iocatalyst {
void BlockMeshSet::openIOSSDatabase(IOSSparams &iop)
{
Ioss::PropertyManager properties = Ioss::PropertyManager(iop.dbProps);
std::string dbType = iop.dbType;
std::string dbType = iop.dbType;
if (iop.isCatalyst) {
dbType = CATALYST_DATABASE_TYPE;
}
Expand Down Expand Up @@ -258,7 +258,8 @@ namespace Iocatalyst {
void BlockMeshSet::writeStructuredTransientFieldDefinitions(IOSSparams &iop)
{
for (auto bm : bms) {
//Modify this to access field dict in "bm" and populate ioss block with those fields (as well).
// Modify this to access field dict in "bm" and populate ioss block with those fields (as
// well).
auto iossBlock = iop.region->get_structured_block(getStructuredBlockName(bm.getID()));
iossBlock->field_add(Ioss::Field(IOSS_CELL_FIELD, Ioss::Field::REAL, IOSS_SCALAR_STORAGE,
Ioss::Field::TRANSIENT));
Expand Down Expand Up @@ -359,7 +360,7 @@ namespace Iocatalyst {
auto nodeBlock = iop.region->get_node_block("nodeblock");
nodeBlock->field_add(Ioss::Field(IOSS_POINT_FIELD, Ioss::Field::REAL, IOSS_SCALAR_STORAGE,
Ioss::Field::TRANSIENT));

writeUnstructuredAddedTransientFields(bm, iop);
}
}
Expand All @@ -373,23 +374,21 @@ namespace Iocatalyst {
void BlockMeshSet::writeUnstructuredAddedCellTransientFields(BlockMesh bm, IOSSparams &iop)
{
auto cell_fields = bm.getTransientCellFieldMap();
auto elemBlock = iop.region->get_element_block(getUnstructuredBlockName(bm.getID()));
for (auto itr = cell_fields->begin(); itr != cell_fields->end(); ++itr)
{
elemBlock->field_add(Ioss::Field(itr->first, Ioss::Field::REAL, IOSS_SCALAR_STORAGE,
Ioss::Field::TRANSIENT));
}
auto elemBlock = iop.region->get_element_block(getUnstructuredBlockName(bm.getID()));
for (auto itr = cell_fields->begin(); itr != cell_fields->end(); ++itr) {
elemBlock->field_add(
Ioss::Field(itr->first, Ioss::Field::REAL, IOSS_SCALAR_STORAGE, Ioss::Field::TRANSIENT));
}
}

void BlockMeshSet::writeUnstructuredAddedPointTransientFields(BlockMesh bm, IOSSparams &iop)
{
auto point_fields = bm.getTransientPointFieldMap();
auto nodeBlock = iop.region->get_node_block("nodeblock");
for (auto itr = point_fields->begin(); itr != point_fields->end(); ++itr)
{
nodeBlock->field_add(Ioss::Field(itr->first, Ioss::Field::REAL, IOSS_SCALAR_STORAGE,
Ioss::Field::TRANSIENT));
}
auto nodeBlock = iop.region->get_node_block("nodeblock");
for (auto itr = point_fields->begin(); itr != point_fields->end(); ++itr) {
nodeBlock->field_add(
Ioss::Field(itr->first, Ioss::Field::REAL, IOSS_SCALAR_STORAGE, Ioss::Field::TRANSIENT));
}
}

void BlockMeshSet::writeUnstructuredTransientBulkData(IOSSparams &iop)
Expand Down Expand Up @@ -422,36 +421,36 @@ namespace Iocatalyst {
writeUnstructuredAddedPointTransientFieldsBulkData(bm, iop);
}

void BlockMeshSet::writeUnstructuredAddedCellTransientFieldsBulkData(BlockMesh bm, IOSSparams &iop)
void BlockMeshSet::writeUnstructuredAddedCellTransientFieldsBulkData(BlockMesh bm,
IOSSparams &iop)
{
auto cell_fields = bm.getTransientCellFieldMap();
auto elemBlock = iop.region->get_element_block(getUnstructuredBlockName(bm.getID()));
auto elemBlock = iop.region->get_element_block(getUnstructuredBlockName(bm.getID()));
std::vector<double> values;
for (auto itr = cell_fields->begin(); itr != cell_fields->end(); ++itr)
{
for (auto itr = cell_fields->begin(); itr != cell_fields->end(); ++itr) {
int num_elements = elemBlock->get_field(itr->first).raw_count();
for (int j = 0; j < num_elements; j++) {
values.push_back(itr->second + j*0.1);
values.push_back(itr->second + j * 0.1);
}
elemBlock->put_field_data(itr->first, values);
values.clear();
}
}
}

void BlockMeshSet::writeUnstructuredAddedPointTransientFieldsBulkData(BlockMesh bm, IOSSparams &iop)
void BlockMeshSet::writeUnstructuredAddedPointTransientFieldsBulkData(BlockMesh bm,
IOSSparams &iop)
{
auto point_fields = bm.getTransientPointFieldMap();
auto nodeBlock = iop.region->get_node_block("nodeblock");
auto point_fields = bm.getTransientPointFieldMap();
auto nodeBlock = iop.region->get_node_block("nodeblock");
std::vector<double> values;
for (auto itr = point_fields->begin(); itr != point_fields->end(); ++itr)
{
for (auto itr = point_fields->begin(); itr != point_fields->end(); ++itr) {
int num_nodes = nodeBlock->get_field(itr->first).raw_count();
for (int j = 0; j < num_nodes; j++) {
values.push_back(itr->second + j*0.1);
values.push_back(itr->second + j * 0.1);
}
nodeBlock->put_field_data(itr->first, values);
values.clear();
}
}
}

std::string BlockMeshSet::getStructuredBlockName(int index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ namespace Iocatalyst {
class IOSSparams
{
public:
IOSSparams(const std::string &fileName, const std::string &dbType, Ioss::PropertyManager dbProps = {})
: fileName(fileName), dbType(dbType), databaseIO(nullptr), isCatalyst(false), dbProps(dbProps)
IOSSparams(const std::string &fileName, const std::string &dbType,
Ioss::PropertyManager dbProps = {})
: fileName(fileName), dbType(dbType), databaseIO(nullptr), isCatalyst(false),
dbProps(dbProps)
{
}
bool isStructured() { return dbType == CGNS_DATABASE_TYPE; }
Expand All @@ -45,12 +47,12 @@ namespace Iocatalyst {
IOSSparams();
};

void addBlockMesh(const BlockMesh &blockMesh);
void writeIOSSFile(IOSSparams &iop);
void writeCatalystIOSSFile(IOSSparams &iop);
Ioss::DatabaseIO* getCatalystDatabase(IOSSparams &iop);
int getNumLocalPointsInMeshSet();
void addBlockMesh(const BlockMesh &blockMesh);
void writeIOSSFile(IOSSparams &iop);
void writeCatalystIOSSFile(IOSSparams &iop);
Ioss::DatabaseIO *getCatalystDatabase(IOSSparams &iop);

int getNumLocalPointsInMeshSet();

std::string getStructuredBlockName(int index);
std::string getStructuredNodeBlockName(int index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ TEST_F(Iocatalyst_DatabaseIOTest, AddTransientFieldToBlockMesh)

addBlockMesh(bmOne);

std::string exodusFileName =
"AddTransientFieldToBlockMesh" + CATALYST_TEST_FILE_NP + std::to_string(part.size) + EXODUS_FILE_EXTENSION;
std::string exodusFileName = "AddTransientFieldToBlockMesh" + CATALYST_TEST_FILE_NP +
std::to_string(part.size) + EXODUS_FILE_EXTENSION;
Iocatalyst::BlockMeshSet::IOSSparams iop(exodusFileName, EXODUS_DATABASE_TYPE);
bmSet.writeIOSSFile(iop);
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ TEST_F(Iocatalyst_DatabaseIOTest, CellIdsAndCellNodeIds)
EXPECT_EQ(cidBuff[0], 1);
EXPECT_EQ(cidBuff[cids.raw_count() - 1], 256);


auto cnids = sb->get_fieldref("cell_node_ids");
EXPECT_TRUE(cnids.get_type() == Ioss::Field::INTEGER);
std::vector<int32_t> cnidsBuff(cnids.raw_count());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ Iocatalyst_DatabaseIOTest::getCatalystDatabaseFromConduit(conduit_cpp::Node &
Ioss::DatabaseIO *Iocatalyst_DatabaseIOTest::getDatabaseOnReadFromFileName(
const std::string &fileName, const std::string &iossDatabaseType, Ioss::PropertyManager dbProps)
{
Ioss::PropertyManager dbaseProps = Ioss::PropertyManager(dbProps);
auto inputFileName = fileName;
Ioss::ParallelUtils pu;
int numRanks = pu.parallel_size();
int rank = pu.parallel_rank();
Ioss::PropertyManager dbaseProps = Ioss::PropertyManager(dbProps);
auto inputFileName = fileName;
Ioss::ParallelUtils pu;
int numRanks = pu.parallel_size();
int rank = pu.parallel_rank();
if (iossDatabaseType == EXODUS_DATABASE_TYPE && numRanks > 1) {
inputFileName += "." + std::to_string(numRanks) + "." + std::to_string(rank);
}
Expand Down
Loading

0 comments on commit 27d3203

Please sign in to comment.