Computing a Solution
Overview
A solution can be computed in a few ways depending on the sequence implemented for a model.
For the settings in the Solution node’s Settings window under Cluster Computing, see Cluster Computing Settings below.
The Difference Between Computing a Study, Solver, or Job
There are conceptual differences between computing, or running, a study versus running a solver configuration or a job configuration. When a solver configuration or job configuration is run, no nodes are added or removed; it is computed “as is.”
Running a study, on the other hand, can be different. When you compute a Study, it always runs the enabled configurations (see below). What the Study runs can be a Job or a Solver (for example, a Stationary Solver) depending on the study configuration. If a Job is run, it typically also means that a solver is also run (by the job). But before the study runs a job or a solver, it reconstructs the (enabled) configurations from scratch. An exception to this rule is when the enabled configurations are edited (an asterisk indicates this; see Figure 20-7 for an example), in which case the sequences are computed “as is.”
About Enabled Study or Solver Sequences
The particular sequence that is Enabled and runs when selecting Compute has a green border around its icon (). You can disable an enabled sequence by right-clicking the node and selecting Disable (which removes the green border). If no sequence is enabled when the study or solver configuration attempts to generate a sequence, a new sequence with default settings is generated. Only one sequence per study can be enabled. For job configurations, the sequence here means a unique path defined from a solver sequence to a job configuration and possibly another job configuration pointing to that job configuration, and so on. Also see Figure 20-6 for other examples of enabled sequences.
Computing a Study or Solver
The most straightforward method to compute a solution is to right-click the Study node () and select Compute () or press F8. You can also click Compute () in the main and Study toolbars and in the toolbar at the top of the study steps’ and solver nodes’ Settings windows.
By default, a study creates a Solution dataset and plot groups with results plots suitable for the physics interfaces for which you compute the solution. If you do not want to generate plots automatically, clear the Generate default plots check box in the Study Settings section in the main Study node’s Settings window. You can also right-click the main Study node and select Show Default Plots () to add the plot groups and plots that are added by default if the Generate default plots check box is selected. Right-click the main Study node and choose Reset Default Plots () to restore the default plots and their settings to the default plots and settings.
If the study contains more than one study step, and you want to compute only a part of the study steps, right-click a study step and select:
Compute Selected Step () (or press F7) to compute just the selected study step.
Compute to Selected () to compute from the first to the selected study step.
Compute from Selected () to compute for all study steps from the selected study step to the last.
If you show the solver sequences under Solver Configurations, you can right-click any node in a solver sequence and select:
Compute () (or press F8) to compute the entire solver sequence.
Compute to Selected () (or press F7) to compute the solver sequence from the top down to the selected node.
Compute from Selected () to compute from the Compile Equations node () that is associated with the selected node down to the end of the solver sequence.
Updating a Solution
To update the solution for a study to use the current values of parameters and user-defined variables, right-click the Study node and select Update Solution () (or press F5).
Updating the solution updates the current study (if selected) or all studies if no study is selected. This is useful in the following situations when you have:
In all these cases, the COMSOL software passes or interpolates the solution to the resulting datasets but does not recompute it to reflect any changes in variables, equations, mesh, or geometry.
Computing a Solver Configuration
When you have added study steps to a study, a Solver Configurations (and maybe a Job Configurations) sequence is generated when the Study is computed. The Solver Configurations branch represents the solvers, dependent variables and degrees of freedom, and other study-related functionality that the study steps require.
A Solver Configurations or Job Configurations node displays automatically if it has content. Otherwise, if you click the Show More Options button () and select Solver and Job Configurations in the Show More Options dialog box, it is available as an option from the context menu.
In some cases, the default settings in the study steps are not sufficient to specify the details of how to obtain a solution. In this case you can edit the sequence and run it again. See Editing and Rerunning a Solver Configuration below.
To compute a solution:
Under Solver Configurations, right-click the corresponding Solution node and select Compute.
Right-click a Study node and select Compute to compute the enabled solver (the node with a green border around its icon), if such a solver configuration exists. If no solver configuration exists, or if all sequences are disabled, a new solver configuration is generated and computed.
Figure 20-7: A Solver Configurations sequence with more than one solver. This is an example from the CFD Module Application Library.
If you have already generated a solver configuration for the study, or if your solver configuration consists of several solvers, as with the study steps, you can right-click a configuration and choose:
Compute to Selected () (or press F7), to run a particular solver, or
Compute from Selected () to run the selected solver and all solvers below it in the sequence, or
Compute (or press F8), to run the entire solver configuration.
For example, right-click a Dependent Variables node and select Compute to Selected to evaluate the initial values for the dependent variables (similar to the Get Initial Value and Get Initial Value for Step options for the main Study nodes and the study steps).
Editing and Rerunning a Solver Configuration
The Solver Configurations branch nodes (or if applicable, the Job Configurations branch) can be edited to adjust solver settings, for example, if you want to change a tolerance or use a different time-stepping method. If you edit any settings in a subnode to a Solution node, an asterisk in the upper-right corner (Figure 20-8) indicates that the settings differ from the default settings for the study types in the study.
Figure 20-8: A Solution node has an asterisk in the icon to indicate the sequences that have been edited. To compute, highlight the Solution node, press F8, right-click and choose Compute, or click the button in the Settings window.
To see what properties and values that have changed in any node with an asterisk in a solver configuration, the Changes from Default Values section at the bottom of each node’s Settings window contains a list of all properties that have changed, including descriptions, property names, default values, and current values.
After editing a solver configuration, you run the sequence again. Running a solver configuration is tantamount to computing a solution. Like mesh nodes, solution nodes are not built automatically as they are added. It is possible to have several solver configurations under a Solver Configurations node (see Figure 20-7), including Solver - Copy nodes for copies of a solution (see Create Solution Copy).
Cluster Computing Settings
Under Cluster Computing, you get information about cluster solution storage. You can also choose a partitioning method from the Partitioning method for distributed computing list: Off (the default), Mesh ordering, Nested dissection, or Weighted nested dissection. This method affects the partitioning of the mesh data on cluster for the purpose of creating a DOF enumeration optimized for the particular cluster configuration (number of nodes). Mesh ordering is doing the partitioning based on existing mesh-element order and will produce a result similar to the existing DOF enumeration without any partitioning of the data. The nested dissection will on n cluster nodes partition the mesh data into n parts, minimizing the overlap between the parts before the DOFs for all the parts are enumerated. The weighted nested dissection option takes into account the expected number of DOFs per mesh element to produce parts with comparable total number of DOFs in each part. The benefit of using nested dissection and weighted nested dissection partitioning for cluster configuration-specific DOF enumeration is the performance improvement due to the reduction in the amount of communication between cluster nodes.
Converting a Solution for Cluster Computing
Right-click a Solution node and choose Domain Decomposition>Convert to Domain Decomposition (Schwarz) and Domain Decomposition>Convert to Domain Decomposition (Schur) to convert a solver into a similar Domain Decomposition solver with settings adapted for cluster computing. These options for conversion to domain decomposition solvers are also available on the context menus of solver nodes that support direct and iterative solvers (such as Stationary Solver and Time-Dependent Solver nodes). They are mainly intended for running on larger clusters where the domain decomposition strategy can be faster than the usual solvers. See Domain Decomposition (Schwarz) and Domain Decomposition (Schur) for more information about the domain decomposition solvers.
Progress and Log Information
While a problem is being solved, it is useful to know its progress. The Progress Window monitors the state of the analysis for the solvers during the solution process. In this window, you can Cancel or Stop a Solver Process and also continue the solver process. Alternatively, in The Log Window you can inspect convergence information and other data from the latest and earlier runs.