Hi, I was toying around with the polytrope test, and it looks like there might be some code in GYRE that can actually generate a polytrope profile directly. In the polytrope test folder there is a "build_poly_hom.in," and upon inspecting the code it seems like the machinery to do this might be there. However, just running gyre_ad on that input file produces some errors. My question is if this feature is in fact implemented yet? If so, how does one generate a polytrope, and if not, is it coming soon?

Hi.
I do not know if this is exactly what you're asking for, but I have attached a Python short script that solves the Lane-Emden equation for a set of indices, n<5.
Please unzip the attached file. Unfortunately, the .py is not a valid extension for attachments.
I hope you find it useful.

To build these tools, run 'make' in the src/util subdirectory. *NOTE*: you'll need to install the Madison SDK (MADSDK) to compile -- this is a superset of the MESA SDK, which includes the ODEPACK library and a number of other useful things. You can grab the MADSDK from

To use the tools, you need to create a namelist input file. There's a sample input file, build_poly.in, provided in src/utils -- it specifies an n=4.97 polytrope with a spacing of 1E-2 in the Lane-Emden variable xi. Input files are read from standard input, and so

./build_poly < build_poly.in

...will run build_poly with the build_poly.in namelist input file. In future releases of the code I'm going to make build_poly[_hom] use command-line arguments, but for now we're stuck using namelists.

Hi, Apologies for bumping this very old thread. I am new to Gyre, and was interested in using the build_poly functionality. I noticed that locations of things had changed, and was wondering how one would go about using build_poly (and related tools) now, if it differs in a meaningful way. Furthermore, I was a little confused by the sample namelist file build_poly.in given in src/poly; in particular, I wanted to clarify what the namelist entries were (was in particular confused at how n_poly specified the polytropic index in that example file).

EDIT: I've realized that that the build_poly executable, which the compilation says should be produced by the build process, is not present in gyre/bin/. Is this something I should try to address?

Hi, Apologies for bumping this very old thread. I am new to Gyre, and was interested in using the build_poly functionality. I noticed that locations of things had changed, and was wondering how one would go about using build_poly (and related tools) now, if it differs in a meaningful way. Furthermore, I was a little confused by the sample namelist file build_poly.in given in src/poly; in particular, I wanted to clarify what the namelist entries were (was in particular confused at how n_poly specified the polytropic index in that example file).

EDIT: I've realized that that the build_poly executable, which the compilation says should be produced by the build process, is not present in gyre/bin/. Is this something I should try to address?

Thanks so much,
Kavish

Hi Kavish --

For build_poly to get compiled, you need to be using the Mad SDK rather than the usual MESA SDK. The Mad (Madison) SDK is a superset of the MESA SDK, which includes the ODEPACK integration library; build_poly requires ODEPACK to integrate the Lane-Emden equation.

...and install it and activate it, in lieu of the MESA SDK. Then, when you run 'make' inside $GYRE_DIR, build_poly should now get built.

How to use it is another matter -- I recently revamped it to allow for composite polytropes, and so the layout of input files has changed quite a bit. I'll try to throw together a crash-course over the next day or so, so you can get up and running.

As an aside: can I ask what your interest in build_poly is? Are you wanting to use GYRE on polytropes, or are you just looking for a polytrope builder? (Either answer is good!).

Thank you for the fix! No rush on the crash course, although it certainly would be much appreciated. As for myself: I am mostly interested in learning to use Gyre, and was practicing using polytropes as an example. I had started by generating my own .h5 files but then saw a post here that mentioned that the functionality was in-built, which prompted me to try to use it (and then led me here when I got confused).