Skip to content

Commit

Permalink
found the bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangyu-Hu committed Jul 21, 2024
1 parent 6ef7e27 commit 5005f2d
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/shared/particles/base_particles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,13 @@ DiscreteVariable<DataType> *BaseParticles::
template <typename DataType>
void BaseParticles::addVariableToSort(const std::string &name)
{
constexpr int type_index = DataTypeIndex<DataType>::value;
if (type_index != DataTypeIndex<size_t>::value) // particle IDs excluded
DiscreteVariable<DataType> *new_sortable =
addVariableToList<DataType>(sortable_variables_, name);
if (new_sortable != nullptr)
{
DiscreteVariable<DataType> *new_sortable =
addVariableToList<DataType>(sortable_variables_, name);
if (new_sortable != nullptr)
{
StdLargeVec<DataType> *variable_data = new_sortable->DataField();
std::get<type_index>(sortable_data_).push_back(variable_data);
}
constexpr int type_index = DataTypeIndex<DataType>::value;
StdLargeVec<DataType> *variable_data = new_sortable->DataField();
std::get<type_index>(sortable_data_).push_back(variable_data);
}
}
//=================================================================================================//
Expand Down

0 comments on commit 5005f2d

Please sign in to comment.