Exemplo n.º 1
0
int CellMLModelDefinition::setVariableAsKnown(const char* name)
{
  std::vector<iface::cellml_services::VariableEvaluationType> vets;
  // initially, only allow parameters to be controlled by OpenCMISS(cm)
  vets.push_back(iface::cellml_services::CONSTANT);
  //vets.push_back(iface::cellml_services::VARIABLE_OF_INTEGRATION);
  //vets.push_back(iface::cellml_services::FLOATING);
  int code = flagVariable(this,name,L"KNOWN",vets,mNumberOfKnownVariables,mParameterCounter);
  return code;
}
Exemplo n.º 2
0
int CellMLModelDefinition::setVariableAsWanted(const char* name)
{
  std::vector<iface::cellml_services::VariableEvaluationType> vets;
  // can't flag state variables
  //vets.push_back(iface::cellml_services::STATE_VARIABLE);
  vets.push_back(iface::cellml_services::PSEUDOSTATE_VARIABLE);
  vets.push_back(iface::cellml_services::ALGEBRAIC);
  //vets.push_back(iface::cellml_services::LOCALLY_BOUND);
  // we need to allow constant variables to be flagged as wanted since if it is a model with no
  // differential equations then all algebraic variables will be constant - i.e., constitutive laws
  vets.push_back(iface::cellml_services::CONSTANT);
  int code = flagVariable(this,name,L"WANTED",vets,mNumberOfWantedVariables,mIntermediateCounter);
  return code;
}
Exemplo n.º 3
0
int CellmlModelDefinition::setVariableAsInput(const std::string &variableId)
{
    std::cout << "CellmlModelDefinition::setVariableAsInput: flagging variable: " << variableId
              << "; as a INPUT variable." << std::endl;
    std::vector<iface::cellml_services::VariableEvaluationType> vets;
    // initially, only allow "constant" variables to be defined externally
    vets.push_back(iface::cellml_services::CONSTANT);
    //vets.push_back(iface::cellml_services::VARIABLE_OF_INTEGRATION);
    //vets.push_back(iface::cellml_services::FLOATING);
    int index = flagVariable(variableId, csim::InputType, vets,
                             mNumberOfInputVariables, mCapi,
                             mVariableTypes, mVariableIndices);
    return index;
}
Exemplo n.º 4
0
int CellmlModelDefinition::setVariableAsOutput(const std::string &variableId)
{
    std::cout << "CellmlModelDefinition::setVariableAsOutput: flagging variable: " << variableId
              << "; as a OUTPUT variable." << std::endl;
    std::vector<iface::cellml_services::VariableEvaluationType> vets;
    // state variables should be flagged if they need to be copied into the wanted array
    vets.push_back(iface::cellml_services::STATE_VARIABLE);
    vets.push_back(iface::cellml_services::PSEUDOSTATE_VARIABLE);
    vets.push_back(iface::cellml_services::ALGEBRAIC);
    //vets.push_back(iface::cellml_services::LOCALLY_BOUND);
    // we need to allow constant variables to be flagged as wanted since if it is a model with no
    // differential equations then all algebraic variables will be constant - i.e., constitutive laws
    vets.push_back(iface::cellml_services::CONSTANT);
    vets.push_back(iface::cellml_services::VARIABLE_OF_INTEGRATION);
    int index = flagVariable(variableId, csim::OutputType, vets,
                             mNumberOfOutputVariables, mCapi, mVariableTypes,
                             mVariableIndices);
    return index;
}