use of cbit.vcell.solver.SolverDescription in project vcell by virtualcell.
the class SimulationListPanel method quickRun.
/*
private void particleView() {
int row = getScrollPaneTable().getSelectedRow();
if (row < 0) {
return;
}
Simulation selectedSim = getSimulationListTableModel1().getValueAt(row);
getSimulationWorkspace().getClientSimManager().runSmoldynParticleView(selectedSim);
}
*/
private void quickRun(ViewerType viewerType) {
int row = getScrollPaneTable().getSelectedRow();
if (row < 0) {
return;
}
activateConsole();
Simulation selectedSim = getSimulationListTableModel1().getValueAt(row);
SolverDescription solverDescription = selectedSim.getSolverTaskDescription().getSolverDescription();
if (solverDescription.equals(SolverDescription.FiniteVolume)) {
if (getSimulationWorkspace().getSimulationOwner() instanceof SimulationContext) {
String option = DialogUtils.showOKCancelWarningDialog(SimulationListPanel.this, "Deprecated Solver", VCellErrorMessages.getSemiFVSolverCompiledSolverDeprecated(selectedSim));
if (option.equals(SimpleUserMessage.OPTION_CANCEL)) {
return;
}
try {
selectedSim.getSolverTaskDescription().setSolverDescription(SolverDescription.FiniteVolumeStandalone);
selectedSim.setIsDirty(true);
} catch (PropertyVetoException e) {
e.printStackTrace();
}
}
}
getSimulationWorkspace().getClientSimManager().runQuickSimulation(selectedSim, viewerType);
}
use of cbit.vcell.solver.SolverDescription in project vcell by virtualcell.
the class DataProcessingInstructionPanel method refresh.
private void refresh() {
if (solverTaskDescription == null) {
return;
}
SolverDescription solverDesc = solverTaskDescription.getSolverDescription();
if (solverDesc.supports(SolverFeature.Feature_DataProcessingInstructions)) {
setVisible(true);
DataProcessingInstructions dpi = solverTaskDescription.getSimulation().getDataProcessingInstructions();
if (dpi != null) {
dataProcessorCheckBox.setSelected(true);
editDataProcessorButton.setEnabled(true);
} else {
editDataProcessorButton.setEnabled(false);
}
} else {
setVisible(false);
}
}
use of cbit.vcell.solver.SolverDescription in project vcell by virtualcell.
the class SolverTaskDescriptionAdvancedPanel method createSolverComboBoxModel.
/**
* Gets the solverTaskDescription property (cbit.vcell.solver.SolverTaskDescription) value.
* @return The solverTaskDescription property value.
* @see #setSolverTaskDescription
* new javax.swing.DefaultComboBoxModel()
*/
private javax.swing.DefaultComboBoxModel<String> createSolverComboBoxModel(SolverTaskDescription newSolverTaskDescription) {
if (fieldSolverComboBoxModel == null) {
fieldSolverComboBoxModel = new DefaultComboBoxModel<String>();
}
// remember cuurent solver so we can put it back as the selected one after creating the list
// otherwise, iterating while adding elements will fire events that will change it on the TornoffSolverTaskDescription...
SolverDescription currentSolverDescription = null;
if (newSolverTaskDescription != null && newSolverTaskDescription.getSolverDescription() != null) {
currentSolverDescription = newSolverTaskDescription.getSolverDescription();
}
//
fieldSolverComboBoxModel.removeAllElements();
if (getSolverTaskDescription() != null) {
MathDescription mathDescription = getSolverTaskDescription().getSimulation().getMathDescription();
for (SolverDescription sd : SolverDescription.getSupportingSolverDescriptions(mathDescription)) {
if (!sd.deprecated) {
fieldSolverComboBoxModel.addElement(sd.getDisplayLabel());
}
}
}
//
if (currentSolverDescription != null) {
fieldSolverComboBoxModel.setSelectedItem(currentSolverDescription.getDisplayLabel());
}
return (fieldSolverComboBoxModel);
}
use of cbit.vcell.solver.SolverDescription in project vcell by virtualcell.
the class SolverTaskDescriptionAdvancedPanel method refresh.
/**
* Comment
*/
private void refresh() {
if (getSolverTaskDescription() == null) {
return;
}
SolverDescription solverDescription = getSolverTaskDescription().getSolverDescription();
if (solverDescription == null) {
getSolverComboBox().setEnabled(false);
} else {
getSolverComboBox().setEnabled(true);
//
if (getSolverComboBox().getSelectedItem() == null || !getSolverComboBox().getSelectedItem().equals(solverDescription.getDisplayLabel())) {
if (getSolverComboBox().getModel().getSize() > 0) {
getSolverComboBox().setSelectedItem(solverDescription.getDisplayLabel());
}
}
}
Set<SolverFeature> supportedFeatures = ivjTornOffSolverTaskDescription.getSolverDescription().getSupportedFeatures();
if (supportedFeatures.contains(SolverFeature.Feature_SerialParameterScans)) {
serialParameterScanCheckBox.setVisible(true);
boolean bSerialParameterScan = ivjTornOffSolverTaskDescription.isSerialParameterScan();
if (bSerialParameterScan) {
serialParameterScanCheckBox.setSelected(bSerialParameterScan);
}
} else {
serialParameterScanCheckBox.setVisible(false);
}
// sensitivity panel's visibility
managePanels();
getMiscPanel().setVisible(supportedFeatures.contains(SolverFeature.Feature_SerialParameterScans) || supportedFeatures.contains(SolverFeature.Feature_StopAtSpatiallyUniform) || supportedFeatures.contains(SolverFeature.Feature_DataProcessingInstructions));
if (getSolverTaskDescription().getSolverDescription().isChomboSolver()) {
getTimeBoundsPanel().setVisible(false);
getTimeStepPanel().setVisible(false);
getChomboTimeBoundsPanel().setVisible(true);
getChomboDeveloperToolsPanel().setVisible(true);
} else {
getTimeBoundsPanel().setVisible(true);
getTimeStepPanel().setVisible(true);
getChomboTimeBoundsPanel().setVisible(false);
getChomboDeveloperToolsPanel().setVisible(false);
}
movingBoundarySolverOptionsPanel.setVisible(getSolverTaskDescription().getSolverDescription().isMovingBoundarySolver());
}
use of cbit.vcell.solver.SolverDescription in project vcell by virtualcell.
the class ClientSimManager method createQuickRunSolver.
public static Solver createQuickRunSolver(File directory, SimulationTask simTask) throws SolverException, IOException {
SolverDescription solverDescription = simTask.getSimulation().getSolverTaskDescription().getSolverDescription();
if (solverDescription == null) {
throw new IllegalArgumentException("SolverDescription cannot be null");
}
// ----- 'FiniteVolume, Regular Grid' solver (semi-implicit) solver is not supported for quick run; throw exception.
if (solverDescription.equals(SolverDescription.FiniteVolume)) {
throw new IllegalArgumentException("Semi-Implicit Finite Volume Compiled, Regular Grid (Fixed Time Step) solver not allowed for quick run of simulations.");
}
SolverUtilities.prepareSolverExecutable(solverDescription);
// create solver from SolverFactory
Solver solver = SolverFactory.createSolver(directory, simTask, false);
return solver;
}
Aggregations