Re: different particles

From: Daniel Pfenniger <Daniel.Pfenniger_at_unige.ch>
Date: Wed, 27 May 2009 12:09:44 +0200

Hi,

Note that varying softening during a run breaks conservation of energy,
a sever change in the physics. A softened particle can be seen as
a distributed mass producing the softened potential. Changing the
softening radius amounts to displace spherically the mass, which
changes the binding energy of the whole system.

        Dan


Sander Valcke wrote:
>
> Hi all,
>
> I don't know if it would be possible to just add a softening variable to
> the P struct in this case: allvars.h (523):
>
> #ifdef ADAPTIVE_GRAVSOFT
> FLOAT Softening;
> #endif
>
> I'm not very familiar with the gravity code but it seems that setting
> UNEQUALSOFTENINGS and ADAPTIVE_GRAVSOFT_FORGAS allows varying softening
> lengths when some code is modified to extend this beyond the sph particles.
>
> the following code is found in forcetree.c (line 585):
>
> if(All.ForceSoftening[pa->Type] > maxsoft)
> maxsoft = All.ForceSoftening[pa->Type];
>
> if this would be encapsulated in an extra ADAPTIVE_GRAVSOFT flag:
>
> #ifndef ADAPTIVE_GRAVSOFT
> <insert code above>
> #else
> if (pa->Softening > maxsoft)
> maxsoft = pa->Softening;
> #endif
>
> (or something similar and more general)
>
> a similar change in potential.c lines 108/109, gravtree.c lines 132/133,
> forcetree.c lines 585/586, 1158/1159, 1174/1175, 1230/1244, 1455/1456,
> 1514/1528, 2070/2071, 2140/2154, 2334/2335, 2416/2430 (note: the
> two-line pieces of code are identical, as are the 15 line pieces),
> timestep.c around 477. Basically at every place where
> ADAPTIVE_GRAVSOFT_FORGAS is found.
>
> Then there would just need to be 2 more small additions, for reading and
> writing the softening length from and to snapshots in the case
> ADAPTIVE_GRAVSOFT is set.
>
> Anyway that's what I make of it : )
>
> kind regards,
>
> Sander
>
> Yves Revaz wrote:
>> Hi Florian,
>>
>> One possibility could be simply to extend the number of type to a value
>> higher than 6.
>> Unfortunately in the code the number of type is not coded by a constant
>> but by
>> the number 6, so you will have to change this value in a lot of places
>> in the code :-( .
>>
>> Then of course, you will have to add new parameters in the gadget param
>> file,
>> corresponding to the new types (and read them correctly in begrun.c and
>> set_softenings in gravtree.c).
>>
>> SofteningGas
>> SofteningHalo
>> SofteningDisk
>> SofteningBulge
>> SofteningStars
>> SofteningBndry
>> SofteningXxxx
>> etc...
>>
>> SofteningGasMaxPhys
>> SofteningHaloMaxPhys
>> SofteningDiskMaxPhys
>> SofteningBulgeMaxPhys
>> SofteningStarsMaxPhys
>> SofteningBndryMaxPhys
>> SofteningXxxxMaxPhys
>> etc...
>>
>>
>> Be also carefull to the way the snapshot header will be written, as
>> npart (and npartTotal)
>> will have a larger size.
>>
>> I hope it will help,
>>
>> yves
>>
>>
>>
>>
>> Florian Beutler wrote:
>>
>>> hello
>>> I am working with a DM halo containing particles with different mass
>>> (shell model). I would like to have different softening values for
>>> particles with different mass. The softening value is connected to
>>> the particle type therefore I am using particle types 1-5 for halo
>>> particles (I think these particle types are all collisionless and I
>>> can use them all as halo type particles... or am I wrong?). Is there
>>> any possibility to extend the particle types to more then 5?
>>> thanks and regards
>>> Florian Beutler
>>>
>>
>>
>>
>
Received on 2009-05-27 12:09:19

This archive was generated by hypermail 2.3.0 : 2022-09-01 14:03:42 CEST