Comparing Models Saved in Databases
The Comparison Result window enables you to compare versions of models stored in databases. In this section, you will see five different ways you can encounter comparisons involving such models:
Comparing Models and Applications in the COMSOL Multiphysics Reference Manual
Comparing Two Versions From a Model’s History
If you select two model versions in the Versions window and click Compare (), the Comparison Result window will open with the older version shown on the left, labeled as Older Version, and the newer version on the right, labeled as Newer Version. The versions need not belong to the same model: the older version may, for example, belong to an origin model of the newer version’s model — see Splitting a Model Version History in Two. Since model versions are immutable in the database, it is not possible to merge or override any differences from the Comparison Result window.
Comparing Two Models
If you select two models in The Model Manager Window or The Databases Window and click Compare (), the Comparison Result window will open with one of the models labeled as First and the other as Second. The compared versions depend on the context where the models were selected. Selecting two models when Searching in Branches will compare the latest versions of each respective model. Selecting when Searching in Snapshots and Commits will compare the versions that were the latest at the time of the corresponding commit. Similar to when comparing two versions from a model’s history, it is not possible to merge or override any differences in the Comparison Result window.
Comparing a Version With the Opened Model in the COMSOL Desktop
If you select a single model version and click Compare (), the Comparison Result window will open with a comparison between the model opened in the COMSOL Desktop, labeled Opened, and the selected version, labeled Saved version.
Right-click the top node in the Differences tree and select Merge Changes to Opened () to merge all changes marked as incoming (that is, changes to the model tree made in the selected model version) into the desktop model. All changes marked as outgoing (that is, changes made to the model tree in the desktop model) are left alone.
Right-click any node in the Differences tree and select Override Difference in Opened () to write all changes in that node to the opened model, regardless if any changes are incoming or outgoing, effectively reverting any changes you have made in the desktop model.
Comparing the Opened Model in the COMSOL Desktop With the Saved Version
After having opened a model version from a database and worked on it for a while in the COMSOL Desktop, you may want to see all changes you have made. As a shortcut to selecting the corresponding saved version in the Versions window and clicking Compare () from the window’s toolbar, you can click Compare with Saved () in the Model Builder’s Developer toolbar. The Comparison Result window is opened with a comparison between the model in the COMSOL Desktop and the version it was loaded from.
Comparing the Opened Model in the COMSOL Desktop With the Latest Version
If you encounter a version conflict when trying to save a new version of the model opened in the COMSOL Desktop, you can open the Comparison Result window with a comparison between the desktop model, labeled Opened, and the latest version of the model being saved, labeled Latest Version — see also Save Conflicts. Similar to Comparing a Version With the Opened Model in the COMSOL Desktop, you can merge changes and override differences into the desktop model to include those changes you want to keep from the latest version.