Skip to content
Dr Weymouth edited this page Sep 10, 2016 · 6 revisions

LilyPad Getting started with Lily Pad

Introduction

This wiki is intended to help users get started with the code. If you are interested in the code and want to keep up to date, please "watch" or "fork" the project. If you think there is an additional step missing from this wiki, please add it.

Further documentation includes

Getting Started

The code is written in Processing and uses Git for version control. Before working with Lily Pad you will need to get these two programs (both of these are cross platform, so get the flavour you need).

Now you can download the Lily Pad program. You can use the buttons to the right to fork the Lily Pad project, making a clone of it in your own github account, or just download the Lily Pad source as a zipfile. Alternatively, open a command terminal and type

$ git clone https://github.com/weymouth/lily-pad

Now navigate to the lily-pad\LilyPad folder and open LilyPad.pde with Processing.

That's it! You're ready to run.

Running

Once the source is opened in Processing, click the play button. The default set-up (a cylinder in a free stream) will run automatically. You can drag the cylinder around in the default set-up as well.

The main Processing file is LilyPad.pde and this file controls what happens when you click play. Each of the files in the LilyPad folder has an example code section commented out at the top. By replacing the contents of the LilyPad.pde file with these example code sections you can run a wide variety of simulations and explore the types of geometries, flow conditions, and visualizations available.

Contributing

However, soon enough you will probably want to do something which isn't coded up yet.

Great! This is an active and growing project and we love seeing how people are using it. And as you contribute, don't worry too much about making a mistake or putting up ugly code. We can always fix/clean it. Even better, we can suggest how you can fix/clean it yourself.

If you have never contributed to a github repository, look through this introduction page.

Issues

As you start developing your own tests with LilyPad, you'll certainly run into a few walls. Try to write a minimum working example. In most cases, simply boiling a problem down to the bare minimum will help you figure it out yourself. If that doesn't work, raise an issue including your example and we'll try to help.

Best practises

The basic guideline is to add code which is general and friendly enough to be useful for other users. This means:

  • Creating and pushing test case files (such as BlindFish.pde) is especially useful since it gives everyone a chance to run and play with a new test case out-of-the-box!
  • Let users run your code through high-level interfaces, and only dig down into the guts of the methods if they choose.
  • Reuse as much existing code as possible. i.e. add a new capability by making a new class which extends a current class.
  • If you change low level routines, do so in a way which does not break compatibility. i.e. trigger your change with an optional argument.
  • Completely document and test all changes.
  • Add a minimum working example at the top of any new files.

Good luck!

Clone this wiki locally