use of cbit.vcell.math.FilamentRegionEquation in project vcell by virtualcell.
the class ModelOptimizationSpec method fromMath.
/**
* Insert the method's description here.
* Creation date: (11/1/2005 8:11:32 PM)
* @return cbit.vcell.mapping.MathSystemHash
* @param mathDesc cbit.vcell.math.MathDescription
*/
private static MathSystemHash fromMath(cbit.vcell.math.MathDescription mathDesc) {
MathSystemHash hash = new MathSystemHash();
hash.addSymbol(new MathSystemHash.IndependentVariable("t"));
hash.addSymbol(new MathSystemHash.IndependentVariable("x"));
hash.addSymbol(new MathSystemHash.IndependentVariable("y"));
hash.addSymbol(new MathSystemHash.IndependentVariable("z"));
Variable[] vars = (Variable[]) BeanUtils.getArray(mathDesc.getVariables(), Variable.class);
for (int i = 0; i < vars.length; i++) {
hash.addSymbol(new MathSystemHash.Variable(vars[i].getName(), vars[i].getExpression()));
}
SubDomain[] subDomains = (SubDomain[]) BeanUtils.getArray(mathDesc.getSubDomains(), SubDomain.class);
for (int i = 0; i < subDomains.length; i++) {
Equation[] equations = (Equation[]) BeanUtils.getArray(subDomains[i].getEquations(), Equation.class);
for (int j = 0; j < equations.length; j++) {
MathSystemHash.Variable var = (MathSystemHash.Variable) hash.getSymbol(equations[j].getVariable().getName());
hash.addSymbol(new MathSystemHash.VariableInitial(var, equations[j].getInitialExpression()));
if (equations[j] instanceof PdeEquation) {
// hash.addSymbol(new MathSystemHash.VariableDerivative(var,pde.getRateExpression()));
throw new RuntimeException("MathSystemHash doesn't yet support spatial models");
} else if (equations[j] instanceof VolumeRegionEquation) {
// hash.addSymbol(new MathSystemHash.VariableDerivative(var,vre.getRateExpression()));
throw new RuntimeException("MathSystemHash doesn't yet support spatial models");
} else if (equations[j] instanceof MembraneRegionEquation) {
// hash.addSymbol(new MathSystemHash.VariableDerivative(var,mre.getRateExpression()));
throw new RuntimeException("MathSystemHash doesn't yet support spatial models");
} else if (equations[j] instanceof FilamentRegionEquation) {
// hash.addSymbol(new MathSystemHash.VariableDerivative(var,fre.getRateExpression()));
throw new RuntimeException("MathSystemHash doesn't yet support spatial models");
} else if (equations[j] instanceof OdeEquation) {
OdeEquation ode = (OdeEquation) equations[j];
hash.addSymbol(new MathSystemHash.VariableDerivative(var, ode.getRateExpression()));
}
}
}
return hash;
}
Aggregations