Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/LaserWakefield/cmakeFlags
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ flags[8]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_DIMENSION=DIM2"
flags[9]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_CURRENTSOLVER=Esirkepov;-DPARAM_PARTICLESHAPE=CIC;-DPARAM_DIMENSION=DIM2"
flags[10]="-DCUDA_ARCH=sm_20 -DPARAM_OVERWRITES:LIST=-DPARAM_PRECISION=precision64Bit;-DPARAM_DIMENSION=DIM2"
flags[11]="-DCUDA_ARCH=sm_35 -DPARAM_OVERWRITES:LIST=-DENABLE_CURRENT=0;-DPARAM_DIMENSION=DIM2"
flags[12]="-DCUDA_ARCH=sm_35 -DPARAM_OVERWRITES:LIST=-DPARAM_GASPROFILE=gasSphereFlanks;-DPARAM_IONS=1;-DPARAM_IONIZATION=1"
flags[12]="-DCUDA_ARCH=sm_35 -DPARAM_OVERWRITES:LIST=-DPARAM_IONS=1;-DPARAM_IONIZATION=1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, why did you change that? do you mind reverting that change (or moving gasSphereFlanks up to DIM2 would also be ok).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it because @psychocoderHPC 's big pull request #730 removed all of the gas configuration via cmake flags. Test case 12 was originally introduced by me anyway. I plan to make gas droplet studies later but for now this -DPARAM_GASPROFILE=gasSphereFlanks was totally without effect for all of the structure was changed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah true, thanks!

################################################################################
# execution

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2013 Axel Huebl, Rene Widera
* Copyright 2013-2015 Axel Huebl, Rene Widera, Marco Garten
*
* This file is part of PIConGPU.
*
Expand All @@ -23,6 +23,8 @@
#pragma once

#include "particles/startPosition/functors.def"
#include "particles/manipulators/manipulators.def"
#include "nvidia/functors/Assign.hpp"

namespace picongpu
{
Expand Down Expand Up @@ -65,6 +67,17 @@ typedef QuietImpl<QuietParameter> Quiet;


} //namespace startPosition

namespace manipulators
{

struct BoundElectronsWhenNeutral
{
/* space for attribute initial parameters */
};
typedef SetAttributeImpl<BoundElectronsWhenNeutral,nvidia::functors::Assign> SetBoundElectrons;
} //namespace manipulators

} //namespace particles

} //namespac picongpu
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,18 @@ namespace picongpu
* the functors are called in order (from first to last functor)
*/
typedef mpl::vector<
#if (PARAM_IONIZATION == 0)

particles::CreateGas<gasProfiles::Gaussian,particles::startPosition::Random,PIC_Electrons>
#if (ENABLE_IONS == 1)
,particles::CloneSpecies<PIC_Electrons,PIC_Ions>
#if (ENABLE_IONS == 1)
,particles::CloneSpecies<PIC_Electrons,PIC_Ions>
#endif

#else

particles::CreateGas<gasProfiles::Gaussian,particles::startPosition::Random,PIC_Ions>,
particles::Manipulate<particles::manipulators::SetBoundElectrons,PIC_Ions>

#endif
> InitPipeline;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "particles/ionization/ionizationEnergies.param"
#include "particles/traits/GetAtomicNumbers.hpp"
#include "traits/attribute/GetChargeState.hpp"
#include "algorithms/math/floatMath/floatingPoint.tpp"

