use of cbit.vcell.math.MeasureEquation in project vcell by virtualcell.
the class FiniteVolumeFileWriter method writeCompartment_VarContext.
/**
* Insert the method's description here.
* Creation date: (5/9/2005 2:52:48 PM)
* @throws ExpressionException
*/
private void writeCompartment_VarContext(CompartmentSubDomain volSubDomain) throws ExpressionException {
Simulation simulation = simTask.getSimulation();
//
// get list of volVariables participating in PDEs (anywhere).
//
Vector<VolVariable> pdeVolVariableList = new Vector<VolVariable>();
Variable[] variables = simTask.getSimulationJob().getSimulationSymbolTable().getVariables();
for (int i = 0; i < variables.length; i++) {
if (variables[i] instanceof VolVariable && simulation.getMathDescription().isPDE((VolVariable) variables[i])) {
pdeVolVariableList.add((VolVariable) variables[i]);
}
}
Enumeration<Equation> enum_equ = volSubDomain.getEquations();
while (enum_equ.hasMoreElements()) {
Equation equation = enum_equ.nextElement();
// for chombo solver, only write equations for variables that are defined in this compartment
if (!bChomboSolver || equation.getVariable().getDomain().getName().equals(volSubDomain.getName())) {
if (equation instanceof VolumeRegionEquation) {
writeCompartmentRegion_VarContext_Equation(volSubDomain, (VolumeRegionEquation) equation);
} else if (equation instanceof MeasureEquation) {
throw new RuntimeException("Measure Equation " + equation.getClass().getSimpleName() + " not yet supported in FiniteVolume solvers");
} else {
writeCompartment_VarContext_Equation(volSubDomain, equation);
}
}
if (equation instanceof PdeEquation) {
pdeVolVariableList.remove(equation.getVariable());
}
}
//
if (!bChomboSolver) {
for (int i = 0; i < pdeVolVariableList.size(); i++) {
VolVariable volVar = pdeVolVariableList.elementAt(i);
boolean bSteady = simulation.getMathDescription().isPdeSteady(volVar);
PdeEquation dummyPdeEquation = new PdeEquation(volVar, bSteady, new Expression(0.0), new Expression(0.0), new Expression(0.0));
writeCompartment_VarContext_Equation(volSubDomain, dummyPdeEquation);
}
}
}
Aggregations