{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "PyNE Tutorial\n", "=============\n", "\n", "Welcome to the PyNE tutorial! \n", "\n", "![PyNE Tree](https://raw.github.com/pyne/pyne/staging/img/pyne_icon_big.png)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Is PyNE Installed?\n", "\n", "You can verify that PyNE is successfully installed by running the following: \n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from pyne import data\n", "print data.atomic_mass('U235')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "235.043930131\n" ] } ], "prompt_number": 1 }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Have you cloned the tutorial repo?\n", "\n", "```bash\n", "$ git clone https://github.com/pyne/tutorial.git\n", "```\n", "\n", "----------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# What is PyNE?\n", "\n", "As out tagline says, PyNE is the open source nuclear engineering toolkit. \n", "\n", "* PyNE is intended as a library of composable tools that is used to build nuclear science and engineering applications.\n", "* It is permissively licensed (2-clause BSD)\n", "* It supports both a C++ and a Python API.\n", "* The name 'PyNE' is a bit of a misnomer since most of the code base is in C++ but most daily usage happens in Python.\n", "* The v0.3 code base was just released!\n", "* As an organization, PyNE was born in April 2011. However, core parts of PyNE have existed since 2007." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# What are the goals of PyNE?\n", "\n", "To help nuclear engineers:\n", "\n", "* be more productive,\n", "* have the *best* solvers,\n", "* have a beautiful API,\n", "* write really great code,\n", "* and teach the next generation.\n", "\n", "And of course, to perform neat tricks like this:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import numpy as np\n", "from pyne import mesh, material \n", "from pyne.xs.channels import sigma_t\n", "from yt.config import ytcfg; ytcfg[\"yt\",\"suppressStreamLogging\"] = \"True\"\n", "from yt.mods import *\n", "m = mesh.Mesh(structured_coords=[np.linspace(0.0, 1.0, 101), np.linspace(0.0, 1.0, 101), [0.0, 1.0]], structured=True)\n", "fuel = material.from_atom_frac({'U235': 0.045, 'U238': 0.955, 'O16': 2.0}, mass=1.0, density=10.7)\n", "cool = material.from_atom_frac({'H1': 2.0, 'O16': 1.0}, mass=1.0, density=1.0)\n", "for i, mat, ve in m:\n", " coord = m.mesh.getVtxCoords(ve)\n", " m.mats[i] = fuel if (coord[0]**2 + coord[1]**2) <= 0.5**2 else cool\n", "m.sigma_t = mesh.ComputedTag(lambda mesh, i: sigma_t(mesh.mats[i], group_struct=[10.0, 1e-6], phi_g=[1.0])[0])\n", "m.u_mass = mesh.ComputedTag(lambda mesh, i: max(mesh.mats[i]['U':'Np'].mass, 0.0))\n", "SlicePlot(PyneMoabHex8StaticOutput(m), 'z', 'sigma_t', origin='native').display()\n", "print \"Pu Content of Mesh:\", sum(m.u_mass[:])" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
" ], "metadata": {}, "output_type": "display_data", "text": [ "" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "Pu Content of Mesh: " ] }, { "output_type": "stream", "stream": "stdout", "text": [ "1732.10345314\n" ] } ], "prompt_number": 1 }, { "cell_type": "markdown", "metadata": {}, "source": [ "# What should you do with PyNE?\n", "\n", "As a **user** you should do your work or research with PyNE. Even if you have your own software which looks and behaves similar to some aspects of PyNE, using PyNE will mean that you no longer have to develop AND maintain that functionality.\n", "\n", "As a **developer** you should be selfish. Contribute to PyNE in ways that support the work that you are doing. If a feature you want is not in PyNE right now, chances are that other people want to see that feature too! This will help your future self as much as future other people." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# What goes into PyNE?\n", "\n", "Anything that is not export controllable, proprietary, or under HIPPA restrictions! (If you have questions, ask.)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Contact PyNE\n", "\n", "**Website:** http://pynesim.org/\n", "\n", "**User's Mailing List:** pyne-users@googlegroups.com\n", "\n", "**Developer's List:** pyne-dev@googlegroups.com" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Questions?" ] } ], "metadata": {} } ] }