radiation is one of the fundamental constituents of our universe .its interaction with baryons may lead to an energy exchange that can both heat and cool the matter , initiating pressure forces that may strongly influence the subsequent hydrodynamical evolution .radiation may also exert a direct pressure force upon the matter through the exchange of momentum .radiative interactions are furthermore often the dominating process in governing the excitation and ionization state of atoms and molecules .the inclusion of the transport of radiation into hydrodynamical simulations may therefore provide the key for interpreting the outcome of physical experiments and observational campaigns .  to perform hydrodynamical simulations ,the lagrangian technique smoothed particle hydrodynamics ( sph ; ; ) is often employed . in sph , the continuum fluid is discretized using a finite set of point particles , each carrying its own collection of variables .the deformation of the fluid by internal and external processes manifests itself in a steady redistribution of the point particles in space .all it takes to determine the values of physical field variables at a given point in the simulation box is to perform a weighted average over the values the relevant variables take on the particles in its surrounding .this elegant simplicity of the sph technique is one of the many reasons for its success .  although the first radiative transfer calculation was already included in sph at the very birth of this numerical technique more than thirty years ago ( ) , the detailed treatment of radiation transport in sph is still an enormous challenge .one of the main reasons for this is certainly the high dimensionality of the problem .in fact , the radiative transfer equation depends on no less than seven variables ( three space coordinates , two angles , frequency and time ) .moreover , existing numerical schemes to solve the radiative transfer equation have most often only been formulated for use with uniform grids . despite these difficulties , there has been encouraging progress over the last years , with several interesting and rather different approaches ( see section [ sec : rt ] ) . in this paperwe present a new method to solve the radiative transfer equation in sph .we specifically designed our method for use in hydrodynamical simulations exhibiting a wide dynamic range in physical length scales and containing a large number of light sources .a prominent example for such simulations are cosmological simulations of large - scale structure formation . performing cosmological simulationsis an exceedingly demanding computational task .difficulties in describing the growth of the initially tiny matter density perturbations produced before and during the event of recombination and their metamorphosis into the rich structure observable today do not only arise because of our ignorance of how to properly model the governing physical processes. often , it is simply the lack of computational power which prevents us from faithfully representing the basic actions involved : cosmological simulations are both time consuming and memory exhaustive . to overcome these computational challenges, one can make use of advanced techniques and resort to clever approximations , reducing the computational effort .consider the wide range of scales encountered in cosmological hydrodynamical simulations . according to the hierarchical model of structure formation , the first structures and building blocks of the evolving universeare expected to form at small scales .the non - linear evolution at these scales shapes the distribution of the matter at all times , thus necessitating simulations of high spatial resolution . on the other hand, we also require sufficiently large simulation boxes in order to properly account for the modulation of the small - scale nonlinear evolution by the large - scale structure formation processes ( e.g.  ) and not to be deceived by the cosmic scatter .  to accommodate these two antithetic demands while keeping the number of particles representing the matter low enough to be computationally manageable ,_ spatially adaptive _ sph simulations have been invoked .it is then immediately clear that when solving the transport of radiation along with the gravito - hydrodynamics of the matter , one requires the radiative transfer scheme to be adaptive , too .even spatially adaptive cosmological sph simulations , however , make use of hundreds of millions of particles and are therefore still extremely memory - consuming .it is then indispensable to distribute the computational load over a large number of machines .for this reason , we require a radiative transfer scheme that is _ parallel on distributed memory_ machines .when performing radiative transfer simulations , sources of light are assigned a special importance . as a result ,the computation time of most of the available radiative transfer schemes scales linearly with the number of sources in the simulation box . however , in cosmological simulations , even at times as early as 1 billion years after the big bang , i.e. at a redshift of , a non - negligible amount ( per cent ) of baryonic matter has undergone star formation .in addition to these stellar sources of light , the intergalactic gas emits photons too , producing a radiation component often referred to as diffuse radiation .hence , without _ breaking the linear scaling _ with the number of light sources , radiative transfer simulations at the resolution of state - of - the - art cosmological hydrodynamic simulations need to be dispatched to the realm of the future .in this paper we present a radiative transfer scheme for use in sph simulations that is adaptive , parallel on distributed memory and that avoids the linear scaling of the computation time with the number of sources , making it ideal for application in large simulations covering a wide range of length scales and containing many sources . in our schemewe follow the propagation of individual photon packets .hence , it is _ explicitly photon - conserving _ ( ) and can be applied to solve the _ time - dependent _ radiative transfer equation . because the photon packets are traced in cones , we refer to our scheme as traphic - transport of photons in cones .the introduction of cones is required in order to perform the transport of photon packets directly on the unstructured grid defined by the sph particles .although we have designed our radiative transfer scheme to be readily coupled to the hydrodynamic evolution of the matter in sph simulations , here we limit ourselves to the description and testing of the radiative transfer scheme itself .we will report on fully coupled radiation - hydrodynamics sph simulations employing traphic in future work .the outline for the rest of this paper is as follows .we start with a brief review of the principles of sph that we consider crucial for the understanding of the present work . in section[ sec : rt ] we then recall the radiative transfer equation and place our radiative transfer method in context by reviewing the approaches that have been used to solve the radiative transfer problem in sph so far . in section [ sec : method ]we give a detailed description of the ideas behind our method . throughout we will emphasize how we satisfy the requirements set by our primary aim of performing radiative transfer in simulations exhibiting a wide range in length scales and a large number of light sources . thereafter , in section [ sec : application ] , we apply our method to the transport of hydrogen - ionizing radiation , describe its numerical implementation in the parallel state - of - the - art sph code gadget-2 and report its behaviour in test problems .finally , we summarise our approach and conclude with an outlook .excellent reviews of sph exist ( see e.g.  ; ; ) . here, we just briefly outline the basic principles we consider critical for the understanding of our radiative transfer method .  at the basis of sphlies the representation of a field by its integral interpolant , where the smoothing length determines the spatial resolution .the interpolation kernel satisfies where is the dirac delta function , such that coincides with in the limit .the last two conditions do not fix the functional form for .an often adopted choice is the spherically symmetric compact spline where . from here on , when referring to the interpolation kernel , we assume that it is of this form .the discrete representation of a fluid by sph particles is achieved by approximating the integral interpolant ( eq . [ eq : sph : integralinterpolant ] ) by the summation interpolant , where the summation is over the particles of mass and mass density . for a self - contained numerical treatment, any field needs to be discretized only at the positions of the particles representing the fluid , since the kernel is compact , only local information needs to be accessed for the evaluation of the last sum , which can be carried out in a computationally efficient manner in parallel on distributed memory machines .  for the interpretation of eq . [eq : sph : sum ] , two main approaches can be taken , depending on the choice for ( ) . in the scattering approach each particle is considered as a cloud of radius and contributes to the field at the position of particle with the weight . in the gathering approach , each particle searches the sphere of radius ( in the following referred to as the sphere of influence , or _ neighbourhood _ ) for particles ( its _ neighbours _ ) and obtains an estimate of the field value at its position by summing the field values at the positions of the neighbours , each weighted by .the two interpretations are identical only if the spatial resolution is fixed throughout the fluid , i.e. if .however , the sph formalism only unfolds its true strength by allowing the resolution to vary in space , according to the local density field .this is usually achieved by either directly fixing the number of neighbours for all particles , or by requiring that the kernel volume contains a constant mass ( ) .before describing traphic , our method to solve the radiative transfer equation in sph , we briefly recall the radiative transfer equation and give a short overview of the main numerical methods that have been employed so far to obtain its solution in sph simulations .  the classical equation of radiative transfer reads ( see e.g. ) in eq .[ eq : rte ] , is the monochromatic intensity ( units ) of frequency at position , is a unit vector along the direction of light propagation and is the speed of light .sources and sinks of radiation are described by the emissivity ( units ) and the mass absorption coefficient ( units ) , respectively . in general , both and are functions of and time .if we define the photon number density such that is the number of photons per unit volume with frequencies travelling with velocity into a solid angle around , the intensity is given by , where is the planck constant .[ eq : rte ] is a partial differential equation depending on seven variables , which in general is hard to solve .different approximations have been employed to obtain its solution , giving rise to different numerical approaches .below we discuss the main approaches that have been taken so far to accomplish the transport of radiation in sph simulations .  in his study of optically thick proto - stars , modelled the transport of radiation as a diffusion process by including a corresponding term in the sph formulation of the energy equation. pointed out drawbacks of the particular formulation used in , and re - phrased the diffusion equation in sph such as to reduce its sensitivity to particle disorder .this new formulation of the diffusion equation was employed by to perform collapse simulations of centrally condensed clouds .treating the transport of radiation in the diffusion limit is , however , only a good approximation in optically thick media . in the optically thin regime ,infinite signal propagation speeds result , since the diffusion equation is a partial differential equation of parabolic type .this defect can be remedied by supplementing the diffusion equation with a so - called flux - limiter .sph simulations with flux - limited diffusion have been carried out by e.g. , , and , covering a wide range of physical applications , from supernovae explosions and proto - stellar collapse to the study of proto - planetary disks . the ( flux - limited ) diffusion approach to solve the radiative transfer equation fails in complex geometries . in particular , opaque obstacles illuminated by a point source do not cast sharp shadows , because the shadow region is filled in by the diffusion .  to solve the radiative transfer equation without being restricted to the optically thick regime or simple geometries , monte carlo techniques can be employed ( , , , ) . in monte carloradiative transfer , individual photon packets emitted by each source are directly followed as they pass through the matter , thus simulating the physical process of radiation transport as encountered in nature . while monte carlo simulations allow realistic shadows to be cast behind opaque obstacles , they are computationally very demanding , since the poisson noise inherent to the statistical description of the radiation field leads to a signal - to - noise ratio that grows only with the square - root of the number of photon packets emitted .ray - tracing schemes keep the advantages of monte carlo radiative transfer simulations , whilst not being affected by the statistical noise . in short , in ray - tracing schemes raysare cast from each source throughout the simulation box . the optical depth to each point in space is calculated along theses rays , and the attenuation of the flux emitted by the sources is obtained .variants of ray - tracing working with photons instead of fluxes blur the differences with monte - carlo schemes .ray - tracing schemes are most easily implemented on a regular grid superimposed on the sph density field . however, this implies that all information about substructure on scales smaller than the size of the grid cells is ignored . as a cure ,adaptive grids have been invoked ( e.g.  , ) . in sph ,_ grid - less _ ray - tracing has been introduced by to investigate the effects of ionizing uv radiation by massive stars on the surrounding interstellar medium . the strmgren volume method ( ,compare also ) and the ionization front tracking technique employed by are related approaches .another grid - less radiation tracing scheme that has been applied to sph simulations is presented in .inspired by the approach , describes a radiation - hydrodynamics scheme for the transport of ionizing radiation in cosmological simulations of structure formation .one major drawback most ray - tracing schemes share with the monte - carlo technique is that the computational effort to solve the radiative transfer equation scales linearly with the number of sources in the simulation box ( but see section [ sec : traphic : merging ] later on ) .for this reason , sph radiation - hydrodynamical simulations employing the ray - tracing approach have mostly been restricted to the study of problems involving only a few sources .  in the following sections we will describe traphic , a novel method to solve the radiative transfer equation in sph .traphic employs a photon tracing technique that works directly on the discrete set of irregularly distributed sph particles .it is designed to overcome the challenges set by our goal of carrying out large radiation - hydrodynamics sph simulations exhibiting a wide dynamic range in length scales and containing a large number of light sources .in this section we give a detailed description of traphic , our method to solve the radiative transfer equation in sph .we start the presentation of our radiative transfer scheme by sketching the main idea , in order to give an overview and to introduce the reader to the underlying concepts , which will be illustrated and explained in more detail in the subsequent sections .traphic can be applied to solve the radiative transfer equation in both two - dimensional and three - dimensional sph simulations . when illustrating concepts with schematic figures we will , however , restrict ourselves to two dimensions for the sake of clarity .although we ultimately aim at performing simulations in which the radiation transport is fully coupled to the hydrodynamics , here we assume that the sph density field is static and that the radiation does not exert any thermodynamic or hydrodynamic feedback on the matter .we will report on the coupling of radiation and hydrodynamics in future work .we solve the radiative transfer equation ( eq . [ eq : rte ] ) in finite steps , where is the current simulation time , by tracing photon packets radially away from their location of emission until a certain stopping criterion is fulfilled .we do not introduce a grid on which the photons are propagated .instead , we propagate the photons directly on the discrete set of particles in the simulation . for the transport of photonswe employ the same particle - to - neighbour communication scheme that is already used in the sph simulation to solve the equations of hydrodynamics .that is , we accomplish the global transport of photons by propagating them only locally , between a particle and its neighbours .we allow to be different from , the number of neighbours used during the sph calculations . in sph, determines the adaptive spatial resolution of the hydrodynamical simulation .similarly , in our scheme , sets the adaptive spatial resolution of the radiation transport .it is the first of two numerical parameters in our method ( see also the left - hand panel of fig .[ fig : emission ] ) .working directly on the set of sph particles , our scheme exploits the full spatial resolution of the hydrodynamical simulation .a further advantage of our approach is that the radiation transport is automatically parallel on distributed memory , as long as the sph simulation itself is parallel on distributed memory .this is in contrast to radiation - hydrodynamical schemes that employ individual communication schemes for the transport of radiation and the sph computations .our radiative transfer scheme can hence be coupled to the sph simulation without introducing any additional computational structures .the main challenge we face when performing radiation transport by propagating photons only from a particle to its neighbours is achieving a transport that is directed : photons travel along straight rays , while the spatial distribution of the sph particles is generally highly irregular . in the following we give an overview of the concepts employed in our scheme and describe how we overcome this and other challenges to accomplish the transport of radiation in sph simulations .we distinguish two types of particles present in sph simulations that are relevant for the transport of photons : _ star _ particles and sph , or _ gas _ , particles .only gas particles can interact with photons , via absorptions and scatterings .we assume , however , that both star and gas particles can be sources of photons and will therefore refer to them as source particles , or simply sources .the transport of radiation at simulation time over a single radiative transfer time step starts with the emission of photons by the source particles .subsequently , these photons are propagated downstream , radially away from the source , simultaneously for all sources . in our particle - to - neighbour transport scheme photonsare propagated from gas particle to gas particle . on their way, photons may interact with the matter field discretized by the gas particles .each gas particle can simultaneously receive photons , possibly emitted at different times , from multiple ( in principle all ) sources in the simulation .their further propagation would require a loop over all propagation directions .we explicitly avoid the resulting linear scaling of the computation effort with the total number of sources by introducing a source merging procedure .the distribution of photons amongst the neighbours of the source particles must respect the angular dependence of the source emissivity .we achieve this by introducing for each source a set of randomly oriented , tessellating _emission cones_(section [ section : emissionbysourceparticles ] ) , as illustrated in the middle panel of fig .[ fig : emission ] .the fraction of the total number of photons emitted into each cone is proportional to its solid angle .the emission direction ( which we will equivalently refer to as the propagation direction ) associated with each emitted photon packet is determined by the central axis of the emission cone .the number of cones used in the emission cone tessellation , , is the second numerical parameter in our method .it sets the angular resolution .the random orientation given to the cones ensures that photons are not restricted to propagate along a fixed number of directions and prevents artefacts introduced by the shape of the emission cones .some of the emission cones may not contain any neighbours , as is the case for the bottom - right cone of the tessellation shown in the middle panel of fig .[ fig : emission ] . to nevertheless emit photons into the corresponding directions , we create additional neighbours to which the photonscan then be transferred ( fig .[ fig : emission ] , right - hand panel ) .we refer to these neighbours as virtual particles ( vips ) , since they do not take part in the sph simulation .the properties of the vips are obtained from those of the neighbouring sph particles using sph interpolation .vips compensate for the lack of neighbours in certain solid angles around the emitting source .hence , by employing vips we introduce the freedom of choosing emission directions independently of the geometry of the sph particle distribution . as we will argue in section [ section : emissionbysourceparticles ] and investigate in more detail in appendix [ appendix : a ] , this freedom is a necessary requirement for achieving a desired angular dependence of the transport process , e.g. the isotropic emission of photons by star particles , in any particle - to - neighbour transport scheme .the photon packets distributed amongst the neighbours of the sources are further transferred downstream until they experience an interaction .in contrast to the emission of photons by source particles , gas particles distribute photons only amongst the subset of neighbours located in the downstream direction ( see fig . [fig : transmission ] ) .we distinguish this directed particle - to - neighbour transport from the emission process by referring to it as _ transmission _ ( section [ section : transmission ] ) . in more detail , each gas particle transmits photons downstream by distributing photon packets amongst the subset of neighbours located in certain regular cones only .these so - called transmission cones are centred on the emission ( propagation ) direction associated with each photon packet and have an opening angle determined by the angular resolution , i.e. by .they confine the photon packets to the cone into which they were emitted by the corresponding source particle . as a result ,the photon packets are propagated radially away from the sources , in a manner that is independent of the geometry of the sph particle distribution . like emission cones, transmission cones might not contain any neighbours .again we employ vips to accomplish the photon transport into the corresponding directions .  by keeping the opening angle of the cones fixed , the solid angle subtended by a transmission cone as viewed from the original source decreases with the distance from the source . as a result, the photon transport becomes adaptive in angle , as in the ray - splitting technique employed in ray - tracing schemes ( e.g.  ) .we will demonstrate later on , when testing a numerical implementation of our scheme ( section [ section : test2 ] ) , that the use of implicitly adaptive transmission cones confining the photon propagation yields sharp shadows behind opaque obstacles .gas particles receive photon packets from other particles through the processes of emission and transmission described above .a given gas particle can simultaneously receive multiple photon packets , which may each be associated with a different emission direction .in fact , our assumption that all star and gas particles in the simulation box can be source particles would imply that the number of directions from which photon packets can be simultaneously received by a given gas particle would scale linearly with the total number of particles in the simulation . the computational effort to accomplish the subsequent photon transmission along the associated directionswould then also scale linearly with the total number of particles .since this consideration applies to the transmission of photons by any sph particle in the simulation , the total computational effort to solve the radiative transfer equation would scale no less than quadratically with the total number of sph particles .  to avoid this computationally expensive scaling, we introduce a source _ merging _ procedure ( cp .[ fig : merging ] , which will be explained in more detail in section [ sec : traphic : merging ] ) .we make use of the fact that source particles that are seen as close ( in angle ) to each other from a given gas particle can be approximated by , or merged into , a single point source .we average the emission directions associated with the photon packets received from sources in solid angle bins defined by a so - called reception cone tessellation which , except for a random rotation , is identical to the cone tessellation employed for the emission process .consequently , photon packets need to be transmitted into at most directions .we distinguish two types of interactions with the matter field sampled by gas particles and vips that photons may experience .absorption interactions change the number of photons contained in each packet .scattering interactions change the propagation direction ( and possibly the frequency ) of the photons in a packet .all interactions are taken into account in an explicitly photon - conserving manner .we give a detailed description of interactions in section [ sec : method : interaction ] .we now expand on the description of our radiative transfer scheme given above .we comment in detail on the main concepts underlying traphic , i.e. the emission of photons by source particles , the transmission of photons by gas particles and the source merging procedure . the description of how these concepts are employed to advance the solution of the radiative transfer equation in time is deferred to section [ sec : evolution ] .in this section we describe the emission of photons by source particles .star particles emit photons according to their intrinsic luminosity , which can for instance be obtained from population synthesis models .an example of the emission of photons by gas particles is the emission of recombination radiation by a recombining ion .let us consider the emission of photons by source particle , located at .we denote the number of photons emitted per unit time per unit frequency per unit solid angle around the unit direction vector by , or simply . with this notation ,the number of photons emitted per unit time at frequency is , and the total number of photons emitted per unit time is   source particle emits photons over the radiative transfer time step . in agreement with our particle - to - neighbour based transport approach, the emission process is modelled by distributing these photons amongst the nearest gas particles , residing in a sphere of radius centred on .this sphere is schematically depicted in the left - hand panel of fig .[ fig : emission ] .source particle distributes its photons amongst its neighbours with the help of a set of space - filling emission cones , defined as follows ( middle panel of fig . [ fig : emission ] ) .we tessellate the simulation box into cones of ( generally not identical ) solid angles , , with the apexes located at the position of particle .the number of neighbours in each cone is determined , taking values in the range .for what follows we consider the emission of photons for each frequency separately . to each neighbour in cone a photon packet of characteristic frequency is emitted .the packet contains a fraction ( ) of the total number of photons to be emitted per unit time at frequency , with where are weights attached to neighbour in cone . the first factor on the right - hand side of eq .[ eq : coneweights ] determines which fraction of the total number of photons is emitted into cone , whereas the second factor controls the fraction of photons that is transferred to neighbour , that is , it controls the distribution of photons amongst the particles within cone . herewe set , i.e. equal weights for all neighbours in a given cone .the number of cones used in the tessellation , the parameter , determines the angular resolution of the radiation transport .a cone tessellation may consist of cones with different solid angles . ] .we therefore define the angular resolution to be the size of the average solid angle , .  for each emission cone the central axis is defined , characterised by the unit vector pointing away from the source ( fig .[ fig : emission ] , middle panel ) .we refer to this vector as the emission direction associated to photon packets emitted into cone .when a photon packet is emitted to a neighbouring gas particle , the emission direction is transferred in addition to the number of photons it contains ( fig .[ fig : emission ] , right - hand panel ) .since the orientation of the emission cone tessellation is randomised by applying a random rotation . ] at each emission , there is no a priori limit on the values the emission directions can take .note that while we transfer the emission direction , we do not transfer the position of the source .photon packets are traced further downstream based on their emission direction only , as we will explain in section [ section : transmission ] .each photon packet has also an associated _ clock _ . at emission the clock timeis set to the time of the simulation , . in section [ sec : evolution ]we will see that the clock can be employed to propagate the photon packets at the speed of light .some cones may not contain any neighbouring gas particles .this is for instance the case for the bottom right cone in the middle panel of fig .[ fig : emission ] . for a fixed number of neighboursthese empty cones will occur more frequently if the angular resolution is higher ( i.e. if the solid angles of the cones are smaller ) .on the other hand , for a fixed angular resolution , empty cones will occur more frequently if the number of neighbours is smaller .spatial clustering of the neighbours also increases the probability of the occurrence of empty emission cones . in the absence of a neighbouringgas particle photons can not be transported along the emission direction of the empty cone .we therefore create a new neighbour , a so - called virtual particle ( vip ) , to which the photons are transferred .the vip is placed along the cone axis at a random distance from the source particle , such that the volume of the cone is uniformly sampled ( see the right - hand panel of fig .[ fig : emission ] ) .the properties of vips ( e.g. density ) are determined from their neighbouring gas particles using sph interpolation .vips are only employed for the transport of photons .we stress that vips are not used by the sph simulation .we emphasize that the introduction of cones is essential for accomplishing the emission process in our particle - to - neighbour transport scheme . to see this , consider the alternative of distributing the photons directly amongst the neighbours of gas particle .this amounts to setting and for in eq .[ eq : coneweights ] . without any reference system , the emission directions associated to the photon packetswould then be given by the unit vectors pointing from source to neighbour .in appendix [ appendix : a ] we show that in this case the net emission direction in general would correlate with the direction towards the centre of mass of the neighbours . as a result ,the emission process would depend on the clustering of the neighbours in space as set by the geometry of the sph simulation .the use of emission cones combined with vips gives us the freedom to choose emission directions independently of the spatial clustering of the neighbours .this allows us to model any angular dependence of the source emissivity , within the bounds of the chosen angular resolution .in summary , source particles transfer photon packets to their neighbouring gas particles using a set of randomly oriented , tessellating cones .each cone defines a direction of transport , i.e. the emission direction , associated with the packets .the random orientation applied to the cone tessellation ensures that photon packets are not transferred along a fixed set of directions only .virtual particles ( vips ) are placed in emission cones not containing any neighbours , to which the photon packets are then transferred to .the combination of emission cones and vips makes the radiation transport independent of the spatial distribution of the neighbours .      in the last section we described how a source particle distributes photon packets amongst the gas particles in its neighbourhood . for each packet we defined an emission direction , independently of the spatial distribution of the neighbouring gas particles by employing a randomly oriented set of emission cones . in this sectionwe describe how the packets are propagated through the simulation box along their emission directions , by employing directed particle - to - neighbour transport , a process which we refer to as transmission .consider a gas particle , which receives a photon packet . recall that the neighbours of particle are the nearest gas particles located in the sphere with radius , centred on particle ( fig .[ fig : transmission ] , left - hand panel ) .analogous to the case of emission , particle re - distributes the photons contained in the packet amongst its neighbours .in contrast to emission , photons are only distributed amongst the subset of neighbours located _ downstream_. these are the neighbours residing in a _ regular _cone centred on the direction of propagation of the packet ( see the middle panel of fig .[ fig : transmission ] ) .we refer to this cone as transmission cone .the apex of the transmission cone is located at the position of gas particle .the solid angle of the cone is set by the angular resolution , , and determines the apex angle through the standard relation we show this relation in fig . [fig : apex ] . by definition ,a neighbour with position is interior to the transmission cone with apex at the position of the transmitting particle if the inner angle between the transmission cone axis and the vector is less than .the received photon packet is split into packets , each of which is transferred to one of the downstream neighbours of particle .the number of photons contained in each packet is set by the weights , such that each neighbour receives a photon fraction of the parent photon packet , where the sum is over all downstream neighbours .here we assume , giving equal weight to each neighbour .if there are no downstream neighbours , i.e. if the transmission cone is empty , we simply create a neighbour as in the case of empty emission cones described in the previous section .that is , we place a virtual particle ( vip ) along the emission direction of the photon packet , a random ( in volume ) radial distance away from the transmitting gas particle .the properties of the vip are determined by sph interpolation from its neighbours , and the photon packet is transferred .each photon packet inherits the emission direction from its parent packet ( fig .[ fig : transmission ] , right - hand panel ) . after all packets have been transferred to the downstream neighbours, the transmission is finished .subsequently , the transmission procedure can be applied again .the transmission process thus generally splits each photon packet into multiple packets , propagating with the same emission direction . with each subsequent transmission individual photon packetsare confined to a smaller fraction of the solid angle traced out by the emission cone they were emitted into ( see fig .[ fig : transmission ] , middle panel ) .this is similar to the technique of ray splitting employed in ray - tracing codes .hence , in traphic the photon transport takes place adaptively in angle .  the transmission procedure specified above for gas particlesis also applied for vips .again , the transmission cone of the vip can either contain gas neighbours or be empty .if it is empty , the vip creates another vip , as in the case of transmission by gas particles . after the vip has performed the transmission , it is deleted .vips are therefore temporary constructs . for total number of vips in the simulation is proportional to , whereas for the total number of vips approaches zero .the main purpose of the transmission cones is to confine the downstream propagation of photons to the solid angles into which they were emitted by the source particles , which is the main challenge for schemes using particle - to - neighbour transport .just as emission cones were introduced to make the emission of photons by source particles independent of the geometry of the sph particle distribution , transmission cones are introduced to further propagate the photons downstream , independently of the geometry of the sph particle distribution . as a consequence, shadows will be thrown behind opaque obstacles , and their sharpness will be in agreement with the chosen angular resolution .in fact , as we will see in section [ section : test2 ] , the shadows are much sharper than implied by the formal angular resolution .the cones making up the emission tessellation will generally be irregular - in three dimensions there exists no tessellation of space with regular cones .the use of regular cones for the downstream propagation of photon packets emitted into a certain irregular emission cone is therefore an approximation . in principle , each photon packet could be transmitted into a cone having the shape of the emission cone it originates from . however , tracing photons within irregular cones is computationally more demanding .furthermore , in the next section we will see the necessity for combining multiple photon packets propagating along different directions into a single photon packet that propagates along a correspondingly averaged direction . since there is no unique way of defining the shape of a transmission cone associated with this average direction , we use a regular shape .      in the previous section we described the transmission ofa _ single _ photon packet arriving at a gas particle . in principle, each gas particle can simultaneously receive _ multiple _ photon packets , possibly emitted by different sources at different times , propagating along different emission directions , a situation which is depicted schematically in the left - hand panel of fig . [fig : merging ] . accomplishing the transmissionwould then require executing a loop over all received packets for each transmitting gas particle .clearly , for each gas particle this would imply a linear scaling of the computation effort with the number of packets that need to be transmitted , or in other words , with the total number of source particles present in the simulation .  in cosmological simulations of structure formation ,for instance , where a significant number of star particles can usually be found already at high redshift , the simultaneous reception of multiple photon packets will be the rule rather than the exception . even without taking into account the diffuse radiation of the intergalactic gas resulting from radiative de - excitations , recombinations and scatterings, a linear scaling with the number of sources would quickly turn the radiation transport into a computational task that would be too expensive to be carried out even with the most advanced supercomputer available today .a few radiation tracing schemes have attempted to tackle this scaling problem by replacing sources that are close to each other with a single point source ( e.g.  ; ; ) . herewe introduce a photon packet merging procedure that strictly limits the number of packets that need to be transmitted per particle to at most , without restricting the number of directions along which each individual packet can propagate .  for each gas particle receiving a photon packet we define a so - called reception cone tessellation , as shown in the middle panel of fig .[ fig : merging ] .a reception cone tessellation is a tessellating set of cones attached to a gas particle .it is identical to the set of cones employed for the emission of photons by source particles , but generally has a different orientation . as their name indicates , and in contrast to the emission cones , reception cones are used to collect photons .whenever a photon packet is transferred to gas particle , the packet is binned into one of the reception cones by examining into which reception cone its emission direction falls , after translation to the location of the gas particle .photon packets whose emission directions fall in one and the same cone are merged , leaving only a single packet for transmission ( fig .[ fig : merging ] , right - hand panel ) .the reception cone tessellation is given a random orientation to prevent artefacts .a merged photon packet created in cone is assigned the new , merged emission direction .this new emission direction is defined as the weighted average , where the sum is over all photon packets received in emission cone ( ) , and the weights are the number of photons per packet that are to be transmitted into direction to the downstream neighbours of particle ( fig .[ fig : merging ] , right - hand panel ) .similarly , the merged photon packet is associated a merged clock by averaging over the individual clock times in reception cone , i.e. .  as a result of the photon packet ( resp .source ) merging at most packets have to be transmitted per gas particle , fully consistent with the angular resolution of our transport scheme . the computation effort required to perform radiative transfer simulations with traphiccan therefore be readily controlled : in the most demanding situation , i.e. in the optically thin limit , when the whole box is filled with radiation , it merely scales with the product of spatial and angular resolution , , where is the total number of particles ( sph + stars ) .the merged photon packets are not associated with any existing source particle in the simulation .they should be thought of as emerging from an imaginary source , whose properties are implicitly defined by our merging prescription .the merged photon packets are traced further downstream , radially away from this imaginary source , into the merged emission direction , exactly as was described for non - merged emission directions in the previous section .photons are propagated radially away from each source until they interact with the matter represented by the sph particles .here we distinguish between absorptions and scattering interactions and describe how they are accounted for in traphic .we remind the reader that in this work we do not discuss the effect of interactions on the thermodynamical and hydrodynamical evolution of the sph particles .absorptions remove photons from the beam emitted by the source .this process is described in terms of the mass absorption coefficient . from the formal solution of the radiative transfer equationit can easily be seen ( e.g. ) that the fraction of photons of frequency that is absorbed while travelling along the straight line connecting the positions and is given by , where is the optical depth over the distance .  in traphic , absorptions are accounted for by removing the photon fraction from photon packets propagating between particle and its neighbouring particles . for the calculation of the optical depth between these two particleswe need to numerically evaluate the integral eq .[ method : opticaldepth ] .this is computationally expensive , since it involves the calculation of the density ( and the absorption coefficient ) at a large number of points along the photon path using the sph formulation .similar to the approach of , we therefore approximate the density field near a gas or virtual particle by the sph density evaluated at its position .since photon packets are propagated between particle , located at , and particle , located at , along their emission direction , i.e. in the direction of the unit vector , the distance they cover is generally not equal to the distance between the particles .instead , we set , i.e. , we employ the projection of the particle distance along the emission direction .this is a valid approximation far away from the source from which the photon packets originate , but it generally fails close to the source .therefore , we only employ the projected distance when propagating photons between a transmitting particle and its neighbours . on the other hand , when propagating photons from a source particle to its neighbours , we use the particle distance , i.e. we set , corresponding to radially outward propagation .  the distance is used to obtain the optical depth between particle and particle , .this approximation neglects the existence of any substructure between particle and its neighbouring particle .however , this does not result in a loss of information if the radius of the neighbourhood of particle is chosen such that ( resp . ) .the distance is furthermore used to advance the clock of each photon packet according to the rule by synchronising the clock with the simulation time , the clock can be employed to advance photon packets at the speed of light , as we discuss in sec .[ sec : evolution ] .we note in passing that the clock can also be used to implement the cosmological redshifting of photons .  the number of absorbed and transmitted photons is now calculated as follows . from the photon packet emitted or transmitted by particle to particle ,a fraction is absorbed by particle .the photon packet is subsequently transmitted by particle containing a fraction of the original number of photons . by construction, this procedure explicitly conserves photons , since photons absorbed by vips are distributed amongst all neighbours of the vip using ( photon - conserving ) sph interpolation .this is necessary , because vips are a temporary construct employed for the transport of photons ; permanent information is only stored at the particles in the sph simulation . for further reference, we denote the total number of photons impinging on and the total number of photons absorbed by particle over a single time step with and , resp .in contrast to absorptions , scatterings change the direction and possibly the frequency of the interacting photons .a scattering event can be thought of as an absorption event followed by an immediate re - emission .scatterings can hence be described by eq .[ eq : rte ] after adapting the absorption coefficient and the emissivity .the re - emission re - distributes the photons in angle ( and possibly frequency ) . for this reasonthe scattered photons are sometimes referred to as diffuse .adapting the emissivity for scatterings requires evaluating an integral over the intensity .therefore , scatterings turn the radiative transfer equation ( eq . [ eq : rte ] ) into an integro - differential equation .  in traphic, scatterings , that is the transport of diffuse photons , are modelled by a combination of absorption and re - emission events .photons to be scattered travelling between two particles are first removed from the photon packet as described in the last section . for a true absorption event, the photon energy would be lost to the thermal bath provided by the matter .in contrast , in case of scattering , a gas particle that absorbed photons re - emits them , closely following the description for source particles in section [ section : emissionbysourceparticles ] .in particular , we employ randomly oriented emission cones in combination with eq .[ eq : coneweights ] to re - emit the absorbed photons . since modelling the scattering process means following photons emitted earlier by a source , the clock of the photon packets that are to be re - emitted is not set to the simulation time , as was the case for the intrinsic emission of photons by source particles . instead, it is determined by the clock of the photon packets that are scattered and the details of the scattering interactions ( e.g. there could be a time delay between absorption and re - emission , or photons could have travelled a distance greater than the ( projected ) particle distance when inferring the properties of the scattering process from a sub - resolution model ) . if the scattering details are taken into account by correspondingly adjusting , eq .[ eq : clock ] can be employed to find the new clock time .note that it is crucial for the modelling of scatterings to employ a radiative transfer scheme which does not scale with the number of sources , since every gas particle will soon re - emit photons .traphic solves the radiative transfer equation ( eq . [ eq : rte ] ) in discrete time steps , the size of which depends on the details of the problem under study and has to be decided on a case by case basis .hence , we defer its discussion to the second part of this work , where we present an implementation of our method to solve specific problems . in this sectionwe briefly review the concepts described in the previous sections used to obtain the solution to the radiative transfer equation over a single time step before discussing how this solution is advanced in time .starting at simulation time , the size of the radiative transfer time step is determined .source particles emit photon packets to their neighbouring gas particles employing cones .the total number of photons contained in the packets is determined by the number of photons to be emitted per unit time in frequency bin and by the size of the time step . for each neighbouring gas particle the optical depth to the source particle is evaluated and the number of photons interacting with the matter on their way from the source particle is inferred .some photons may be absorbed , some may be scattered ; the remaining photons are left unimpeded for transmission .for the subsequent transmission of photons by the gas particles , photons associated to sources that are seen as close ( in angle ) to each other are merged , limiting the number of directions into which photons have to be transmitted to at most .next , for each transmitting and scattering gas particle the neighbours are found .photons to be transmitted are distributed amongst the subset of neighbours that are located downstream , as determined by the corresponding ( merged ) emission directions .photons to be scattered are distributed amongst all neighbours following the prescription in section [ sec : method : interaction ] .virtual particles ( vips ) , which are placed in cones that do not contain any neighbours , are deleted after having transmitted or scattered their photons .photons that were absorbed by a vip are distributed amongst the neighbours of the vip using ( photon - conserving ) sph interpolation .the cycle described in the previous paragraph repeats until a stopping criterion is satisfied .the form of the stopping criterion depends on whether one solves the time-_independent _ or the time-_dependent _ radiative transfer equation . when solving the time - independent radiative transfer equation , i.e. when neglecting the first term on the left hand side of eq .[ eq : rte ] , one formally assumes . accordingly , the stopping criterion becomes independent of the speed of light .the cycle can then for example be repeated until all photons have been absorbed or have left the simulation box . in contrast , when solving the time - dependent radiative transfer equation , the stopping criterion is directly tied to the speed of light : the cycle is repeated until all photons have propagated a distance .  to decide whether or not a photon packet has travelled over the distance , we employ its clock . for further illustrationit is convenient to explicitly follow the clock of a photon packet as it is propagated through the simulation box . upon emission ,the clock of the photon packet is initialized with the simulation time , as already mentioned in sec. [ section : emissionbysourceparticles ] .after the emission , when the photon packet has been transferred from the source to one of the neighbouring sph particles ( or to a vip ) , its clock is advanced according to eq .[ eq : clock ] .it is then checked whether the clock has reached or crossed the threshold value if not , the photon packet is transmitted further downstream . as before , its clock is advanced according to eq .[ eq : clock ] .the photon packet is repeatedly transmitted and its clock is advanced until it has reached or crossed the threshold value defined in eq .[ eq : propagationcondition ] . at this point ,the value displayed by its clock can in full generality be expressed as , with .the propagation error , , is typically larger than zero because the set of particles on which the photon packets are propagated is discrete , with the particle - to - neighbour distances generally not related to . employing eq .[ eq : propagationcondition ] to stop photon packets therefore results in the photon packets typically being propagated too far .due to the lagrangian nature of the sph simulation , is individual for each photon packet . if is the particle - to - neighbour distance corresponding to the emission or transmission event after which the photon packet was stopped , then .the propagation error is therefore strictly limited , , where the maximum is over all emitting and transmitting particles .note that becomes smaller with higher spatial resolution .once stopped , a photon packet is held ( and hence its clock stands still ) until the simulation time progresses to a value , at which point the packet is transmitted and its clock is advanced again .the clocks of photon packets are thus kept in synchronization with the current simulation time , which effectively matches their propagation speed to become the speed of light different from the speed of light ( cp . the reduced speed of light approximation suggested in ) , by simply making the replacement . ] .photon packets may be held over several radiative transfer time steps , as may be ( several times ) larger than .while the photon packet is held , its propagation error with respect to the current simulation time steadily decreases with each passing radiative transfer time step .since is fixed while is increasing in steps of , the current propagation error decreases according to , where indicates the number of radiative transfer time steps that have passed since the photon packet was stopped .immediately before the photon packet is propagated again , its propagation error is strictly limited by the size of the time step , .the photon packet is then propagated such as to again bring the clock into synchronization with the simulation time , as described above .when multiple photon packets are merged into a single packet , the clock of the merged packet is determined by the averaging procedure described in section [ sec : traphic : merging ] . as a result , photons may be propagated over distances that differ somewhat from the case without merging .we have seen above that , due to the synchronization of the photon packet propagation with the current simulation time , clocks display only values in the interval .the difference in the clocks of different photon packets and hence the photon propagation error introduced by the merging procedure can therefore be controlled to become arbitrarily small by increasing the temporal ( i.e. decreasing ) and spatial ( leading to smaller ) resolution .  after the stopping criterion ( time - independent or time - dependent ) has been fulfilled for all photon packets , the properties of gas particles are updated according to the radiative interactions that occurred .we emphasize that the properties of the gas particles ( e.g. the ionization state ) are therefore only updated at the end of each time step . within each timestep the order in which photon packets from different sources arrive at gas particles is therefore irrelevant .after updating the particle properties , the simulation time is advanced , .finally , the size of the next time step is determined and the radiation is transported as described above .  in summary , we have presented a radiative transfer scheme for use in sph simulations that works directly on the unstructured grid formed by the discrete set of irregularly distributed sph particles .traphic thus employs the full spatial resolution of the sph simulation .it achieves directed transport of radiation by adaptively tracing photon packets in cones .traphic can be used to solve both the time - independent and the time - dependent radiative transfer equation in an explicitly photon - conserving way .our scheme is by construction parallel on distributed memory machines if the sph simulation itself is parallel on distributed memory machines .furthermore , the computation time necessary to accomplish the radiation transport does not scale linearly with the number of sources .instead , it merely scales with the product of spatial and angular resolution , making our scheme suitable for simulations containing a large number of sources as well as for taking into account a diffuse radiation component .the radiative transfer equation describes the propagation of photons within a continuum medium . in our scheme , however , photons are propagated on the discrete set of sph particles , localised at irregular positions dictated by the sph simulation .consequently , numerical noise may arise from the discreteness and irregularity of the spatial distribution of sph particles and this could influence the numerical solution of the radiative transfer equation obtained with traphic .  to see how this _ particle noise _ can be reduced , it is helpful to employ a formal analogy ( e.g. ) between estimating the density in sph simulations and estimating a probability density from sample points : we can consider the positions of the sph particles as a random sample drawn from a probability density function proportional to the mass density .we can therefore monte carlo resample the density field without sacrificing its information content .periodically assigning new positions to the sph particles during the radiation transport by resampling the density field should lead to a better representation of the continuum physics by the discrete set of sph particles and hence lead to a reduction of particle noise .  to employ the resampling , we think of particle at position in the simulation box as being de - localised within its sphere of influence of radius centred on and assume that the probability of finding it in the volume around a particular point in that sphere is given by the value of the interpolation kernel at that point ( cp .the scattering approach of section [ sec : sph ] ) .for the radiative transfer on a static set of particles with positions we then periodically monte carlo re - distribute the particles within their sphere of influence according to this probability .we note that while we change the positions of the sph particles , we keep all their other properties ( e.g. density ) fixed in order to avoid introducing scatter in the physical variables . we describe the numerical implementation of the resampling in appendix [ sec : resampling : implementation ] . in sections [ section :test1 ] and [ section : test2 ] we will demonstrate that the application of this recipe leads to a significant reduction of particle noise .we will , however , also see that for most applications the noise is small .we therefore do not employ the resampling technique in our simulations , unless explicitly stated .  since the resampling randomly offsets the sph particles from their positions provided by the hydrodynamical simulation , the apexes of the transmission cones attached to them are randomly offset , too .the resampling procedure may therefore lead to a slight diffusion of photons out of the emission cone they were emitted into , effectively decreasing the angular resolution .note that a similar diffusion of photons could occur when solving the radiative transfer equation coupled to the hydrodynamics ( on which we will report in a future publication ) , because of the physical particle motion .we will study this diffusion in our numerical implementation of traphic in section [ section : test2 ] .in this section we apply the radiative transfer scheme presented in section [ sec : method ] to the transport of ionizing radiation .ionizing radiation is thought to play a key role in determining the ionization state and shaping the spatial distribution of the baryonic matter in the universe on both small and large scales .examples include the triggering and quenching of star formation through radiative feedback from nearby ionizing stellar sources both in the early ( e.g.  ; ; ; ; ) and present - day universe ( e.g.  ; ) , the thin shell instability ( for a recent simulation see ) and the growth and percolation of ionized regions generated by the first stars and quasars during the so - called epoch of reionization ( for recent simulations see e.g. ; ; ; ) .  in the following we describe a numerical implementation of traphic , our radiative transfer scheme , specified for the transport of mono - chromatic hydrogen - ionizing radiation , in the state - of - the - art sph code gadget-2 ( ) .we start in section [ sec : photoionization ] with a short review of the photo - ionization process . in section[ sec : numericalimplementation ] we present the details of our numerical implementation , establishing the connection to the general description given in section [ sec : method ] .finally , in section [ sec : application : tests ] , we perform several radiative transfer simulations , comparing the performance of our numerical implementation of traphic in three different test problems to both analytic solutions and numerical simulations carried out with other radiative transfer codes as reported in the literature .   herewe briefly recall the principles of the photo - ionization and recombination process occurring for a hydrogen - only gas of mass density exposed to hydrogen - ionizing radiation .we will employ the equations derived in this section in the description of the numerical implementation of traphic .hydrogen - ionizing photons can be absorbed by neutral hydrogen .we approximate the frequency - dependence of the mass absorption coefficient for hydrogen - ionizing radiation ( e.g.  ) by with the neutral hydrogen number density , the lyman - limit frequency of energy , the absorption cross - section for photons at the lyman - limit , the mass of a hydrogen atom and the heaviside step function ; the ionized fraction is .the number of photo - ionizations per unit time per neutral hydrogen atom at a certain point in space is determined by the photo - ionization rate , where is the mean ionizing intensity .the rate of change of the neutral fraction at this point is then in the last equation , is the number of recombinations occurring per unit time per ionized hydrogen atom , is the recombination time - scale and is the photo - ionization time - scale .collisional ionizations can easily be taken into account by replacing with , where describes the number of collisional ionizations per unit time per neutral hydrogen atom . in this work, however , we assume that collisional ionizations are unimportant , setting throughout . ]  with the definition we can rewrite eq .[ photoionization : rateequation ] to read setting yields the the equilibrium ionized fraction . over time - scales that are shortcompared with and , eq .[ photoionization : rateequation : reformulation ] constitutes a first order linear homogeneous differential equation in with constant coefficients , whose solution reads from eq . [ photoionization : rateequation : reformulation : solution ] we see that the equilibrium ionized fraction is exponentially approached on the instantaneous ionization equilibrium time - scale .we will employ this time - scale later on for the numerical integration of the rate equation .we have adapted traphic for the transport of hydrogen - ionizing radiation according to the physics of photo - ionization presented in section [ sec : photoionization ] and implemented it using a single frequency bin in the parallel n - body - tree - sph code gadget-2 ( ) .the description of this implementation is the subject of this section .the transport of ionizing photons is performed in finite radiative transfer time steps of size , employing the absorption coefficient given by eqs .[ photoionzation : coefficient ] and [ photoionzation : cross - section ] .photon packets are transported in cones according to the description given in section [ sec : method ] . at the end of each radiative transfer time step ,i.e. at time , where is the current simulation time , we know the number of ionizing photons impinging on and the number of ionizing photons absorbed by particle over the time interval ( cp .section [ sec : method : interaction ] ) .the photo - ionization rate is obtained directly , that is without explicitly referring to the mean intensity , using , \label{eq : photoionizationrate}\ ] ] where is the hydrogen mass fraction and is the a posteriori optical depth and we use superscripts to indicate the time at which quantities are evaluated . in the next sectionwe describe how the photo - ionization rate is used to update the neutral fraction of particle .   in the simulation the neutral fraction associated with any gas particle assumed to be constant over the time step ( see section [ sec : evolution ] ) .the correspondingly discretized rate equation would read ( cp .eq . [ photoionization : rateequation ] ) , according to eq .[ photoionization : rateequation : reformulation : solution ] , however , the neutral fraction evolves on the time - scale during the photo - ionization process . in order to accurately follow the evolution of the neutral fraction using eq .[ eq : discreterateequation ] one would have to choose time steps limited by the ionization equilibrium time - scale , over which our assumption of a constant neutral fraction is a good approximation .  in our implementationwe choose the radiative transfer time step independently of the time - scale , which can be prohibitively small , by employing the following sub - cycling strategy at the end of each radiative transfer time step .we only assume that the flux of ionizing photons impinging on particle is constant over the time step , i.e. , in agreement with the temporal discretisation of the radiation transport in traphic .we then a posteriori follow the evolution of the neutral fraction in time on sub - cycles , our assumption of a constant ionizing flux implies that the photo - ionization rate ( see eq .[ eq : photoionizationrate ] ) .hence , a change in the neutral fraction implies a change in the photo - ionization rate , \frac{\eta_i^{t_r}}{\eta_i^{t_i } } , \label{subcycling : gamma}\ ] ] where and are the photo - ionization rate and the optical depth at the beginning of the sub - cycling , given by eqs .[ eq : photoionizationrate ] and [ eq : aposterioriopticaldepth ] , and .the number of ionizations occurring over is then , where the sum is over all sub - steps in .we set , where is a dimensionless factor .it can be demonstrated that for this choice of eq . [ photoionization : rateequation : discretization ] is a sufficiently good approximation to eq .[ photoionization : rateequation ] that the neutral fraction never violates the physical bound . because the neutral fraction changes during the sub - cycling , the number of ionizations can be less than the number of photons that have been removed due to absorptions during the radiation transport over the time step based on the assumption of a constant neutral fraction .we then explicitly conserve photons by adding photons to the photon transport in the next radiative transfer step .when either the photo - ionization rate or recombination rate is high , and hence will be very small ( dropping the particle index for simplicity ) .for the sub - cycling becomes computationally very expensive .we find , however , that photo - ionization equilibrium is typically reached after only a few sub - cycles .once photo - ionization equilibrium is reached , an explicit integration of the rate equation is no longer necessary . for a photon - conserving transportwe still require knowledge about the number of photo - ionizations and recombinations occuring during the equilibrium phase .both can , however , be obtained in a stroke , based on the number of photo - ionizations and recombinations occuring during the last sub - cycle step over which the rate equation was explicitly integrated .  the importance of properly following the evolution of the photo - ionization rate in the presence of an evolving neutral fraction in the optically thick eq .[ subcycling : gamma ] implies that the photo - ionization rate is constant , .] regime has been pointed out by . there , a time - averaged photo - ionization rate obtained from an iterative procedure was employed . the sub - cycling procedure ( eq . [ subcycling : gamma ] ) presented here has the advantage that it is well - motivated also in the presence of recombinations .we note that whenever one is only interested in obtaining the equilibrium neutral fraction , the detailed handling of the photo - ionization rate is rather unimportant .this is because ionization equilibrium implies that the number of photo - ionizations over the time interval exactly cancels the number of recombinations over that same time interval .this balance , however , has a unique ( and stable ; see eq .[ photoionization : rateequation : reformulation : solution ] ) solution for the neutral fraction .the equilibrium neutral fraction then also implies the correct photo - ionization rate , via eq .[ eq : photoionizationrate ] .when one is interested in following the details of the evolution of the neutral fraction towards photo - ionization equilibrium , on the other hand , the dependence of the photo - ionization rate on the neutral fraction needs to be taken into account , as presented above .our main consideration when choosing the size of the radiative transfer time step for the simulations we are presenting in this work , is that we wish to accurately reproduce the analytical and numerical reference results we are comparing with .these results include the time - dependence of the size of ionized regions around ionizing sources . at early times , just after the sources start to emit ionizing photons , the ionized regions expand quickly into the neutral hydrogen field surrounding the sources .to accurately reproduce this early phase of rapid growth , we necessarily have to employ time steps that are relatively small .the phase of rapid growth is , however , only of relatively short duration .the subsequent evolutionary stages of modest resp .slow growth , which account for most of the ( simulation ) time , are often more interesting .we show in section [ section : test1 ] that whenever we are not interested in the very early phase of rapid growth we can , thanks to the photon - conserving nature of traphic , choose substantially larger time steps without affecting the outcome of our simulations .  for all but one of the simulations we present in this work, we will be concerned with solving the time - independent radiative transfer equation . in these simulations , we choose to propagate photon packets downstream from their location of emission over only a single inter - particle distance per radiative transfer time step , unless stated otherwise .this approach is equivalent to solving the time - independent radiative transfer equation in the limit of small radiative transfer time steps , .we have explicitly checked for all our simulations that the time step was chosen sufficiently small to be in agreement with this limit .our treatment of the time - independent radiation transport reduces the computational effort for the simulation of problems for which the time - step has been fixed to a small value , e.g. by considerations like those presented in the beginning of this section . in the limit that radiation completely fills the simulation box , the computational effort required to solve the time - independent radiative transfer equation over the time interval by propagating photon packets only over a single inter - particle distance per radiative transfer time step is proportional to ( cp .section [ sec : traphic : merging ] ) .this has to be compared to the computational effort required to follow all photon packets over each time step until they leave the simulation box , which is proportional to .this is larger by a factor of , which for typical simulations reaches values of the order of .  in sec .[ sec : test3 ] we will present one simulation in which we solve the time - dependent radiative transfer equation . in this simulationwe will employ the photon clock ( section [ sec : evolution ] ) to accurately control the distance over which photon packets are propagated over each time step to match the light crossing distance . in this contextit is interesting to note that in the case of small time steps , i.e. , it is less expensive to solve the time - dependent than the time - independent radiative transfer equation .this is because the computational effort to solve the time - dependent equation ( again in the limit that radiation completely fills the simulation box and assuming that its boundaries are photon - absorbing ) scales as , which is smaller than the computational effort for obtaining the time - independent solution ( assuming that over each radiative transfer time step photon packets are transported until they leave the box ) by the factor , and assuming photon - absorbing boundaries , the computational effort for solving the time - dependent radiative transfer equation equals the computational effort for solving the time - independent radiative transfer equation .it exceeds the computational effort for solving the time - independent radiative transfer equation with photon packets propagating only a single inter - particle distance per radiative transfer time - step if . ] .   in our current implementationwe use only a single frequency .thus , we either assume that the ionizing radiation is mono - chromatic , or we assume ionizing radiation with a frequency spectrum and provide an effective multi - frequency description using only a single frequency bin ( for a textbook introduction to the numerical treatment of multi - frequency radiation , see e.g. ) .  for the latter case, we define a frequency - independent ( grey ) photo - ionization cross - section such that the total photo - ionization rate ( eq . [ photoionzation : rate ] ) is conserved , or , ^{-1}. \label{eq : photoionization : crosssection : grey}\ ] ]   in this section we report on the performance of our implementation in simple and well - defined test problems .the tests comprise the evolution of the ionized region around a single star in a homogeneous medium ( section [ section : test1 ] ) , the casting of a shadow behind an opaque obstacle ( section [ section : test2 ] ) and the propagation of ionization fronts driven by the ionizing radiation of multiple stars in an inhomogeneous density field obtained from a cosmological simulation ( section [ sec : test3 ] ) .we compare the results obtained with traphicwith analytic solutions , where available . for most physical settings ,however , no analytic solution to the radiative transfer problem is known , mainly due to the complex geometries involved .we have therefore designed the test problems in sections [ section : test1 ] and [ sec : test3 ] to closely follow the description given in the cosmological radiative transfer codes comparison project ( ) , which provides a set of very useful numerical reference solutions to compare with .  throughoutwe will assume that the density field is static . to facilitate a direct comparison with , we present results after mapping physical quantities defined on the sph particles to a regular grid , unless stated otherwise .this is done using a mass - conserving sph interpolation similar to the one described in .we opted for the sph interpolation since it is most consistent with the sph simulation we are employing . for comparison, we repeated our analysis using tsc mass - conserving interpolation ( ) but found no significant differences .for all tests reported in this section we employ the on - the - spot approximation ( e.g.  ) , in order to allow a direct comparison with . in the on - the - spot approximation diffuse photons emitted during recombinations to the hydrogen ground energy levelare assumed to be immediately re - absorbed by neutral hydrogen atoms close to the location of emission .the effect of diffuse recombination radiation can then be simply taken into account by setting the recombination coefficient to the so - called case b value , which for the temperature range of interest can be well approximated by we will report on the study of diffuse radiation in which we will be explicitly following the scattering of diffuse photons instead of employing the on - the - spot approximation in future work .  in their simulations , assumed that the speed of light is infinite , i.e. they solved the time - independent radiative transfer equation .for the comparison with these simulations we will therefore make the same assumption ( recall sec . [sec : timestep ] for the discussion of how we solve the time - independent radiative transfer equation ) . from now on ,when referring to the radiative transfer equation , we therefore assume it to be of the time - independent form , unless stated otherwise .we will repeat one of the simulations presented in sec .[ sec : test3 ] to solve the time - dependent radiative transfer equation by employing the photon packet clocks as described in sec .[ sec : evolution ] .+  in this section we consider the problem of a steady ionizing source emitting mono - chromatic photons of frequency per unit time , which is turned on in a static , initially neutral , uniform medium of constant hydrogen number density .the analytical solution to this problem is well - known ( for a textbook discussion see e.g.  ) . in equilibrium, the number of photons emitted by the source has to compensate the number of recombinations within the surrounding , stationary , ionized region , the so - called strmgren sphere . assuming that the strmgren sphere is fully ionized , i.e. , its radius is therefore given by the balance equation   the evolution of the spherical , fully ionized region towards the equilibrium strmgren sphere is described by the following equation for its radius , the ionization front , introducing the new variables and , where the strmgren time - scale is the recombination time in a fully ionized gas , we arrive at the differential equation the solution of which reads hence , the ionization front reaches the strmgren sphere after a few strmgren times and stays static thereafter .  in realitythe neutral fraction inside the ionized region is , however , not zero , but varies smoothly with the distance to the ionizing source .we therefore invoke the commonly employed definition of the ionization front as the radius at which the neutral fraction equals per cent , i.e. . the equilibrium neutral fraction can be obtained by solving the equation ( e.g. ) where the optical depth is given by we refer to the neutral fraction obtained by direct numerical integration of eq .[ eq : test1:eqneutralfraction1 ] as the exact neutral fraction profile and to as the exact ionized fraction profile .these profiles are shown as black solid curves in fig .[ test1:fig : neutralfraction1d ] .note that for our choice of parameters , . the ionization front obtained from the solution to eq .[ eq : test1:eqneutralfraction1 ] is thus at a slightly larger radius than the equilibrium ionization front obtained assuming the strmgren sphere is fully ionized ( eq . [ test1:if ] ) .the last observation indicates that the analytic solution given by eq .[ test1:if ] generally fails to provide an accurate reference solution that can be used to judge the validity of the numerical results obtained with a new radiative transfer scheme like traphic , due to its simplification of the problem .we therefore employ a one - dimensional , explicitly photon - conserving , grid - based radiative transfer scheme that we have implemented ourselves to obtain an accurate numerical reference solution .we will make use of this numerical reference solution in our comparisons below .  in the followingwe present a suite of radiative transfer simulations demonstrating that traphic is able to accurately follow the evolution of the ionization front around a single ionizing point source . for the setup of the numerical simulations we closely follow the description of test 1 presented in , the only difference being the spatial resolution we employ .this allows us to directly compare our results to the results presented in the code comparison project .in particular , we choose a number density and an ionizing luminosity of .the gas is assumed to have a constant temperature . with these values , and .we set up the initial conditions in a simulation box of length containing sph particles cells , with the ionizing source located in one of the corners of the box . ] .the ionizing source is located in the centre .the box boundary is photon - transmissive .we assign each sph particle a mass .the positions of the sph particles are chosen to be glass - like .glass - like initial conditions yield a more regular distribution of the particles within the box as compared to monte carlo sampling of the density field .the sph smoothing kernel is computed and the sph densities are found using the sph formalism implemented in gadget-2 , with .  we perform 5 simulations , increasing the angular resolution in factors of two from to .the number of neighbours employed for the transport of radiation is fixed to .hence all 5 simulations employ the same spatial resolution .the time step is set to in fig .[ fig : test1:if ] we show the evolution of the ionization front radius , which we determined by taking the average over the positions of all particles that have a neutral fraction .for all 5 simulations , the position of the ionization front never deviates more than per cent from the analytic solution , eq .[ test1:if ] , comparable to what has been found with other codes as reported in the cosmological radiative transfer code comparison project ( ) .note that the deviations from the analytic solution can mainly be attributed to the fact that the analytic approach provides only an approximate expression for the radius of the ionization front , because it erroneously assumes .in fact , all simulations ( except for the run , which shows a small deviation of less than two percent , the reason for which will become clear in our discussion below ) , nearly perfectly follow the numerical reference solution and approach the proper asymptotic limit .  the top row of fig .[ fig : test1:neutralfraction2d ] shows the neutral fraction in a slice through the centre of the simulation box at , which marks the end of the simulation , for each of the 5 simulations .as we already noted , the ionization front is at the expected position .as is true for all other surfaces of constant neutral fraction shown , the ionization front clearly exhibits the expected spherically symmetric shape , although it is noisy in some of the simulations .the amount of noise depends on the ratio of the angular and spatial resolution employed . for ( left - most panel in the top row ) ,the average number of neighbours per emission or transmission cone is high , and , as a result , numerical noise arising from the representation of the continuous density field with discrete sph particles are suppressed . with increasing angular resolutionthe average number of neighbours per cone decreases , and the contours become more noisy .the noise level reaches a maximum at ( middle panel in the top row ) . for higher angular resolutions ,the probability of finding no neighbours inside an emission or transmission cone becomes high and a large number of vips are created .the ratio of the number of vips to the number of sph particles enclosed by the ionization front for the simulation with angular resolution and is and , resp .the vips placed in empty cones regularize the neutral fraction of the ionized density field by distributing the photons they absorb amongst their sph neighbours using ( photon - conserving ) sph interpolation .  in the left - hand panel of fig .[ test1:fig : neutralfraction1d ] we plot the neutral and ionized fraction averaged in spherical shells as a function of distance to the star , for all 5 simulations .the grey bands indicate the neutral and ionized fraction profiles obtained with other codes as reported in the cosmological radiative transfer code comparison project ( ) . except for the run , for which the neutral contours were most noisy ( see fig .[ fig : test1:neutralfraction2d ] ) , all simulations agree very well with the results published in the comparison project . the deviations from the exact equilibrium neutral fraction profile , i.e. the result of the numerical integration of eq .[ eq : test1:eqneutralfraction1 ] , can be explained by the particle noise seen in fig .[ fig : test1:neutralfraction2d ] . due to the fuzzy structure exhibited by the neutral fraction contours , a range of neutral fractions can simultaneously be found within each spherical shell .the profiles obtained from the numerical simulation with traphic should therefore not be directly compared to the exact profile , i.e. the solution of eq .[ eq : test1:eqneutralfraction1 ] , but to the profile that results after locally averaging the exact profile along the radial direction .  to investigate the effect of particle noise on the neutral fraction profile we apply the resampling technique introduced in section [ sec : method : regularization ] .we perform a series of 5 simulations that are identical to the simulations presented above , except that every 10th radiative transfer time step the particle positions are randomly perturbed within their sph spheres of influence .the numerical implementation of the resampling is described in appendix [ sec : resampling : implementation ] .the densities are not recalculated after the positions have been changed due to the resampling , because this would generate fluctuations in the neutral hydrogen density which would increase the recombination rate and lead to a smaller strmgren sphere .the resulting neutral fraction profiles are shown in the right - hand panel of fig .[ test1:fig : neutralfraction1d ] .all profiles are now in close agreement with each other and with the exact result .the panels in the bottom row of fig .[ fig : test1:neutralfraction2d ] show the neutral fraction in a slice through the centre of the simulation box from the simulations with resampling .clearly , resampling strongly suppresses the particle noise visible in the panels in the top row of fig .[ fig : test1:neutralfraction2d ] , yielding nearly spherical neutral fraction contours .we now investigate the dependence of the equilibrium neutral and ionized fraction profile on the spatial resolution by varying , the number of particles employed in the simulation .because traphic is explicitly photon - conserving , we expect that the radiative transfer in a homogeneous medium is essentially independent of the spatial resolution ( see e.g. the discussion in ) , except for a trivial averaging. for each of the simulations with angular resolution and and presented above , we performed three additional simulations , at lower and higher ( ) spatial resolutions , but otherwise identical to the fiducial case .we will focus on the runs , but note that the and series shows the same behaviour .  the equilibrium neutral and ionized fraction profiles are shown in the left - hand panel of fig . [ test1:fig : neutralfraction1dres ] .for all spatial resolutions the ionization front is at nearly the same radius .it can furthermore be seen that when the spatial resolution is increased , the equilibrium neutral fraction follows the exact result more closely .the simulation employing the fiducial spatial resolution ( ) is almost converged .the differences in the neutral fraction profiles between the simulations using different numbers of particles are fully consistent with the corresponding spatial resolutions , as is demonstrated in the right - hand panel fig .[ test1:fig : neutralfraction1dres ] .there , we average the neutral fraction profiles obtained in the simulations employing and particles over the spatial resolution element of the lowest resolution simulation , the size of which is indicated by the vertical line .the averaged profiles match the neutral fraction profile obtained in the low spatial resolution simulation almost exactly .this shows that decreasing the spatial resolution does not introduce any artefacts .the solution obtained by traphic is the converged solution averaged over the adopted spatial resolution .finally , we show how the size of the time step affects the outcome of our simulations .we again concentrate on the simulation with angular resolution ( and , ) , noting that the simulations of higher angular resolution exhibit a similar behaviour . in fig .[ test1:fig : timestep ] we show the evolution of the ionization front for four different choices for the size of the radiative transfer time step , and .note that the simulation with is identical to the simulation discussed in fig .[ fig : test1:if ] . in order to keep the angular sampling the same , at each radiative transfer step we split the emission of photons over 10 , 100 and 1000 random orientations of the emission cone tessellation of the ionizing source for the simulations employing and , resp .photon packets that are emitted by the source in a certain orientation are transmitted further downstream and can propagate over multiple inter - particle distances .we follow each photon packet until it has either been absorbed or left the simulation box , to properly solve the time - independent radiative transfer equation for the large time steps under consideration .  from fig .[ test1:fig : timestep ] we see that the evolution of the ionization front for the simulations with time step and is delayed with respect to the evolution of the ionization front for the simulation with time step .this delay increases with the size of the time step , being barely visible for the simulation using .the delay arises because the neutral fraction is only updated at the end of each radiative transfer time step .photons that have been absorbed during the transport over a single time step but that have not been used to advance the neutral fraction during the subsequent sub - cycling of the rate equation are therefore only re - inserted in the transport process at the beginning of the next time step . ] , and are thus delayed . from fig . [ test1:fig : timestep ] it can , however , be seen that after a few time steps ( here ) , the ionization front catches up to agree with the ionization front obtained in the simulation using .we have convinced ourselves that from then on the neutral fraction profile around the ionizing source is also nearly identical to the profile obtained in the simulation with ( fig .[ test1:fig : neutralfraction1d ] ) .in summary , in this section we showed that traphic is able to reproduce the expected equilibrium neutral fraction around an ionizing source embedded in a homogeneous medium , as well as the dynamical evolution towards it .because the radiative transfer is explicitly photon - conserving , the spatial resolution only determines the scale over which the converged solution is averaged .we have furthermore seen that the performance of traphic is stable with respect to variations in the size of the time step .particle noise due to the discrete nature of sph simulations is small except for the choice of parameters .the noise can be successfully suppressed by applying the resampling technique of section [ sec : method : regularization ] , i.e. by periodically perturbing the positions of the sph particles within their spheres of influence .  in the next sectionwe employ a test with broken symmetry to demonstrate the ability of traphic to correctly produce shadows behind opaque obstacles and we study further how the choice of the parameters and affects the outcome of the numerical simulations .   in the absence of scattering interactions , photons propagate along straight lines into the direction set at the time of their emission .consequently , opaque obstacles throw sharply defined shadows . in this sectionwe are mainly interested in studying the properties of the shadow thrown by an opaque obstacle exposed to ionizing radiation from a single point source , as obtained with traphic . at the same time, we will extend the study of particle noise presented in section [ section : test1 ] to include other choices for the parameter .the geometry of our test problem closely follows the description of the shadow test in .we consider a source emitting , each of hydrogen - ionizing energy , residing in an initially neutral , static hydrogen - only field of constant number density and temperature . the strmgren radius ( eq . [ eq : stroemgrenradius ] ) corresponding to this set of parametersis and the strmgren time is . for the numerical simulationa star particle is placed in the centre of a box of size .the boundaries of the box are photon - transmissive .the density field is sampled using gas particles with mass at glass - like positions .the particle densities are found using the sph interpolation implemented in gadget-2 , with .we furthermore place an infinitely thin opaque disc perpendicular to the -axis at a distance of along the -axis from the star ( thick blue vertical lines in figs .[ test2:fig:1]-[test2:fig:2 ] ) .the and coordinates of the disc centre are identical to those coordinates of the star .photons that cross the disc are removed .we performed a series of radiative transfer simulations ( with time step ) , using different choices for the parameters , which sets the spatial resolution if the total number of sph particles is fixed , and , which sets the angular resolution .the results are shown in fig .[ test2:fig:1 ] - [ test2:fig:2 ] , displaying a slice through the simulation box at . in each panel ,the black dash - dotted line shows the expected position of the ionization front ( eq . [ test1:if ] ) at time , which marks the end of the simulation .the black solid lines emerging from the star at the centre of the slice show the boundaries of the shadow expected to be thrown by the opaque disc ( thick blue vertical line ) . in the top - left corner of each panelwe indicate the spatial resolution by a cross of length corresponding to the average diameter of the sphere containing neighbours .the angular resolution is indicated by the angle enclosed by the black dashed line and the upper shadow boundary , where is determined using eq .[ eq : apex ] .it indicates the _ maximum _ angle photons can theoretically diverge from the shadow boundary into the shadow region , given the chosen angular resolution .  the position of the ionization front ( the iso - surface for which the neutral fraction ) at time as obtained with traphic is shown by the red solid line . in all panels , that is for all spatial and angular resolutions , the ionization front is found at the proper position , in agreement with our findings of section [ section : test1 ] .the shadow thrown by the opaque disc is always sharp .we now discuss the dependence of the results on the chosen spatial and angular resolutions .  in fig .[ test2:fig:1 ] we show the ionization front obtained in simulations employing a fixed spatial resolution , , but varying angular resolution , ranging from in the left - most to in the right - most panel .the most prominent difference between the results of the different simulations is the noisiness of the contour tracing out the ionization front .the angular resolution study presented here is very similar to the one in the last section . for the lowest angular resolution , , the ionization front is very smooth due to the large number of neighbours within each emission and transmission cone. the noise increases with the angular resolution until it reaches a maximum for . for higher angular resolutions ,particle noise is efficiently suppressed due to the large number of vips that are placed in empty cones and that distribute the photons they absorb amongst their sph neighbours using ( photon - conserving ) sph interpolation .  from fig .[ test2:fig:1 ] it can furthermore be seen how the sharpness of the shadow thrown by the opaque disc depends on the angular resolution . for the lowest angular resolution ,the shadow is somewhat blurred , though not nearly as much as the angular resolution would imply . increasing the angular resolution yields slightly sharper shadows .however , if the angular resolution is increased beyond , the shadows become slightly less sharp .this is because the photons absorbed by vips are distributed amongst the neighbouring gas particles using sph interpolation and the interpolation procedure does not know about the shadow region .the slight diffusion of photons across the shadow boundary is in this case consistent with the spatial resolution .  in fig .[ test2:fig:3 ] we show the results of the simulations where we fixed the angular resolution to , but varied the spatial resolution by changing .the trends visible in fig .[ test2:fig:1 ] can also be observed here .the ionization front is most noisy and the shadow is sharpest for . for ,noise due to the discreteness of the particles employed for the transport of photons is suppressed by the large number of neighbours per cone , but the shadow is slightly blurred . the shadow becomes sharper for a smaller number of neighbours , since generally not all of the solid angle will be covered by the neighbours , an effect that becomes more important for smaller numbers of neighbours . for the ionization front becomes smoother due to the regularizing effect of the sph interpolation from vips , which also leads to a small diffusion of photons across the shadow boundary , consistent with the spatial resolution .  in figs .[ test2:fig:5 ] and [ test2:fig:6 ] we keep the ratio fixed at and , resp . in the first case there are on average neighbours per cone , whereas in the second case there is on average one neighbour in every second cone . from fig .[ test2:fig:5 ] it is clear that the shadow does get sharper when the angular resolution is increased , although the effect is small , since the shadow is always very sharp .because we keep the ratio fixed at , the number of vips employed in the simulation stays low for all angular resolutions and the shadows are not visibly diffused by the sph interpolation of absorbed photons from the vips .furthermore , the noisiness of the ionization front remains constant throughout the parameter range .this is because the noise is primarily set by the ratio if . in fig .[ test2:fig:6 ] , on the other hand , there is a substantial probability for creating a vip per cone . since the absolute number of vips present in the simulation increases with increasing angular resolution , the noise decreases with .  in the last section ( see bottom row of fig . [fig : test1:neutralfraction2d ] ) we employed a resampling technique to decrease the noise exhibited by the neutral fraction contours .recall from section [ section : transmission ] that the apexes of the transmission cones are attached to the positions of the sph particles .hence , resampling results in slight shifts in the position of each transmission cone apex , on the scale of the spatial resolution employed in the sph simulation .this shifting is expected to lead to a small diffusion of photons across the expected shadow boundary .as noted earlier in section [ sec : method : regularization ] , such a diffusion due to particle resp .apex motion will also occur in radiation - hydrodynamical simulations because of the movement of the sph particles .it is therefore interesting to study the properties of the shadow thrown by an opaque obstacle in the case of resampling .  in fig .[ test2:fig:2 ] we show the results of a simulation which employs the same parameters as used for the simulation presented in the middle panels of fig . [ test2:fig:1 ] and [ test2:fig:3 ] , but with an additional resampling of the hydrogen density field every 10th radiative transfer time step . as in the last section, the resampling is performed without changing the hydrogen density , since this would lead to an enhanced recombination rate .numerical noise is successfully suppressed by the random perturbations given to the positions of the sph particles .consequently , the ionization front appears significantly smoother .the degree of photon diffusion into the shadow region is small and does not significantly degrade the angular resolution of the radiative transfer .this is because the diffusion scale is set by the spatial resolution employed in the sph simulation .therefore , well - defined shadows will be thrown as long as the obstacle is spatially resolved .in summary , in this section we showed that traphic is able to produce a well - defined shadow behind an opaque obstacle , with the shadow sharpness in full agreement with the chosen spatial and angular resolutions .in fact , the shadows are much sharper than implied by the formal angular resolution , thanks to the angular adaptivity inherent to traphic . for a fixed angular resolution ,the shadows are sharpest for .they are slightly broadened by photon diffusion for both and , due to the increased coverage of the solid angles traced out by the transmission cones with sph particles for an increasing number of neighbours and the sph interpolation of the photons absorbed by vips , resp .we confirmed our finding of the last section that unless , noise due to the discreteness of the particles on which the transport of photons takes place is small , since it is suppressed by either the large number of neighbours per cone ( if ) or the large number of vips employed ( if ) .the resampling technique presented in section [ sec : method : regularization ] is very effective at suppressing particle noise .we have seen that resampling the density field does not severely degrade the angular resolution , even though it leads to a small shift of the cone apexes . as long as the opaque obstacleis spatially resolved by the sph simulation , a well - defined shadow will still be thrown .the ability to produce sharp shadows is one of the main requirements a radiative transfer code has to pass .the results of this section , together with the results of test 1 , which showed that traphic is able to reproduce the expected neutral fraction within a spherically symmetric hii region , indicate that traphiccan be used to perform the transport of ionizing photons in arbitrary complex geometries .this is the subject of test 3 , which we will describe next .   in this testwe study the propagation of ionization fronts around multiple sources in a static cosmological density field .the parameters of this test are taken from test 4 of the cosmological radiative transfer code comparison project ( ) .for reference we repeat the test description here .the initial conditions are provided by a snapshot ( at redshift ) from a cosmological n - body and gas - dynamical simulation performed using the cosmological ( uniform - mesh ) pm+tvd code of .the simulation box is on a side , uniformly divided into cells .the initial temperature is fixed at everywhere .the halos in the simulation box were found using a friends - of - friends halo finder with a linking length of .the ionizing sources are chosen to correspond to the 16 most massive halos in the box .we assume that these have a black - body spectrum with temperature .the ionizing photon production rate is assumed to be constant and assigned assuming that each source lives for and emits photons per atom during its lifetime .hence , the number of ionizing photons emitted per unit time is where is the total halo mass , , and .for simplicity , all sources are assumed to switch on at the same time .the boundary conditions are photon - transmissive. outputs are produced at and .with respect to the original test setup described above , we require three changes . first , since our code does not yet solve for the temperature of the gas , we assume a constant temperature of for the ionized gas .second , since our code currently treats only a single frequency ( bin ) , we assume the grey photo - ionization cross - section eq . [eq : photoionization : crosssection : grey ] , for which we find the third change concerns the input density field . since our code works directly on the set of particles used in sph simulations , we have to monte carlo sample the original input density field in order to place particles in the box .we replace every grid cell by sph particles ( randomly distributed within the volume of the grid cell ) , where is the mass of the cell and is the mass of an sph particle .if is not an integer , we draw a random number from a uniform distribution on the interval ( 0,1 ) and place an additional particle if this number is smaller than the difference between and the nearest lower integer .we use . since the monte carlo sampling only results in the approximate equality , we adjust the particle masses a posteriori to conserve mass , i.e. . after the particles have been placed , we calculate their densities using the sph formalism of gadget-2 , with .note that monte carlo sampling the density field with particles yields a smaller effective resolution than that of the grid input field in low density regions ( many grid cells will be left empty of particles ) , and to a spurious higher resolution in high density regions ( cells are sampled with many particles , even though there is no substructure on the scale of a single cell in the input field ) .note also that because the initial conditions were specified on a uniform grid , we do not benefit from the intrinsic spatial adaptivity of traphic , effectively wasting computational resources .+   +   +  we performed a set of three radiative transfer simulations with angular resolutions and , which we refer to as the low angular resolution , fiducial and high angular resolution simulations , resp .every simulation used neighbours .the time step was set to   in fig .[ test3:fig : contours ] we show in red the neutral fraction contours ( left - hand column ) and ( right - hand column ) at times ( top row ) and ( bottom row ) for the fiducial angular resolution .the ionization front ( neutral fraction ) is delayed by the dense filaments , leading to the characteristic `` butterfly '' shapes of the ionized regions . for comparison, we also show the results obtained with two other codes , the ray - tracing scheme c-ray( ; green contours ) and the monte carlo code crash ( ; ; blue contours ) , as published in the cosmological radiative transfer code comparison project ( )-ray and crash , we do not show the results obtained with ftte .we do not include the results of simplexin our comparison , since they differ considerably from those obtained with all other codes . ] .both c-ray and crashare mesh codes , working directly on the uniform mesh input density field provided by the pm+tvd code of .  the agreement between the results of traphic and c-ray resp .crash  is very good , not only for the ionization front , but also for smaller neutral fractions .the contours from traphic are slightly noisier than those from c-ray , which is expected since in addition to the particle noise affecting the radiative transfer , the monte - carlo sampling noise imprinted on the density field affects our simulations , particularly in the under - sampled low density regions , as already noted earlier .the noise level is , however , substantially lower than one would anticipate based on the tests presented in sections [ section : test1 ] and [ section : test2 ] .the most likely explanation for this welcome surprise is that the presence of multiple ionizing sources leads to a regularization in the distribution of the neutral fraction .numerical noise arising from the representation of the continuous density field by a discrete set of particles is therefore reduced .differences between our results and those of c-ray resp .crash also arise through the different treatment of the photon spectrum .since the photo - ionization cross - section depends on frequency ( eq . [ photoionzation : cross - section ] ) , the thickness of finite ionization fronts ( e.g. defined as ) and hence the position of the particular contour will in part be determined by the details of the numerical implementation of the multi - frequency transport .  in fig .[ test3:fig : contours : resolution ] we show the neutral fraction contours ( left - hand side ) and ( right - hand side ) at times ( top row ) and ( bottom row ) for the low ( green contours ) and the high ( blue contours ) angular resolution simulations . for comparison ,the contours obtained in the fiducial simulation are also shown ( red ) .we note that the high angular resolution simulation yields neutral fraction contours that are almost identical to those obtained in our fiducial simulation , indicating numerical convergence . the low angular resolution simulation , although still in good agreement with the high angular resolution simulation , fails to properly reproduce the expected neutral fraction contours when scrutinised in detail . in the low angular resolution simulation ,neutral fraction contours are often slightly advanced instead of delayed by the dense filaments .although the effect is small , it becomes apparent when the contours are compared to the corresponding contours of the high angular resolution simulation .the last observation agrees with the discussion of anisotropies in particle - to - neighbour transport schemes sketched in section [ section : emissionbysourceparticles ] and presented in detail in appendix [ appendix : a ] . in appendix[ appendix : a ] we demonstrate that when photons are transported from a given particle to its neighbours , the net transport direction is generally strongly correlated with the direction towards the centre of mass of the neighbouring particles . as a result , the transport is partly governed by the spatial distribution of the sph particles . for cosmological simulationsthis implies that photons are preferentially transported along dense filaments .traphic propagates photons in cones to overcome this problem .the cones confine the photons to the solid angles they were emitted into , ensuring a correct transport of radiation on the scale of the chosen angular resolution .if the angular resolution is chosen too low to properly resolve the structures in the sph density field , the transport is no longer independent of the geometry of the sph simulation and artefacts may occur , as we see in fig .[ test3:fig : contours : resolution ] for the low angular resolution simulation .even with an angular resolution as low as , however , the artefacts are small .nevertheless , it is clear that in order to properly solve the radiative transfer equation , the angular resolution must be chosen high enough to establish numerical convergence .[ test3:fig : contours : resolution ] shows that an angular resolution of , which corresponds to a relatively large opening angle of degrees ( eq . [ eq : apex ] ) , is already converged .the reason why a relatively poor formal angular resolution suffices , is , as already noted in the discussion of the sharpness of shadows thrown by opaque obstacles in section [ section : test2 ] , that the photon transport with traphic is intrinsically adaptive in angle .  in fig .[ test3:fig : contours : resampling ] we present results for a simulation that used the resampling technique presented in section [ sec : resampling : implementation ] , but which was otherwise identical to the fiducial simulation presented above .the neutral hydrogen densities of the sph particles were not re - calculated according to the perturbed positions resulting from the resampling , but kept constant to avoid additional scatter in the density .the resampling leads to a reduction in the particle noise , which is most apparent for the contours , since in case of the the noise is already low , as noted above .note that the resampling does not noticeable degrade the angular resolution .  in fig .[ test3:fig : average ] we show the evolution of the mean ( over all particles ) ionized fraction , both volume - weighted , i.e. , and mass - weighted , i.e. .again , the results obtained with traphicare in excellent agreement with the results obtained with c-ray and crash . for the latter two we obtained the mean ionized fraction by averaging the ionized fraction reported in the cosmological radiative transfer code comparison project ( ) over all grid cells , i.e. and .the ratio of mass - weighted and volume - weighted mean ionized fractions is at early times slightly larger for the low angular resolution simulation than for the high angular resolution simulation , as can be seen in the bottom panel of fig .[ test3:fig : average ] .this is another manifestation of the fact that particle - to - neighbour transport is generally not independent of the geometry of the sph simulation , resulting in photons being preferentially transported into high ( particle ) density regions .it once more underlines the importance of the concept of emission and transmission cones ( with sufficiently small solid angles ) which traphic uses to accomplish the transport of radiation independently of the spatial distribution of the sph particles .finally , we show that for the present radiative transfer problem simulations solving the time - dependent radiative transfer equation give a significantly different result than the simulations solving the time - independent radiative transfer equation discussed above .we carried out a simulation using and additionally employed the photon packet clocks to limit the distance over which photon packets can propagate during each time step .the size of the radiative transfer time step was set to .this time step is a factor 10 times larger than the time step used for solving the time - independent radiative transfer equation in the simulations presented above , which required a smaller time step because of our particular treatment of the time - independent radiative transfer equation ( see section [ sec : timestep ] ) .the locations of the ionization fronts ( i.e. ) obtained in this simulation are shown in fig .[ test3:fig : clock ] ( blue curves ) , together with those obtained in the corresponding simulation solving the time - independent radiative transfer equation ( red curves , cp .the left - hand panels of fig .[ test3:fig : contours ] ) , at four different simulation times and .it is clear from fig .[ test3:fig : clock ] that the simulation solving the time - independent radiative transfer equation produces ionized spheres that are unphysically large .this is due to the well - known fact ( see , e.g. , the discussion in ) that ionization fronts may propagate at speeds larger than the speed of light , if the time - independent radiative transfer equation is solved .the difference between the two simulations is larger at early times than at late times , which is expected , since in equilibrium , i.e. , the results of both simulations must agree .in summary , in this section we studied the propagation of ionization fronts around multiple sources in a static cosmological density field .we demonstrated the importance of the concept of cones which underlies the photon transport in traphic . without the confinement by transmission cones of sufficiently small solid angle, particle - to - neighbour transport is governed in part by the spatial distribution of the particles , resulting in the preferential transport of photons into high ( particle ) density regions .thanks to the fact that traphic is adaptive in angle , a relatively modest formal angular resolution of is already sufficient to obtain a converged solution .since the setup of our simulations followed the description of the corresponding test in the cosmological radiative transfer code comparison project ( ) , we were able to benchmark our radiative transfer scheme by comparing with the results obtained by the ray - tracing scheme c-ray ( ) and the monte carlo code crash ( ; ) .we found excellent agreement in the positions of neutral fraction contours as well as the mass and volume - weighted mean ionized fractions .we have furthermore seen that for the test problem presented in this section , simulations solving the time - independent radiative transfer equation lead to ionized regions that are unphysically large during their early evolution .this illustrates the importance of correctly accounting for the finite speed of light when performing radiative transfer simulations to study the morphology of ionized regions that are strongly out of equilibrium .in this paper we have presented traphic ( transport of photons in cones ) , a novel radiative transfer scheme for sph simulations .traphic has been designed for use in radiation - hydrodynamical simulations exhibiting a wide dynamic range of physical length scales and containing a large number of light sources , as for instance encountered in cosmological simulations .the requirements for this are high : due to the limits on the computational power available today , radiative transfer simulations at the resolution of state - of - the - art hydrodynamical simulations need to be adaptive both in space and in angle and parallel on distributed memory machines .traphic meets these requirements .the radiative transfer equation is solved by transporting photons in an explicitly photon - conserving manner directly on the discrete set of sph particles .photons are transported globally by propagating them locally , between a particle and its neighbours . for a fixed number of sph particles , the number of neighbours employed for the transport , the parameter , sets the adaptive spatial resolution .the conceptual similarity between the photon transport and the calculation of particle properties in sph simulations allows a straightforward numerical implementation of traphic in sph simulations for application on distributed memory machines .  in traphic photon packetsare transported inside cones .because source particles emit into a set of cones that tessellates the simulation box , the angular dependence of the emission can be modelled independently of the spatial distribution of the neighbouring sph particles .the number of cones , , is the second parameter employed in traphic and determines the formal angular resolution of the radiative transfer simulation .after their emission , the photon packets are transported downstream from sph particle to sph particle .they are confined to the solid angle they were originally emitted into by regular cones of solid angle . mimicking the ray - splitting technique used in ray - tracing schemes , the photon transport is adaptive in angle .the effective angular resolution is therefore much higher than the formal one .radiative transfer simulations employing traphic can thus be performed using only a relatively small number of cones without loss of accuracy .the propagation of photons inside cones that do not contain a neighbour requires the introduction of so - called virtual particles ( vips ) .it is the concept of cones combined with vips that enables the directed transport of photons on the unstructured grid defined by the discrete set of irregularly distributed sph particles .in addition to the number of cones and the number of sph neighbours , it is the ratio that directly influences the performance of traphic .it controls the amount of noise introduced by the representation of the underlying continuum physics with a discrete set of particles .this particle noise is small for both and due to the large number of neighbours per cone and the large number of vips , resp . for the choice of parameters the particle noise can be substantial .it can , however , be efficiently suppressed by employing a density field resampling strategy .a practical problem often encountered when solving the radiative transfer equation is the linear scaling of the computational effort with the number of sources .such a scaling limits the application of most of the existing radiative transfer schemes to simulations containing only a few sources . in traphic this problemis circumvented by introducing a source merging procedure .photon packets emitted by different sources are merged in accordance with the angular resolution employed , such that at any point in space at most photon packets need to be propagated .this renders the photon transport effectively independent of the number of sources in the simulation and makes it feasible to include a diffuse radiation component emitted by the sph particles . in the most extreme case of radiation from an arbitrary number of sources completely filling the simulation box ,the computational effort required by traphic merely scales as the product of spatial and angular resolution , , where is the total number of particles ( sph + stars ) .applications of traphic include the solution of both the time - independent and time - dependent radiative transfer equation in large - scale simulations of cosmological reionization .here we have specified traphic for the transport of mono - chromatic hydrogen - ionizing radiation and described its implementation in the parallel sph code gadget-2 ( ) .we showed that traphic is able to accurately reproduce the expected growth of the ionized sphere around a single point source in a homogeneous medium and to cast sharp shadows behind opaque obstacles .furthermore , we tested our scheme in a physical setting of complex geometry : the growth of ionized regions around multiple point sources in a cosmological density field .detailed comparisons with the results obtained by other codes ( ) for identical problems show excellent agreement .  in this paperwe have limited ourselves to the description of the radiative transfer scheme traphic and its implementation for use on static density fields .however , traphic can by design readily be coupled to the thermo- and hydrodynamic evolution of matter in sph simulations .we will report on such a coupling and its extension to the transport of multi - frequency radiation in future work .we thank claudio dalla vecchia for stimulating discussions , enduring encouragement as well as technical help and huub rttgering for his valuable advice .we are grateful to craig booth and benedetta ciardi for a thorough reading of the draft . a.h.p .thanks the university of potsdam and the max planck institut fr astrophysik for their hospitality .some of the simulations presented here were run on the cosmology machine at the institute for computational cosmology in durham as part of the virgo consortium research programme and on stella , the lofar bluegene / l system in groningen .this work was supported by marie curie excellence grant mext - ct-2004 - 014112 .  99  abel t. , norman m. l. , madau p. , 1999, apj , 523 , 66  abel t. , wandelt b. d. , 2002 , mnras , 330 , l53  alvarez m. a. , bromm v. , shapiro p. r. , 2006 , apj , 639 , 621  barkana r. , loeb a. , 2004 , apj , 609 , 474  brookshaw l. , 1994 , mmsai , 65 , 1033  cen r. , 2002 , apjs , 141 , 211  ciardi b. , ferrara a. , marri s. , raimondo g. , 2001 , mnras , 324 , 381  croft r. a. c. , altay g. , 2007 , arxiv , 709 , arxiv:0709.2362  dale j. e. , ercolano b. , clarke c. j. , 2007 , mnras , 1056  dale j. e. , bonnell i. a. , whitworth a. p. , 2007 ,mnras , 375 , 1291  dopita m. a. , sutherland r. s. , 2003 , astrophysics of the diffuse universe , springer  fryer c. l. , rockefeller g. , warren m. s. , 2006 , apj , 643 , 292  gingold r. a. , monaghan j. j. , 1977 , mnras , 181 , 375  gingold r. a. , monaghan j. j. , 1978 , mnras , 184 , 481  gingold r. a. , monaghan j. j. , 1982 , j. comput .phys . , 46 , 429  gnedin n. y. , abel t. , 2001 , newa , 6 , 437  goldstein h. , 1980 , classical mechanics , addison - wesley publ . co  gritschneder m. , naab t. , heitsch f. , burkert a. , 2007 , iaus , 237 , 246  herant m. , benz w. , hix w. r. , fryer c. l. , colgate s. a. , 1994 , apj , 435 , 339  hernquist l. , katz n. , 1989 , apjs , 70 , 419  hockney r. w. , eastwood j. w. , 1988 , computer simulations using particles , taylor & francis  iliev i. t. , mellema g. , pen u .-l . , merz h. , shapiro p. r. , alvarez m. a. , 2006 , mnras , 369 , 1625  iliev i. t. , et al . , 2006 , mnras , 371 , 1057  johnson j. l. , greif t. h. , bromm v. , 2007 , apj , 665 , 85  kessel - deynet o. , burkert a. , 2000 , mnras , 315 , 713  kohler k. , gnedin n. y. , hamilton a. j. s. , 2007 , apj , 657 , 15  lucy l. b. , 1977 , aj , 82 , 1013  maselli a. , ferrara a. , ciardi b. , 2003 , mnras , 345 , 379  mayer l. , lufkin g. , quinn t. , wadsley j. , 2007 , apj , 661 , l77  mellema g. , iliev i. t. , alvarez m. a. , shapiro p. r. , 2006 , newa , 11 , 374  mihalas d. , weibel mihalas b. , 1984 , foundations of radiation hydrodynamics , oxford university press , new york  miles r. e. , 1965 , biometrika , vol .3/4 , pp . 636  monaghan j. j. , 1992 , ara&a , 30 , 543  monaghan j. j. , rep . prog .phys . , 68 , 1703 ( 2005 )  okabe a. , boots b. , sugihara k. , chiu s. n. , 2000 , spatial tessellations , second edition , wiley  osterbrock d. e. , 1989 , astrophysics of gaseous nebulae and active galactic nuclei , palgrave macmillan  oxley s. , woolfson m. m. , 2003 , mnras , 343 , 900  paschos p. , norman m. l. , bordner j. o. , harkness r. , 2007 , arxiv , 711 , arxiv:0711.1904  press w. h. , teukolsky s. a. , vetterling w. t. , flannery b. p. , 1992, numerical recipes in c. the art of scientific computing , cambridge university press , 2nd ed .price d. , 2005 , astro , arxiv : astro - ph/0507472  razoumov a. o. , cardall c. y. , 2005 , mnras , 362 , 1413  razoumov a. o. , sommer - larsen j. , 2006 , apj , 651 , l89  ritzerveld j. , icke v. , 2006 , phrve , 74 , 026704  ryu d. , ostriker j. p. , kang h. , cen r. , 1993 , apj , 414 , 1  semelin b. , combes f. , baek s. , 2007 , arxiv , 707 , arxiv:0707.2483  soneira r. m. , peebles p. j. e. , 1978 , aj , 83 , 845  springel v. , hernquist l. , 2002 , mnras , 333 , 649  springel v. , 2005 , mnras , 364 , 1105  stamatellos d. , whitworth a. p. , 2005, a&a , 439 , 153  stewart g. w. , 1980 , siam journal on numerical analysis , vol .17 , no . 3 , 403  susa h. , 2006 , pasj , 58 , 445  susa h. , umemura m. , 2006 , apj , 645 , l93  trac h. , cen r. , 2006 , astro , arxiv : astro - ph/0612406  viau s. , bastien p. , cha s .- h . , 2006 , apj , 639 , 559  whalen d. , norman m. l. , 2007 , arxiv , 708 , arxiv:0708.2444  wise j. h. , abel t. , 2007 , arxiv , 710 , arxiv:0710.3160  white s. d. m. , 1996 , cosmology and large scale structure , proceedings of the `` les houches ecole dete de physique theorique '' ( les houches summer school ) , p. 349, elsevier scientific publishing company , amsterdam  whitehouse s. c. , bate m. r. , 2006 , mnras , 367 , 32  yoshida n. , oh s. p. , kitayama t. , hernquist l. , 2007 , apj , 663 , 687in section [ section : emissionbysourceparticles ] we introduced an emission cone tessellation to accomplish the emission of photons by a source particle to its neighboring gas particles .then we also mentioned that the cones are required to achieve an emission in agreement with the angular dependence of the emissivity of the source , independently of the spatial distribution of the neighbors . in this appendixwe explain why this is the case .in particular , assuming that particles have equal mass , we show that when transporting photons ( or more generally , any extensive quantity ) in particle simulations from a particle to its neighbors , the net transport direction is generally correlated with the direction towards the centre of mass of the neighbouring particles . as a result , the transport is partly governed by the geometry of the simulation , in addition to the intrinsic emissivity of the source .consider a particle located at the origin of a 3-dimensional coordinate system ( the emitter frame ) .the particle emits photons to its nearest neighbours , residing in the sphere of radius centred on the emitting particle . throughout this sectionwe assume that all particles have equal mass , .the emission is performed by transferring the fraction of the total number of photons to neighbour ( , where the are weights to be specified .the emission properties will depend both on the weights and on the spatial distribution of the neighbours .to study the angular dependence of the emission process , we introduce the vector sum over all unit vectors , where is the position of neighbour .this vector sum can be interpreted as the net direction of the emission .let us denote the angle enclosed by and the vector to the centre of mass of the neighbours , , with .we ask for the probability density function ( pdf ) of the cosine of , where   the meaning of the pdf can be understood by looking at its extremes . if is strongly peaked around , the emission has a net direction biased towards the centre of mass direction , and photons will be preferentially transported into the high ( particle ) density regions . on the other hand ,if is strongly peaked around , photons will be preferentially transported into the direction opposite to the centre of mass .finally , a flat pdf indicates that the net emission direction and the direction towards the centre of mass are uncorrelated .  as an illustration ,assume that all neighbours have identical weights and that their positions are drawn from a probability distribution that uniformly samples the surface of the sphere of radius surrounding the emitter at .to obtain , we note that our assumptions imply that the centre of mass vector and the vector sum point in the same direction , so that , where is the dirac  -function .hence , there is a perfect correlation between and .another example is given by assuming that the particles of unit mass are distributed randomly within the sphere of radius around the emitter .the resulting pdf as obtained through a monte carlo simulation is shown in its cumulative form in fig .[ appendix : a : photondistribution ] for two choices of the number of neighbours , ( thin dotted curve ) and ( thick dotted curve ; falling nearly on top of the thin dotted curve ) . clearly , there is a very strong correlation between the net direction of emission and the direction towards the centre of mass of the neighbour distribution .  for the important case of isotropic sources of photons the net emission directionshould not be correlated with the direction towards the centre of mass , i.e. , independent of , and thus . from hereon , we will refer to this case as isotropic emission of radiation .we emphasize the statistical character of this statement .an individual particle may still emit anisotropically , which could be revealed by studying the amplitude . for emission that is isotropic for individual particles , .consider the neighbour distribution of the last example , for which we showed the emission pattern to be far from isotropic .can the emission be isotropized by tuning the weights ?for instance , consider solid angle weighting , defined as follows .we project all neighbours radially onto the unit sphere . to each neighbourwe attach a weight proportional to its area of influence , which we define by the collection of all points on the unit sphere which are closer to the projected neighbour for which we calculate the weight than to all other projected neighbours .hereby , the distance of two points on the sphere is given by the arclength of the connecting geodesic ( great circle ) .this definition of the area of influence results in a specific tessellation of the surface of the sphere , the so - called voronoi tessellation ( e.g. ) , and provides us with well - defined non - overlapping solid angles .the resulting cumulative distribution is shown in fig .[ appendix : a : photondistribution ] ( dashed curves ) .although the weighted emission has weakened the correlation between and as compared to the case of equal weights , the net emission direction is still markedly peaked towards the direction to the centre of mass .we note that weighting by solid angle is the most natural choice and its inability to isotropize the transport might be surprising .alternatively , one could introduce _ ad hoc _ weights , where is some exponent and the are solid angle weights , to re - shape the distribution to become less and less peaked around .  however , the reason why the solid angle weights fail to isotropize the transport is not that the weights are inappropriate , but that the directions to the neighbours are fixed and thus can not be freely chosen along with the weights , as mentioned in section [ section : emissionbysourceparticles ] .this strongly limits one s ability to influence the shape of . for illustration , consider an emitter having all its neighbours located in one hemisphere .the net emission direction will then necessarily lie in that hemisphere , too , _regardless _ of the chosen weights .for a statistical ensemble of emitters , will then necessarily be correlated with the direction towards the centre of mass .this also explains the dependence of on the number of neighbours .the larger , the greater the probability of finding a neighbour in any chosen solid angle . through this increase in directional sampling, can be expected to approach the uncorrelated case .this behaviour can indeed be observed in fig .[ appendix : a : photondistribution ] .we also compute the statistic for the case of neighbours clustered in space , which is more typical for cosmological simulations of structure formation .we did this both using a toy clustering model ( ) and for a cosmological density field obtained from a hydrodynamical simulation ( the same field that is used in section [ sec : test3 ] ) . for the weighting schemes we investigatedthe dependence of the shape of on the chosen weights is qualitatively very similar to that in the case of the random distribution of neighbours discussed earlier .we emphasize that our discussion is not limited to the transport of photons . indeed , particle - to - neighbour transport is for example routinely employed in sph simulations of galaxy formation , where a star particle distributes its metals and energy amongst its neighbours. different recipes for distributing metals and energy can be found in the literature .most of these apply a weighting related to the sph formalism . as an example , to each neighbour we associate the weight here , is the radius of the neighbourhood of the emitting particle ( at ) , and is the spline kernel eq .[ eq : kernel : spline ] . performing the transport on the same random neighbour distribution as before ,we obtain the distribution . as can be seen in fig .[ appendix : a : photondistribution ] ( solid curves ) , the direction of net transport and the direction to the centre of mass are found to be almost uncorrelated .we note that this result , the reason of which at the moment is not clear to us , is only a statistical statement .we calculated and found that the emission of individual particles is still not close to isotropic .we arrive at qualitatively similar results for different definitions of the sph weights , both for random and clustered neighbour distributions . a more quantitative statement ,however , must depend on both the specific properties of the spatial distribution of the neighbours , and the precise form of the adopted sph weights .in summary , in this appendix we have shown that when transporting a quantity from a particle to its neighbours , the net transport direction is generally governed by the spatial distribution of the neighbours , in addition to the the intrinsic properties of the emitting particle .we emphasize that our observations apply to the particle - to - neighbour transport of arbitrary quantities in _ any _ particle simulation .we would like to remind the reader that in section [ sec : method ] we presented a specifically designed particle - based transport scheme , traphic , that overcomes the problems of particle - to - neighbour based transport discussed in this appendix , not just statistically , but also on a particle by particle basis .we achieved this by employing cones to confine photons to the solid angle into which they are emitted , making the transport independent of the geometry of the sph simulation , on the scale of the chosen angular resolution .in this section we describe the numerical implementation of the cones employed for the emission and reception of photon packets in traphic . for the emission ( section [ section : emissionbysourceparticles ] ), each source particle divides its neighbourhood using a set of tessellating emission cones .the same tessellation is also employed for the reception of photon packets by gas particles ( section [ sec : traphic : merging ] ) . in the following ,we employ spherical coordinates , which are related to the cartesian components of an arbitrary vector through in our implementation , the emission ( reception ) cones sample the volume around each particle isotropically .since the surface element of the unit sphere is given by , this is achieved by distributing the cone boundaries , but this implies asymmetric cones . ] uniformly ( i.e. on a regular lattice with indices ) in .thus , the boundaries of cone are described by the four arcs of constant correspondingly , we define the emission ( reception ) cone axes by note that each of the emission ( reception ) cones has the same solid angle , as can be seen from integrating over the surface element of the unit sphere within the boundaries ( eqs . [cones : boundaries:1]-[cones : boundaries:4 ] ) of a single cone .we also implemented the tessellation used in , which leads to cones that are more similar in shape .we could not find any systematic differences in the test problems described in sections [ section : test1 ] - [ sec : test3 ] using either of the two types of tessellations .this is not surprising because any artefacts due to the shape of the cones will be suppressed by the random rotations of the emission ( reception ) cones we perform before each emission ( reception ) , as we will describe in the following section .recall from sections [ section : transmission ] and [ sec : traphic : merging ] that we apply a random rotation to each cone tessellation .consequently , each cone tessellation has a random orientation .the primary motivation for randomly rotating cones is to increase the angular sampling .furthermore , randomly rotating the emission and reception cones leads to a reduction of artefacts arising from the particular definition we employ to construct the cone tessellation , as noted in the last section . herewe describe our numerical implementation of the random rotations .we can think of the set of cones that comprises a particular cone tessellation as a rigid body , to which we can attach a local cartesian coordinate system with axes .the orientation of this coordinate system with respect to the canonical cartesian coordinate system , e.g. the simulation box axes , is fully described by three variables , the eulerian angles ( e.g.  ) .eulerian angles are defined as the three successive angles of rotations that map the axes onto the axes . thereexist several conventions . in the convention we employ here ,the initial system of axes is first rotated counter - clockwise by an angle around the -axis , with the resulting coordinate system labelled .second , the coordinate system is rotated by an angle counter - clockwise about the -axis , leaving the new coordinate system . the third and last rotation is carried out counter - clockwise by an angle around the -axis , giving the desired coordinate system .  to obtain random eulerian angles, we note that the invariant measure ( the `` volume element '' ) on , the group of proper rotations in , in the eulerian angle parametrization reads ( e.g.  ) , random eulerian angles are therefore obtained by drawing random variables from a uniform distribution on the interval $ ] and applying the usual transformation ( cp . ) , we implement random rotations using rotation matrices , which are obtained from the random eulerian angles .the matrix elements of a matrix representing a rotation associated with a given set of eulerian angles can be readily calculated . for details , we refer the reader to .  in principle , random rotation matrices can be obtained without drawing random eulerian angles ( e.g.  ) .however , we find that it is faster to generate random eulerian angles , and then calculate the corresponding rotation matrices . moreover , storing the three eulerian angles instead of the nine rotation matrix elements reduces the memory cost .   for some of the simulations presented in sections [ section : test1 ] - [ sec : test3 ] we employ the resampling approach described in section [ sec : method : regularization ] to reduce numerical artefacts arising from the representation of the continuous density field with a discrete set of particles .the resampling requires the sampling of the sph kernel used in gadget-2 , which is the spline given by eq .[ eq : kernel : spline ] .we approximate this kernel by a gaussian , we find that with a standard deviation of , the gaussian provides a reasonable fit to the spline .a similar relation was employed in .when we resample the sph density field , all sph particles are redistributed by randomly displacing them from the positions given by the hydrodynamical simulation , with the probability to find a given particle displaced by the distance given by eq .[ kernel : gaussian ] .the ( rare ) displacements larger than are discarded ; in this case the original particle positions as determined by the hydrodynamical simulation are used .

Abstract: we present traphic , a novel radiative transfer scheme for smoothed particle hydrodynamics ( sph ) simulations . traphic is designed for use in simulations exhibiting a wide dynamic range in physical length scales and containing a large number of light sources . it is adaptive both in space and in angle and can be employed for application on distributed memory machines . the commonly encountered computationally expensive scaling with the number of light sources in the simulation is avoided by introducing a source merging procedure . the ( time - dependent ) radiative transfer equation is solved by tracing individual photon packets in an explicitly photon - conserving manner directly on the unstructured grid traced out by the set of sph particles . to accomplish directed transport of radiation despite the irregular spatial distribution of the sph particles , photons are guided inside cones . we present and test a parallel numerical implementation of traphic in the sph code gadget-2 , specified for the transport of mono - chromatic hydrogen - ionizing radiation . the results of the tests are in excellent agreement with both analytic solutions and results obtained with other state - of - the - art radiative transfer codes .   [ firstpage ]  methods : numerical radiative transfer hydrodynamics cosmology : large - scale structure of the universe hii regions diffuse radiation