Re: help on Gadget

From: Yves Revaz <yves.revaz_at_epfl.ch>
Date: Tue, 26 Jan 2010 09:31:22 +0100

Jianling Wang wrote:
> Dear Yves,
>
Hi Jianling,


> I am now using Gadget to simulate galaxy with gas and want to
> change the type of some particles from gas to other type, such as star.
> I knowed you have solved this problem from website:
> http://www.mpa-garching.mpg.de/gadget/gadget-list/0025.html
yes, indeed.
> So I followed your method.
>
> But there is always an error when I made a following change
> N_gas = N_gas -N_remove
> All.TotN_gas =All.TotN_gas - N_remove
>
> I even made simply test. I did nothing but just modified the gas number
> as following
>
> N_gas = N_gas -1 ;
> All.TotN_gas = All.TotN_gas - 1 ;
> All.NumForcesSinceLastDomainDecomp = 1 + All.TreeDomainUpdateFrequency
> * All.TotNumPart;
> TreeReconstructFlag=1;
> between
> every_timestep_stuff(); and domain_Decomposition();
> But there is still an error which result in stoping the code.
What it seem you forget here is to change the particle type (this is
really what makes the difference between gas and other particles).
When a particle moves from gas to stars its P[i].Type become 5 instead of 1.
In fact, this is not explicitly written in my point 1) of
http://www.mpa-garching.mpg.de/gadget/gadget-list/0025.html
but its what I mean when saying : "the routine that changes particle
types..."

Then you just have follow the other points and Volker's comment
(http://www.mpa-garching.mpg.de/gadget/gadget-list/0026.html).

I advise you to post your mails in the gadget list, as it may be helpful
for others.
(I did it for my reply)

Cheers,

yves

>
> I guess maybe the gas number is not changed simply like what I did.
>
> would you please give me some suggestions on how to decrease the gas
> number in Gadget ?
>
> Thank you in advance !
>
> Best wishes,
>
>
>
>


-- 
                                                 (o o)
--------------------------------------------oOO--(_)--OOo-------
  Dr. Yves Revaz
  Laboratory of Astrophysics EPFL
  Observatoire de Sauverny     Tel : ++ 41 22 379 24 28
  51. Ch. des Maillettes       Fax : ++ 41 22 379 22 05
  1290 Sauverny             e-mail : Yves.Revaz_at_epfl.ch
  SWITZERLAND                  Web : http://www.lunix.ch/revaz/
----------------------------------------------------------------
Received on 2010-01-26 09:31:22

This archive was generated by hypermail 2.3.0 : 2023-01-10 10:01:31 CET