Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Mar 14, 2023
1 parent 0e2707f commit 3407568
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 24 deletions.
1 change: 0 additions & 1 deletion include/picongpu/plugins/IsaacPlugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ namespace picongpu
#endif
>;


std::unique_ptr<VisualizationType> visualization;

static_assert(std::is_trivially_copyable<std::decay_t<VectorFieldSourceList>>::value);
Expand Down
11 changes: 5 additions & 6 deletions include/picongpu/plugins/PluginController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ namespace picongpu
* with two components
*/
template<typename T_TupleVector>
using Apply = typename boost::mpl::apply1<
pmacc::mp_at<T_TupleVector, pmacc::mp_int<plugin>>,
pmacc::mp_at<T_TupleVector, pmacc::mp_int<species>>>::type;
using Apply = typename boost::mpl::
apply1<pmacc::mp_at_c<T_TupleVector, plugin>, pmacc::mp_at_c<T_TupleVector, species>>::type;

/** Check the combination Species+Plugin in the Tuple
*
Expand All @@ -124,8 +123,8 @@ namespace picongpu
template<typename T_TupleVector>
struct IsEligible
{
using Species = pmacc::mp_at<T_TupleVector, pmacc::mp_int<species>>;
using Solver = pmacc::mp_at<T_TupleVector, pmacc::mp_int<plugin>>;
using Species = pmacc::mp_at_c<T_TupleVector, species>;
using Solver = pmacc::mp_at_c<T_TupleVector, plugin>;

static constexpr bool value
= particles::traits::SpeciesEligibleForSolver<Species, Solver>::type::value;
Expand Down Expand Up @@ -180,7 +179,7 @@ namespace picongpu
>;

using CombinedUnspecializedSpeciesPlugins
= AllCombinations<pmacc::meta::detail::SeqToList<VectorAllSpecies>, UnspecializedSpeciesPlugins>;
= pmacc::AllCombinations<VectorAllSpecies, UnspecializedSpeciesPlugins>;

using CombinedUnspecializedSpeciesPluginsEligible
= pmacc::mp_copy_if<CombinedUnspecializedSpeciesPlugins, TupleSpeciesPlugin::IsEligible>;
Expand Down
15 changes: 6 additions & 9 deletions include/picongpu/plugins/misc/SpeciesFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,14 @@ namespace picongpu
/** evaluate if the filter and species combination is valid
*
* @tparam T_SpeciesFilter SpeciesFilter, type of the filter and species
* @return ::type pmacc::mp_bool<>, if the species is eligible for the filter
* @return pmacc::mp_bool<>, if the species is eligible for the filter
*/
template<typename T_SpeciesFilter>
struct IsEligible
{
using type = std::bool_constant<
particles::traits::SpeciesEligibleForSolver<
typename T_SpeciesFilter::Species,
typename T_SpeciesFilter::Filter>::type::value
&& T_SpeciesFilter::Filter::isDeterministic>;
};
using IsEligible = std::bool_constant<
particles::traits::SpeciesEligibleForSolver<
typename T_SpeciesFilter::Species,
typename T_SpeciesFilter::Filter>::type::value
&& T_SpeciesFilter::Filter::isDeterministic>;
} // namespace speciesFilter

} // namespace misc
Expand Down
7 changes: 2 additions & 5 deletions include/picongpu/plugins/openPMD/openPMDWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,9 @@ make sure that environment variable OPENPMD_BP_BACKEND is not set to ADIOS1.

using AllSpeciesFilter = pmacc::mp_transform<CreateSpeciesFilter, AllParticlesTimesAllFilters>;

private:
template<typename T>
using IsEligible = typename plugins::misc::speciesFilter::IsEligible<T>::type;

public:
using AllEligibleSpeciesSources = pmacc::mp_copy_if<AllSpeciesFilter, IsEligible>;
using AllEligibleSpeciesSources
= pmacc::mp_copy_if<AllSpeciesFilter, plugins::misc::speciesFilter::IsEligible>;

using AllFieldSources = FileOutputFields;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ namespace picongpu
series.iterations[currentStep].close();
}


public:
struct Help : public plugins::multi::IHelp
{
Expand All @@ -403,7 +402,6 @@ namespace picongpu
return std::shared_ptr<IInstance>(new ParticleCalorimeter<ParticlesType>(help, id, cellDescription));
}


// find all valid filter for the current used species
template<typename T>
using Op = typename particles::traits::GenerateSolversIfSpeciesEligible<T, ParticlesType>::type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace picongpu
*
* the functors are called in order (from first to last functor)
*/
using InitPipeline = boost::mp11::mp_list<
using InitPipeline = pmacc::mp_list<
CreateDensity<densityProfiles::FreeFormula, startPosition::Random, PIC_Electrons>,
Manipulate<manipulators::AssignYDriftPositive, PIC_Electrons>,
Manipulate<manipulators::AddTemperature, PIC_Electrons>>;
Expand Down

0 comments on commit 3407568

Please sign in to comment.