Search in sources :

Example 11 with SolverDescription

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);
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) SolverDescription(cbit.vcell.solver.SolverDescription) Simulation(cbit.vcell.solver.Simulation) SimulationContext(cbit.vcell.mapping.SimulationContext)

Example 12 with SolverDescription

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);
    }
}
Also used : SolverDescription(cbit.vcell.solver.SolverDescription) DataProcessingInstructions(cbit.vcell.solver.DataProcessingInstructions)

Example 13 with SolverDescription

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);
}
Also used : SolverDescription(cbit.vcell.solver.SolverDescription) MathDescription(cbit.vcell.math.MathDescription)

Example 14 with SolverDescription

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());
}
Also used : SolverDescription(cbit.vcell.solver.SolverDescription) SolverFeature(cbit.vcell.solver.SolverDescription.SolverFeature)

Example 15 with SolverDescription

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;
}
Also used : SmoldynSolver(org.vcell.solver.smoldyn.SmoldynSolver) Solver(cbit.vcell.solver.server.Solver) SolverDescription(cbit.vcell.solver.SolverDescription)

Aggregations

SolverDescription (cbit.vcell.solver.SolverDescription)20 SolverTaskDescription (cbit.vcell.solver.SolverTaskDescription)7 Simulation (cbit.vcell.solver.Simulation)6 DefaultOutputTimeSpec (cbit.vcell.solver.DefaultOutputTimeSpec)5 BioModel (cbit.vcell.biomodel.BioModel)4 SimulationContext (cbit.vcell.mapping.SimulationContext)4 OutputTimeSpec (cbit.vcell.solver.OutputTimeSpec)4 PropertyVetoException (java.beans.PropertyVetoException)4 ArrayList (java.util.ArrayList)4 NonspatialStochSimOptions (cbit.vcell.solver.NonspatialStochSimOptions)3 TimeBounds (cbit.vcell.solver.TimeBounds)3 TimeStep (cbit.vcell.solver.TimeStep)3 UniformOutputTimeSpec (cbit.vcell.solver.UniformOutputTimeSpec)3 IOException (java.io.IOException)3 DataGenerator (org.jlibsedml.DataGenerator)3 Model (org.jlibsedml.Model)3 UniformTimeCourse (org.jlibsedml.UniformTimeCourse)3 MathMappingCallbackTaskAdapter (cbit.vcell.mapping.MathMappingCallbackTaskAdapter)2 Application (cbit.vcell.mapping.SimulationContext.Application)2 MathMappingCallback (cbit.vcell.mapping.SimulationContext.MathMappingCallback)2