Skip to content

Commit

Permalink
IOSS: Remove use of fmt in installed ioss headers
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Aug 28, 2024
1 parent d43b819 commit 98ef6fd
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 46 deletions.
1 change: 1 addition & 0 deletions packages/seacas/applications/cpup/cpup.C
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <Ioss_SmartAssert.h>
#include <Ioss_SubSystem.h>
#include <Ioss_Utils.h>
#include <Ioss_use_fmt.h>

#include <cgns/Iocgns_Utils.h>

Expand Down
9 changes: 0 additions & 9 deletions packages/seacas/libraries/ioss/src/Ioss_Field.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "Ioss_CodeTypes.h"
#include <cstddef> // for size_t
#include <fmt/ostream.h>
#include <stdint.h>
#include <string> // for string
#include <vector> // for vector
Expand Down Expand Up @@ -245,11 +244,3 @@ namespace Ioss {
};
IOSS_EXPORT std::ostream &operator<<(std::ostream &os, const Field &fld);
} // namespace Ioss

#if FMT_VERSION >= 90000
namespace fmt {
template <> struct formatter<Ioss::Field> : ostream_formatter
{
};
} // namespace fmt
#endif
18 changes: 8 additions & 10 deletions packages/seacas/libraries/ioss/src/Ioss_Region.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "Ioss_Utils.h"
#include "Ioss_VariableType.h"
#include "ioss_export.h"
#include <fmt/ostream.h>
#include <functional> // for less
#include <iosfwd> // for ostream
#include <map> // for map, map<>::value_compare
Expand Down Expand Up @@ -288,8 +287,8 @@ namespace Ioss {
return topologyObserver;
}

void reset_topology_modification();
void set_topology_modification(unsigned int type);
void reset_topology_modification();
void set_topology_modification(unsigned int type);
unsigned int get_topology_modification() const;

void start_new_output_database_entry(int steps = 0);
Expand Down Expand Up @@ -379,7 +378,6 @@ namespace Ioss {
bool modelWritten{false};
bool transientWritten{false};
bool fileGroupsStarted{false};

};
} // namespace Ioss

Expand Down Expand Up @@ -482,12 +480,12 @@ namespace Ioss {

if (found && field.get_role() != role) {
std::ostringstream errmsg;
fmt::print(errmsg,
"ERROR: Field {} with role {} on entity {} does not match previously found "
"role {}.\n",
field.get_name(), field.role_string(), entity->name(),
Ioss::Field::role_string(role));
IOSS_ERROR(errmsg);
// Would be nice to use fmt:: here, but we need to avoid using fmt includes in public
// headers...
errmsg << "ERROR: Field " << field.get_name() << " with role " << field.role_string()
<< " on entity " << entity->name() << " does not match previously found role "
<< Ioss::Field::role_string(role) << ".\n";
IOSS_ERROR(errmsg);
}

found = true;
Expand Down
9 changes: 0 additions & 9 deletions packages/seacas/libraries/ioss/src/Ioss_StructuredBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "Ioss_NodeBlock.h"
#include "Ioss_Property.h"
#include "Ioss_ZoneConnectivity.h"
#include <fmt/ostream.h>
#include <array>
#include <cassert>
#include <iosfwd>
Expand Down Expand Up @@ -349,11 +348,3 @@ namespace Ioss {
}
};
} // namespace Ioss

#if FMT_VERSION >= 90000
namespace fmt {
template <> struct formatter<Ioss::BoundaryCondition> : ostream_formatter
{
};
} // namespace fmt
#endif
1 change: 1 addition & 0 deletions packages/seacas/libraries/ioss/src/Ioss_Utils.C
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "Ioss_State.h"
#include "Ioss_Utils.h"
#include "Ioss_VariableType.h"
#include "Ioss_use_fmt.h"

#if defined(__IOSS_WINDOWS__)
#include <io.h>
Expand Down
10 changes: 0 additions & 10 deletions packages/seacas/libraries/ioss/src/Ioss_ZoneConnectivity.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include <array>
#include <cassert>
#include <cmath>
#include <fmt/core.h>
#include <fmt/ostream.h>
#include <iosfwd>
#include <stdlib.h>
#include <string>
Expand Down Expand Up @@ -142,11 +140,3 @@ namespace Ioss {

IOSS_EXPORT std::ostream &operator<<(std::ostream &os, const ZoneConnectivity &zgc);
} // namespace Ioss

#if FMT_VERSION >= 90000
namespace fmt {
template <> struct formatter<Ioss::ZoneConnectivity> : ostream_formatter
{
};
} // namespace fmt
#endif
1 change: 1 addition & 0 deletions packages/seacas/libraries/ioss/src/main/io_info.C
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "Ioss_SurfaceSplit.h"
#include "Ioss_Utils.h"
#include "Ioss_VariableType.h"
#include "Ioss_use_fmt.h"
#if defined(SEACAS_HAVE_EXODUS)
#include "exodusII.h"
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions
// Copyright(C) 1999-2020, 2022, 2024 National Technology & Engineering Solutions
// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
// NTESS, the U.S. Government retains certain rights in this software.
//
Expand All @@ -20,7 +20,6 @@
#include <vector> // for vector

#include <assert.h>
#include <fmt/ostream.h>

#include "Ioss_ElementPermutation.h"
#include "Ioss_ElementTopology.h"
Expand Down Expand Up @@ -904,15 +903,14 @@ namespace Iotm {
for (int side = 1; side <= numSides; side++) {
if (topology->boundary_type(side) != sideTopologies_[side - 1]->topology) {
std::ostringstream errmsg;
fmt::print(errmsg,
"ERROR: For element topology: {} on side: {}, expected topology: {} does not "
"match topology: {}",
topology->name(), side, topology->boundary_type(side)->name(),
sideTopologies_[side - 1]->topology->name());
// Would be nice to use fmt:: here, but we need to avoid using fmt includes in public
// headers...
errmsg << "ERROR: For element topology: " << topology->name() << " on side: " << side
<< ", expected topology: " << topology->boundary_type(side)->name()
<< " does not match topology: " << sideTopologies_[side - 1]->topology->name();
IOSS_ERROR(errmsg);
}
}

sideTopologies = sideTopologies_;
}

Expand Down

0 comments on commit 98ef6fd

Please sign in to comment.