Search in sources :

Example 31 with MembraneSubDomain

use of cbit.vcell.math.MembraneSubDomain in project vcell by virtualcell.

the class MembraneParticleDiffusionVisitor method hasMembraneDiffusion.

private boolean hasMembraneDiffusion(MathDescription mathDesc) throws ExpressionException {
    // 
    for (SubDomain subDomain : Collections.list(mathDesc.getSubDomains())) {
        if (subDomain instanceof MembraneSubDomain) {
            MembraneSubDomain membraneSubDomain = (MembraneSubDomain) subDomain;
            for (ParticleProperties particleProperties : membraneSubDomain.getParticleProperties()) {
                Expression diffusionCoef = particleProperties.getDiffusion();
                diffusionCoef = MathUtilities.substituteFunctions(diffusionCoef, mathDesc);
                diffusionCoef = diffusionCoef.flatten();
                if (!diffusionCoef.isZero()) {
                    return true;
                }
            }
        }
    }
    return false;
}
Also used : SubDomain(cbit.vcell.math.SubDomain) MembraneSubDomain(cbit.vcell.math.MembraneSubDomain) MembraneSubDomain(cbit.vcell.math.MembraneSubDomain) Expression(cbit.vcell.parser.Expression) ParticleProperties(cbit.vcell.math.ParticleProperties)

Aggregations

MembraneSubDomain (cbit.vcell.math.MembraneSubDomain)31 CompartmentSubDomain (cbit.vcell.math.CompartmentSubDomain)26 SubDomain (cbit.vcell.math.SubDomain)21 Expression (cbit.vcell.parser.Expression)13 ArrayList (java.util.ArrayList)13 MathDescription (cbit.vcell.math.MathDescription)12 SubVolume (cbit.vcell.geometry.SubVolume)10 ExpressionException (cbit.vcell.parser.ExpressionException)10 Variable (cbit.vcell.math.Variable)9 SurfaceClass (cbit.vcell.geometry.SurfaceClass)8 Constant (cbit.vcell.math.Constant)7 Equation (cbit.vcell.math.Equation)7 MathException (cbit.vcell.math.MathException)7 OdeEquation (cbit.vcell.math.OdeEquation)7 JumpCondition (cbit.vcell.math.JumpCondition)6 ParticleProperties (cbit.vcell.math.ParticleProperties)6 HashMap (java.util.HashMap)6 AnalyticSubVolume (cbit.vcell.geometry.AnalyticSubVolume)5 Function (cbit.vcell.math.Function)5 MemVariable (cbit.vcell.math.MemVariable)5