From 92a94366aaf793542e6b9af409ba900df0a9637b Mon Sep 17 00:00:00 2001 From: Yinjian Zhao Date: Thu, 16 Apr 2020 17:09:47 -0700 Subject: Particle Plotfile Filter (#724) * functors to select particles * add const * oops, typo * Update Source/Particles/Filter/FilterFunctors.H Co-Authored-By: Axel Huebl * Apply suggestions from code review @ax3l Co-Authored-By: Axel Huebl * use SuperParticleType * New particle filter. * Fix bug * Add doc * Modify doc * Test * Modify based on suggestions * Change units of ux,uy,uz * Modify doc * Move to constructor * Minor * Update Source/Diagnostics/ParticleIO.cpp Co-Authored-By: Andrew Myers * Minor * Apply suggestions from code review Co-Authored-By: MaxThevenet Co-authored-by: MaxThevenet Co-authored-by: Axel Huebl Co-authored-by: Andrew Myers --- Source/Particles/PhysicalParticleContainer.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Source/Particles/PhysicalParticleContainer.cpp') diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index 982f3277f..c63b94a27 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -164,6 +164,20 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp plot_flags[plot_flag_size-1] = 1; } #endif + + // build filter functors + m_do_random_filter = pp.query("random_fraction", m_random_fraction); + m_do_uniform_filter = pp.query("uniform_stride", m_uniform_stride); + std::string buf; + m_do_parser_filter = pp.query("plot_filter_function(t,x,y,z,ux,uy,uz)", buf); + if (m_do_parser_filter) { + std::string function_string = ""; + Store_parserString(pp,"plot_filter_function(t,x,y,z,ux,uy,uz)", + function_string); + m_particle_filter_parser.reset(new ParserWrapper<7>( + makeParser(function_string,{"t","x","y","z","ux","uy","uz"}))); + } + } PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core) -- cgit v1.2.3