globals.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2020 by
  4. * The Salk Institute for Biological Studies
  5. *
  6. * Use of this source code is governed by an MIT-style
  7. * license that can be found in the LICENSE file or at
  8. * https://opensource.org/licenses/MIT.
  9. *
  10. ******************************************************************************/
  11. #include "api/globals.h"
  12. #include "api/species.h"
  13. #include "generated/gen_constants.h"
  14. namespace MCell {
  15. namespace API {
  16. // we need to have global shared pointers, they are added to Model in its constructor
  17. // having simple global variables would mean that we need to make a copy
  18. // and in model initialization we would be updating the copy (which will not reflect changes to our globals)
  19. std::shared_ptr<Species> AllMolecules(new Species(ALL_MOLECULES, FLT_UNSET, 0));
  20. std::shared_ptr<Species> AllVolumeMolecules(new Species(ALL_VOLUME_MOLECULES, FLT_UNSET, 0));
  21. std::shared_ptr<Species> AllSurfaceMolecules(new Species(ALL_SURFACE_MOLECULES, 0, FLT_UNSET));
  22. } // API
  23. } // MCell