How to Search for a Specific COMSOL Multiphysics® Application

Andrew Griesmer May 10, 2018
Share this on Facebook Share this on Twitter Share this on LinkedIn

The Application Libraries, accessed directly in the COMSOL Multiphysics® software, contain an ever-growing number of examples filled with valuable information on how to model certain types of problems, use certain features, and employ specific modeling techniques. To get the most out of the Application Libraries, you should be able to easily find the information you need.

Finding What You Need in the Application Libraries

We are regularly adding more examples to the Application Libraries. However, as the number of models and apps in the libraries grows, the more difficult it is to find a specific one.

A screenshot of the Application Libraries in COMSOL Multiphysics.
The Application Libraries in COMSOL Multiphysics, with the Thermal Actuator model open.

To help circumvent this catch-22, you can use the search tools available in the Application Libraries to easily narrow down your search. The Application Libraries are organized by module, including subfolders for further organization, and the search field can be used to crawl any free text in model descriptions. For example, searching automotive returns “automotive_muffler” as well as the “brake_disc” and “snap_hook” models (because both descriptions also contain the term “automotive”).

Let’s look at some alternatives to searching free text for a faster and easier way to find a specific model. (Note that the Application Libraries will only contain models and apps that you have downloaded during or after installation, so the results shown in this blog post may not match your own search results.)

Note: To get the most out of the search functionality discussed in this blog post, we recommend using version 5.3 update 3 of COMSOL Multiphysics or later.

Searching by Application Name

There is a way to search through the names of applications with more purpose than by free text. To configure the search functionality to search for models based strictly on names, you can use the prefix @name:. This tool enables you to search for an exact match, such as @name:electric_sensor, which will return the model with that exact name. You can also search for a partial match with a specific beginning (or end), such as @name:elec*, which will return any model that starts with “elec”. Finally, you can search for a partial match with the search string anywhere in the name, such as @name:*elec*, which will return any model with “elec” anywhere in the name.

A collage of three screenshots of the Application Libraries to demonstrate how to search for a tutorial model.
Search for a model by the exact name (left), text that the name begins with (center), or text that appears anywhere in the name (right).

With this capability, you can search for the exact model you are looking for instead of clicking through the folder structure, as long as you know the name. Or, you can search for a model with names that involve a key term, prefix, or suffix, such as @name:*mixer*, @name:piezo*, and @name:*metry, respectively.

Searching by Feature and Tag

Searching for a model by its title is simple enough, but searching by text included in a model file is another story. The following features make it easy to search by terms in MPH-files to find the specific model feature you are looking for. First, let’s look at how to find these search terms, in this case, tags.

In the toolbar at the top of the Model Builder window, there is a button to the far right, Model Tree Node Text. This button displays a string next to the nodes in the model tree. While you are able to search the model files with any of the Name, Tag, or Type options, the Tag option applies to the most nodes, so it is the most efficient choice.

A zoomed-in screenshot showing how to view tags in the Model Builder.
Click to show tags for applicable nodes; {comp1} is the only tag shown in this screenshot.

You can then create queries that find all of the models containing that tag, or feature, in the format @, removing the number associated with the tag. As we’ll discuss later on, you can further narrow your search results from a tag query.

If you are curious about a certain physics feature, such as what it is used for and how, you can search through the Application Libraries for models that use it. For example, the Release from Grid feature, included with the Particle Tracing Module, is featured in the Application Libraries in different modules.

Without being able to search these tags, there would be no practical way to find some features. Most features with a tag can be found in this way, whether it is a definition (functions, selections, probes, and couplings); geometry (primitives and operations); physics boundary condition; mesh node; study step; or results node (plot types, data sets, and derived values).

A screenshot of the Application Libraries after searching for models containing the Release from Grid feature.
The list of models that contain the Release from Grid feature. This information is not available just by looking at the model preview on the right.

Searching by Physics Interface

Certain physics interfaces are included in models that you might not expect. This makes it difficult to find all of the models that use an interface. The Global ODEs and DAEs (ge) interface is one example. How would you know which models use this widely applicable interface without reading through model descriptions one-by-one?

Using the scoping syntax @physics:, you can search the Application Libraries for models that include a specific interface. The search term @physics:ge, for example, will locate all models that use the Global ODEs and DAEs (ge) interface. You only need to know the abbreviation, which can all be found in the Add Physics Settings window.

You can also find these models with the search term @ge; however, this will also return models that contain the Global Equations node.

A screenshot of the Application Libraries after searching for models containing the Global ODEs and DAEs interface.
A search for @physics:ge returns all of the models that use the Global ODEs and DAEs interface.

Narrowing Down a Search for a Specific COMSOL Multiphysics® Application

Let’s say, for example, that you want to search for all models in the Application Libraries that include a geometry sweep. You could search by tag, but both the swept mesh and sweep geometry operations have the same tag, {swe}. The number of models that contain swept meshes far outweighs the number of models that contain geometry sweeps, so if you want to learn how to implement a geometry sweep, it becomes almost impossible to find a relevant example by querying @swe. The solution? You can enter @geom:swe to search for the {swe} tag within the Geometry node only.

A screenshot of the Application Libraries after searching for models containing the Sweep geometry operation.
The query @geom:swe returns five models that contain the Sweep geometry operation.

List of Useful Queries for Searching the Application Libraries

You can search for almost any feature within the COMSOL® software Application Libraries with the tools described above. Below, you’ll find a table of search parameters that are especially useful if you are interested in finding specific features:

Search Parameter Use
@axi Returns models that contain the default Axisymmetry physics node, which is useful for finding axisymmetric models
@gr Returns models that include the effects of gravity with the Gravity feature
@pml Returns models that contain a perfectly matched layer (PML)
@ie Returns models that contain an Infinite Element domain
@physics:dg Returns models that contain the Deformed Geometry physics interface
@genext Returns models that contain the General Extrusion feature
@physics:shell Returns models that contain the Shell interface, which spans 5 modules
@iss Returns models that contain the Initial Stress and Strain attribute
@study:sens Returns models that contain a Sensitivity study
@dataset:join Returns models that combine two solution sets using a Join data set
@result:str Returns models that contain a Streamline plot (similar queries can be used for any plot type in COMSOL Multiphysics)
@result:hght Returns models that contain a Height Expression (a 2D plot attribute)

If you find this functionality useful, and find a practical search parameter that you think would be helpful to others, we encourage you to let us know in the comments so we can add it to the table!

Further Reading

Check out the following related topics on the COMSOL Blog:


Categories


Comments

  1. shivashankar hiremath May 11, 2018   5:05 am

    ple give model photothermal actuator application

  2. Shantharama Bhat September 4, 2018   6:22 am

    Dear Sir/Madam,
    Can it be possible to import FORTRAN script in initial values? Instead of sine wave as initial condition we want to use random initial wave condition. The random wave initial condition is in FORTRAN language script. Otherwise can we run it as MATLAB code and import it to initial value condition?

Loading Comments...

Categories


Tags