Skip to main content

Stretched Equal Area Generator

Project description

SEAGen

A python implementation of the stretched equal area (SEA) algorithm for generating spherically symmetric arrangements of particles with accurate particle densities, e.g. for SPH initial conditions that precisely match an arbitrary density profile, as presented in Kegerreis et al. (2019), MNRAS 487:4, 5029-5040, https://doi.org/10.1093/mnras/stz1606.

See also https://github.com/srbonilla/WoMa for making input planetary profiles, placing particles with SEAGen, and modifications for spinning bodies.

Jacob Kegerreis (2020) jacob.kegerreis@durham.ac.uk
Josh Borrow

Visit https://github.com/jkeger/seagen to download the code including examples and for support.

This program has been tested for a wide range of cases but not exhaustively. If you find any bugs, potential improvements, or features worth adding, then please let us know!

Contents

  • seagen.py The main program classes and functions.
  • examples.py Examples to demonstrate how to use the SEAGen module.
  • setup.py, setup.cfg, __init__.py, MANIFEST.in Python package files.
  • LICENSE.txt GNU general public license v3+.

Basic Usage

  • See the doc strings in seagen.py for all the details.
  • Create a single shell of particles and print their positions:
    import seagen
    N = 100
    r = 1
    
    particles = seagen.GenShell(N, r)
    
    print(particles.x, particles.y, particles.z)
    
  • Create a full sphere of particles on a simple density profile and print their positions and masses:
    import seagen
    import numpy as np
    N = 100000
    radii = np.arange(0.01, 10, 0.01)
    densities = np.ones(len(radii))     # e.g. constant density
    
    particles = seagen.GenSphere(N, radii, densities)
    
    print(particles.x, particles.y, particles.z, particles.m)
    
  • See examples.py for other working examples, e.g. an arbitrary density profile with multiple layers and extra temperature information.

Installation

  • PyPI: Automatically install the package with pip install seagen, see https://pypi.org/project/seagen/
  • Direct download: The single seagen.py file can be imported and used without any extra installation, so you can just download this repository and place the file in a local directory or wherever your python will look for modules.

Requirements

  • Python 3 (tested with 3.6.0).

Notation etc.

  • Formatted with black.
  • Arrays are explicitly labelled with a prefix A1_, or An_ for an n-dimensional array.
  • Particle is abbreviated to picle.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seagen-1.6.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seagen-1.6-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

Details for the file seagen-1.6.tar.gz.

File metadata

  • Download URL: seagen-1.6.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for seagen-1.6.tar.gz
Algorithm Hash digest
SHA256 68160019ef8515feb8885b27be4667c0b54fb8e6ccfbb1634283275b7f3d0a14
MD5 2e170871523bbd065c89f1ff77fcf833
BLAKE2b-256 af2bf48bdacebc781067474648f1da9e2a0df69762eedf7ad4d0c3d93c493aae

See more details on using hashes here.

File details

Details for the file seagen-1.6-py3-none-any.whl.

File metadata

  • Download URL: seagen-1.6-py3-none-any.whl
  • Upload date:
  • Size: 31.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for seagen-1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9a3dd6f3c6c5cf517e75f78a50799550ea07cdd7d7959678d23854b3ccbcefb1
MD5 db0b451863ef0873f93776fb1fda74fe
BLAKE2b-256 f332289c7529dc8a0b4ca9951b20ee1ef3a57d27b0371e9d042c04aa7cbace88

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page