Skip to content
This repository

A Mathematica package for generating code for solving time dependent partial differential equations

This branch is 0 commits ahead and 1276 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 Auxiliary
Octocat-spinner-32 Bin
Octocat-spinner-32 Doc
Octocat-spinner-32 Examples
Octocat-spinner-32 Tools
Octocat-spinner-32 .gitignore
Octocat-spinner-32 COPYING GPL info May 09, 2004
Octocat-spinner-32 Changelog added brief description of recent changes October 20, 2004
Octocat-spinner-32 README
README
========================================
    KRanc Assembles Numerical Codes
    Version 1.0.0
========================================

What is Kranc?
--------------

Kranc is a set of Mathematica scripts to convert systems of time
evolution PDEs into code for numerical simulations using the Cactus
infrastructure.  You need Mathematica in order to use Kranc.

What is here?
-------------

README           This file

COPYING          Licensing information - Kranc is licensed under the GPL

Tools            Mathematica packages used in the conversion of a PDE system
                 to a numerical code

Examples         Worked out examples (massive scalar field, Maxwell equations, ADM
                 formulation of general relativity)

Auxiliary        Auxiliary code required for compilation of the code produced
                 by the scripts


Getting up and running with the examples
----------------------------------------

For the following instructions, we assume that you are working
on a Unix-type system, and that you have Mathematica and a C compiler
installed.  We have tested with Mathematica versions 4.1 and 5.
The example for the Einstein equations requires a Fortran 90 compiler, as it
relies on existing Fortran code for initial data.

We assume that your Kranc directory lives in your home directory, so
that this file is ~/Kranc/README.  If this is not the case, modify the
pathnames given in the following accordingly.  We will be creating a
standard Cactus directory as well, as ~/Cactus.  These instructions
are for the Klein-Gordon example, which is the simplest example.
There are also notes at the end on things you need if you want to try
out the other examples.

Building the Massive Klein-Gordon arrangement
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change into the directory appropriate for this example:

  cd ~/Kranc/Examples/KleinGordon

Invoke a Mathematica command line session with input from the source
file (this relies on the Kranc packages being found in the correct
place relative to the current directory):

  math < MKGTT.m

There will be some output, and an arrangement directory MKG will be
created containing the thorns.  A thorn list will also be created as
MKG/MKG.th


Installing the Cactus flesh and the required standard thorns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Login to the cactusdevcvs repository (you only need to do this once;
the login information is cached in your home directory):

cvs -d :pserver:cvs_anon@cvs.cactuscode.org:/cactusdevcvs login

Enter the password "anon".

Check out the Cactus "flesh" from CVS.  This command will check out
the beta 14 version.

  cvs -d :pserver:cvs_anon@cvs.cactuscode.org:/cactusdevcvs co -r Cactus_4_0_Beta_14 Cactus

Change into the Cactus directory:

  cd Cactus

You can use this Cactus directory for all the examples, and all your
work with Kranc.

Make a directory for your thornlists:

  mkdir thornlists

Link the MKG.th thornlist into this directory (replace with the
correct path to your thornlist):

  ln -s ~/Kranc/Examples/KleinGordon/MKG/MKG.th thornlists/MKG.th

Run the program used for checking out public thorns:

  gmake checkout

Enter "arr" to download thorns by arrangement, choose default option to
download all arrangements. Press q to quit the checkout program.

For consistency with the Cactus 4.0 Beta14 release, you need to
checkout the MoL thorns separately. Enter the Cactus/arrangements directory
and issue the command 

  cvs -d :pserver:cvs_anon@cvs.cactuscode.org:/cactusdevcvs co -r Cactus_4_0_Beta_14 AlphaThorns/MoL

Verify that the thorns have been downloaded into the Cactus/arrangements
directory.

Linking the extra thorns into your Cactus installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You should have a ~/Cactus/arrangements directory into which the
standard Cactus thorns have been downloaded.

