Using a Tag Tree for Organization and Retrieval in a Database
There are various ways a user of the COMSOL Multiphysics software may organize their simulation work when relying solely on the file system for storage. Perhaps they have set up a folder structure containing their MPH-files and associated data files. The files are maybe placed in various subfolders corresponding to different projects (in a generic sense). Perhaps there is a shared folder with data files used as input in several models and in different projects. There could also be a template folder with a few models containing some common setups and to be used as starting points for new projects. Version control of files could be achieved via a strict naming convention: say model_v1.mph, model_v2.mph, model_v3.mph, and so on and data_file_v1.txt, data_file_v2.txt, data_file_v3.txt, and so on. To keep track of the ongoing work, each series of version-controlled MPH-files could perhaps have an associated work log file that describes what was changed between each version. Each data file might have an associated used-by text file, containing a list of MPH-files known to use this particular data file as input (or there could a be single spreadsheet document containing a table with all such relations).
The Model Manager tools in the COMSOL Desktop modeling environment helps you with these organizational and version-control aspects of your simulation work by, for example, keeping a version history of items, automatically keeping track of references between items, and enabling you to save comments, descriptions, and other metadata with your items. One such organizational metadata is the concept of assigning tags to items, which is the Model Manager analogue to placing such items in folders on your computer. Much like folders on the file system, tags can be assigned to other tags, resulting in a tag tree structure of tags, models, and data files.
The demo database for Model Manager already contains such a tag tree. These tags were automatically created from the corresponding folders that contained the models and data files in the COMSOL Application Libraries when these files were imported into the database.
You can view the tag tree from the Model Manager window by switching from the Table View to the Tree View. While the former view is useful when you quickly want to find models and data files given a specific set of search and filter criteria, the latter is more suited to browsing the items in the database without having a particular model or data file in mind.
1
In the Model Manager window, click the Tree button () in the toolbar.
The Model Manager window switches to show a tree of tags (). There are about 50 tags at the top level, with several hundred more tags found under these top tags.
2
Expand the tags ACDC Module>Tutorials, Cables. You will find about 30-40 items under the last tag tree node. In the Model Manager database, these items are all assigned a tag with title Tutorials, Cables. The Tutorials, Cables tag is itself assigned the ACDC Module tag. The number of items found under each tag tree node in the search result is written within parentheses next to the tag’s title.
3
Write tutorials, cables in the text field and click Search. The tree only shows the items assigned the tag, the Tutorials, Cables tag itself, and the ACDC Module tag.
Punctuation characters, such as commas, are ignored when searching in a Model Manager database. Write tutorials cables to get the same search result.
4
Write acdc module and click Search. The search result contains all items found under the ACDC Module tag. You may be surprised, however, to discover a few other tags on the top level in the tag tree.
5
Expand ACDC Module>Electromagnetics and Optimization. One of the tagged items is the Topology Optimization of a Magnetic Circuit model (). Also expand Acoustics Module>Optimization and notice that the same model is in fact also found under these latter tags.
You can assign multiple tags to the same item in a Model Manager database. In this case, Model Manager discovered during the import that the model Topology Optimization of a Magnetic Circuit was stored as identical MPH-files in multiple folders in the COMSOL Application Libraries. Rather than importing duplicate models, a single model was imported and assigned multiple tags.
6
Write topology optimization magnetic circuit and click Search. You will discover that the model, together with a few other items, was assigned three different tags during the import.
7
Click the Reset button () to clear the current search terms and restore the tag tree. Click the Table button () to switch back to the Table View.
Browsing the Tag Trees of Multiple Databases
The Model Manager window enables you to search and browse a specific branch in a specific repository in a Model Manager database. If you would prefer to browse multiple branches in different repositories, and perhaps in different databases, at once, you can use the Databases window.
1
In the Database toolbar, in the Database section, click the Databases button ().
The Databases window opens next to the Model Manager window. The window shows all databases that you have added to the COMSOL Desktop as a tree.
2
Expand the Main () branch node for the demo database.
The same tag tree available in the Model Manager window is shown as a subtree to the branch node. Unlike the Model Manager window, however, there is no search functionality available in the window.
3
4
Click the Databases button () again to close the Databases window.
The Databases window is also where you perform more advanced database operations including, for example, creating and merging branches or managing users and groups in a Model Manager server database.