Search in sources :

Example 1 with ComputeNormalComponentEquation

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;
}
Also used : NormalComponent(cbit.vcell.math.ComputeNormalComponentEquation.NormalComponent) MemVariable(cbit.vcell.math.MemVariable) ComputeNormalComponentEquation(cbit.vcell.math.ComputeNormalComponentEquation)

Aggregations

ComputeNormalComponentEquation (cbit.vcell.math.ComputeNormalComponentEquation)1 NormalComponent (cbit.vcell.math.ComputeNormalComponentEquation.NormalComponent)1 MemVariable (cbit.vcell.math.MemVariable)1