![]() Before we can do that, we need to make sure that the Windows® operating system knows where to find that command. We are just about to call the COMSOL® software using the comsolbatch command. ![]() ![]() Next, we open a Command Prompt window and, at the command line, make our way to our working folder. In this example, that’s C:/Users/jf.Īt this point, we can close the COMSOL Desktop. Now that we’ve ensured that the model is properly set up, we can refine the mesh and save the file under the name Model1.mph in our working folder. This presents the additional benefit of generating a default data set and one or two default plots in the Study branch of the model tree. Once you are comfortable with this functionality, it can, of course, also be applied to sophisticated models that take a long time to solve.Īt this stage, we check that the model is properly set up by running it with a relatively coarse mesh. This will allow us to understand the functionality and perform tests on it quickly. Since we’re going over how to use a new functionality, the smaller and less detailed the model, the better. Let’s start with a demonstration of how to run a single COMSOL Multiphysics model from the command line.įirst, we create a model file in the COMSOL Multiphysics GUI, also known as the COMSOL Desktop. How to Run a Single Model from the Command Line I’ll explain how to do this step by step on a computer with the Windows® operating system, but these ideas also apply to the other supported platforms (macOS and the Linux® operating system). But who would want to return to the office after hours or on weekends just to launch their next model?įortunately, there is a solution: creating a shell script, or a batch file, which automatically launches your COMSOL Multiphysics simulations one after the other. You could launch your first model in the graphical user interface (GUI) and wait for it to solve, launch the second model in the GUI and wait for it to solve, and so on. Running multiple models at the same time on the same computer is not a good option, as they would compete for resources (RAM, in particular) and therefore take longer to run simultaneously than they would sequentially, or back to back. This is especially common if your models are quick to set up but take a fair amount of time to solve. If you have used simulation tools for any significant period of time, you may have found yourself creating new models faster than your computer can solve them. Why Run COMSOL Multiphysics® in Batch Mode from the Command Line? As it turns out, this is quite a simple process. Do you find yourself creating new models in the COMSOL Multiphysics® software faster than you can launch them interactively in the COMSOL Desktop® environment? If having to wait for your current model to finish solving before launching the next one does not sound appealing, it’s time to learn how to run your simulations in Batch mode from the command line.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |