How to Search for a Specific COMSOL Multiphysics® Application

May 10, 2018

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 use specific modeling techniques. To get the most out of the Application Libraries, you should be able to easily find the information you need.

Editor’s note: This blog post was updated on 1/31/2020 to include an updated list of search parameters.

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 applications 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 applications that you have downloaded during or after installation, so the results shown in this blog post may not match your own search results. Added in with version 5.5 of the COMSOL software, you can also download and search through application files as preview files, with a smaller memory requirement than downloading the actual files.)

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 Type 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, type.

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 Type option returns exactly what you’re looking for, so it is the most efficient choice.

A screenshot showing how to search for applications by type.
Click to show the Type for applicable nodes.

You can then create queries that find all of the models containing that type, or feature, in the format @type:. 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, most associated with the Particle Tracing Module, is featured in the Application Libraries in different modules.

Without being able to search these types, there would be no practical way to find some features. Most features with a type can be found in this way, including functions, selections, probes, and couplings; geometry primitives and operations; physics nodes; mesh nodes; study nodes; or results node plot types, datasets, and derived values. You can also use the Tag option to search through features. This is useful for features with long names; however, some features have the same tags, so your results may include models without the feature you are looking for.

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.

Narrow Your Aim with Scopes

Scoping terms allow you to narrow your focus to predefined sets of options. The list of scopes includes @selection, @geom, @mesh, @physics, and @result, all of which produce a search within the specified scope. Let’s take a look at how some are used.

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 be found in the Add Physics Settings window.

You can also find these models with the search term @tag: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.

Geometry and Mesh

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 @tag: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.

Miscellaneous Scope

Just like new features are added to the software, new search features are added as well, such as the following, included with COMSOL Multiphysics 5.5. There are three additional classifications that apply to some applications: industrial examples, tutorials, and verification models. You can narrow your search to only show one of these using the @keyword: scope, followed by industrial, tutorial, or verification. Additionally, the @time: scope lets you search for models with a specific computation time. For example, use @time:>=1[h] <=2[h] to search for models with a computation time between 1 and 2 hours. Finally, your Application Libraries will either contain solved models, unsolved models, or preview models, or a combination of the three. You can use the search strings $solved, $compact, and $preview, respectively, to only include those models in your Application Libraries.

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. For a full list of scopes and other helpful info, you can access a list in the Help menu when the cursor is in the search box.

Search Parameter Use
@type:axialsymmetry Returns models that contain the default Axisymmetry physics node, which is useful for finding axisymmetric models
@type:gravity Returns models that include the effects of gravity with the Gravity feature
@type:generalextrusion Returns models that contain the General Extrusion feature
@tag:pml Returns models that contain a perfectly matched layer (PML)
@tag:ie Returns models that contain an Infinite Element domain
@tag:iss Returns models that contain the Initial Stress and Strain attribute
@geom:swe Returns models that include the Sweep geometry feature
@mesh:swe Returns models that include the Swept mesh feature
@physics:dg Returns models that contain the Deformed Geometry physics interface
@physics:shell Returns models that contain the Shell interface, which spans five modules
@physics:shell @physics:solid Returns models that contain both a Shell interface and a Solid Mechanics interface
@multiphysics:nitf Returns models that include nonisothermal flow
@study:sens Returns models that contain a Sensitivity study
@dataset:join Returns models that combine two solution sets using a Join dataset
@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 (4)

Leave a Comment
Log In | Registration
Loading...
shivashankar hiremath
shivashankar hiremath
May 11, 2018

ple give model photothermal actuator application

Brianne Costa
Brianne Costa
December 3, 2018 COMSOL Employee

Hello Shivashankar,

Thank you for your comment.

For questions related to your modeling, please contact our Support team.

Online Support Center: https://www.comsol.com/support
Email: support@comsol.com

Shantharama Bhat
Shantharama Bhat
September 4, 2018

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?

Brianne Costa
Brianne Costa
December 3, 2018 COMSOL Employee

Hello Shantharama,

Thank you for your comment.

For questions related to your modeling, please contact our Support team.

Online Support Center: https://www.comsol.com/support
Email: support@comsol.com

EXPLORE COMSOL BLOG