Since
the COMSOL Application Builder has been added to COMSOL release v5.0 last year (with improvements in v5.1 earlier this year) we have developed a collection of customer specific applications and are in the process of developing a few generally available applications for public use. Even though we’ve been using COMSOL Multiphysics for many years the Application Builder functionality is a new venture for us and has caused us to think on a higher level – on a software developer level.
And, of course, we’re learning the hard way how to become good application developers – making mistakes and overcoming those mistakes as a team. To help you get over the learning curve a little faster than we have, we wanted to pass along one tip that we’ve found particularly helpful along the way.
Let us quickly introduce the process of building an application in COMSOL to give a context for the tip:
Developing a
COMSOL Application amounts to taking a functioning COMSOL model file and putting a wrapper around it with an eminently simple interface that is designed to be easily used and understood by a general user with a non-technical background. The programming required to develop this interface can be as simple as using the Application Wizard to add predefined buttons, input fields, and plots. This method is quick and simple but, in practice, we’ve found that taking advantage of the advanced
programming capabilities of the Application Builder is necessary for developing commercially viable applications up to AltaSim standards.
If you need to use the Method editor advanced programming capabilities, we’d like to recommend three “helper commands” that we’ve found extremely helpful for debugging your code: message(), debugLog(), and alert(). Say, for example, we needed to read a post-processing value into a method editor variable named,
tot_layers. To confirm this value has been read in properly as an integer, we recommend using one of the three commands with a red star (see screen shot below taken from the Method editor):