use of cbit.vcell.math.ComputeNormalComponentEquation in project vcell by virtualcell.
the class XmlReader method getComputeNormal.
private ComputeNormalComponentEquation getComputeNormal(Element param, MathDescription mathDesc) throws XmlParseException {
// get attributes
String varname = unMangle(param.getAttributeValue(XMLTags.NameAttrTag));
// find reference in the dictionnary
// try a MembraneRegionVariable
MemVariable varref = (MemVariable) mathDesc.getVariable(varname);
if (varref == null) {
throw new XmlParseException("The reference to the Membrane variable " + varname + " could not be resolved!");
}
NormalComponent normalComponent = null;
String normalComponentString = param.getAttributeValue(XMLTags.ComputeNormalComponentAttrTag);
if (normalComponentString.equals(XMLTags.ComputeNormalComponentAttrTagValue_X)) {
normalComponent = NormalComponent.X;
} else if (normalComponentString.equals(XMLTags.ComputeNormalComponentAttrTagValue_Y)) {
normalComponent = NormalComponent.Y;
} else if (normalComponentString.equals(XMLTags.ComputeNormalComponentAttrTagValue_Z)) {
normalComponent = NormalComponent.Z;
}
ComputeNormalComponentEquation computeNormal = new ComputeNormalComponentEquation(varref, normalComponent);
return computeNormal;
}
Aggregations