diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 03eb3a8171..bc24e2d037 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,7 +32,7 @@ test-rebase-to-mainline: # "examples/KelvinHelmholtz" compile all cases within one gitlab job generate-reduced-matrix: variables: - PIC_INPUTS: "examples" + PIC_INPUTS: "examples tests" TEST_TUPLE_NUM_ELEM: 1 extends: ".base_generate-reduced-matrix" diff --git a/share/picongpu/examples/KelvinHelmholtz/cmakeFlags b/share/picongpu/examples/KelvinHelmholtz/cmakeFlags index ec0ffe7464..ed1190ee36 100755 --- a/share/picongpu/examples/KelvinHelmholtz/cmakeFlags +++ b/share/picongpu/examples/KelvinHelmholtz/cmakeFlags @@ -32,11 +32,6 @@ flags[0]="" flags[1]="-DPARAM_OVERWRITES:LIST='-DPARAM_DIMENSION=DIM2'" flags[2]="-DPARAM_OVERWRITES:LIST='-DPARAM_RADIATION=1'" -flags[3]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=EmZ;-DPARAM_PARTICLESHAPE=CIC'" -flags[4]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=EmZ;-DPARAM_PARTICLESHAPE=PCS'" -flags[5]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=EmZ;-DPARAM_PARTICLESHAPE=TSC'" -flags[6]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=EmZ;-DPARAM_PARTICLESHAPE=TSC;-DPARAM_DIMENSION=DIM2'" -flags[7]="-DPARAM_OVERWRITES:LIST='-DPARAM_FIELDSOLVER=DirSplitting;-DPARAM_CURRENTINTERPOLATION=NoneDS'" ################################################################################ diff --git a/share/picongpu/examples/KelvinHelmholtz/include/picongpu/param/fieldSolver.param b/share/picongpu/examples/KelvinHelmholtz/include/picongpu/param/fieldSolver.param index 9e83590fc9..e8f70c8cff 100644 --- a/share/picongpu/examples/KelvinHelmholtz/include/picongpu/param/fieldSolver.param +++ b/share/picongpu/examples/KelvinHelmholtz/include/picongpu/param/fieldSolver.param @@ -55,10 +55,7 @@ namespace fields * - experimental assignment for all-centered/directional splitting * - updates E & B at the same time */ -#ifndef PARAM_CURRENTINTERPOLATION -# define PARAM_CURRENTINTERPOLATION None -#endif - using CurrentInterpolation = currentInterpolation::PARAM_CURRENTINTERPOLATION; + using CurrentInterpolation = currentInterpolation::None; /** FieldSolver * @@ -72,7 +69,7 @@ namespace fields * - None< CurrentInterpolation >: disable the vacuum update of E and B */ - using Solver = maxwellSolver::PARAM_FIELDSOLVER< CurrentInterpolation >; + using Solver = maxwellSolver::Yee< CurrentInterpolation >; } // namespace fields } // namespace picongpu diff --git a/share/picongpu/examples/KelvinHelmholtz/include/picongpu/param/grid.param b/share/picongpu/examples/KelvinHelmholtz/include/picongpu/param/grid.param index 55b8c32e54..4633d2c3e0 100644 --- a/share/picongpu/examples/KelvinHelmholtz/include/picongpu/param/grid.param +++ b/share/picongpu/examples/KelvinHelmholtz/include/picongpu/param/grid.param @@ -34,53 +34,9 @@ namespace picongpu /** equals X * unit: meter */ -#ifndef PARAM_FIELDSOLVER -# define PARAM_FIELDSOLVER Yee -#endif - -#define DirSplitting 1 - -#if( PMACC_CUDA_ENABLED != 1 ) -/* DirSplitting is only available for the CUDA accelerator. - * Automatically switch back to Yee when we compile for non CUDA accelerator. - */ -# if (PARAM_FIELDSOLVER == 1) -# warning "DirSplitting is only for CUDA available, solver will be set to Yee." -# warning "CurrentInterpolation solver will be set to None." -// rest current interpolation -# ifdef PARAM_CURRENTINTERPOLATION -# undef PARAM_CURRENTINTERPOLATION -# endif -# define PARAM_CURRENTINTERPOLATION None -# undef DirSplitting -// switch to the field solver Yee -# undef PARAM_FIELDSOLVER -# define PARAM_FIELDSOLVER Yee -// define DirSplitting to two to force cell size calculation based on Yee solver conditions -# define DirSplitting 2 -# endif -#endif -// check if DirSplitting is activated -#if (PARAM_FIELDSOLVER == 1) - /* THIS CODE PATH IS ONLY USED IF `PARAM_FIELDSOLVER` IS CHANGED IN - * `cmakeFlags` and the field solver there is set to fieldSolverDirSplitting - * - * Directional Splitting requires a fixed ratio between dt and dx - * and in addition cubic cells. - * conditions: dX == dt * c - * dX == dY - * dX == dZ - */ - constexpr float_64 CELL_WIDTH_SI = DELTA_T_SI*SPEED_OF_LIGHT_SI; -#else - /* cell size for Yee solver (must fulfill CFL) - * WARNING: if you change the field solver in `componentsConfig` you - * have to change the CELL_SIZE in this code path - */ + /** equals X + * unit: meter */ constexpr float_64 CELL_WIDTH_SI = 9.34635e-8; -#endif -#undef DirSplitting - /** equals Y * unit: meter */ constexpr float_64 CELL_HEIGHT_SI = CELL_WIDTH_SI; diff --git a/share/picongpu/examples/KelvinHelmholtz/include/picongpu/param/species.param b/share/picongpu/examples/KelvinHelmholtz/include/picongpu/param/species.param index 34cd99cbda..7d0e60f5ad 100644 --- a/share/picongpu/examples/KelvinHelmholtz/include/picongpu/param/species.param +++ b/share/picongpu/examples/KelvinHelmholtz/include/picongpu/param/species.param @@ -40,10 +40,7 @@ namespace picongpu * * example: using UsedParticleShape = particles::shapes::CIC; */ -#ifndef PARAM_PARTICLESHAPE -#define PARAM_PARTICLESHAPE TSC -#endif -using UsedParticleShape = particles::shapes::PARAM_PARTICLESHAPE; +using UsedParticleShape = particles::shapes::TSC; /* define which interpolation method is used to interpolate fields to particle*/ using UsedField2Particle = FieldToParticleInterpolation< UsedParticleShape, AssignedTrilinearInterpolation >; @@ -62,10 +59,7 @@ using UsedField2Particle = FieldToParticleInterpolation< UsedParticleShape, Assi * - currentSolver::strategy::CachedSupercells * - currentSolver::strategy::NonCachedSupercells */ -#ifndef PARAM_CURRENTSOLVER -#define PARAM_CURRENTSOLVER Esirkepov -#endif -using UsedParticleCurrentSolver = currentSolver::PARAM_CURRENTSOLVER; +using UsedParticleCurrentSolver = currentSolver::Esirkepov; /*! particle pusher configuration ---------------------------------------------- * diff --git a/share/picongpu/examples/LaserWakefield/cmakeFlags b/share/picongpu/examples/LaserWakefield/cmakeFlags index d25c78758a..dd6a91868c 100755 --- a/share/picongpu/examples/LaserWakefield/cmakeFlags +++ b/share/picongpu/examples/LaserWakefield/cmakeFlags @@ -30,15 +30,8 @@ # - increase by 1, no gaps flags[0]="" -flags[1]="-DPARAM_OVERWRITES:LIST='-DPARAM_FIELDSOLVER=Lehe;-DPARAM_PARTICLEPUSHER=Vay'" -flags[2]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=Esirkepov;-DPARAM_PARTICLESHAPE=CIC'" -flags[3]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=VillaBune;-DPARAM_PARTICLESHAPE=CIC'" -flags[4]="-DPARAM_OVERWRITES:LIST='-DPARAM_PRECISION=precision64Bit'" -flags[5]="-DPARAM_OVERWRITES:LIST='-DPARAM_DIMENSION=DIM2'" -flags[6]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=Esirkepov;-DPARAM_PARTICLESHAPE=CIC;-DPARAM_DIMENSION=DIM2'" -flags[7]="-DPARAM_OVERWRITES:LIST='-DPARAM_PRECISION=precision64Bit;-DPARAM_DIMENSION=DIM2'" -flags[8]="-DPARAM_OVERWRITES:LIST='-DPARAM_DIMENSION=DIM2'" -flags[9]="-DPARAM_OVERWRITES:LIST='-DPARAM_IONS=1;-DPARAM_IONIZATION=1'" +flags[1]="-DPARAM_OVERWRITES:LIST='-DPARAM_DIMENSION=DIM2'" +flags[2]="-DPARAM_OVERWRITES:LIST='-DPARAM_IONS=1;-DPARAM_IONIZATION=1'" ################################################################################ # execution diff --git a/share/picongpu/examples/LaserWakefield/include/picongpu/param/fieldSolver.param b/share/picongpu/examples/LaserWakefield/include/picongpu/param/fieldSolver.param index d98d2ba0cc..9255aa126d 100644 --- a/share/picongpu/examples/LaserWakefield/include/picongpu/param/fieldSolver.param +++ b/share/picongpu/examples/LaserWakefield/include/picongpu/param/fieldSolver.param @@ -55,10 +55,8 @@ namespace fields * - experimental assignment for all-centered/directional splitting * - updates E & B at the same time */ -#ifndef PARAM_CURRENTINTERPOLATION -# define PARAM_CURRENTINTERPOLATION None -#endif - using CurrentInterpolation = currentInterpolation::PARAM_CURRENTINTERPOLATION; + + using CurrentInterpolation = currentInterpolation::None; /** FieldSolver * @@ -72,13 +70,7 @@ namespace fields * - None< CurrentInterpolation >: disable the vacuum update of E and B */ -#ifndef PARAM_FIELDSOLVER - /* WARNING: if you change field solver by hand please update your CELL_WIDTH_SI - * in `grid.param` to fulfill the convergence condition (CFL) - */ -# define PARAM_FIELDSOLVER Yee -#endif - using Solver = maxwellSolver::PARAM_FIELDSOLVER< CurrentInterpolation >; + using Solver = maxwellSolver::Yee< CurrentInterpolation >; } // namespace fields } // namespace picongpu diff --git a/share/picongpu/examples/LaserWakefield/include/picongpu/param/species.param b/share/picongpu/examples/LaserWakefield/include/picongpu/param/species.param index 9389fc21d6..d88298dbea 100644 --- a/share/picongpu/examples/LaserWakefield/include/picongpu/param/species.param +++ b/share/picongpu/examples/LaserWakefield/include/picongpu/param/species.param @@ -40,10 +40,7 @@ namespace picongpu * * example: using UsedParticleShape = particles::shapes::CIC; */ -#ifndef PARAM_PARTICLESHAPE -#define PARAM_PARTICLESHAPE TSC -#endif -using UsedParticleShape = particles::shapes::PARAM_PARTICLESHAPE; +using UsedParticleShape = particles::shapes::TSC; /* define which interpolation method is used to interpolate fields to particle*/ using UsedField2Particle = FieldToParticleInterpolation< UsedParticleShape, AssignedTrilinearInterpolation >; @@ -62,10 +59,7 @@ using UsedField2Particle = FieldToParticleInterpolation< UsedParticleShape, Assi * - currentSolver::strategy::CachedSupercells * - currentSolver::strategy::NonCachedSupercells */ -#ifndef PARAM_CURRENTSOLVER -#define PARAM_CURRENTSOLVER Esirkepov -#endif -using UsedParticleCurrentSolver = currentSolver::PARAM_CURRENTSOLVER< UsedParticleShape >; +using UsedParticleCurrentSolver = currentSolver::Esirkepov< UsedParticleShape >; /*! particle pusher configuration ---------------------------------------------- * @@ -87,9 +81,6 @@ using UsedParticleCurrentSolver = currentSolver::PARAM_CURRENTSOLVER< UsedPartic * For development purposes: -------------------------------------------------- * - particles::pusher::Axel : a pusher developed at HZDR during 2011 (testing) */ -#ifndef PARAM_PARTICLEPUSHER -#define PARAM_PARTICLEPUSHER Boris -#endif -using UsedParticlePusher = particles::pusher::PARAM_PARTICLEPUSHER; +using UsedParticlePusher = particles::pusher::Boris; }//namespace picongpu diff --git a/share/picongpu/tests/compileCurrentSolver/README.rst b/share/picongpu/tests/compileCurrentSolver/README.rst new file mode 100644 index 0000000000..d1ffee0bd2 --- /dev/null +++ b/share/picongpu/tests/compileCurrentSolver/README.rst @@ -0,0 +1,5 @@ +Compile Test for Selected Species Solver +======================================== + +This test compiles current solver for different partcle shapes. +Particle pusher are checked in the example SingleParticleTest. diff --git a/share/picongpu/tests/compileCurrentSolver/cmakeFlags b/share/picongpu/tests/compileCurrentSolver/cmakeFlags new file mode 100755 index 0000000000..4b0a6f1754 --- /dev/null +++ b/share/picongpu/tests/compileCurrentSolver/cmakeFlags @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# +# Copyright 2013-2020 Axel Huebl, Rene Widera +# +# This file is part of PIConGPU. +# +# PIConGPU is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# PIConGPU is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with PIConGPU. +# If not, see . +# + +# +# generic compile options +# + +################################################################################ +# add presets here +# - default: index 0 +# - start with zero index +# - increase by 1, no gaps + +flags[0]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=EmZ;-DPARAM_PARTICLESHAPE=PCS'" +flags[1]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=EmZ;-DPARAM_PARTICLESHAPE=P4S;-DPARAM_DIMENSION=DIM2'" +# Esirkepov and TSC is tested in most examples +flags[2]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=Esirkepov;-DPARAM_PARTICLESHAPE=CIC'" +flags[3]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=Esirkepov;-DPARAM_PARTICLESHAPE=PCS;-DPARAM_DIMENSION=DIM2'" +flags[4]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=VillaBune<>;-DPARAM_PARTICLESHAPE=CIC'" + + +################################################################################ +# execution + +case "$1" in + -l) echo ${#flags[@]} + ;; + -ll) for f in "${flags[@]}"; do echo $f; done + ;; + *) echo -n ${flags[$1]} + ;; +esac diff --git a/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/density.param b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/density.param new file mode 100644 index 0000000000..9edc35a15e --- /dev/null +++ b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/density.param @@ -0,0 +1,46 @@ +/* Copyright 2013-2020 Axel Huebl, Heiko Burau, Rene Widera, Felix Schmitt, + * Richard Pausch + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +#pragma once + +#include "picongpu/particles/densityProfiles/profiles.def" + + +namespace picongpu +{ +namespace SI +{ + /** Base density in particles per m^3 in the density profiles. + * + * This is often taken as reference maximum density in normalized profiles. + * Individual particle species can define a `densityRatio` flag relative + * to this value. + * + * unit: ELEMENTS/m^3 + */ + constexpr float_64 BASE_DENSITY_SI = 1.e25; +} + +namespace densityProfiles +{ + /* definition of homogenous profile */ + using Homogenous = HomogenousImpl; +} +} diff --git a/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/dimension.param b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/dimension.param new file mode 100644 index 0000000000..9f14baaec3 --- /dev/null +++ b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/dimension.param @@ -0,0 +1,31 @@ +/* Copyright 2014-2020 Axel Huebl, Rene Widera + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +#pragma once + +#ifndef PARAM_DIMENSION +#define PARAM_DIMENSION DIM3 +#endif + +#define SIMDIM PARAM_DIMENSION + +namespace picongpu +{ + constexpr uint32_t simDim = SIMDIM; +} // namespace picongpu diff --git a/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/fileOutput.param b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/fileOutput.param new file mode 100644 index 0000000000..9f36de08ac --- /dev/null +++ b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/fileOutput.param @@ -0,0 +1,57 @@ +/* Copyright 2013-2020 Axel Huebl, Rene Widera, Felix Schmitt, + * Benjamin Worpitz, Richard Pausch + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +#pragma once + +#include + +/* some forward declarations we need */ +#include "picongpu/fields/Fields.def" +#include "picongpu/particles/particleToGrid/ComputeGridValuePerFrame.def" + +#include + + +namespace picongpu +{ + + /** FieldTmpSolvers groups all solvers that create data for FieldTmp ****** + * + * FieldTmpSolvers is used in @see FieldTmp to calculate the exchange size + */ + using FieldTmpSolvers = MakeSeq_t<>; + + /** FileOutputFields: Groups all Fields that shall be dumped *************/ + + /** Possible native fields: FieldE, FieldB, FieldJ + */ + using NativeFileOutputFields = MakeSeq_t<>; + + using FileOutputFields = MakeSeq_t<>; + + + /** FileOutputParticles: Groups all Species that shall be dumped ********** + * + * hint: to disable particle output set to + * using FileOutputParticles = MakeSeq_t< >; + */ + using FileOutputParticles = MakeSeq_t<>; + +} diff --git a/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/isaac.param b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/isaac.param new file mode 100644 index 0000000000..15766458fc --- /dev/null +++ b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/isaac.param @@ -0,0 +1,58 @@ +/* Copyright 2016-2020 Alexander Matthes + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +/** @file + * + * Definition which native fields and density fields of particles will be + * visualizable with ISAAC. ISAAC is an in-situ visualization library with which + * the PIC simulation can be observed while it is running avoiding the time + * consuming writing and reading of simulation data for the classical post + * processing of data. + * + * ISAAC can directly visualize natives fields like the E or B field, but + * density fields of particles need to be calculated from PIConGPU on the fly + * which slightly increases the runtime and the memory consumption. Every + * particle density field will reduce the amount of memory left for PIConGPUs + * particles and fields. + * + * To get best performance, ISAAC defines an exponential amount of different + * visualization kernels for every combination of (at runtime) activated + * fields. So furthermore a lot of fields will increase the compilation time. + * + */ + +#pragma once + +namespace picongpu +{ +namespace isaacP +{ + + /** Intermediate list of native particle species of PIConGPU which shall be + * visualized. */ + using Particle_Seq = MakeSeq_t<>; + + + /** Compile time sequence of all fields which shall be visualized. Basically + * the join of Native_Seq and Density_Seq. */ + using Fields_Seq = MakeSeq_t<>; + + +} // namespace isaacP +} // namespace picongpu diff --git a/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/particle.param b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/particle.param new file mode 100644 index 0000000000..a676292c7b --- /dev/null +++ b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/particle.param @@ -0,0 +1,97 @@ +/* Copyright 2013-2020 Axel Huebl, Rene Widera, Benjamin Worpitz, + * Richard Pausch + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +#pragma once + +#include "picongpu/particles/startPosition/functors.def" +#include "picongpu/particles/manipulators/manipulators.def" +#include "picongpu/particles/filter/filter.def" + +#include + +namespace picongpu +{ +namespace particles +{ + namespace startPosition + { + struct QuietParam25ppc + { + /** Count of particles per cell per direction at initial state + * unit: none + */ + using numParticlesPerDimension = typename mCT::shrinkTo< + mCT::Int< + 5, + 5, + 1 + >, + simDim + >::type; + }; + using Quiet25ppc = QuietImpl< QuietParam25ppc >; + + } // namespace startPosition + + /** a particle with a weighting below MIN_WEIGHTING will not + * be created / will be deleted + * unit: none + */ + constexpr float_X MIN_WEIGHTING = 10.0; + + /** During unit normalization, we assume this is a typical + * number of particles per cell for normalization of weighted + * particle attributes. + */ + constexpr uint32_t TYPICAL_PARTICLES_PER_CELL = mCT::volume< + startPosition::QuietParam25ppc::numParticlesPerDimension + >::type::value; + +namespace manipulators +{ + + CONST_VECTOR(float_X,3,DriftParamPositive_direction,1.0,0.0,0.0); + struct DriftParamPositive + { + /** Initial particle drift velocity for electrons and ions + * Examples: + * - No drift is equal to 1.0 + * unit: none + */ + static constexpr float_64 gamma = 1.021; + const DriftParamPositive_direction_t direction; + }; + using AssignXDriftPositive = unary::Drift< + DriftParamPositive, + nvidia::functors::Assign + >; + + struct TemperatureParam + { + /* Initial temperature + * unit: keV + */ + static constexpr float_64 temperature = 0.0005; + }; + using AddTemperature = unary::Temperature< TemperatureParam >; + +} // namespace manipulators +} // namespace particles +} // namespace picongpu diff --git a/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/particleFilters.param b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/particleFilters.param new file mode 100644 index 0000000000..81e27e34f0 --- /dev/null +++ b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/particleFilters.param @@ -0,0 +1,87 @@ +/* Copyright 2013-2020 Rene Widera + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +/** @file + * + * A common task in both modeling and in situ processing (output) is the + * selection of particles of a particle species by attributes. Users can + * define such selections as particle filters in this file. + * + * Particle filters are simple mappings assigning each particle of a species + * either `true` or `false` (ignore / filter out). + * + * All active filters need to be listed in `AllParticleFilters`. They are then + * combined with `VectorAllSpecies` at compile-time, e.g. for plugins. + */ + +#pragma once + +#include "picongpu/particles/filter/filter.def" +#include "picongpu/particles/traits/SpeciesEligibleForSolver.hpp" + +#include +#include + + +namespace picongpu +{ +namespace particles +{ +namespace filter +{ + struct IfRelativeGlobalPositionParamLowQuarterPosition + { + /* lowerBound is included in the range */ + static constexpr float_X lowerBound = 0.0; + /* upperBound is excluded in the range */ + static constexpr float_X upperBound = 0.25; + /* dimension for the filter + * x = 0; y= 1; z = 2 + */ + static constexpr uint32_t dimension = 1u; + + // filter name + static constexpr char const * name = "lowerQuarterYPosition"; + }; + + using LowerQuarterYPosition = filter::RelativeGlobalDomainPosition< + IfRelativeGlobalPositionParamLowQuarterPosition + >; + + /** Plugins: collection of all available particle filters + * + * Create a list of all filters here that you want to use in plugins. + * + * Note: filter All is defined in picongpu/particles/filter/filter.def + */ + using AllParticleFilters = MakeSeq_t< + All, + LowerQuarterYPosition + >; + +} // namespace filter + +namespace traits +{ + /* if needed for generic "free" filters, + * place `SpeciesEligibleForSolver` traits for filters here + */ +} // namespace traits +} // namespace particles +} // namespace picongpu diff --git a/share/picongpu/examples/LaserWakefield/include/picongpu/param/precision.param b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/precision.param similarity index 100% rename from share/picongpu/examples/LaserWakefield/include/picongpu/param/precision.param rename to share/picongpu/tests/compileCurrentSolver/include/picongpu/param/precision.param diff --git a/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/species.param b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/species.param new file mode 100644 index 0000000000..34cd99cbda --- /dev/null +++ b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/species.param @@ -0,0 +1,92 @@ +/* Copyright 2014-2020 Rene Widera, Richard Pausch + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +#pragma once + +#include "picongpu/particles/shapes.hpp" +#include "picongpu/algorithms/FieldToParticleInterpolationNative.hpp" +#include "picongpu/algorithms/FieldToParticleInterpolation.hpp" +#include "picongpu/algorithms/AssignedTrilinearInterpolation.hpp" + +#include "picongpu/particles/flylite/NonLTE.def" +#include "picongpu/fields/currentDeposition/Solver.def" + + +namespace picongpu +{ +/*---------------------------- generic solver---------------------------------*/ + +/*! Particle Shape definitions ------------------------------------------------- + * - particles::shapes::CIC : 1st order + * - particles::shapes::TSC : 2nd order + * - particles::shapes::PCS : 3rd order + * - particles::shapes::P4S : 4th order + * + * example: using UsedParticleShape = particles::shapes::CIC; + */ +#ifndef PARAM_PARTICLESHAPE +#define PARAM_PARTICLESHAPE TSC +#endif +using UsedParticleShape = particles::shapes::PARAM_PARTICLESHAPE; + +/* define which interpolation method is used to interpolate fields to particle*/ +using UsedField2Particle = FieldToParticleInterpolation< UsedParticleShape, AssignedTrilinearInterpolation >; + +/*! select current solver method + * - currentSolver::Esirkepov< SHAPE, STRATEGY > : particle shapes - CIC, TSC, PCS, P4S (1st to 4th order) + * - currentSolver::VillaBune< SHAPE, STRATEGY > : particle shapes - CIC (1st order) only + * - currentSolver::EmZ< SHAPE, STRATEGY > : particle shapes - CIC, TSC, PCS, P4S (1st to 4th order) + * + * For development purposes: + * - currentSolver::currentSolver::EsirkepovNative< SHAPE, STRATEGY > : generic version of currentSolverEsirkepov + * without optimization (~4x slower and needs more shared memory) + * + * STRATEGY (optional): + * - currentSolver::strategy::StridedCachedSupercells + * - currentSolver::strategy::CachedSupercells + * - currentSolver::strategy::NonCachedSupercells + */ +#ifndef PARAM_CURRENTSOLVER +#define PARAM_CURRENTSOLVER Esirkepov +#endif +using UsedParticleCurrentSolver = currentSolver::PARAM_CURRENTSOLVER; + +/*! particle pusher configuration ---------------------------------------------- + * + * Defining a pusher is optional for particles + * + * - particles::pusher::HigueraCary : Higuera & Cary's relativistic pusher preserving both volume and ExB velocity + * - particles::pusher::Vay : Vay's relativistic pusher preserving ExB velocity + * - particles::pusher::Boris : Boris' relativistic pusher preserving volume + * - particles::pusher::ReducedLandauLifshitz : 4th order RungeKutta pusher + * with classical radiation reaction + * - particles::pusher::Composite : composite of two given pushers, + * switches between using one (or none) of those + * + * For diagnostics & modeling: ------------------------------------------------ + * - particles::pusher::Free : free propagation, ignore fields + * (= free stream model) + * - particles::pusher::Photon : propagate with c in direction of normalized mom. + * - particles::pusher::Probe : Probe particles that interpolate E & B + * For development purposes: -------------------------------------------------- + * - particles::pusher::Axel : a pusher developed at HZDR during 2011 (testing) + */ +using UsedParticlePusher = particles::pusher::Boris; + +} // namespace picongpu diff --git a/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/speciesDefinition.param b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/speciesDefinition.param new file mode 100644 index 0000000000..ba1106a925 --- /dev/null +++ b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/speciesDefinition.param @@ -0,0 +1,90 @@ +/* Copyright 2013-2020 Rene Widera, Benjamin Worpitz, Heiko Burau + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +#pragma once + +#include "picongpu/simulation_defines.hpp" +#include "picongpu/particles/Particles.hpp" + +#include +#include +#include +#include +#include + + +#ifndef PARAM_RADIATION + /* disable radiation calculation */ +# define PARAM_RADIATION 0 +#endif + + +namespace picongpu +{ + +/*########################### define particle attributes #####################*/ + +/** describe attributes of a particle*/ +using DefaultParticleAttributes = MakeSeq_t< + position< position_pic >, + momentum, + weighting +#if( PARAM_RADIATION == 1 ) + , momentumPrev1 +#endif +>; + +/*########################### end particle attributes ########################*/ + +/*########################### define species #################################*/ + +/*--------------------------- electrons --------------------------------------*/ + +/* ratio relative to BASE_CHARGE and BASE_MASS */ +value_identifier( float_X, MassRatioElectrons, 1.0 ); +value_identifier( float_X, ChargeRatioElectrons, 1.0 ); + +using ParticleFlagsElectrons = MakeSeq_t< + particlePusher< UsedParticlePusher >, + shape< UsedParticleShape >, + interpolation< UsedField2Particle >, + current< UsedParticleCurrentSolver >, + massRatio< MassRatioElectrons >, + chargeRatio< ChargeRatioElectrons > +>; + +/* define species electrons */ +using PIC_Electrons = Particles< + PMACC_CSTRING( "e" ), + ParticleFlagsElectrons, + DefaultParticleAttributes +>; + +/*########################### end species ####################################*/ + +/** All known particle species of the simulation + * + * List all defined particle species from above in this list + * to make them available to the PIC algorithm. + */ +using VectorAllSpecies = MakeSeq_t< + PIC_Electrons +>; + +} // namespace picongpu diff --git a/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/speciesInitialization.param b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/speciesInitialization.param new file mode 100644 index 0000000000..08a9e7d6a8 --- /dev/null +++ b/share/picongpu/tests/compileCurrentSolver/include/picongpu/param/speciesInitialization.param @@ -0,0 +1,60 @@ +/* Copyright 2015-2020 Rene Widera, Axel Huebl + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +/** @file + * + * Initialize particles inside particle species. This is the final step in + * setting up particles (defined in `speciesDefinition.param`) via density + * profiles (defined in `density.param`). One can then further derive particles + * from one species to another and manipulate attributes with "manipulators" + * and "filters" (defined in `particle.param` and `particleFilters.param`). + */ + +#pragma once + +#include "picongpu/particles/InitFunctors.hpp" + + +namespace picongpu +{ +namespace particles +{ + /** InitPipeline define in which order species are initialized + * + * the functors are called in order (from first to last functor) + */ + using InitPipeline = bmpl::vector< + CreateDensity< + densityProfiles::Homogenous, + startPosition::Quiet25ppc, + PIC_Electrons + >, + Manipulate< + manipulators::AssignXDriftPositive, + PIC_Electrons, + filter::LowerQuarterYPosition + >, + Manipulate< + manipulators::AddTemperature, + PIC_Electrons + > + >; + +} // namespace particles +} // namespace picongpu diff --git a/share/picongpu/tests/compileFieldSolver/README.rst b/share/picongpu/tests/compileFieldSolver/README.rst new file mode 100644 index 0000000000..2d44f77f07 --- /dev/null +++ b/share/picongpu/tests/compileFieldSolver/README.rst @@ -0,0 +1,5 @@ +Compile Test for Field Solver +============================= + +This test compiles filed solver for two and three dimensions. +One species electron is required to test the current interpolation algorithms. diff --git a/share/picongpu/tests/compileFieldSolver/cmakeFlags b/share/picongpu/tests/compileFieldSolver/cmakeFlags new file mode 100755 index 0000000000..f613da71a4 --- /dev/null +++ b/share/picongpu/tests/compileFieldSolver/cmakeFlags @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# +# Copyright 2013-2020 Axel Huebl, Rene Widera +# +# This file is part of PIConGPU. +# +# PIConGPU is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# PIConGPU is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with PIConGPU. +# If not, see . +# + +# +# generic compile options +# + +################################################################################ +# add presets here +# - default: index 0 +# - start with zero index +# - increase by 1, no gaps + +# Yee solver is tested in the example FieldAbsorberTest +flags[0]="-DPARAM_OVERWRITES:LIST='-DPARAM_FIELDSOLVER=LehePML;-DPARAM_PRECISION=precision64Bit'" +flags[1]="-DPARAM_OVERWRITES:LIST='-DPARAM_FIELDSOLVER=LehePML;-DPARAM_DIMENSION=DIM2'" +flags[2]="-DPARAM_OVERWRITES:LIST='-DPARAM_FIELDSOLVER=DirSplitting;-DPARAM_CURRENTINTERPOLATION=NoneDS'" +flags[3]="-DPARAM_OVERWRITES:LIST='-DPARAM_FIELDSOLVER=Lehe;-DPARAM_CURRENTINTERPOLATION=Binomial'" +flags[4]="-DPARAM_OVERWRITES:LIST='-DPARAM_FIELDSOLVER=Lehe;-DPARAM_DIMENSION=DIM2'" + + +################################################################################ +# execution + +case "$1" in + -l) echo ${#flags[@]} + ;; + -ll) for f in "${flags[@]}"; do echo $f; done + ;; + *) echo -n ${flags[$1]} + ;; +esac diff --git a/share/picongpu/tests/compileFieldSolver/include/picongpu/param/dimension.param b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/dimension.param new file mode 100644 index 0000000000..9f14baaec3 --- /dev/null +++ b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/dimension.param @@ -0,0 +1,31 @@ +/* Copyright 2014-2020 Axel Huebl, Rene Widera + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +#pragma once + +#ifndef PARAM_DIMENSION +#define PARAM_DIMENSION DIM3 +#endif + +#define SIMDIM PARAM_DIMENSION + +namespace picongpu +{ + constexpr uint32_t simDim = SIMDIM; +} // namespace picongpu diff --git a/share/picongpu/tests/compileFieldSolver/include/picongpu/param/fieldSolver.param b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/fieldSolver.param new file mode 100644 index 0000000000..9e83590fc9 --- /dev/null +++ b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/fieldSolver.param @@ -0,0 +1,78 @@ +/* Copyright 2013-2020 Axel Huebl, Heiko Burau, Rene Widera + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +/** @file + * + * Configure the field solver. + * + * Select the numerical Maxwell solver (e.g. Yee's method). + * + * Also allows to configure ad hoc mitigations for high frequency + * noise in some setups via current smoothing. + */ + +#pragma once + +#include "picongpu/fields/MaxwellSolver/Solvers.def" +#include "picongpu/fields/currentInterpolation/CurrentInterpolation.def" + + +namespace picongpu +{ +namespace fields +{ + + /** Current Interpolation + * + * CurrentInterpolation is used to set a method performing the + * interpolate/assign operation from the generated currents of particle + * species to the electro-magnetic fields. + * + * Allowed values are: + * - None: + * - default for staggered grids/Yee-scheme + * - updates E + * - Binomial: 2nd order Binomial filter + * - smooths the current before assignment in staggered grid + * - updates E & breaks local charge conservation slightly + * - NoneDS: + * - experimental assignment for all-centered/directional splitting + * - updates E & B at the same time + */ +#ifndef PARAM_CURRENTINTERPOLATION +# define PARAM_CURRENTINTERPOLATION None +#endif + using CurrentInterpolation = currentInterpolation::PARAM_CURRENTINTERPOLATION; + + /** FieldSolver + * + * Field Solver Selection: + * - Yee< CurrentInterpolation >: standard Yee solver + * - Lehe< CurrentInterpolation >: Num. Cherenkov free field solver in a chosen direction + * - YeePML< CurrentInterpolation >: standard Yee solver with PML absorber + * - LehePML< CurrentInterpolation >: Num. Cherenkov free field solver in a chosen direction + * with PML absorber + * - DirSplitting< CurrentInterpolation >: Sentoku's Directional Splitting Method + * - None< CurrentInterpolation >: disable the vacuum update of E and B + */ + + using Solver = maxwellSolver::PARAM_FIELDSOLVER< CurrentInterpolation >; + +} // namespace fields +} // namespace picongpu diff --git a/share/picongpu/tests/compileFieldSolver/include/picongpu/param/fileOutput.param b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/fileOutput.param new file mode 100644 index 0000000000..9f36de08ac --- /dev/null +++ b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/fileOutput.param @@ -0,0 +1,57 @@ +/* Copyright 2013-2020 Axel Huebl, Rene Widera, Felix Schmitt, + * Benjamin Worpitz, Richard Pausch + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +#pragma once + +#include + +/* some forward declarations we need */ +#include "picongpu/fields/Fields.def" +#include "picongpu/particles/particleToGrid/ComputeGridValuePerFrame.def" + +#include + + +namespace picongpu +{ + + /** FieldTmpSolvers groups all solvers that create data for FieldTmp ****** + * + * FieldTmpSolvers is used in @see FieldTmp to calculate the exchange size + */ + using FieldTmpSolvers = MakeSeq_t<>; + + /** FileOutputFields: Groups all Fields that shall be dumped *************/ + + /** Possible native fields: FieldE, FieldB, FieldJ + */ + using NativeFileOutputFields = MakeSeq_t<>; + + using FileOutputFields = MakeSeq_t<>; + + + /** FileOutputParticles: Groups all Species that shall be dumped ********** + * + * hint: to disable particle output set to + * using FileOutputParticles = MakeSeq_t< >; + */ + using FileOutputParticles = MakeSeq_t<>; + +} diff --git a/share/picongpu/tests/compileFieldSolver/include/picongpu/param/grid.param b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/grid.param new file mode 100644 index 0000000000..55b8c32e54 --- /dev/null +++ b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/grid.param @@ -0,0 +1,136 @@ +/* Copyright 2013-2020 Axel Huebl, Rene Widera, Richard Pausch, + * Benjamin Worpitz + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + + + +#pragma once + +namespace picongpu +{ + + namespace SI + { + /** Duration of one timestep + * unit: seconds */ + constexpr float_64 DELTA_T_SI = 1.79e-16; + + /** equals X + * unit: meter */ + +#ifndef PARAM_FIELDSOLVER +# define PARAM_FIELDSOLVER Yee +#endif + +#define DirSplitting 1 + +#if( PMACC_CUDA_ENABLED != 1 ) +/* DirSplitting is only available for the CUDA accelerator. + * Automatically switch back to Yee when we compile for non CUDA accelerator. + */ +# if (PARAM_FIELDSOLVER == 1) +# warning "DirSplitting is only for CUDA available, solver will be set to Yee." +# warning "CurrentInterpolation solver will be set to None." +// rest current interpolation +# ifdef PARAM_CURRENTINTERPOLATION +# undef PARAM_CURRENTINTERPOLATION +# endif +# define PARAM_CURRENTINTERPOLATION None +# undef DirSplitting +// switch to the field solver Yee +# undef PARAM_FIELDSOLVER +# define PARAM_FIELDSOLVER Yee +// define DirSplitting to two to force cell size calculation based on Yee solver conditions +# define DirSplitting 2 +# endif +#endif +// check if DirSplitting is activated +#if (PARAM_FIELDSOLVER == 1) + /* THIS CODE PATH IS ONLY USED IF `PARAM_FIELDSOLVER` IS CHANGED IN + * `cmakeFlags` and the field solver there is set to fieldSolverDirSplitting + * + * Directional Splitting requires a fixed ratio between dt and dx + * and in addition cubic cells. + * conditions: dX == dt * c + * dX == dY + * dX == dZ + */ + constexpr float_64 CELL_WIDTH_SI = DELTA_T_SI*SPEED_OF_LIGHT_SI; +#else + /* cell size for Yee solver (must fulfill CFL) + * WARNING: if you change the field solver in `componentsConfig` you + * have to change the CELL_SIZE in this code path + */ + constexpr float_64 CELL_WIDTH_SI = 9.34635e-8; +#endif +#undef DirSplitting + + /** equals Y + * unit: meter */ + constexpr float_64 CELL_HEIGHT_SI = CELL_WIDTH_SI; + /** equals Z + * unit: meter */ + constexpr float_64 CELL_DEPTH_SI = CELL_WIDTH_SI; + + /** Note on units in reduced dimensions + * + * In 2D3V simulations, the CELL_DEPTH_SI (Z) cell length + * is still used for normalization of densities, etc. + * + * A 2D3V simulation in a cartesian PIC simulation such as + * ours only changes the degrees of freedom in motion for + * (macro) particles and all (field) information in z + * travels instantaneous, making the 2D3V simulation + * behave like the interaction of infinite "wire particles" + * in fields with perfect symmetry in Z. + */ + } //namespace SI + + //! Defines the size of the absorbing zone (in cells) + constexpr uint32_t ABSORBER_CELLS[3][2] = { + {32, 32}, /*x direction [negative,positive]*/ + {32, 32}, /*y direction [negative,positive]*/ + {32, 32} /*z direction [negative,positive]*/ + }; //unit: number of cells + + //! Define the strength of the absorber for any direction + constexpr float_X ABSORBER_STRENGTH[3][2] = { + {1.0e-3, 1.0e-3}, /*x direction [negative,positive]*/ + {1.0e-3, 1.0e-3}, /*y direction [negative,positive]*/ + {1.0e-3, 1.0e-3} /*z direction [negative,positive]*/ + }; //unit: none + + /** When to move the co-moving window. + * An initial pseudo particle, flying with the speed of light, + * is fired at the begin of the simulation. + * When it reaches movePoint % of the absolute(*) simulation area, + * the co-moving window starts to move with the speed of light. + * + * (*) Note: beware, that there is one "hidden" row of gpus at the y-front, + * when you use the co-moving window + * 0.75 means only 75% of simulation area is used for real simulation + * + * Warning: this variable is deprecated, but currently still required for + * building purposes. Please keep the variable here. In case a moving window + * is enabled in your .cfg file, please set the move point using the + * 'windowMovePoint' parameter in that file, its default value is movePoint. + */ + constexpr float_64 movePoint = 0.90; + +} diff --git a/share/picongpu/tests/compileFieldSolver/include/picongpu/param/isaac.param b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/isaac.param new file mode 100644 index 0000000000..15766458fc --- /dev/null +++ b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/isaac.param @@ -0,0 +1,58 @@ +/* Copyright 2016-2020 Alexander Matthes + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +/** @file + * + * Definition which native fields and density fields of particles will be + * visualizable with ISAAC. ISAAC is an in-situ visualization library with which + * the PIC simulation can be observed while it is running avoiding the time + * consuming writing and reading of simulation data for the classical post + * processing of data. + * + * ISAAC can directly visualize natives fields like the E or B field, but + * density fields of particles need to be calculated from PIConGPU on the fly + * which slightly increases the runtime and the memory consumption. Every + * particle density field will reduce the amount of memory left for PIConGPUs + * particles and fields. + * + * To get best performance, ISAAC defines an exponential amount of different + * visualization kernels for every combination of (at runtime) activated + * fields. So furthermore a lot of fields will increase the compilation time. + * + */ + +#pragma once + +namespace picongpu +{ +namespace isaacP +{ + + /** Intermediate list of native particle species of PIConGPU which shall be + * visualized. */ + using Particle_Seq = MakeSeq_t<>; + + + /** Compile time sequence of all fields which shall be visualized. Basically + * the join of Native_Seq and Density_Seq. */ + using Fields_Seq = MakeSeq_t<>; + + +} // namespace isaacP +} // namespace picongpu diff --git a/share/picongpu/tests/compileFieldSolver/include/picongpu/param/precision.param b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/precision.param new file mode 100644 index 0000000000..2ab132f083 --- /dev/null +++ b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/precision.param @@ -0,0 +1,60 @@ +/* Copyright 2013-2020 Rene Widera + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +/** @file + * + * Define the precision of typically used floating point types in the + * simulation. + * + * PIConGPU normalizes input automatically, allowing to use single-precision by + * default for the core algorithms. Note that implementations of various + * algorithms (usually plugins or non-core components) might still decide to + * hard-code a different (mixed) precision for some critical operations. + */ + +#pragma once + + +namespace picongpu +{ + +/*! Select a precision for the simulation data + * - precision32Bit : use 32Bit floating point numbers + * [significant digits 7 to 8] + * - precision64Bit : use 64Bit floating point numbers + * [significant digits 15 to 16] + */ +#ifndef PARAM_PRECISION +# define PARAM_PRECISION precision32Bit +#endif +namespace precisionPIConGPU = PARAM_PRECISION; + +/*! Select a precision special operations (can be different from simulation precision) + * - precisionPIConGPU : use precision which is selected on top (precisionPIConGPU) + * - precision32Bit : use 32Bit floating point numbers + * - precision64Bit : use 64Bit floating point numbers + */ +namespace precisionSqrt = precisionPIConGPU; +namespace precisionExp = precisionPIConGPU; +namespace precisionTrigonometric = precisionPIConGPU; + + +} // namespace picongpu + +#include "picongpu/unitless/precision.unitless" diff --git a/share/picongpu/tests/compileFieldSolver/include/picongpu/param/species.param b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/species.param new file mode 100644 index 0000000000..4801cc513f --- /dev/null +++ b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/species.param @@ -0,0 +1,89 @@ +/* Copyright 2014-2020 Rene Widera, Richard Pausch + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +#pragma once + +#include "picongpu/particles/shapes.hpp" +#include "picongpu/algorithms/FieldToParticleInterpolationNative.hpp" +#include "picongpu/algorithms/FieldToParticleInterpolation.hpp" +#include "picongpu/algorithms/AssignedTrilinearInterpolation.hpp" + +#include "picongpu/particles/flylite/NonLTE.def" +#include "picongpu/fields/currentDeposition/Solver.def" + + +namespace picongpu +{ +/*---------------------------- generic solver---------------------------------*/ + +/*! Particle Shape definitions ------------------------------------------------- + * - particles::shapes::CIC : 1st order + * - particles::shapes::TSC : 2nd order + * - particles::shapes::PCS : 3rd order + * - particles::shapes::P4S : 4th order + * + * example: using UsedParticleShape = particles::shapes::CIC; + */ +#ifndef PARAM_PARTICLESHAPE +#define PARAM_PARTICLESHAPE TSC +#endif +using UsedParticleShape = particles::shapes::PARAM_PARTICLESHAPE; + +/* define which interpolation method is used to interpolate fields to particle*/ +using UsedField2Particle = FieldToParticleInterpolation< UsedParticleShape, AssignedTrilinearInterpolation >; + +/*! select current solver method + * - currentSolver::Esirkepov< SHAPE, STRATEGY > : particle shapes - CIC, TSC, PCS, P4S (1st to 4th order) + * - currentSolver::VillaBune< SHAPE, STRATEGY > : particle shapes - CIC (1st order) only + * - currentSolver::EmZ< SHAPE, STRATEGY > : particle shapes - CIC, TSC, PCS, P4S (1st to 4th order) + * + * For development purposes: + * - currentSolver::currentSolver::EsirkepovNative< SHAPE, STRATEGY > : generic version of currentSolverEsirkepov + * without optimization (~4x slower and needs more shared memory) + * + * STRATEGY (optional): + * - currentSolver::strategy::StridedCachedSupercells + * - currentSolver::strategy::CachedSupercells + * - currentSolver::strategy::NonCachedSupercells + */ +using UsedParticleCurrentSolver = currentSolver::Esirkepov; + +/*! particle pusher configuration ---------------------------------------------- + * + * Defining a pusher is optional for particles + * + * - particles::pusher::HigueraCary : Higuera & Cary's relativistic pusher preserving both volume and ExB velocity + * - particles::pusher::Vay : Vay's relativistic pusher preserving ExB velocity + * - particles::pusher::Boris : Boris' relativistic pusher preserving volume + * - particles::pusher::ReducedLandauLifshitz : 4th order RungeKutta pusher + * with classical radiation reaction + * - particles::pusher::Composite : composite of two given pushers, + * switches between using one (or none) of those + * + * For diagnostics & modeling: ------------------------------------------------ + * - particles::pusher::Free : free propagation, ignore fields + * (= free stream model) + * - particles::pusher::Photon : propagate with c in direction of normalized mom. + * - particles::pusher::Probe : Probe particles that interpolate E & B + * For development purposes: -------------------------------------------------- + * - particles::pusher::Axel : a pusher developed at HZDR during 2011 (testing) + */ +using UsedParticlePusher = particles::pusher::Boris; + +} // namespace picongpu diff --git a/share/picongpu/tests/compileFieldSolver/include/picongpu/param/speciesDefinition.param b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/speciesDefinition.param new file mode 100644 index 0000000000..9bc40963d5 --- /dev/null +++ b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/speciesDefinition.param @@ -0,0 +1,80 @@ +/* Copyright 2013-2020 Rene Widera, Benjamin Worpitz, Heiko Burau + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +#pragma once + +#include "picongpu/simulation_defines.hpp" +#include "picongpu/particles/Particles.hpp" + +#include +#include +#include +#include +#include + +namespace picongpu +{ + +/*########################### define particle attributes #####################*/ + +/** describe attributes of a particle*/ +using DefaultParticleAttributes = MakeSeq_t< + position< position_pic >, + momentum, + weighting +>; + +/*########################### end particle attributes ########################*/ + +/*########################### define species #################################*/ + +/*--------------------------- electrons --------------------------------------*/ + +/* ratio relative to BASE_CHARGE and BASE_MASS */ +value_identifier( float_X, MassRatioElectrons, 1.0 ); +value_identifier( float_X, ChargeRatioElectrons, 1.0 ); + +using ParticleFlagsElectrons = MakeSeq_t< + particlePusher< UsedParticlePusher >, + shape< UsedParticleShape >, + interpolation< UsedField2Particle >, + current< UsedParticleCurrentSolver >, + massRatio< MassRatioElectrons >, + chargeRatio< ChargeRatioElectrons > +>; + +/* define species electrons */ +using PIC_Electrons = Particles< + PMACC_CSTRING( "e" ), + ParticleFlagsElectrons, + DefaultParticleAttributes +>; + +/*########################### end species ####################################*/ + +/** All known particle species of the simulation + * + * List all defined particle species from above in this list + * to make them available to the PIC algorithm. + */ +using VectorAllSpecies = MakeSeq_t< + PIC_Electrons +>; + +} // namespace picongpu diff --git a/share/picongpu/tests/compileFieldSolver/include/picongpu/param/speciesInitialization.param b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/speciesInitialization.param new file mode 100644 index 0000000000..6a02765d6c --- /dev/null +++ b/share/picongpu/tests/compileFieldSolver/include/picongpu/param/speciesInitialization.param @@ -0,0 +1,47 @@ +/* Copyright 2015-2020 Rene Widera, Axel Huebl + * + * This file is part of PIConGPU. + * + * PIConGPU is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PIConGPU is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PIConGPU. + * If not, see . + */ + +/** @file + * + * Initialize particles inside particle species. This is the final step in + * setting up particles (defined in `speciesDefinition.param`) via density + * profiles (defined in `density.param`). One can then further derive particles + * from one species to another and manipulate attributes with "manipulators" + * and "filters" (defined in `particle.param` and `particleFilters.param`). + */ + +#pragma once + +#include "picongpu/particles/InitFunctors.hpp" + + +namespace picongpu +{ +namespace particles +{ + /** InitPipeline define in which order species are initialized + * + * the functors are called in order (from first to last functor) + */ + using InitPipeline = bmpl::vector< + + >; + +} // namespace particles +} // namespace picongpu