Skip to content

Commit 0cefb78

Browse files
committed
Can't use the "Extracellular_Intracellular_membrane" math name of the subdomain, get membrane physiology name from anchor
1 parent a888959 commit 0cefb78

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

vcell-core/src/main/java/org/vcell/solver/langevin/LangevinLngvWriter.java

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import cbit.vcell.geometry.AnalyticSubVolume;
77
import cbit.vcell.geometry.SubVolume;
8+
import cbit.vcell.math.*;
89
import cbit.vcell.model.Structure;
910
import cbit.vcell.solver.*;
1011
import org.vcell.util.Pair;
@@ -18,28 +19,8 @@
1819
import cbit.vcell.mapping.SimulationContext;
1920
import cbit.vcell.mapping.SpeciesContextSpec;
2021
import cbit.vcell.mapping.SimulationContext.Application;
21-
import cbit.vcell.math.Action;
22-
import cbit.vcell.math.JumpProcessRateDefinition;
23-
import cbit.vcell.math.LangevinParticleJumpProcess;
24-
import cbit.vcell.math.LangevinParticleMolecularComponent;
25-
import cbit.vcell.math.LangevinParticleMolecularType;
26-
import cbit.vcell.math.MacroscopicRateConstant;
27-
import cbit.vcell.math.MathDescription;
28-
import cbit.vcell.math.MathException;
29-
import cbit.vcell.math.MathUtilities;
30-
import cbit.vcell.math.ParticleComponentStateDefinition;
31-
import cbit.vcell.math.ParticleComponentStatePattern;
32-
import cbit.vcell.math.ParticleJumpProcess;
33-
import cbit.vcell.math.ParticleMolecularComponent;
34-
import cbit.vcell.math.ParticleMolecularComponentPattern;
35-
import cbit.vcell.math.ParticleMolecularType;
36-
import cbit.vcell.math.ParticleMolecularTypePattern;
37-
import cbit.vcell.math.ParticleProperties;
3822
import cbit.vcell.math.ParticleProperties.ParticleInitialCondition;
3923
import cbit.vcell.math.ParticleProperties.ParticleInitialConditionCount;
40-
import cbit.vcell.math.ParticleSpeciesPattern;
41-
import cbit.vcell.math.SubDomain;
42-
import cbit.vcell.math.Variable;
4324
import cbit.vcell.mathmodel.MathModel;
4425
import cbit.vcell.messaging.server.SimulationTask;
4526
import cbit.vcell.parser.DivideByZeroException;
@@ -910,7 +891,21 @@ private static void writeSpeciesInfo(StringBuilder sb) {
910891
throw new RuntimeException("Initial concentration must be a number");
911892
}
912893

913-
sb.append("MOLECULE: \"" + lpmt.getName() + "\" " + subDomain.getName() +
894+
String locationName;
895+
if(subDomain instanceof MembraneSubDomain) {
896+
// we can't use the "Extracellular_Intracellular_membrane" math name of the subdomain,
897+
// the Langevin solver has no clue about what that might be
898+
// luckily we enforce that a membrane molecule must be anchored to exactly one membrane (named "Membrane")
899+
// alternatively we can check the Anchor site and get the membrane name "Membrane" from there
900+
if(lpmt.getAnchorList().size() != 1) {
901+
throw new RuntimeException("MembraneSubDomain particle must be anchored to one and only one Membrane");
902+
}
903+
// we make sure elsewhere that it's a membrane
904+
locationName = lpmt.getAnchorList().get(0);
905+
} else {
906+
locationName = subDomain.getName();
907+
}
908+
sb.append("MOLECULE: \"" + lpmt.getName() + "\" " + locationName +
914909
" Number " + scount +
915910
// number of site types and number of sites is the same for the vcell implementation of springsalad
916911
" Site_Types " + lpmt.getComponentList().size() + " Total" + "_Sites " + lpmt.getComponentList().size() +

0 commit comments

Comments
 (0)