libSBML C++ API  5.20.5
Loading...
Searching...
No Matches
example1.cpp

An example layout.

An example layout.

#include <iostream>
#include <sbml/SBMLTypes.h>
using namespace std;
LIBSBML_CPP_NAMESPACE_USE
void writeSpatialSBML();
void readSpatialSBML();
int main(int argc, char* argv[])
{
writeSpatialSBML();
readSpatialSBML();
}
void writeSpatialSBML()
{
// SBMLNamespaces of SBML Level 3 Version 1 with 'req' Version 1
// then add 'spatial' package namespace.
SpatialPkgNamespaces sbmlns(3,1,1);
// create the L3V1 document with spatial package
SBMLDocument document(&sbmlns);
// set 'required' attribute on document for 'spatial' and 'req' packages to 'T'??
dplugin = static_cast<SBMLDocumentPlugin*>(document.getPlugin("spatial"));
dplugin->setRequired(true);
// create the Model
Model *model = document.createModel();
model-> setId("trial_spatial");
model-> setName("trial_spatial");
// create the Compartments
Compartment* compartment = model->createCompartment();
compartment->setId("cytosol");
compartment->setConstant(true);
// create the Species
Species* species1 = model->createSpecies();
species1->setId("ATPc");
species1->setCompartment("cytosol");
species1->setInitialConcentration(1.0);
species1->setHasOnlySubstanceUnits(false);
species1->setBoundaryCondition(false);
species1->setConstant(false);
// spatial package extension to species.
srplugin = static_cast<SpatialSpeciesPlugin*>(species1->getPlugin("spatial"));
srplugin->setIsSpatial(true);
// add parameter for diff coeff of species1
Parameter* paramSp = model->createParameter();
paramSp->setId(species1->getId()+"_dc");
paramSp->setValue(1.0);
// spatial package extension to parameter.
pplugin = static_cast<SpatialParameterPlugin*>(paramSp->getPlugin("spatial"));
diffCoeff->setVariable(species1->getId());
// add parameter for adv coeff of species1
paramSp = model->createParameter();
paramSp->setId(species1->getId()+"_ac");
paramSp->setValue(1.5);
// spatial package extension to parameter.
pplugin = static_cast<SpatialParameterPlugin*>(paramSp->getPlugin("spatial"));
advCoeff->setVariable(species1->getId());
// add parameter for boundary condition of species1
paramSp = model->createParameter();
paramSp->setId(species1->getId()+"_bc");
paramSp->setValue(2.0);
// spatial package extension to parameter.
pplugin = static_cast<SpatialParameterPlugin*>(paramSp->getPlugin("spatial"));
boundCon->setVariable(species1->getId());
boundCon->setCoordinateBoundary("Xmin");
Species* species2 = model->createSpecies();
species2->setId("ADPc");
species2->setCompartment("cytosol");
species2->setHasOnlySubstanceUnits(false);
species2->setBoundaryCondition(false);
species2->setConstant(false);
srplugin = static_cast<SpatialSpeciesPlugin*>(species2->getPlugin("spatial"));
srplugin->setIsSpatial(true);
Reaction* reaction = model->createReaction();
reaction->setId("rxn1");
reaction->setReversible(false);
reaction->setFast(false);
reaction->setCompartment("cytosol");
SpatialReactionPlugin* rplugin = static_cast<SpatialReactionPlugin*>(reaction->getPlugin("spatial"));
rplugin->setIsLocal(true);
//
// Get a SpatialModelPlugin object plugged in the model object.
//
// The type of the returned value of SBase::getPlugin() function is
// SBasePlugin*, and thus the value needs to be casted for the
// corresponding derived class.
//
mplugin = static_cast<SpatialModelPlugin*>(model->getPlugin("spatial"));
//
// Creates a geometry object via SpatialModelPlugin object.
//
Geometry* geometry = mplugin->createGeometry();
coordX->setId("coordComp1");
coordX->setUnit("umeter");
Boundary* minX = coordX->createBoundaryMin();
minX->setId("Xmin");
minX->setValue(0.0);
Boundary* maxX = coordX->createBoundaryMax();
maxX->setId("Xmax");
maxX->setValue(10.0);
Parameter* paramX = model->createParameter();
paramX->setId("x");
paramX->setValue(8.0);
// spatial package extension to parameter.
// SpatialParameterPlugin* pplugin;
pplugin = static_cast<SpatialParameterPlugin*>(paramX->getPlugin("spatial"));
spSymRef->setSpatialRef(coordX->getId());
DomainType* domainType = geometry->createDomainType();
domainType->setId("dtype1");
domainType->setSpatialDimensions(3);
// Spatial package extension to compartment (mapping compartment with domainType)
cplugin = static_cast<SpatialCompartmentPlugin*>(compartment->getPlugin("spatial"));
CompartmentMapping* compMapping = cplugin->createCompartmentMapping();
compMapping->setId("compMap1");
compMapping->setDomainType(domainType->getId());
compMapping->setUnitSize(1.0);
Domain* domain = geometry->createDomain();
domain->setId("domain1");
domain->setDomainType("dtype1");
InteriorPoint* internalPt1 = domain->createInteriorPoint();
internalPt1->setCoord1(1.0);
domain = geometry->createDomain();
domain->setId("domain2");
domain->setDomainType("dtype1");
InteriorPoint* internalPt2 = domain->createInteriorPoint();
internalPt2->setCoord1(5.0);
AdjacentDomains* adjDomain = geometry->createAdjacentDomains();
adjDomain->setId("adjDomain1");
adjDomain->setDomain1("domain1");
adjDomain->setDomain2("domain2");
AnalyticGeometry* analyticGeom = geometry->createAnalyticGeometry();
analyticGeom->setId("analyticGeom1");
AnalyticVolume* analyticVol = analyticGeom->createAnalyticVolume();
analyticVol->setId("analyticVol1");
analyticVol->setDomainType(domainType->getId());
analyticVol->setOrdinal(1);
const char* mathMLStr = "<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><apply xmlns=\"\"><plus /><apply><times /><ci>x</ci><ci>x</ci></apply><apply><minus /><cn>1.0</cn></apply></apply></math>";
ASTNode* mathNode = readMathMLFromString(mathMLStr);
analyticVol->setMath(mathNode);
sfg->setId("sampledFieldGeom1");
sfg->setSampledField("sampledField1");
SampledField* sampledField = geometry->createSampledField();
sampledField->setId("sampledField1");
sampledField->setNumSamples1(4);
sampledField->setNumSamples2(4);
sampledField->setNumSamples3(2);
sampledField->setInterpolationType("linear");
sampledField->setCompression("uncompressed");
//int samples[5] = {1, 2, 3, 4, 5};
int samples[32] = {
// z=0
0,0,0,0,
0,1,1,0,
0,1,1,0,
0,0,0,0,
// z=1
0,0,0,0,
0,1,1,0,
0,1,1,0,
0,0,0,0
};
sampledField->setDataType("uint8");
sampledField->setSamples(samples, 32);
SampledVolume* sampledVol = sfg->createSampledVolume();
sampledVol->setId("sv_1");
sampledVol->setDomainType(domainType->getId());
sampledVol->setSampledValue(128.0);
sampledVol->setMinValue(0.0);
sampledVol->setMaxValue(255.0);
writeSBML(&document, "spatial_example2.xml");
}
void readSpatialSBML() {
SBMLDocument *document2 = readSBML("spatial_example2.xml");
Model *model2 = document2->getModel();
Compartment *comp;
for (unsigned int i = 0; i < model2->getNumCompartments(); i++) {
comp = model2->getCompartment(i);
cout << "Compartment" << i << ": " << comp->getId() << endl;
cplugin = static_cast<SpatialCompartmentPlugin*>(comp->getPlugin("spatial"));
if (cplugin->getCompartmentMapping()->isSetId()) {
cout << "Comp" << i << " CMSpId: " << cplugin->getCompartmentMapping()->getId() << endl;
cout << "Comp" << i << " CM_DType: " << cplugin->getCompartmentMapping()->getDomainType() << endl;
cout << "Comp" << i << " CM_UnitSz: " << cplugin->getCompartmentMapping()->getUnitSize() << endl;
}
}
Species *sp;
for (unsigned int i = 0; i < model2->getNumSpecies(); i++) {
sp = model2->getSpecies(i);
cout << "Species" << i << ": " << sp->getId() << endl;
srplugin = static_cast<SpatialSpeciesPlugin*>(sp->getPlugin("spatial"));
if (srplugin->getIsSpatial()) {
cout << "species" << i << " isSpatial: " << srplugin->getIsSpatial() << endl;
}
}
Parameter *param;
for (unsigned int i = 0; i < model2->getNumParameters(); i++) {
param = model2->getParameter(i);
cout << "Parameter" << i << ": " << param->getId() << endl;
pplugin = static_cast<SpatialParameterPlugin*>(param->getPlugin("spatial"));
if (pplugin->isSetSpatialSymbolReference()) {
cout << "Parameter" << i << " SpRefId: " << pplugin->getSpatialSymbolReference()->getSpatialRef() << endl;
}
if (pplugin->isSetDiffusionCoefficient()) {
cout << "Diff_" << i << " SpeciesVarId: " << pplugin->getDiffusionCoefficient()->getVariable() << endl;
cout << "Diff_" << i << " Type: " << DiffusionKind_toString(pplugin->getDiffusionCoefficient()->getType()) << endl;
cout << "Diff_" << i << " CoordinateReference1 : " << CoordinateKind_toString(pplugin->getDiffusionCoefficient()->getCoordinateReference1()) << endl;
cout << "Diff_" << i << " CoordinateReference2 : " << CoordinateKind_toString(pplugin->getDiffusionCoefficient()->getCoordinateReference2()) << endl;
}
if (pplugin->isSetAdvectionCoefficient()) {
cout << "Adv_" << i << " SpeciesVarId: " << pplugin->getAdvectionCoefficient()->getVariable() << endl;
cout << "Adv_" << i << " SpCoordIndex: " << CoordinateKind_toString(pplugin->getAdvectionCoefficient()->getCoordinate()) << endl;
}
if (pplugin->isSetBoundaryCondition()) {
cout << "BC_" << i << " SpeciesVarId: " << pplugin->getBoundaryCondition()->getVariable() << endl;
cout << "BC_" << i << " SpCoordBoundary: " << pplugin->getBoundaryCondition()->getCoordinateBoundary() << endl;
cout << "BC_" << i << " SpBoundaryType: " << pplugin->getBoundaryCondition()->getType() << endl;
}
}
Reaction *rxn;
for (unsigned int i = 0; i < model2->getNumReactions(); i++) {
rxn = model2->getReaction(i);
cout << "Reaction" << i << ": " << rxn->getId() << endl;
rplugin = static_cast<SpatialReactionPlugin*>(rxn->getPlugin("spatial"));
if (rplugin->getIsLocal()) {
cout << "rxn" << i << " isLocal: " << rplugin->getIsLocal() << endl;
}
}
Rule *rule;
for (unsigned int i = 0; i < model2->getNumRules(); i++) {
rule = model2->getRule(i);
cout << "Rule" << i << ": " << rule->getVariable() << endl;
}
//
// Get a SpatialModelPlugin object plugged in the model object.
//
// The type of the returned value of SBase::getPlugin() function is
// SBasePlugin*, and thus the value needs to be cast for the
// corresponding derived class.
//
SpatialModelPlugin* mplugin2;
mplugin2 = static_cast<SpatialModelPlugin*>(model2->getPlugin("spatial"));
cout << "URI: " << mplugin2->getURI() << endl;
cout << "prefix: " << mplugin2->getPrefix() << endl;
// get a Geometry object via SpatialModelPlugin object.
Geometry* geometry2 = mplugin2->getGeometry();
cout << "Geometry coordSystem: " << geometry2->getCoordinateSystem() << endl;
// get a CoordComponent object via the Geometry object.
CoordinateComponent* coordComp = geometry2->getCoordinateComponent(0);
std::cout << "CoordComponent Id: " << coordComp->getId() << std::endl;
std::cout << "CoordComponent type: " << CoordinateKind_toString( coordComp->getType()) << std::endl;
std::cout << "CoordComponent sbmlUnit: " << coordComp->getUnit() << std::endl;
if (coordComp->isSetBoundaryMin())
{
Boundary* minX = coordComp->getBoundaryMin();
std::cout << "minX name: " << minX->getId() << std::endl;
std::cout << "minX value: " << minX->getValue() << std::endl;
}
if (coordComp->isSetBoundaryMax())
{
Boundary* maxX = coordComp->getBoundaryMax();
std::cout << "maxX name: " << maxX->getId() << std::endl;
std::cout << "maxX value: " << maxX->getValue() << std::endl;
}
// get a DomainType object via the Geometry object.
DomainType* domainType2 = geometry2->getDomainType(0);
std::cout << "DomainType Id: " << domainType2->getId() << std::endl;
std::cout << "DomainType spatialDim: " << domainType2->getSpatialDimensions() << std::endl;
// get a Domain object via the Geometry object.
Domain* domain = geometry2->getDomain(0);
std::cout << "Domain1 Id: " << domain->getId() << std::endl;
std::cout << "Domain1 domainType: " << domain->getDomainType() << std::endl;
// get an internal point via the domain object
InteriorPoint* internalPt = domain->getInteriorPoint(0);
std::cout << "InternalPt_1 coord1: " << internalPt->getCoord1() << std::endl;
// get a Domain object via the Geometry object.
domain = geometry2->getDomain(1);
std::cout << "Domain2 Id: " << domain->getId() << std::endl;
std::cout << "Domain2 domainType: " << domain->getDomainType() << std::endl;
// get an internal point via the domain object
internalPt = domain->getInteriorPoint(0);
std::cout << "InternalPt_2 coord1: " << internalPt->getCoord1() << std::endl;
// get an AdjacentDomains object via the Geometry object.
AdjacentDomains* adjDomain = geometry2->getAdjacentDomains(0);
std::cout << "AdjDomain Id: " << adjDomain->getId() << std::endl;
std::cout << "AdjDomain domain1: " << adjDomain->getDomain1() << std::endl;
std::cout << "AdjDomain domain2: " << adjDomain->getDomain2() << std::endl;
// get an AnalyticGeometry object via the Geometry object.
for (unsigned int i = 0; i < geometry2->getNumGeometryDefinitions(); i++) {
gd = geometry2->getGeometryDefinition(i);
if (gd->isAnalyticGeometry()) {
AnalyticGeometry* analyticalGeom = static_cast<AnalyticGeometry*>(gd);
std::cout << "AnalGeom Id: " << analyticalGeom->getId() << std::endl;
// analVol from analGeom.
AnalyticVolume* av = analyticalGeom->getAnalyticVolume(0);
std::cout << "AnalVol Id: " << av->getId() << std::endl;
std::cout << "AnalVol domainType: " << av->getDomainType() << std::endl;
std::cout << "AnalVol funcType: " << av->getFunctionType() << std::endl;
std::cout << "AnalVol ordinal: " << av->getOrdinal() << std::endl;
const ASTNode* mathNode = av->getMath();
char* mathStr = writeMathMLToString(mathNode);
std::cout << "AnalVol math: " << mathStr << std::endl;
}
SampledFieldGeometry* sfGeom = static_cast<SampledFieldGeometry*>(gd);
std::cout << "SampledFieldGeom Id: " << sfGeom->getId() << std::endl;
std::cout << "SampledFieldGeom sampledField: " << sfGeom->getSampledField() << std::endl;
// sampledField from sfGeom
SampledField* sf = geometry2->getSampledField(sfGeom->getSampledField());
std::cout << "SampledField Id: " << sf->getId() << std::endl;
std::cout << "SampledField dataType: " << DataKind_toString(sf->getDataType()) << std::endl;
std::cout << "SampledField interpolation: " << InterpolationKind_toString(sf->getInterpolationType()) << std::endl;
std::cout << "SampledField compression: " << CompressionKind_toString( sf->getCompression() ) << std::endl;
std::cout << "SampledField numSamples1: " << sf->getNumSamples1() << std::endl;
std::cout << "SampledField numSamples2: " << sf->getNumSamples2() << std::endl;
std::cout << "SampledField numSamples3: " << sf->getNumSamples3() << std::endl;
int* samples = new int[sf->getSamplesLength()];
sf->getSamples(samples);
std::cout << "SampledField samples[0]: " << samples[0] << std::endl;
std::cout << "SampledField samplesLen: " << sf->getSamplesLength() << std::endl;
// sampledVolVol from sfGeom.
SampledVolume* sv = sfGeom->getSampledVolume(0);
std::cout << "SampledVol Id: " << sv->getId() << std::endl;
std::cout << "SampledVol domainType: " << sv->getDomainType() << std::endl;
std::cout << "SampledVol sampledVal: " << sv->getSampledValue() << std::endl;
std::cout << "SampledVol min: " << sv->getMinValue() << std::endl;
std::cout << "SampledVol max: " << sv->getMaxValue() << std::endl;
}
}
delete document2;
}
Abstract Syntax Tree (AST) for representing formula trees.
ASTNode_t * readMathMLFromString(const char *xml)
Definition MathML.cpp:2273
char * writeMathMLToString(const ASTNode *node)
Definition MathML.cpp:2428
Utilities for reading and writing MathML to/from text strings.
Definition of SBMLDocumentPlugin, the derived class of SBasePlugin.
SBMLDocument_t * readSBML(const char *filename)
Reads an SBML document from the given file.
Include all SBML types in a single header file.
int writeSBML(const SBMLDocument_t *d, const char *filename)
Writes the given SBML document d to the file named by filename.
const char * DiffusionKind_toString(DiffusionKind_t dk)
Returns the string version of the provided DiffusionKind_t enumeration.
Definition SpatialExtension.cpp:667
const char * CompressionKind_toString(CompressionKind_t ck)
Returns the string version of the provided CompressionKind_t enumeration.
Definition SpatialExtension.cpp:1419
const char * InterpolationKind_toString(InterpolationKind_t ik)
Returns the string version of the provided InterpolationKind_t enumeration.
Definition SpatialExtension.cpp:1037
const char * DataKind_toString(DataKind_t dk)
Returns the string version of the provided DataKind_t enumeration.
Definition SpatialExtension.cpp:1326
const char * CoordinateKind_toString(CoordinateKind_t ck)
Returns the string version of the provided CoordinateKind_t enumeration.
Definition SpatialExtension.cpp:574
Definition of SpatialExtension.
@ SPATIAL_BOUNDARYKIND_DIRICHLET
Definition SpatialExtension.h:438
@ SPATIAL_GEOMETRYKIND_CARTESIAN
Definition SpatialExtension.h:925
@ SPATIAL_FUNCTIONKIND_LAYERED
Definition SpatialExtension.h:811
@ SPATIAL_COORDINATEKIND_CARTESIAN_X
Definition SpatialExtension.h:559
@ SPATIAL_DIFFUSIONKIND_ANISOTROPIC
Definition SpatialExtension.h:687
Definition of SpatialExtensionTypes.
Definition ASTNode.h:221
Definition AdjacentDomains.h:74
int setDomain1(const std::string &domain1)
Sets the value of the "domain1" attribute of this AdjacentDomains.
Definition AdjacentDomains.cpp:242
const std::string & getDomain1() const
Returns the value of the "domain1" attribute of this AdjacentDomains.
Definition AdjacentDomains.cpp:158
virtual int setId(const std::string &id)
Sets the value of the "id" attribute of this AdjacentDomains.
Definition AdjacentDomains.cpp:221
const std::string & getDomain2() const
Returns the value of the "domain2" attribute of this AdjacentDomains.
Definition AdjacentDomains.cpp:168
virtual const std::string & getId() const
Returns the value of the "id" attribute of this AdjacentDomains.
Definition AdjacentDomains.cpp:138
int setDomain2(const std::string &domain2)
Sets the value of the "domain2" attribute of this AdjacentDomains.
Definition AdjacentDomains.cpp:260
Definition AdvectionCoefficient.h:113
int setVariable(const std::string &variable)
Sets the value of the "variable" attribute of this AdvectionCoefficient.
Definition AdvectionCoefficient.cpp:193
CoordinateKind_t getCoordinate() const
Returns the value of the "coordinate" attribute of this AdvectionCoefficient.
Definition AdvectionCoefficient.cpp:149
int setCoordinate(const CoordinateKind_t coordinate)
Sets the value of the "coordinate" attribute of this AdvectionCoefficient.
Definition AdvectionCoefficient.cpp:211
const std::string & getVariable() const
Returns the value of the "variable" attribute of this AdvectionCoefficient.
Definition AdvectionCoefficient.cpp:138
Definition AnalyticGeometry.h:76
AnalyticVolume * createAnalyticVolume()
Creates a new AnalyticVolume object, adds it to this AnalyticGeometry object and returns the Analytic...
Definition AnalyticGeometry.cpp:269
AnalyticVolume * getAnalyticVolume(unsigned int n)
Get an AnalyticVolume from the AnalyticGeometry.
Definition AnalyticGeometry.cpp:158
Definition AnalyticVolume.h:101
int setDomainType(const std::string &domainType)
Sets the value of the "domainType" attribute of this AnalyticVolume.
Definition AnalyticVolume.cpp:356
const ASTNode * getMath() const
Returns the value of the "math" element of this AnalyticVolume.
Definition AnalyticVolume.cpp:462
int setOrdinal(int ordinal)
Sets the value of the "ordinal" attribute of this AnalyticVolume.
Definition AnalyticVolume.cpp:344
int getOrdinal() const
Returns the value of the "ordinal" attribute of this AnalyticVolume.
Definition AnalyticVolume.cpp:211
int setMath(const ASTNode *math)
Sets the value of the "math" element of this AnalyticVolume.
Definition AnalyticVolume.cpp:492
const std::string & getDomainType() const
Returns the value of the "domainType" attribute of this AnalyticVolume.
Definition AnalyticVolume.cpp:221
virtual int setId(const std::string &id)
Sets the value of the "id" attribute of this AnalyticVolume.
Definition AnalyticVolume.cpp:285
virtual const std::string & getId() const
Returns the value of the "id" attribute of this AnalyticVolume.
Definition AnalyticVolume.cpp:171
int setFunctionType(const FunctionKind_t functionType)
Sets the value of the "functionType" attribute of this AnalyticVolume.
Definition AnalyticVolume.cpp:306
FunctionKind_t getFunctionType() const
Returns the value of the "functionType" attribute of this AnalyticVolume.
Definition AnalyticVolume.cpp:191
Definition BoundaryCondition.h:135
BoundaryKind_t getType() const
Returns the value of the "type" attribute of this BoundaryCondition.
Definition BoundaryCondition.cpp:155
int setVariable(const std::string &variable)
Sets the value of the "variable" attribute of this BoundaryCondition.
Definition BoundaryCondition.cpp:241
int setCoordinateBoundary(const std::string &coordinateBoundary)
Sets the value of the "coordinateBoundary" attribute of this BoundaryCondition.
Definition BoundaryCondition.cpp:298
const std::string & getVariable() const
Returns the value of the "variable" attribute of this BoundaryCondition.
Definition BoundaryCondition.cpp:145
const std::string & getCoordinateBoundary() const
Returns the value of the "coordinateBoundary" attribute of this BoundaryCondition.
Definition BoundaryCondition.cpp:176
int setType(const BoundaryKind_t type)
Sets the value of the "type" attribute of this BoundaryCondition.
Definition BoundaryCondition.cpp:259
Definition Boundary.h:78
virtual const std::string & getId() const
Returns the value of the "id" attribute of this Boundary.
Definition Boundary.cpp:141
double getValue() const
Returns the value of the "value" attribute of this Boundary.
Definition Boundary.cpp:161
virtual int setId(const std::string &id)
Sets the value of the "id" attribute of this Boundary.
Definition Boundary.cpp:201
int setValue(double value)
Sets the value of the "value" attribute of this Boundary.
Definition Boundary.cpp:222
Definition Compartment.h:490
virtual const std::string & getId() const
Returns the value of the "id" attribute of this Compartment.
Definition Compartment.cpp:243
int setConstant(bool value)
Sets the value of the "constant" attribute of this Compartment object.
Definition Compartment.cpp:661
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Compartment object.
Definition Compartment.cpp:479
Definition CompartmentMapping.h:81
int setDomainType(const std::string &domainType)
Sets the value of the "domainType" attribute of this CompartmentMapping.
Definition CompartmentMapping.cpp:247
virtual const std::string & getId() const
Returns the value of the "id" attribute of this CompartmentMapping.
Definition CompartmentMapping.cpp:142
int setUnitSize(double unitSize)
Sets the value of the "unitSize" attribute of this CompartmentMapping.
Definition CompartmentMapping.cpp:265
const std::string & getDomainType() const
Returns the value of the "domainType" attribute of this CompartmentMapping.
Definition CompartmentMapping.cpp:162
virtual int setId(const std::string &id)
Sets the value of the "id" attribute of this CompartmentMapping.
Definition CompartmentMapping.cpp:226
double getUnitSize() const
Returns the value of the "unitSize" attribute of this CompartmentMapping.
Definition CompartmentMapping.cpp:172
virtual bool isSetId() const
Predicate returning true if this CompartmentMapping's "id" attribute is set.
Definition CompartmentMapping.cpp:183
Definition CoordinateComponent.h:102
virtual const std::string & getId() const
Returns the value of the "id" attribute of this CoordinateComponent.
Definition CoordinateComponent.cpp:184
Boundary * createBoundaryMin()
Creates a new Boundary object, adds it to this CoordinateComponent object and returns the Boundary ob...
Definition CoordinateComponent.cpp:548
virtual int setId(const std::string &id)
Sets the value of the "id" attribute of this CoordinateComponent.
Definition CoordinateComponent.cpp:278
int setType(const CoordinateKind_t type)
Sets the value of the "type" attribute of this CoordinateComponent.
Definition CoordinateComponent.cpp:299
int setUnit(const std::string &unit)
Sets the value of the "unit" attribute of this CoordinateComponent.
Definition CoordinateComponent.cpp:337
Boundary * createBoundaryMax()
Creates a new Boundary object, adds it to this CoordinateComponent object and returns the Boundary ob...
Definition CoordinateComponent.cpp:573
bool isSetBoundaryMax() const
Predicate returning true if this CoordinateComponent's "boundaryMax" element is set.
Definition CoordinateComponent.cpp:475
const Boundary * getBoundaryMax() const
Returns the value of the "boundaryMax" element of this CoordinateComponent.
Definition CoordinateComponent.cpp:443
bool isSetBoundaryMin() const
Predicate returning true if this CoordinateComponent's "boundaryMin" element is set.
Definition CoordinateComponent.cpp:464
const std::string & getUnit() const
Returns the value of the "unit" attribute of this CoordinateComponent.
Definition CoordinateComponent.cpp:224
const Boundary * getBoundaryMin() const
Returns the value of the "boundaryMin" element of this CoordinateComponent.
Definition CoordinateComponent.cpp:423
CoordinateKind_t getType() const
Returns the value of the "type" attribute of this CoordinateComponent.
Definition CoordinateComponent.cpp:204
Definition DiffusionCoefficient.h:145
const std::string & getVariable() const
Returns the value of the "variable" attribute of this DiffusionCoefficient.
Definition DiffusionCoefficient.cpp:146
bool isSetCoordinateReference1() const
Predicate returning true if this DiffusionCoefficient's "coordinateReference1" attribute is set.
Definition DiffusionCoefficient.cpp:246
bool isSetCoordinateReference2() const
Predicate returning true if this DiffusionCoefficient's "coordinateReference2" attribute is set.
Definition DiffusionCoefficient.cpp:257
DiffusionKind_t getType() const
Returns the value of the "type" attribute of this DiffusionCoefficient.
Definition DiffusionCoefficient.cpp:156
int setType(const DiffusionKind_t type)
Sets the value of the "type" attribute of this DiffusionCoefficient.
Definition DiffusionCoefficient.cpp:285
int setVariable(const std::string &variable)
Sets the value of the "variable" attribute of this DiffusionCoefficient.
Definition DiffusionCoefficient.cpp:267
int setCoordinateReference1(const CoordinateKind_t coordinateReference1)
Sets the value of the "coordinateReference1" attribute of this DiffusionCoefficient.
Definition DiffusionCoefficient.cpp:322
CoordinateKind_t getCoordinateReference1() const
Returns the value of the "coordinateReference1" attribute of this DiffusionCoefficient.
Definition DiffusionCoefficient.cpp:177
CoordinateKind_t getCoordinateReference2() const
Returns the value of the "coordinateReference2" attribute of this DiffusionCoefficient.
Definition DiffusionCoefficient.cpp:201
Definition Domain.h:76
virtual int setId(const std::string &id)
Sets the value of the "id" attribute of this Domain.
Definition Domain.cpp:203
int setDomainType(const std::string &domainType)
Sets the value of the "domainType" attribute of this Domain.
Definition Domain.cpp:224
InteriorPoint * getInteriorPoint(unsigned int n)
Get an InteriorPoint from the Domain.
Definition Domain.cpp:319
virtual const std::string & getId() const
Returns the value of the "id" attribute of this Domain.
Definition Domain.cpp:143
const std::string & getDomainType() const
Returns the value of the "domainType" attribute of this Domain.
Definition Domain.cpp:163
InteriorPoint * createInteriorPoint()
Creates a new InteriorPoint object, adds it to this Domain object and returns the InteriorPoint objec...
Definition Domain.cpp:380
Definition DomainType.h:87
int getSpatialDimensions() const
Returns the value of the "spatialDimensions" attribute of this DomainType.
Definition DomainType.cpp:158
virtual int setId(const std::string &id)
Sets the value of the "id" attribute of this DomainType.
Definition DomainType.cpp:199
virtual const std::string & getId() const
Returns the value of the "id" attribute of this DomainType.
Definition DomainType.cpp:138
int setSpatialDimensions(int spatialDimensions)
Sets the value of the "spatialDimensions" attribute of this DomainType.
Definition DomainType.cpp:220
Definition GeometryDefinition.h:86
virtual bool isAnalyticGeometry() const
Predicate returning true if this abstract "GeometryDefinition" is of type AnalyticGeometry.
Definition GeometryDefinition.cpp:304
virtual int setId(const std::string &id)
Sets the value of the "id" attribute of this GeometryDefinition.
Definition GeometryDefinition.cpp:212
virtual const std::string & getId() const
Returns the value of the "id" attribute of this GeometryDefinition.
Definition GeometryDefinition.cpp:149
virtual bool isSampledFieldGeometry() const
Predicate returning true if this abstract "GeometryDefinition" is of type SampledFieldGeometry.
Definition GeometryDefinition.cpp:315
Definition Geometry.h:101
Domain * getDomain(unsigned int n)
Get a Domain from the Geometry.
Definition Geometry.cpp:627
AnalyticGeometry * createAnalyticGeometry()
Creates a new AnalyticGeometry object, adds it to this Geometry object and returns the AnalyticGeomet...
Definition Geometry.cpp:1088
CoordinateComponent * createCoordinateComponent()
Creates a new CoordinateComponent object, adds it to this Geometry object and returns the CoordinateC...
Definition Geometry.cpp:405
GeometryKind_t getCoordinateSystem() const
Returns the value of the "coordinateSystem" attribute of this Geometry.
Definition Geometry.cpp:178
unsigned int getNumGeometryDefinitions() const
Get the number of GeometryDefinition objects in this Geometry.
Definition Geometry.cpp:1077
SampledField * createSampledField()
Creates a new SampledField object, adds it to this Geometry object and returns the SampledField objec...
Definition Geometry.cpp:1354
CoordinateComponent * getCoordinateComponent(unsigned int n)
Get a CoordinateComponent from the Geometry.
Definition Geometry.cpp:316
Domain * createDomain()
Creates a new Domain object, adds it to this Geometry object and returns the Domain object created.
Definition Geometry.cpp:736
DomainType * getDomainType(unsigned int n)
Get a DomainType from the Geometry.
Definition Geometry.cpp:474
SampledFieldGeometry * createSampledFieldGeometry()
Creates a new SampledFieldGeometry object, adds it to this Geometry object and returns the SampledFie...
Definition Geometry.cpp:1116
GeometryDefinition * getGeometryDefinition(unsigned int n)
Get a GeometryDefinition from the Geometry.
Definition Geometry.cpp:1003
AdjacentDomains * getAdjacentDomains(unsigned int n)
Get an AdjacentDomains from the Geometry.
Definition Geometry.cpp:804
int setCoordinateSystem(const GeometryKind_t coordinateSystem)
Sets the value of the "coordinateSystem" attribute of this Geometry.
Definition Geometry.cpp:230
SampledField * getSampledField(unsigned int n)
Get a SampledField from the Geometry.
Definition Geometry.cpp:1269
AdjacentDomains * createAdjacentDomains()
Creates a new AdjacentDomains object, adds it to this Geometry object and returns the AdjacentDomains...
Definition Geometry.cpp:933
DomainType * createDomainType()
Creates a new DomainType object, adds it to this Geometry object and returns the DomainType object cr...
Definition Geometry.cpp:559
Definition InteriorPoint.h:81
double getCoord1() const
Returns the value of the "coord1" attribute of this InteriorPoint.
Definition InteriorPoint.cpp:154
int setCoord1(double coord1)
Sets the value of the "coord1" attribute of this InteriorPoint.
Definition InteriorPoint.cpp:217
Definition Parameter.h:202
virtual const std::string & getId() const
Returns the value of the "id" attribute of this Parameter.
Definition Parameter.cpp:225
int setValue(double value)
Sets the "value" attribute of this Parameter to the given double value and marks the attribute as set...
Definition Parameter.cpp:382
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Parameter.
Definition Parameter.cpp:335
Definition Reaction.h:224
int setReversible(bool value)
Sets the value of the "reversible" attribute of this Reaction.
Definition Reaction.cpp:599
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Reaction.
Definition Reaction.cpp:517
virtual const std::string & getId() const
Returns the value of the "id" attribute of this Reaction.
Definition Reaction.cpp:376
int setFast(bool value)
Sets the value of the "fast" attribute of this Reaction.
Definition Reaction.cpp:612
int setCompartment(const std::string &sid)
Sets the value of the "compartment" attribute of this Reaction.
Definition Reaction.cpp:635
Definition Rule.h:163
const std::string & getVariable() const
Get the value of the "variable" attribute of this Rule object.
Definition Rule.cpp:219
Definition SBMLDocument.h:351
const Model * getModel() const
Returns the Model object stored in this SBMLDocument.
Definition SBMLDocument.cpp:350
Definition SBMLDocumentPlugin.h:85
virtual int setRequired(bool value)
Sets the SBML "required" attribute value.
SBasePlugin * getPlugin(const std::string &package)
Returns a plug-in object (extension interface) for an SBML Level&#160;3 package extension with the given ...
Definition SBase.cpp:3551
const std::string & getPrefix() const
Returns the XML namespace prefix of the package to which this plugin object belongs.
Definition SBasePlugin.cpp:477
std::string getURI() const
Returns the XML namespace URI for the package to which this object belongs.
Definition SBasePlugin.cpp:447
Definition SampledFieldGeometry.h:78
SampledVolume * getSampledVolume(unsigned int n)
Get a SampledVolume from the SampledFieldGeometry.
Definition SampledFieldGeometry.cpp:223
int setSampledField(const std::string &sampledField)
Sets the value of the "sampledField" attribute of this SampledFieldGeometry.
Definition SampledFieldGeometry.cpp:165
const std::string & getSampledField() const
Returns the value of the "sampledField" attribute of this SampledFieldGeometry.
Definition SampledFieldGeometry.cpp:144
SampledVolume * createSampledVolume()
Creates a new SampledVolume object, adds it to this SampledFieldGeometry object and returns the Sampl...
Definition SampledFieldGeometry.cpp:331
Definition SampledField.h:146
int setDataType(const DataKind_t dataType)
Sets the value of the "dataType" attribute of this SampledField.
Definition SampledField.cpp:567
DataKind_t getDataType() const
Returns the value of the "dataType" attribute of this SampledField.
Definition SampledField.cpp:225
InterpolationKind_t getInterpolationType() const
Returns the value of the "interpolationType" attribute of this SampledField.
Definition SampledField.cpp:275
int setSamples(int *inArray, size_t arrayLength)
Sets the value of the samples entries of this SampledField.
Definition SampledField.cpp:743
virtual const std::string & getId() const
Returns the value of the "id" attribute of this SampledField.
Definition SampledField.cpp:205
virtual int setId(const std::string &id)
Sets the value of the "id" attribute of this SampledField.
Definition SampledField.cpp:546
int setNumSamples1(int numSamples1)
Sets the value of the "numSamples1" attribute of this SampledField.
Definition SampledField.cpp:603
CompressionKind_t getCompression() const
Returns the value of the "compression" attribute of this SampledField.
Definition SampledField.cpp:295
int setNumSamples3(int numSamples3)
Sets the value of the "numSamples3" attribute of this SampledField.
Definition SampledField.cpp:633
int getNumSamples2() const
Returns the value of the "numSamples2" attribute of this SampledField.
Definition SampledField.cpp:255
int getNumSamples3() const
Returns the value of the "numSamples3" attribute of this SampledField.
Definition SampledField.cpp:265
int getSamples(int *outArray) const
Stores the uncompressed values of the samples entries of this SampledField in the provided array.
Definition SampledField.cpp:342
int setCompression(const CompressionKind_t compression)
Sets the value of the "compression" attribute of this SampledField.
Definition SampledField.cpp:684
int setNumSamples2(int numSamples2)
Sets the value of the "numSamples2" attribute of this SampledField.
Definition SampledField.cpp:618
int setInterpolationType(const InterpolationKind_t interpolationType)
Sets the value of the "interpolationType" attribute of this SampledField.
Definition SampledField.cpp:648
int getSamplesLength() const
Returns the value of the "samplesLength" attribute of this SampledField.
Definition SampledField.cpp:419
int getNumSamples1() const
Returns the value of the "numSamples1" attribute of this SampledField.
Definition SampledField.cpp:245
Definition SampledVolume.h:80
virtual const std::string & getId() const
Returns the value of the "id" attribute of this SampledVolume.
Definition SampledVolume.cpp:158
int setMinValue(double minValue)
Sets the value of the "minValue" attribute of this SampledVolume.
Definition SampledVolume.cpp:333
double getMinValue() const
Returns the value of the "minValue" attribute of this SampledVolume.
Definition SampledVolume.cpp:198
virtual int setId(const std::string &id)
Sets the value of the "id" attribute of this SampledVolume.
Definition SampledVolume.cpp:282
double getMaxValue() const
Returns the value of the "maxValue" attribute of this SampledVolume.
Definition SampledVolume.cpp:208
int setMaxValue(double maxValue)
Sets the value of the "maxValue" attribute of this SampledVolume.
Definition SampledVolume.cpp:345
int setDomainType(const std::string &domainType)
Sets the value of the "domainType" attribute of this SampledVolume.
Definition SampledVolume.cpp:303
double getSampledValue() const
Returns the value of the "sampledValue" attribute of this SampledVolume.
Definition SampledVolume.cpp:188
int setSampledValue(double sampledValue)
Sets the value of the "sampledValue" attribute of this SampledVolume.
Definition SampledVolume.cpp:321
const std::string & getDomainType() const
Returns the value of the "domainType" attribute of this SampledVolume.
Definition SampledVolume.cpp:178
Definition SpatialCompartmentPlugin.h:65
CompartmentMapping * createCompartmentMapping()
Creates a new CompartmentMapping object, adds it to this SpatialCompartmentPlugin object and returns ...
Definition SpatialCompartmentPlugin.cpp:213
const CompartmentMapping * getCompartmentMapping() const
Returns the value of the "compartmentMapping" element of this SpatialCompartmentPlugin.
Definition SpatialCompartmentPlugin.cpp:144
Definition SpatialModelPlugin.h:65
const Geometry * getGeometry() const
Returns the value of the "geometry" element of this SpatialModelPlugin.
Definition SpatialModelPlugin.cpp:139
Geometry * createGeometry()
Creates a new Geometry object, adds it to this SpatialModelPlugin object and returns the Geometry obj...
Definition SpatialModelPlugin.cpp:203
Definition SpatialParameterPlugin.h:68
AdvectionCoefficient * createAdvectionCoefficient()
Creates a new AdvectionCoefficient object, adds it to this SpatialParameterPlugin object and returns ...
Definition SpatialParameterPlugin.cpp:498
SpatialSymbolReference * createSpatialSymbolReference()
Creates a new SpatialSymbolReference object, adds it to this SpatialParameterPlugin object and return...
Definition SpatialParameterPlugin.cpp:472
const AdvectionCoefficient * getAdvectionCoefficient() const
Returns the value of the "advectionCoefficient" element of this SpatialParameterPlugin.
Definition SpatialParameterPlugin.cpp:221
const DiffusionCoefficient * getDiffusionCoefficient() const
Returns the value of the "diffusionCoefficient" element of this SpatialParameterPlugin.
Definition SpatialParameterPlugin.cpp:265
const BoundaryCondition * getBoundaryCondition() const
Returns the value of the "boundaryCondition" element of this SpatialParameterPlugin.
Definition SpatialParameterPlugin.cpp:243
bool isSetSpatialSymbolReference() const
Predicate returning true if this SpatialParameterPlugin's "spatialSymbolReference" element is set.
Definition SpatialParameterPlugin.cpp:287
bool isSetBoundaryCondition() const
Predicate returning true if this SpatialParameterPlugin's "boundaryCondition" element is set.
Definition SpatialParameterPlugin.cpp:309
const SpatialSymbolReference * getSpatialSymbolReference() const
Returns the value of the "spatialSymbolReference" element of this SpatialParameterPlugin.
Definition SpatialParameterPlugin.cpp:199
BoundaryCondition * createBoundaryCondition()
Creates a new BoundaryCondition object, adds it to this SpatialParameterPlugin object and returns the...
Definition SpatialParameterPlugin.cpp:524
bool isSetAdvectionCoefficient() const
Predicate returning true if this SpatialParameterPlugin's "advectionCoefficient" element is set.
Definition SpatialParameterPlugin.cpp:298
bool isSetDiffusionCoefficient() const
Predicate returning true if this SpatialParameterPlugin's "diffusionCoefficient" element is set.
Definition SpatialParameterPlugin.cpp:320
DiffusionCoefficient * createDiffusionCoefficient()
Creates a new DiffusionCoefficient object, adds it to this SpatialParameterPlugin object and returns ...
Definition SpatialParameterPlugin.cpp:550
Definition SpatialReactionPlugin.h:66
bool getIsLocal() const
Returns the value of the "isLocal" attribute of this SpatialReactionPlugin.
Definition SpatialReactionPlugin.cpp:123
int setIsLocal(bool isLocal)
Sets the value of the "isLocal" attribute of this SpatialReactionPlugin.
Definition SpatialReactionPlugin.cpp:144
Definition SpatialSpeciesPlugin.h:66
bool getIsSpatial() const
Returns the value of the "isSpatial" attribute of this SpatialSpeciesPlugin.
Definition SpatialSpeciesPlugin.cpp:123
int setIsSpatial(bool isSpatial)
Sets the value of the "isSpatial" attribute of this SpatialSpeciesPlugin.
Definition SpatialSpeciesPlugin.cpp:144
Definition SpatialSymbolReference.h:79
int setSpatialRef(const std::string &spatialRef)
Sets the value of the "spatialRef" attribute of this SpatialSymbolReference.
Definition SpatialSymbolReference.cpp:157
const std::string & getSpatialRef() const
Returns the value of the "spatialRef" attribute of this SpatialSymbolReference.
Definition SpatialSymbolReference.cpp:136
Definition Species.h:429
int setCompartment(const std::string &sid)
Sets the "compartment" attribute of this Species object.
Definition Species.cpp:661
int setConstant(bool value)
Sets the "constant" attribute of this Species object.
Definition Species.cpp:820
virtual const std::string & getId() const
Returns the value of the "id" attribute of this Species.
Definition Species.cpp:278
int setBoundaryCondition(bool value)
Sets the "boundaryCondition" attribute of this Species object.
Definition Species.cpp:787
int setInitialConcentration(double value)
Sets the "initialConcentration" attribute of this Species and marks the field as set.
Definition Species.cpp:695
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Species.
Definition Species.cpp:591
int setHasOnlySubstanceUnits(bool value)
Sets the "hasOnlySubstanceUnits" attribute of this Species object.
Definition Species.cpp:767