diff --git a/.gitignore b/.gitignore index 4dac5c6d8..e31337989 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,3 @@ perf.* .vscode .phare* PHARE_REPORT.zip -.cache -.envrc -PHAREenv/ diff --git a/src/amr/data/field/initializers/field_user_initializer.hpp b/src/amr/data/field/initializers/field_user_initializer.hpp index 2db139e6d..ef89dd05f 100644 --- a/src/amr/data/field/initializers/field_user_initializer.hpp +++ b/src/amr/data/field/initializers/field_user_initializer.hpp @@ -7,33 +7,30 @@ #include #include -namespace PHARE +namespace PHARE::core { -namespace core{ - class FieldUserFunctionInitializer { - public: - template - void static initialize(Field& field, GridLayout const& layout, - initializer::InitFunction const& init) - { - auto const indices = layout.ghostStartToEndIndices(field, /*includeEnd=*/true); - auto const coords = layout.template indexesToCoordVectors( - indices, field, [](auto& gridLayout, auto& field_, auto const&... args) { - return gridLayout.fieldNodeCoordinates(field_, gridLayout.origin(), args...); - }); - - std::shared_ptr> gridPtr // keep grid data alive - = std::apply([&](auto&... args) { return init(args...); }, coords); - Span& grid = *gridPtr; - - for (std::size_t cell_idx = 0; cell_idx < indices.size(); cell_idx++) - std::apply([&](auto&... args) { field(args...) = grid[cell_idx]; }, - indices[cell_idx]); - } - }; - -} // namespace core +class FieldUserFunctionInitializer +{ +public: + template + void static initialize(Field& field, GridLayout const& layout, + initializer::InitFunction const& init) + { + auto const indices = layout.ghostStartToEndIndices(field, /*includeEnd=*/true); + auto const coords = layout.template indexesToCoordVectors( + indices, field, [](auto& gridLayout, auto& field_, auto const&... args) { + return gridLayout.fieldNodeCoordinates(field_, gridLayout.origin(), args...); + }); + + std::shared_ptr> gridPtr // keep grid data alive + = std::apply([&](auto&... args) { return init(args...); }, coords); + Span& grid = *gridPtr; + + for (std::size_t cell_idx = 0; cell_idx < indices.size(); cell_idx++) + std::apply([&](auto&... args) { field(args...) = grid[cell_idx]; }, indices[cell_idx]); + } +}; -} // namespace PHARE +} // namespace PHARE::core #endif