Commit 07a6a963 authored by ESTERIE Pierre's avatar ESTERIE Pierre
Browse files

change container push to insert

parent 436dcd58
......@@ -181,7 +181,7 @@ auto run(const int& tree_height, const int& group_size, const bool readFile, std
{
e = values_to_read[ii++];
}
container->push_particle(idx, p);
container->insert_particle(idx, p);
}
}
else
......
......@@ -184,7 +184,7 @@ void run_level(Graph_container_type& graph, const int& tree_height, const int& g
p.variables(idx, pos_idx);
box_center += p.position();
std::clog << "idx " << idx << " numbers[idx] " << pos_idx << " p " << p << " --" << std::endl;
container.push_particle(pos_idx, p);
container.insert_particle(pos_idx, p);
}
box_center /= static_cast<Value_type>(nb_part); // The centre of mass
std::clog << " Check particles " << std::endl;
......
......@@ -72,7 +72,7 @@ namespace laplace
e = 0.;
}
// std::clog << "idx: " << idx << " part: " << p << std::endl;
container->push_particle(idx, p);
container->insert_particle(idx, p);
}
loader.close();
}
......
......@@ -113,7 +113,7 @@ auto main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) -> int
{
e = values_to_read[ii++];
}
container.push_particle(idx, p);
container.insert_particle(idx, p);
}
time.tac();
......
......@@ -125,7 +125,7 @@ auto main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) -> int
container_type container(particles.size());
for(std::size_t i = 0; i < particles.size(); ++i)
{
container.push_particle(
container.insert_particle(
i, std::apply([&i](auto&&... xs) { return std::make_tuple(std::forward<decltype(xs)>(xs)[i]..., 0., 0.); },
flatten_views));
std::cout << i << " p " << container.particle(i) << std::endl;
......
......@@ -122,7 +122,7 @@ auto main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) -> int
{
e = values_to_read[ii++];
}
container->push_particle(idx, p);
container->insert_particle(idx, p);
}
time.tac();
......@@ -153,7 +153,7 @@ auto main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) -> int
const auto& p = perm[i];
std::cout << i << " idx " << std::get<0>(p) << " morton " << std::get<1>(p) << std::endl;
nodes[i] = container->position(std::get<0>(perm[i]));
ordered_container->push_particle(i, container->particle(std::get<0>(perm[i])));
ordered_container->insert_particle(i, container->particle(std::get<0>(perm[i])));
}
container_type* old_container = container;
......
......@@ -43,10 +43,10 @@ auto main() -> int
for(std::size_t i = 0; i < 13; ++i)
{
c.push_position(i, container::point<double, 3>(0.));
c.push_inputs(i, std::make_tuple(18., 19.));
c.push_outputs(i, std::array{118., 119.});
c.push_variables(i, meta::to_tuple(std::array{2500}));
c.insert_position(i, container::point<double, 3>(0.));
c.insert_inputs(i, std::make_tuple(18., 19.));
c.insert_outputs(i, std::array{118., 119.});
c.insert_variables(i, meta::to_tuple(std::array{2500}));
}
std::cout << "iterator\n";
......
......@@ -98,7 +98,7 @@ void read_data(const std::string& filename, CONTAINER_T*& container, POINT_T& Ce
e = values_to_read[ii++];
}
p.variables(values_to_read[ii++], idx);
container->push_particle(idx, p);
container->insert_particle(idx, p);
}
}
template<typename Tree_T, typename Container_T, typename Value_T>
......
......@@ -130,7 +130,7 @@ auto run(const std::string& title, const std::string& input_file, const int &tre
e = 0.;
}
// std::clog << "idx: " << idx << " part: " << p << std::endl;
container.push_particle(idx, p);
container.insert_particle(idx, p);
}
loader.close();
// }
......
......@@ -124,7 +124,7 @@ auto main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) -> int
{
e = values_to_read[ii++];
}
container->push_particle(idx, p);
container->insert_particle(idx, p);
}
time.tac();
......
......@@ -92,7 +92,7 @@ namespace scalfmm::container
/// @param p
///
/// @return
inline auto push_particle(std::size_t i, particle_type p) -> void
inline auto insert_particle(std::size_t i, particle_type p) -> void
{
auto it{std::begin(*this)};
std::advance(it, i);
......@@ -129,7 +129,7 @@ namespace scalfmm::container
/// @param p
///
/// @return
inline auto push_position(std::size_t i, typename particle_type::position_type p) -> void
inline auto insert_position(std::size_t i, typename particle_type::position_type p) -> void
{
auto it{std::begin(*this)};
std::advance(it, i);
......@@ -142,7 +142,7 @@ namespace scalfmm::container
/// @param p
///
/// @return
inline auto push_position(std::size_t i, typename particle_type::position_tuple_type p) -> void
inline auto insert_position(std::size_t i, typename particle_type::position_tuple_type p) -> void
{
auto it{std::begin(*this)};
std::advance(it, i);
......@@ -179,7 +179,7 @@ namespace scalfmm::container
/// @param p
///
/// @return
inline auto push_inputs(std::size_t i, typename particle_type::inputs_type p) -> void
inline auto insert_inputs(std::size_t i, typename particle_type::inputs_type p) -> void
{
auto it{std::begin(*this)};
std::advance(it, i);
......@@ -192,7 +192,7 @@ namespace scalfmm::container
/// @param p
///
/// @return
inline auto push_inputs(std::size_t i, typename particle_type::inputs_tuple_type p) -> void
inline auto insert_inputs(std::size_t i, typename particle_type::inputs_tuple_type p) -> void
{
auto it{std::begin(*this)};
std::advance(it, i);
......@@ -229,7 +229,7 @@ namespace scalfmm::container
/// @param p
///
/// @return
inline auto push_outputs(std::size_t i, typename particle_type::outputs_type p) -> void
inline auto insert_outputs(std::size_t i, typename particle_type::outputs_type p) -> void
{
auto it{std::begin(*this)};
std::advance(it, i);
......@@ -242,7 +242,7 @@ namespace scalfmm::container
/// @param p
///
/// @return
inline auto push_outputs(std::size_t i, typename particle_type::outputs_tuple_type p) -> void
inline auto insert_outputs(std::size_t i, typename particle_type::outputs_tuple_type p) -> void
{
auto it{std::begin(*this)};
std::advance(it, i);
......@@ -267,7 +267,7 @@ namespace scalfmm::container
/// @param p
///
///
inline auto push_variables(std::size_t i, typename particle_type::variables_type p) -> void
inline auto insert_variables(std::size_t i, typename particle_type::variables_type p) -> void
{
auto it{std::begin(*this)};
std::advance(it, i);
......
......@@ -82,7 +82,7 @@ namespace scalfmm
// std::cout << " pointer on ordered_container " << ordered_container << std::endl;
for(std::size_t i = 0; i < number_of_particles; ++i)
{
ordered_container->push_particle(i, particle_container->particle(std::get<0>(perm[i])));
ordered_container->insert_particle(i, particle_container->particle(std::get<0>(perm[i])));
}
delete particle_container;
particle_container = ordered_container;
......
......@@ -73,7 +73,7 @@ void read_data(const std::string& filename, CONTAINER_T*& container, POINT_T& Ce
e = values_to_read[ii++];
}
p.variables(values_to_read[ii++], idx);
container->push_particle(idx, p);
container->insert_particle(idx, p);
}
}
template<typename Tree_T, typename Container_T, typename Value_T>
......
......@@ -75,7 +75,7 @@ void read_data(const std::string& filename, CONTAINER_T*& container, POINT_T& Ce
e = values_to_read[ii++];
}
p.variables(values_to_read[ii++], idx);
container->push_particle(idx, p);
container->insert_particle(idx, p);
}
}
template<typename Tree_T, typename Container_T, typename Value_T>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment