Skip to content

Commit

Permalink
remove is empty check due to it not being needed
Browse files Browse the repository at this point in the history
  • Loading branch information
white238 committed Nov 4, 2024
1 parent 13ffa03 commit 784bc0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 35 deletions.
29 changes: 0 additions & 29 deletions src/serac/numerics/functional/quadrature_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,35 +42,6 @@ struct Nothing {};
*/
struct Empty {};

/**
* @brief Checks at compile time if the StateType is of type Empty
*
* @tparam StateType Type to be checked if is of type Empty
*
* @return true if StateType is of type Empty
*/
template <typename StateType>
bool isEmptyType()
{
if (std::is_same_v<typename StateType::State, Empty>) {
return true;
}
return false;
}

/**
* @brief Checks the passed in variable is of type Empty
*
* @tparam StateType Type to be checked if is of type Empty
*
* @return true if StateType is of type Empty
*/
template <typename StateType>
bool isEmptyType(const StateType&)
{
return isEmptyType<std::decay_t<StateType>>();
}

template <typename T>
struct QuadratureData;

Expand Down
10 changes: 4 additions & 6 deletions src/serac/physics/state/state_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,10 @@ class StateManager {
for (std::size_t i = 0; i < detail::qdata_geometries.size(); ++i) {
auto geom = detail::qdata_geometries[i];
auto geom_data = qdata[geom];
if (!isEmptyType(geom_data)) {
auto geom_name = detail::qdata_geometry_names[i];
axom::sidre::View* geom_view = qdata_group->createView(std::string(geom_name));
axom::sidre::IndexType shape[2] = {geom_data.size(), sizeof(geom_data[0])};
geom_view->setExternalDataPtr(axom::sidre::CHAR8_STR_ID, 2, shape, geom_data);
}
auto geom_name = detail::qdata_geometry_names[i];
axom::sidre::View* geom_view = qdata_group->createView(std::string(geom_name));
axom::sidre::IndexType shape[2] = {geom_data.size(), sizeof(geom_data[0])};
geom_view->setExternalDataPtr(axom::sidre::CHAR8_STR_ID, 2, shape, geom_data);
}
} else {
SLIC_ERROR_ROOT("restarts are not enabled yet here...");
Expand Down

0 comments on commit 784bc0c

Please sign in to comment.