model.study stores a list of studies, each of which consists of a number of study steps. Each study step, in turn, defines a solver-ready problem. This means that a study step can be turned into an extended mesh, and a basic solver (Stationary, Time, Eigenvalue, Modal, AWE, or Optimization) can be applied, resulting in a solution object.
The central property of a study step is its study type, which on one hand controls the equations generated by physics interfaces, and on the other hand triggers automatic selection of a suitable solver. Another important property of a study step is which mesh to use (for each geometry in the model). Other fundamental simulation parameters can also be found among the study step settings, like the time span for a Time Dependent study type and frequency range for a Frequency Domain study type.
Under a study step, you can add multigrid levels. The parent node still defines the problem to be solved (for example, the study type and the mesh). Therefore, the added multigrid levels must necessarily be coarser than the parent study step.
Most physics features and also some other parts of the model object (for example expression features) must support a step member, which (in analogy to the spatial
selection) controls for which study steps the feature is active. In many ways, the study selection can be seen as a fourth, discrete, dimension.
model.study().create(<tag>) creates a new study sequence.
model.study(<tag>).run() computes the study. The
run method can take an additional Boolean input argument
createPlots, which, when set to true, generates the corresponding default plots when computing a solution.
model.study(<tag>).runNoGen() runs the attached solver sequence without regenerating it.
model.study(<tag>).createAutoSequences(type) creates an attached solver sequence or job using default solver settings if the solver sequence has not been edited. This command is similar to
Compute in the COMSOL Desktop. The argument
type is one of
all,
jobs, or
sol, corresponding to creating both jobs and solver sequences or one of them.
model.study(<tag>).showAutoSequences(type) generates a new attached solver sequence or job using default solver settings. This command is similar to
Show Default Solver in the COMSOL Desktop; that is, it always creates unedited solver sequences. See
createAutoSequences above for information about the
type argument.
model.study(<tag>).getSolverSequences(type) returns a list of tags for solver sequences (see
model.sol()) connected to this study. The
type argument is one of
SolverSequence,
CopySolution,
ParametricStore,
Stored,
Parametric,
None, or
All.
model.study(<tag>).setGenConv(boolean) controls the generation of convergence plots. Use
model.study(<tag>).isGenConv() to check if convergence plots will be generated.
model.study(<tag>).setGenIntermediatePlots(boolean) controls the generation of default plots for intermediate solutions. Use
model.study(<tag>).isGenIntermediatePlots() to check if plots will be generated for intermediate solutions.
model.study(<tag>).setGenPlots(boolean) controls the generation of default plot for the final solution after the last step in a study sequence. Use
model.study(<tag>).isGenPlots() to check if plots will be generated for the final solution.
model.study(<tag>).setPlotUndefVals(boolean) controls the creation of a plot that indicates the location of undefined values such as Inf and NaN. Use
model.study(<tag>).isPlotUndefVals() to check if plots of undefined values will be generated.
model.study(<tag>).setStoreSolution(boolean) inserts a Solution Store node between each study step in a multistep study if set to
true. If set to
false, Solution Store nodes are only inserted in certain cases. Use
model.study(<tag>).isStoreSolution() to check if a Solution Store node is inserted between each study step (it then returns
true).
model.study(<tag>).create(<ftag>,type) creates a new study step of the given type within the specified sequence. The set of allowed values should be limited to study types supported by at least one physics interface present in the model (Stationary, Time, Frequency, and Eigenvalue should always be allowed).
model.study(<tag>).feature().move(<ftag>,position) moves the feature
<ftag> to the zero indexed position
<position> in the list.
boolean model.study(<tag>).feature(<ftag>).loadFile(String filePath) and
boolean model.study(<tag>).feature(<ftag>).SaveFile(String filePath) both work if the type of feature is a Parametric Sweep and then loads or saves information concerning either All Combinations or Specified Combinations. These methods return
false if the type of feature is not a Parametric Sweep. They also return
false if the operation is not successful.
step = model.study(<tag>).feature(<ftag>) obtains a reference to a specified study step.
step.discardData() discards any experimental data imported into a Parameter Estimation study step.
step.discretization(<phys>,<discr>) assigns discretization for a physics interface. The string
<phys> is the tag of a physics interface. The string
<discr> is a tag of a discretization feature under a physics mode or the string
physics to use the discretization settings in the physics interface itself.
step.exportData(<filePath>) exports any experimental data previously imported to a Parameter Estimation study step to the specified file.
step.importData(<filePath>) imports experimental data into a Parameter Estimation study step from the specified
<filePath>.
step.loadFile(<filePath>) loads parameter values from the specified
<filePath> into a Parametric Sweep study step.
step.mesh(<geom>,<mesh>) specifies which mesh to use for geometry
<geom> in the model.
step.refresh() refreshes, that is, reloads, any experimental data files used by a Parameter Estimation study step.
step.saveFile(<filePath>) saves parameter values from a Parametric Sweep study step to
<filePath>.
step.setSolveFor(<entityPath>, boolean) controls whether degrees of freedom defined by the specified entity will be solved for in the study step. When set to false, the degrees of freedom will not be solved for; when set to true, they will be solved for only if the entity can generate equations for the study step type. The correct
<entityPath> argument corresponding to a model entity is given by
<entity>.resolveModelPath().
step.type() returns the study type.
step.discretization(<phys>) returns the tag of the discretization feature under a physics interface with tag
<phys> that specifies the shape functions to use for the physics interface in this study step, or the string
physics to indicate that the discretization settings in the physics interface itself are used.
step.mesh(<geom>) returns the tag of the mesh to be used in geometry
<geom> in this study step.
step.solveFor(<entityPath>) returns true if degrees of freedom defined by the specified entity will be solved for in the study step. The return value accounts for both the state of the
activate property and whether the entity allows the study step type. The correct
<entityPath> argument corresponding to a model entity is given by
<entity>.resolveModelPath().
step.mglevel.create(<mglevel>) adds a (coarser) multigrid level to a study.
step.mglevel(<mglevel>).mesh(<geom>,<mesh>) specifies a mesh for the multigrid level. The set of allowed values must, in addition to the actual meshes, include an option “from parent”. This should be the default choice and indicates that the multigrid level uses the same mesh as the parent study.
step.mglevel(<mglevel>).discretization(<physpath>,<discr>) assigns discretization for a multigrid level. The string
<physpath> is the path of a physics interface. The string
<discr> is a tag of a discretization feature under a physics mode. The default
<discr> the physics interface tag. It can be changed to the tag of a discretization node under a physics interface.
step.mesh(<geom>) returns the mesh selected for the given geometry.
step.mglevel(<mglevel>).mesh(<geom>) returns the mesh for the selected multigrid level and geometry.
step.mglevel(<mglevel>).discretization(<discpath>) returns activation status of a discretization feature.