Batch Sweep
To enable this option in the context menu, click the Show More Options button () and select Batch or Batch and Cluster (if your license includes cluster computing) in the Show More Options dialog box.
Use the Batch Sweep () study to find the solution to a sequence of stationary or time-dependent simulations that arise when you vary some parameters of interest. See Batch and Batch Sweep for information about situations where a batch sweep is useful. If you want to make a full multiparameter sweep (solving first for the first value of the first parameter combined with all values of the second parameter, then for the second value of the first parameter combined with all values of the second parameter, and so on), you can add several Parametric Sweep nodes, one for each additional parameter except the outermost parameter. COMSOL Multiphysics then treats the parametric sweeps as a “nested for-loop” and indicates the nested structure using indentations of the Parametric Sweep node names. See also Batch Sweeps vs. Cluster Sweeps.
The Batch Sweep is always the outermost sweep. It starts multiple COMSOL Multiphysics batch processes — one for each parameter set in the Batch Sweep node — that solve the current study on your computer given the parameter set.
Once the filename and directory are set, right-click the parent Study node and choose Compute to start the COMSOL Multiphysics batch processes that compute the current study.
When the batch sweep process starts, the COMSOL Desktop follows the progress in The External Process Window. When the process finishes (or you click the Detach Job button to no longer follow the process), an External Process node, one for each parameter, is added under a Batch Data node as in Figure 20-5. The External Process node represents the current running process.
If you click Detach Job, the Batch Sweep then no longer synchronizes the solutions and accumulated probe table. To reenable the synchronization, use the Show All Progress button in the Batch Data node.
Study Settings
The batch sweep is a multiparameter sweep with its parameters solved as a batch job; see Parametric Sweep for more information.
Output while Solving
Use the Probes list to select probes to update during the batch sweep. The default is All, which selects all probes for plotting and tabulation of probe data. Select Manual to open a list with all available probes. Use the Move Up (), Move Down (), Delete (), and Add () buttons to make the list contain the probes that you want to see results from while solving. Select None to disable probe updating for batch sweep.
Select the Accumulated probe table check box to activate the accumulation of probe updates for both the variation on the solver level (time, frequency, and so on) and on the batch sweep level. Use the Output table to select where to put the data. Select the Use all probes check box if all the model probes should be accumulated in the table. If not selected, the probes selected from the Probes list are used.
No plots are generated automatically from the accumulated probe tables. When a full variation has been accumulated, then the Format: Filled is available for the table (see the Settings window for Table). This format makes it possible to make response surfaces directly from the Results view toolbar Surface Plot button.
Batch Settings
You can specify the batch filename in the Filename field on the Computing>Cluster page in the Preferences dialog box if you have selected the Specify batch filename check box on the same page first. If that check box is not selected, the batch filename is taken from the model filename. If you want to use another name, select the check box next to the Filename field and then specify the filename for the file in which to store the model in the Filename field. The directory in which to store the model is the one in the Batch directory field, which is also on the Computing>Cluster page in the Preferences dialog box.
Select the Generate solver sequence in external process check box to delay the generation of the solver sequence (for example, to avoid expensive mesh generation on the desktop before submitting the batch job).
From the Add parameters to filename list, choose Parameter name and value (the default), or choose Index, which instead of parameter names and parameter values uses an index scheme iX, iY, …, where same indices relate to the same parameter value. This option gives much shorter filenames.
Select the Specify server directory path check box if you have a floating network license and want to perform this computation using an installation at a remote location. Then specify the directory path in the Directory field by typing it directly or clicking the Browse button () to choose a directory.
Before Sweep
Select the Clear meshes check box to clear the meshes before running the batch sweep. The default is to clear the meshes. Select the Clear solutions check box to clear the solutions before running the batch sweep. The default is to clear the solutions. These settings are only important if you run a remote computation on a cluster or cloud and want to minimize the size of the file transferred over the network (only available with a floating network license).
During Sweep
Select the Synchronize solutions check box to synchronize the solutions computed by the batch processes with the model. This allows additional postprocessing after the sweep has finished. The default is to disable solution synchronization. If desired, and the Synchronize solutions check box is selected, select the Clear synchronization data check box to clear synchronization files left by batch jobs. Log files, .status, .recovery, and batch job MPH-files are not removed. To save the model to file before removing all synchronization data, select the Save model to file after synchronization is completed check box. The filename is the same as the one used for making a backup.
When the Synchronize solutions check box is selected for some models, the batch sweep stores a large number of files in the directory specified under Cluster computer settings. Those files are needed for the synchronization of the solutions.
After Sweep
Select the Output model to file check box to enable that all batch processes save the models to file. Selecting this check box ensures that the MPH-files that are automatically saved contain the solution (for each parameter). In most cases, the solution synchronization and probe synchronization functionality should be used instead because otherwise the data ends up in one file for each process and cannot be postprocessed efficiently.
Advanced Settings
Select the Use graphics check box when the batch process should run results nodes that create graphical contents such as exporting to file. Enter the Number of simultaneous jobs. The default is 1. This is the maximum number of batch processes that are allowed to run simultaneously. Enter the Number of job restarts. The default is 0. This is the maximum number of times the job can be restarted if it fails to complete. Enter a value for the Alive time (seconds). The default is 300 seconds. This is the longest time the process is allowed to run before it must inform that it is still running. Failure to do so means that the process is considered dead, and a new process is started if the maximum number of job restarts is not reached.