/** IONIZATION ALGORITHM
* - implements the calculation of ionization probability and changes charge states
Expand Down Expand Up @@ -59,8 +60,10 @@ namespace ionization
const float_X protonNumber = GetAtomicNumbers<ParticleType>::type::numberOfProtons;
float_X chargeState = attribute::getChargeState(parentIon);

uint32_t cs = math::float2int_rd(chargeState);

/* ionization condition */
if (math::abs(eField)*UNIT_EFIELD >= SI::IONIZATION_EFIELD && chargeState < protonNumber)
if (math::abs(eField)*UNIT_EFIELD >= SI::IONIZATION_EFIELD[cs] && chargeState < protonNumber)
{
/* set new particle charge state */
parentIon[boundElectrons_] -= float_X(1.0);
Expand Down
20 changes: 17 additions & 3 deletions src/picongpu/include/particles/ionization/ionizationEnergies.param
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,23 @@ namespace SI

/* ionization energy for ground state hydrogen: 13.6 eV --> converted to Joule */
/* Joule = kg * m^2 / s^2 */
const double IONIZATION_ENERGY = 2.179e-18;
/* ionization field strength (E-field) for -""-: in Volt / meter */
const double IONIZATION_EFIELD = 5.14e11;
PMACC_CONST_VECTOR(float_X,1,IONIZATION_ENERGY,
2.179e-18
);
/* ionization field strength (E-field) for hydrogen: in Volt / meter
*
* usage:
* PMACC_CONST_VECTOR(float_X,<NUMBER_OF_PROTONS>,IONIZATION_EFIELD,
* <value_1>,
* ...
* <value_Z>
* );
*
* Do not forget to change the weight of the ion and the atomic numbers in
* their respective `.param` file */
PMACC_CONST_VECTOR(float_X,1,IONIZATION_EFIELD,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do I do if I have two ion species in my simulation that can both be ionized?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(can be answered by opening an issue for that; feel free to address that in a follow up pull request)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep ... it would be possible but very inelegant to just add another differently named array of ionization energies and use them. Therefore let's think about it together in #771 .

5.14e11
);

} // namespace SI
} // namespace picongpu
35 changes: 35 additions & 0 deletions src/picongpu/include/particles/manipulators/SetAttributeImpl.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Copyright 2015 Marco Garten
*
* 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 <http://www.gnu.org/licenses/>.
*/

#pragma once

namespace picongpu
{
namespace particles
{
namespace manipulators
{

template<typename T_ParamClass, typename T_ValueFunctor, typename T_SpeciesType = bmpl::_1>
struct SetAttributeImpl;

} //namespace manipulators
} //namespace particles
} //namespace picongpu
67 changes: 67 additions & 0 deletions src/picongpu/include/particles/manipulators/SetAttributeImpl.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/**
* Copyright 2015 Marco Garten
*
* 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 <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "simulation_defines.hpp"


namespace picongpu
{
namespace particles
{
namespace manipulators
{

template<typename T_ParamClass, typename T_ValueFunctor, typename T_SpeciesType>
struct SetAttributeImpl : private T_ValueFunctor
{
typedef T_ParamClass ParamClass;
typedef T_SpeciesType SpeciesType;
typedef typename MakeIdentifier<SpeciesType>::type SpeciesName;

typedef T_ValueFunctor ValueFunctor;

HINLINE SetAttributeImpl(uint32_t currentStep)
{

}

template<typename T_Particle>
DINLINE void operator()(const DataSpace<simDim>& localCellIdx, T_Particle& particle, const bool isParticle)
{
typedef typename SpeciesType::FrameType FrameType;

if (isParticle)
{
/** Number of bound electrons at initial state of the neutral atom */
const float_X protonNumber = GetAtomicNumbers<T_Particle>::type::numberOfProtons;

/* in this case: 'assign' the number of protons to the number of bound electrons
* \see particleConfig.param for the ValueFunctor */
ValueFunctor::operator()(particle[boundElectrons_], protonNumber);
}
}

};

} //namespace manipulators
} //namespace particles
} //namespace picongpu
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@
#include "particles/manipulators/IfRelativeGlobalPositionImpl.def"
#include "particles/manipulators/CreateParticlesFromParticleImpl.def"
#include "particles/manipulators/FreeImpl.def"
#include "particles/manipulators/SetAttributeImpl.def"
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@
#include "particles/manipulators/IfRelativeGlobalPositionImpl.hpp"
#include "particles/manipulators/CreateParticlesFromParticleImpl.hpp"
#include "particles/manipulators/FreeImpl.hpp"
#include "particles/manipulators/SetAttributeImpl.hpp"