Studies and Study Steps
Introduction
In the COMSOL Desktop, you create one or more studies, each with one or more study steps to compute the solution to a model. The studies generate a solver sequence with the solvers and other solver features that correspond to the study steps in the study.
Study and Study Step Types in the COMSOL Multiphysics Reference Manual.
Creating a Study and Adding Study Step
The following commands create a study std1 and adds a Stationary study step to that study:
model.study().create("std1");
model.study("std1").create("stat", "Stationary");
Running (Computing) a Study
To run a study, use
model.study(<tag>).run();
The run() command corresponds to clicking Compute on a Study node in the COMSOL Desktop.
Creating a Reference to a Study Step
You can also create a reference to an existing study step from a solver sequence:
model.sol("sol1").create("st1", "StudyStep");
model.sol("sol1").feature("st1").set("study", "std1");
model.sol("sol1").feature("st1").set("studystep", "stat");
Attaching a Study
It is also possible to attach a study for making a solver sequence or batch feature part of the study sequence:
model.sol("sol1").attach("std1");
The attach() operation implies calling study(<tag>)(see below). You can only have one solver sequence attached to each study but you can have multiple batch features.
Associating a Solver Sequence With a Study
You can associate a solver sequence with a study using the following syntax:
model.sol("sol1").study("std1");
In contrast, attach() (see above) also makes the solver sequence part of the study sequence.
Main Study Feature Settings
For example, use
model.study("std1").setGenConv(true);
to generate convergence plots when computing the solution.
Common Study Step Properties
The following table explains properties available for all study steps defining equations:
frame: followed by a Frame entity tag
rom: followed by a ReducedModel entity tag
A component tag followed by :shape controlling shape optimization in the component
A component tag followed by :topopt controlling topology optimization in the component
Allowed values are on or off. Default depends on the key.
Choose coupling features to solve for. Allowed keys are MultiphysicsCoupling entity tags. Allowed values are on or off. Default is on.
CommonFeature entities disabled when useadvanceddisable is on. Not all types can be disabled.
Coordinate system features disabled when useadvanceddisable is on. Only types representing PMLs, infinite elements and absorbing layers can be disabled.
MultiphysicsCoupling entities disabled when useadvanceddisable is on.
Pair entities disabled useadvanceddisable is on.
Physics interfaces and features disabled when useadvanceddisable is on. Allowed reference tags are:
Variables entities disabled when useadvanceddisable is on.
Entities which should not control any frame when useadvanceddisable is on. Allowed reference tags are:
frame: followed by a Frame entity tag
A component tag followed by :shape controlling shape optimization in the component
Select discretization for physics interfaces. Allowed keys are the same as in activate. Allowed values are physics (also default) and tags of any Discretization feature belonging to the key entity.
Override study step equation form for physics interfaces. Allowed keys are the same as in activate. Allowed values are physics (also default if the physics allows setting equation form) and any equation form allowed by the physics interface settings.
Specify frequency to use for a physics interface when its equation form is set to a frequency-domain type using the equationform property. Allowed keys are the same as in activate. Allowed values are parameter expressions. The default is the same as the default in the physics interface settings.
on | off
Properties Of Specific Study Step Types
The following table lists the major study steps with links to documentation of available properties for each study step: