Skip to content

Commit

Permalink
added example docs
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed Apr 18, 2024
1 parent 6ed02e9 commit bd1c67a
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Examples

## Conversion of CAD to CSG


The following code snippet will convert a CAD file in the STEP format called example.step into and XML file called geometry.xml that can be opened and run with OpenMC

import geouned
geouned.cad_to_csg(
cad_filename='example.step',
output_filename='geometry.xml',
csg_format='openmc'
)
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Welcome to GEOUNED documentation

GEOUNED converts CAD geometry to CGS and CGS to CAD.


The CSG geometry produced is compatible with Monte Carlo particle transport codes such as [OpenMC](/~https://github.com/openmc-dev/openmc) and [MCNP](https://mcnp.lanl.gov/).

59 changes: 59 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Installation

Recommended method of installing is to make use of Conda / Mamba.
This results in installation of GEOUNED with your system Python and the most straightforward usage.

There are other options which are also documented.
The main difference between the installation options is the manner in which the main dependency FreeCAD is installed and this has consequences for how the code is used.

With some options (Conda) offering integration of FreeCAD Python API into your system Python and other options requiring GEOUNED scripts to be run with freecadcmd or freecad.cmd and integration of GEOUNED and FreeCAD performed with system path appending or freecad.pip

## Linux (Ubuntu)

### Conda


In principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:
- [Miniforge](/~https://github.com/conda-forge/miniforge)
- [Anaconda](https://www.anaconda.com/download)
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)

In this example we will install Miniforge (which includes Mamba)
```bash
wget -O Miniforge3.sh "/~https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
```

Create a new environment, I've chosen Python 3.10 here but newer versions are
also supported.
```bash
mamba create --name new_env python=3.10 -y
```

Activate the environment
```bash
mamba activate new_env
```

Then you can install the cad_to_dagmc package
```bash
mamba install -y -c conda-forge geouned
```

### AppImage

### Apt-get

### Snap



## Mac OS

### Conda

## Windows

### Conda

### Portable FreeCAD

9 changes: 9 additions & 0 deletions docs/python_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Python API

::: geouned.cad_to_csg
options:
show_source: true

::: geouned.csg_to_cad
options:
show_source: true
4 changes: 4 additions & 0 deletions docs/theory_and_methodology.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Theory and Methodology



15 changes: 15 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
site_name: GEOUNED
site_url: /~https://github.com/GEOUNED-org/GEOUNED/deployments/github-pages
nav:
- Home: index.md
- Installation: installation.md
- Examples: examples.md
- Python API: python_api.md
- Theory and Methodology: theory_and_methodology.md
theme: readthedocs
plugins:
- search
- mkdocstrings:
handlers:
python:
paths: [src]

0 comments on commit bd1c67a

Please sign in to comment.