Create a symbolic link from the MKG arrangement to here:

  ln -s ~/Kranc/Examples/KleinGordon/MKG ~/Cactus/arrangements/MKG

Create a symbolic link from the KrancNumericalTools arrangement to here:

  ln -s ~/Kranc/Auxiliary/Cactus/KrancNumericalTools ~/Cactus/arrangements/KrancNumericalTools


Building a Cactus configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You need to create a Cactus "configuration"; this is a directory in
Cactus/configs in which a particular set of thorns (in this case those
listed in MKG.th) are compiled.  For simplicity, you may like to use a
new configuration for each of the examples.  However, it is also
possible to manually merge the thornlists generated from many
different Kranc arrangements and create just one configuration for all
of them.

gmake mkg-config THORNLIST=thornlists/MKG.th

Now compile the configuration:

gmake mkg

An executable program called cactus_mkg should be created in the
Cactus/exe directory.  See the Cactus documentation for instructions
concerning how to compile using optimization.

Running the examples
~~~~~~~~~~~~~~~~~~~~

Create a directory to run Cactus in for the MKG example:

  mkdir MKG
  cd MKG

Run the cactus_mkg executable with the example parameter file.

  ~/Cactus/exe/cactus_mkg ~/Kranc/Examples/KleinGordon/MKG100.par

A directory MKG_100 will be created containing output from the run.

Viewing the output
~~~~~~~~~~~~~~~~~~

Cactus based codes can generate output in many formats.  For getting
started we recommend ygraph (http://www.aei.mpg.de/~pollney/ygraph) to
look at 1D data.

ygraph MKG_100/phi_x_\[6]\[6].xg


Running the other examples
--------------------------

We also supply Maxwell's equations and the ADM form of the Einstein
equations as examples.  To run the ADM example, you will need an extra
thorn ("Exact") which is not part of Cactus.

cd ~/Cactus

Login to the numrelcvs repository

cvs -d :pserver:cvs_anon@cvs.aei.mpg.de:/numrelcvs login
Password: anon

Check out the necessary thorns:

cvs -d :pserver:cvs_anon@cvs.aei.mpg.de:/numrelcvs co AEIThorns/Exact

Link the AEIThorns arrangement into your Cactus/arrangements directory:

ln -s ~/Cactus/AEIThorns ~/Cactus/arrangements/AEIThorns

You also have to add the following thorns to the thornlist KrancADM.th:

AEIThorns/Exact
CactusEinstein/ADMCoupling
CactusEinstein/CoordGauge
CactusEinstein/StaticConformal


NB: You will need a Fortran 90 compiler to compile the Exact thorn,
and several of the standard Cactus thorns needed for Einstein's
equations.  We recommend the Intel Fortran Compiler, version 8 as of
the time of writing.  See the Cactus documentation for details about
telling Cactus which compiler to use for a particular configuration.

Contributing to Kranc
---------------------

In order to contribute a patch to Kranc, first ensure that you are
working with a clone of the public Kranc repository, obtained by

  git clone http://www.aei.mpg.de/~ianhin/kranc.git

Commit your patches to your local working copy, preferably with each
new feature in a separate patch, and make sure the repository is up to
date by using

  git pull --rebase

every so often.  The --rebase makes sure that your commits are moved
to the end of the history.  It is wise to do this frequently to avoid
complicated merging.  When your patches are ready, use

  git format-patch origin

which will output numbered .patch files, one per commit, to the
current directory.  Commits which are present in your repository but
not in the public repository you cloned from (origin) will be output.

Email these to the maintainer (currently ian.hinder@aei.mpg.de) for
review and inclusion.

Authors:
--------
Sascha Husa, Christiane Lechner

  Max Planck Institute for Gravitational Physics / Albert Einstein Institute
  Am Muehlenberg 1
  14476 Potsdam
  Germany

  http://numrel.aei.mpg.de



Ian Hinder
  School of Mathematics
  University of Southampton
  Highfield
  SO17 1BJ
  UK

  http://www.maths.soton.ac.uk/
Something went wrong with that request. Please try again.