model.sol()
Solver sequences.
Syntax
model.sol().create(<tag>)
model.sol().create(<tag>,<studytag>)
model.sol().create(<tag>,<studytag>,<varstag>)
model.sol().remove(<tag>)
 
model.sol(<tag>).create(<ftag>,<oper>)
model.sol(<tag>).feature().remove(<ftag>)
model.sol(<tag>).feature(<ftag>).create(<f2tag>,<oper>)
model.sol(<tag>).feature(<ftag>).set(property,<value>)
model.sol(<tag>).feature(<ftag>).getAllowedPropertyValues(property);
model.sol(<tag>).attach(<stag>)
model.sol(<tag>).isAttached()
model.sol(<tag>).detach(<stag>)
model.sol(<tag>).study(<stag>)
model.sol(<tag>).clearSolutionData()
model.sol(<tag>).copySolution(<ctag>)
model.sol(<tag>).createAutoSequence(<stag>)
model.sol(<tag>).createSolution()
model.sol(<tag>).updateSolution()
model.sol(<tag>).updateSolution()
model.sol(<tag>).adaptationStudyFeature()
model.sol(<tag>).adaptationStudyFeature(<stag>)
model.sol(<tag>).getDefaultSolnum()
model.sol(<tag>).setClusterStorage
model.sol(<tag>).getClusterStorage
model.sol(<tag>).isEmpty()
model.sol(<tag>).isInitialized()
model.sol(<tag>).run(<ftag>,[<creatPlots>])
model.sol(<tag>).runFrom(<ftag>,[<creatPlots>])
model.sol(<tag>).runFromTo(<ftagstart>,<ftagstop>,[<creatPlots>])
model.sol(<tag>).runAll([<creatPlots>])
model.sol(<tag>).run()
model.sol(<tag>).continueRun()
Description
model.sol().create(<tag>) adds a solver sequence to the model.
model.sol().create(<tag>,<studytag>) adds a solver sequence to the model. The constructor adds one feature of the type StudyStep to the solver sequence with the tag <studytag>. This StudyStep feature is connected to a study step (see model.study()).
model.sol().create(<tag>,<studytag>,<varstag>) adds a solver sequence to the model. The constructor adds one feature of the type StudyStep with the tag <studytag> and one feature of the type Variables with the tag <varstag> to the solver sequence.
model.sol().remove(<tag>) removes a solver sequence from the model.
model.sol(<tag>).create(<ftag>,<oper>) creates a solver feature. Each solver feature is a solver operation.
model.sol(<tag>).feature().remove(<ftag>) removes the solver feature <ftag>.
model.sol(<tag>).feature(<ftag>).set(property,<value>) sets the property property for the feature <ftag>.
model.sol(<tag>).feature(<ftag>)).getAllowedPropertyValues(property) returns the set of allowed values for a property if the set is a finite set of strings; otherwise, it returns null.
model.sol(<tag>).attach(<stag>) attaches a solver sequence with tag <tag> to a study with tag <stag>, which makes it visible under that study. You can use attach to make a solver sequence part of the study sequence. Using model.sol(<tag>).study(<stag>), on the other hand, only associates a solver sequence with a study. The attach() operation implies calling study(<tag>). You can only have one solver sequence attached to each study (but you can have multiple batch features).
model.sol(<tag>).isAttached() returns true if the solver sequence with tag <tag> is attached to a study.
model.sol(<tag>).detach(<stag>) detaches a solver sequence with tag <tag> from study with tag <stag>.
model.sol(<tag>).clearSolutionData() clears computed solution data associated with the solver sequence <tag>. Solution selection settings and settings in results features associated with the solution are not modified.
model.sol(<tag>).getDefaultSolnum() returns which solnum the call getU() returns (compare with getU(<solnum>); see Solution Data).
model.sol(<tag>).setClusterStorage(<value>) sets the solution storage format used on clusters. Use the <value> "all" to store the solution on all cluster nodes and the <value> "single" to store the solution only on a single cluster node.
model.sol(<tag>).getClusterStorage() returns "all" if the solution is stored on all cluster nodes and "single" if the solution is only stored a single cluster node.
model.sol(<tag>).copySolution(<ctag>) copies the solution data associated with the solver sequence <tag> to a new solver sequence <ctag>. The features are not copied.
model.sol(<tag>).createAutoSequence(<stag>) creates a solver sequence of features automatically from the study <stag>. The sequence of study steps are used as input to the sequence generation algorithm but also the physics used in the study steps are used to automatically adopt the solver settings.
model.sol(<tag>).createSolution() creates a solution object from one or more set operations (setU(…), …), see Solution Creation for details.
model.sol(<tag>).updateSolution() updates a solution data associated with the solver sequence to make it consistent with the current model.
model.sol(<tag>).adaptationStudyFeature() returns the path to the study feature with adaptation that controls this sequence or empty string if none. model.sol(<tag>).adaptationStudyFeature(<ftag>) sets the study feature with adaptation, <ftag>, that controls the solver sequence <tag>. Use an empty string to disable study control.
model.sol(<tag>).isEmpty() is true if there is no solution data or if all solution data has been cleared.
model.sol(<tag>).isInitialized() is true if the solution is a valid (initialized) object. Even if the solution has been cleared, isInitialized is true (use isEmpty to check for cleared solution data).
model.sol(<tag>).run(<ftag>) runs the features for a solver sequence up to and including the feature <ftag>. It corresponds to clicking Compute on the solver sequence feature node in the COMSOL Desktop.
model.sol(<tag>).runFrom(<ftag>) runs the features for a solver sequence from and including the feature <ftag>.
model.sol(<tag>).runFromTo(<ftagstart>,<ftagstop>) runs the features for a solver sequence from and including the feature <ftagstart> to and including the feature <ftagstop>.
model.sol(<tag>).runAll() and  model.sol(<tag>).run() run all the features for a solver sequence.
All the run, runFrom, runFromTo and runAll methods can take an additional Boolean input argument createPlots, which, when set to true, generates the corresponding default plots when computing a solution.
model.sol(<tag>).continueRun() continues to run a solver sequence.
Examples
Assume that a study st1 represents one stationary study step with the tag stat1 for some equations.
Code for Use with Java
model.sol().create("s","step1","vars1");
model.sol("s").feature("step1").set("study","st1");
model.sol("s").feature("step1").set("studystep","stat1");
model.sol("s").create("solver1","Stationary");
Code for Use with MATLAB
model.sol.create('s','step1','vars1');
model.sol('s').feature('step1').set('study','st1');
model.sol('s').feature('step1').set('studystep','stat1');
model.sol('s').create('solver1','Stationary');
Assume that a second study step with frequency response is added to the study with tag freq1 and that you want to make a frequency sweep from 10 to 1000 using the parametric solver and the solution above as the linearization point (bias solution).
Code for Use with Java
model.sol("s").create("step2","StudyStep");
model.sol("s").feature("step2").set("study","st1");
model.sol("s").feature("step2").set("studystep","freq1");
model.sol("s").create("vars2","Variables");
SolverFeature s2 = (SolverFeature) model.sol("s").create("solver2","Stationary");
s2.set("nonlin","linper");     // (*)
s2.set("linpmethod","sol");
s2.set("linpsol", "s");
s2.set("storelinpoint", "on");
s2.create("par","Parametric");
s2.feature("par").set("pname","freq");
s2.feature("par").set("plist",new double[]{10,1000});
s2.runAll();
Code for Use with MATLAB
model.sol('s').create('step2','StudyStep');
model.sol('s').feature('step2').set('study','st1');
model.sol('s').feature('step2').set('studystep','freq1');
model.sol('s').create('vars2','Variables');
s2 = model.sol('s').create('solver2','Stationary');
s2.set('nonlin','linper');     // (*)
s2.set('linpmethod','sol');
s2.set('linpsol', 's');
s2.set('storelinpoint', 'on');
s2.create('par','Parametric');
s2.feature('par').set('pname','freq');
s2.feature('par').set('plist',[10,1000]);
s2.runAll;
At this point the solution s is associated to the study step freq1 (but it depends indirectly on the bias study step stat1 as well).
(*) Uses the small-signal study functionality, which makes it possible to access also the linearization point for postprocessing together with the small-signal solution. Here it is assumed that the bias problem and the small-signal problem can be set up independently for the two study steps.
Compatibility
From version 5.3a, the method
model.sol(<tag>).clearSolution()
is deprecated and replaced by the method
model.sol(<tag>).clearSolutionData()
since clearSolutionData generally works as expected, while clearSolution clears settings unexpectedly.
See Also
model.study()