computational science and engineering

Archive for the ‘Scientific computing’ Category

Installing PETSc and libMesh on CentOS 5

Friday, January 20th, 2012 Posted in Linux, Scientific computing | No Comments »

Prerequisites: boost-devel, openmpi-devel, valgrind-devel I installed PETSc and libMesh in my user directory, since I have a single-user workstation. Installing PETSc for use with libMesh First, ensure that OpenMPI is installed and the system paths have been configured correctly.  You will need to ...

Paraview 3.12 on 64-bit CentOS 5.7

Thursday, January 19th, 2012 Posted in Linux, Scientific computing | No Comments »

I finally got around to installing Paraview on my CentOS 5 box.  There are no official RPMS for CentOS 5, so I was expecting a painful build process. To my great surprise, I was able to download the Paraview binary ...

Installing Sage 4.7 on CentOS 5

Monday, November 7th, 2011 Posted in Linux, Sage, Scientific computing | No Comments »

I recently upgraded my desktop workstation from an old 32-bit version of Gentoo to 64-bit CentOS 5.  I downloaded and installed the latest version of Sage, and the process went smoothly. If you find this post helpful, please check out the ...

Python string format examples

Thursday, November 3rd, 2011 Posted in Python, Scientific computing, Software development | No Comments »

The format method for Python strings (introduced in 2.6) is very flexible and powerful.  It's also easy to use, but the documentation is not very clear.  It all makes sense with a few examples.  I'll start with one and add ...

How to build ScipPy with Python 2.7.2 on CentOS5

Thursday, August 25th, 2011 Posted in Linux, Python, Scientific computing | 1 Comment »

EDIT: added --enable-shared to configure script for building Python, and added /home/yourname/lib to shared library path.  This is necessary for building some packages such as pycairo (which you may need to build pygtk and matplotlib). EDIT 2: you should use the ...

Removing an axis or both axes from a matplotlib plot

Wednesday, August 17th, 2011 Posted in Python, Scientific computing | 1 Comment »

Sometimes, the frame around a matplotlib plot can detract from the information you are trying to convey.  How do you remove the frame, ticks, or axes from a matplotlib plot? [caption id="attachment_632" align="aligncenter" width="300" caption="matplotlib plot without a y axis"][/caption] The full ...

Finding dimensions of a bounding box in Jmol

Monday, June 13th, 2011 Posted in Molecular modeling, Scientific computing | No Comments »

The Jmol applet (or Java application) is widely used to visualize the structure of molecules.  It is very powerful, but not that well documented. If you don't have Jmol running, open the page for Glucose Oxidase (1CF3) from the Protein ...

A self-contained Fortran linear equation solver

Wednesday, March 16th, 2011 Posted in Fortran, Python, Scientific computing, Software development | No Comments »

I've just released a self-contained Fortran module that solves a system of linear equations using the LU decomposition. Download the Fortran linear solver from github This module is based on code that was implemented and released on the Web by Jean-Pierre Moreau.  ...

Finding a value in an unordered Fortran array

Friday, March 11th, 2011 Posted in Fortran, Scientific computing, Software development | 2 Comments »

I have been optimizing some Fortran code that involved searching for an integer value in an unordered array (we know the value occurs only once).  Since there is no intrinsic procedure to accomplish this, I thought I'd try a couple ...

Sage: open-source mathematical software

Monday, March 7th, 2011 Posted in Python, Sage, Scientific computing, Software development | No Comments »

I've recently gained a lot of experience with Sage, an open-source alternative to MATLAB, Mathematica, Maple, MuPAD, and Magma.  Here are a couple of links to check out: Public notebook servers--try it online right now! Interactive examples with Sage Mathematical publications citing Sage