From 5005f2d2ffe6348924240a7229b708f7316fcc70 Mon Sep 17 00:00:00 2001 From: Xiangyu Hu Date: Sun, 21 Jul 2024 21:51:06 +0000 Subject: [PATCH] found the bug --- src/shared/particles/base_particles.hpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/shared/particles/base_particles.hpp b/src/shared/particles/base_particles.hpp index 256d9fbf91..0252fbe8e2 100644 --- a/src/shared/particles/base_particles.hpp +++ b/src/shared/particles/base_particles.hpp @@ -204,16 +204,13 @@ DiscreteVariable *BaseParticles:: template void BaseParticles::addVariableToSort(const std::string &name) { - constexpr int type_index = DataTypeIndex::value; - if (type_index != DataTypeIndex::value) // particle IDs excluded + DiscreteVariable *new_sortable = + addVariableToList(sortable_variables_, name); + if (new_sortable != nullptr) { - DiscreteVariable *new_sortable = - addVariableToList(sortable_variables_, name); - if (new_sortable != nullptr) - { - StdLargeVec *variable_data = new_sortable->DataField(); - std::get(sortable_data_).push_back(variable_data); - } + constexpr int type_index = DataTypeIndex::value; + StdLargeVec *variable_data = new_sortable->DataField(); + std::get(sortable_data_).push_back(variable_data); } } //=================================================================================================//