From 0562f18100e0a641ebdf1a0dd67c2faddcdeb1de Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 1 May 2015 12:07:44 -0400 Subject: [PATCH] [Reactor] Wall coverages may be set using a compositionMap or string --- include/cantera/zeroD/Wall.h | 8 ++++++++ src/zeroD/Wall.cpp | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/include/cantera/zeroD/Wall.h b/include/cantera/zeroD/Wall.h index b027e87b1..e9c078c63 100644 --- a/include/cantera/zeroD/Wall.h +++ b/include/cantera/zeroD/Wall.h @@ -159,6 +159,14 @@ public: //! (`leftright = 1`) surface to the values in array `cov`. void setCoverages(int leftright, const doublereal* cov); + //! Set the surface coverages on the left (`leftright = 0`) or right + //! (`leftright = 1`) surface to the values in array `cov`. + void setCoverages(int leftright, const compositionMap& cov); + + //! Set the surface coverages on the left (`leftright = 0`) or right + //! (`leftright = 1`) surface to the values in array `cov`. + void setCoverages(int leftright, const std::string& cov); + //! Write the coverages of the left or right surface into array `cov`. void getCoverages(int leftright, doublereal* cov); diff --git a/src/zeroD/Wall.cpp b/src/zeroD/Wall.cpp index 651d2cfe5..3d68ea933 100644 --- a/src/zeroD/Wall.cpp +++ b/src/zeroD/Wall.cpp @@ -101,6 +101,26 @@ void Wall::setCoverages(int leftright, const doublereal* cov) } } +void Wall::setCoverages(int leftright, const compositionMap& cov) +{ + m_surf[leftright]->setCoveragesByName(cov); + if (leftright == 0) { + m_surf[0]->getCoverages(&m_leftcov[0]); + } else { + m_surf[1]->getCoverages(&m_rightcov[0]); + } +} + +void Wall::setCoverages(int leftright, const std::string& cov) +{ + m_surf[leftright]->setCoveragesByName(cov); + if (leftright == 0) { + m_surf[0]->getCoverages(&m_leftcov[0]); + } else { + m_surf[1]->getCoverages(&m_rightcov[0]); + } +} + void Wall::getCoverages(int leftright, doublereal* cov) { if (leftright == 0) {