5 Tips for making finite element models with Salome

Salome is an open source software package used to create geometric models and finite element meshes for use in numerical simulations. It is also able to perform its own numerical simulations and has post-processing capabilities built in. Here are my 5 tips for anyone who is interested in using Salome for model and mesh creation. 1. Practice manually first This goes without saying. Although Salome has a powerful Python-based scripting capability, it is worth practicing with manual model generation....

August 15, 2015 · Simon

Firefox search bar – setting the region for Google searches

The problem If you are visiting/living abroad but still want the Firefox search bar to default to your home version of Google, it is possible to fix it! In the following solution I assume that you are from the UK and want to use the UK/GB version of Google Search: The solution Access the Firefox settings: type “about:config” in the address bar, then click “I’ll be careful, I promise”. For each setting you want to modify, use the search bar to find it more quickly....

April 13, 2015 · Simon

Cool code: plotting columns from many data files with Grace

Grace a.k.a. xmgrace is a really useful tool for plotting histograms from tabular data files. Its power comes from the command line control and being scriptable. Yes, there are other options which are sometimes more suitable for specific situations (e.g. GNUplot, Matplotlib/PyLab), but for quick, basic plotting I usually find myself relying on xmgrace. Here is an example of a single line command to plot two columns from each of a large number of data files:...

November 27, 2014 · Simon

Aligning qhost output on the commandline when hostnames are too damn long

qhost is a UNIX command line tool to print the status of nodes on a Grid Engine system. The output is normally quite readable and is sorted by columns to give information on the hostname (“HOSTNAME”), architecture (“ARCH”), no. of CPUs (“NCPU”), processor load (“LOAD”), total available memory (“MEMTOT”), current memory usage (“MEMUSE”), swap memory size (“SWAPTO”) and current swap usage (“SWAPUS”) of each node on the cluster. Unfortunately, when the hostnames are too long, instead of truncating them to keep the columns aligned the row gets shunted along, making the output messy and much harder to read quickly....

September 24, 2014 · Simon

ZotFile for syncing PDF articles from Zotero to my eReader

I use Zotero to manage my literature collection, including all the associated PDF attachments. It really made my life easier when I set up the WebDAV file sync on Box. However, until now the only way to sync files to my Onyx Boox M96 eReader (image) was by connecting a USB cable and copying them manually to the device. Since Zotero stores the files in cryptically-named individual folders it is hard to do this manually in an organised manner and involves lots of clicking....

September 17, 2014 · Simon

Syncing Zotero files with WebDAV from Box

It’s hard to stay organized when you work on multiple computers, with multiple operating systems. My main notebook is a dual boot Ubuntu/Win7 machine where I have a shared partition for work files. I sync my work folder with my Ubuntu tower PC via BitTorrent Sync. This has now been working well for some time (the syncing happens under Ubuntu only, which is a drawback, but if BTSync under Windows also tries to sync the same shared folder it causes problems, thus I avoided doing so) although if you start with two identical copies of the folder on the two PCs it still wants to sync all of the files one way over the network....

August 6, 2014 · Simon

System Dynamics diagrams with Inkscape

One of the great things about System Dynamics software, such as VenSim, is the GUI, which allows you to see your model and all its connections as you are constructing it. However, the PLE version of VenSim is limited and one possibility is to write one’s own SD code with custom features. This is also a fun programming exercise. Initially I am willing to sacrifice real-time visual feedback in return for flexibility, but when I later want to visualize my model I would like some graphical output....

April 25, 2014 · Simon

Reading scientific papers on Kindle with k2pdfopt

I have been waiting for some time for a new large-format eReader to be announced for reading PDF journal articles and textbooks. The Onyx Boox m96 sounds promising although the screen is “only” 10 inches in size and 13.3 inch eReaders for a reasonable price might be on the horizon. The exciting Sony DPT-S1 is unavailable, expensive and only works with PDFs. What a catastrophe! Come on, Sony! In the meantime, I have discovered an open source project called k2pdfopt that purports to convert journal articles into Kindle-formatted pages, by splitting the pages into smaller pieces and trimming borders etc....

March 24, 2014 · Simon

Reading an OpenOffice spreadsheet into Python

Sometimes the best way to manage simulation output data is in a spreadsheet. Or the data you want to use is already in a spreadsheet. Before reading it into Python for numerical analysis or plotting, or reading into xmgrace to plot, etc, it is normal to export the spreadsheet to a CSV or tab-separated file. But then you have two files. And if you do something in the spreadsheet you have to export it again and this is inefficient....

February 28, 2014 · Simon

LaTeX overfull hbox errors (and how I fixed mine)

If you have ever written a journal article or thesis using LaTeX then you probably came across lots of errors and warnings in the process. Those warnings can usually be ignored as they don’t stop the document from compiling, and many of us who just want to cross the finishing line probably never investigate what was causing them. One such common warning is the Overfull or Underfull /hbox message. These usually occur through no fault of the author, but because LaTeX doesn’t know how to hy-ph-enate certain words....

February 17, 2014 · Simon

Salome reordering during scripted Explode function

When writing Salome scripts that include a step to explode objects to their sub-shapes (using ExtractShapes) it is worth paying attention to the isSorted parameter, which is True by default. In my experience this parameter is best set to False in order to avoid Salome unpredictably changing the order of the objects in the resulting list. For example, here I have a Compound of two objects A and B, which has the faces glued resulting in Glue_1....

November 29, 2013 · Simon