Mcluster
McLuster - a tool to make a star cluster
Install / Use
/learn @ahwkuepper/MclusterREADME
McLuster - a tool to make a star cluster
Developed by Andreas H.W. Kuepper at AIfA Bonn, Germany, in collaboration with Pavel Kroupa & Holger Baumgardt.
25 March 2013
Detailed information on the code and the parameters can be found in the following paper:
Kuepper A.H.W., Maschberger T., Kroupa P., Baumgardt H., 2011, MNRAS, 417, 2300 "Mass segregation and fractal substructure in young massive clusters: (I) the McLuster code and method calibration"
This reference should be used for any publications that utilize McLuster.
For comments, questions and bug reports contact: ahwkuepper@gmail.com
COMPILING THE CODE:
For compiling the basic McLuster version use the MAKEFILE by typing
make mcluster
or simply type
cc -o mcluster main.c -O2 -fopenmp -lm
This should work on most computers on which a recent C-compiler is installed.
For the SSE-version of McLuster you have to use the MAKEFILE. Try compiling by typing
make mcluster_sse
You may have to change the C- or FORTRAN-compiler in the MAKEFILE by editing the variable CC or FC, respectively. Furthermore, you may have to give the correct directory of your gfortran installation to the C-compiler. This can be done by changing the path in the CFLAGS variable
-L/usr/lib/
to the correct path of your gfortran installation.
Note that some warnings like the following may appear:
ld warning: alignment lost in merging tentative definition
which can be ignored.
HELP:
Get a quick help by typing
mcluster -h
for the basic version, or
mcluster_sse -h
respectively for the SSE version.
INTRODUCTION:
McLuster can be run from the command line by passing arguments to the code which specify the desired cluster, e.g.,
mcluster -N1000 -R2.0 -P0
would give a cluster with a Plummer profile and a half-mass radius of 2 pc, consisting of 1000 stars. For parameters which are not specified default values are taken, which can be changed within the code. Go to the top of the 'main' routine for a complete list of available parameters with descriptions.
By typing
mcluster -h
you get the allowed arguments which can be passed to McLuster which will be described in detail in the following:
-N <number> (number of stars)
The number of stars may vary from 3 to ~10^6. Remember though that some procedures within the code require ~N^2 computational steps which may take incredibly long. Furthermore, processes like mass segregation and fractalization may temporarily need a lot of memory/or may temporarily generate more stars than the required number. The parameter NMAX within the main routine may have to be set to a higher value then.
-M <value> (mass of cluster; specify either N or M)
If you specify the total mass of your cluster then McLuster will generate stars until the total mass reaches M.
-P <0|1|2|3|-1> (density profile; 0= Plummer, 1= King (1966),
2= Subr et al. (2007) mass-segregated,
3= 2-dimensional EFF/Nuker template,
-1= no density gradient)
The density profile is used to generate the positions & velocities of the stars. The final cluster is then scaled to exactly match the half-mass radius which you specified. In case you chose the EFF/Nuker profile McLuster, will integrate the density distribution and determine the expected half-mass radius of that specific distribution. The final cluster is then scaled to this expectation value.
For the generation of the Subr et al. profile the routine PLUMIX is used, whose most recent version was incorporated in McLuster.
Note that some choices for the profile necessitate further parameters to be specified.
-W <1-12> (W0 parameter for King model)
In case you choose the King profile you"ll have to specify its concentration which is done by fixing its W0 value.
-R <value> (half-mass radius [pc], ignored for P = 3)
The half-mass radius of the cluster has to be specified for all density profiles except for the EFF/Nuker profile. For the latter it gets determined automatically according to your choice of the scale radius and the cut-off radius. All radii are set in pc! By setting the half-mass radius to -1, McLuster will use the cluster mass-half-mass radius relation from Marks & Kroupa (2012) to estimate an initial half-mass radius according to your choice of mass.
-r <value> (scale radius of EFF/Nuker template [pc])
This specifies the scale radius, see Elson, Fall & Freeman (1987) and or Lauer et al. (1995) for Nuker template.
-c <value> (cut-off radius of EFF/Nuker template [pc])
Since the EFF and Nuker profiles extend infinitely they have to be cut off at some radius.
-g <value> (power-law slope(s) of EFF/Nuker template; use
once for EFF template; use three times for Nuker
template (outer slope, inner slope, transition)
With this option you can set the power-law slopes of the EFF and Nuker profiles. Use once for EFF to set the outer slope. Use three times for outer slope, inner slope and the transition parameter. Note that the EFF profile is a special case of the Nuker profile with the inner slope set to 0.0 and the transition parameter set to 2.0.
-S <0.0-1.0> (degree of mass segregation; 0.0= no segregation)
Mass segregation can be added to any choice of profile. In case of the Subr et al. profile the S value should lie between 0.0 and 0.5 in order to produce reasonable clusters (see Subr, Kroupa & Baumgardt 2007 for further details). All other density profiles allow values from 0.0 to 1.0, where 1.0 corresponds to total segregation, i.e. the most massive star sits most deeply within the cluster potential, followed by the second most massive star, etc. The segregation of stars is done following Baumgardt, de Marchi & Kroupa (2008).
-D <1.6-3.0> (fractal dimension; 3.0= no fractalization)
Any density profile can be fractalized. The fractal dimension specifies the degree of fractalization. Values of 2.6 are reasonable, and values lower than 1.6 should be omitted. The fractalization is realized similar as described in Whitworth & Goodwin (2004). If you choose P = -1 you can get a fractal distribution of stars without explicit density gradient.
-T <value> (tcrit in N-body units)
This specifies the time after which the N-body calculations should be stopped. For details see Sverre Aarseth's NbodyX handbook.
-Q <value> (virial ratio)
The virial ratio can be any positive value. 0.5 means virial equlibrium, values >0.5 mean initial expansion, and values <0.5 result in collapsing clusters.
-C <0|1|3|4> (code; 0= Nbody6, 1= Nbody4,
3= table of stars, 4= Nbody7)
If you want to use the output of McLuster as input for your N-body computations you should specify the corresponding code. You can also generate an ascii table of stars instead.
-A <value> (dtadj in N-body units)
Sets the adjustment time-step for Sverre's NbodyX codes.
-O <value> (deltat in N-body units)
Sets the output interval of NbodyX.
-G <0|1> (GPU usage; 0= no GPU, 1= use GPU)
Specify whether you want to use Nbody6 with a GPU.
-o <name> (output name of cluster model)
Change the name of the output file(s).
-f <0|1|2|3|4> (IMF; 0= no IMF, 1= Kroupa (2001),
2= user defined, 3= equal to "=1" but with optimal
sampling, 4= L3 IMF from Maschberger 2012)
Set f to 0 for a cluster consisting of single-mass stars. For f set to 1 the canonical two-part power-law Kroupa IMF is used from 0.08 Msun to 100 Msun. Those default values can be changed within the main routine of the code or with the -m option. The first -m will specify the lower mass limit, the second one will set the upper mass limit. If f is set to 2 you can specify the limiting masses and slopes between those limits for up to 10 power-law slopes and 11 mass limits. If you need more, change the parameters MAX_AN and MAX_MN within main.h accordingly. If f is set to 4 you can also use the -m option to set upper and lower mass limits, and you can also use the -a option to specify the power law slopes and the mu parameter of the L3 IMF. First -a will set alpha, the second will set beta and the third is for mu.
-a <value> (IMF slope for user defined IMF, may be used
multiple times, from low mass to high mass; or
for parameters alpha, beta and mu of L3 IMF)
-m <value> (IMF mass limits for the IMF; for user defined IMF
it may be used multiple times; always set limits
from low mass to high mass [Msun])
Specify the mass limits and the power-law slopes of the IMF as follows
mcluster -f2 -m 0.08 -a -1.3 -m 0.5 -a -2.3 -m 150.0
This would yield a Kroupa IMF ranging from 0.08 Msun to 150 Msun.
mcluster -f4 -m 0.01 -m 100.0 -a 2.3 -a 1.4 -a 0.2
This would give a L3 IMF from 0.01 to 100 Msun with alpha = 2.3, beta = 1.4 and mu = 0.2.
-B <number> (number of binary systems)
-b <value> (binary fraction, specify either B or b)
For the binary content you can specify the fraction of stars in binaries, 0.0 <= b <= 1.0, or the number of binary systems, 0 <= B <= N/2. Note that the total mass of the cluster may exceed the mass you specified initially when using high binary fractions and eigenevolution. This is due to the form of the eigenevolution al
Related Skills
node-connect
349.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.7kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
