63 install(
"initialize", m_initialize, [
this](
double t0) { R::initialize(t0); });
64 install(
"syncState", m_syncState, [
this]() { R::syncState(); });
66 [
this](std::array<size_t, 1> sizes,
double* y) { R::getState(y); });
67 install(
"updateState", m_updateState,
68 [
this](std::array<size_t, 1> sizes,
double* y) { R::updateState(y); });
69 install(
"updateSurfaceState", m_updateSurfaceState,
70 [
this](std::array<size_t, 1> sizes,
double* y) { R::updateSurfaceState(y); });
71 install(
"getSurfaceInitialConditions", m_getSurfaceInitialConditions,
72 [
this](std::array<size_t, 1> sizes,
double* y) {
73 R::getSurfaceInitialConditions(y);
76 install(
"updateConnected", m_updateConnected,
77 [
this](
bool updatePressure) { R::updateConnected(updatePressure); });
79 [
this](std::array<size_t, 2> sizes,
double t,
double* LHS,
double* RHS) {
83 install(
"evalWalls", m_evalWalls, [
this](
double t) { R::evalWalls(t); });
84 install(
"evalSurfaces", m_evalSurfaces,
85 [
this](std::array<size_t, 3> sizes,
double* LHS,
double* RHS,
double* sdot) {
86 R::evalSurfaces(LHS, RHS, sdot);
89 install(
"componentName", m_componentName,
90 [
this](
size_t k) {
return R::componentName(k); });
91 install(
"componentIndex", m_componentIndex,
92 [
this](
const string& nm) {
return R::componentIndex(nm); });
93 install(
"speciesIndex", m_speciesIndex,
94 [
this](
const string& nm) {
return R::speciesIndex(nm); });
99 void initialize(
double t0)
override {
103 void syncState()
override {
107 void getState(
double* y)
override {
108 std::array<size_t, 1> sizes{R::neq()};
109 m_getState(sizes, y);
112 void updateState(
double* y)
override {
113 std::array<size_t, 1> sizes{R::neq()};
114 m_updateState(sizes, y);
117 void updateSurfaceState(
double* y)
override {
118 std::array<size_t, 1> sizes{R::m_nv_surf};
119 m_updateSurfaceState(sizes, y);
122 void getSurfaceInitialConditions(
double* y)
override {
123 std::array<size_t, 1> sizes{R::m_nv_surf};
124 m_getSurfaceInitialConditions(sizes, y);
127 void updateConnected(
bool updatePressure)
override {
128 m_updateConnected(updatePressure);
131 void eval(
double t,
double* LHS,
double* RHS)
override {
132 std::array<size_t, 2> sizes{R::neq(), R::neq()};
133 m_eval(sizes, t, LHS, RHS);
136 void evalWalls(
double t)
override {
140 void evalSurfaces(
double* LHS,
double* RHS,
double* sdot)
override {
141 std::array<size_t, 3> sizes{R::m_nv_surf, R::m_nv_surf, R::m_nsp};
142 m_evalSurfaces(sizes, LHS, RHS, sdot);
145 string componentName(
size_t k)
override {
146 return m_componentName(k);
149 size_t componentIndex(
const string& nm)
const override {
150 return m_componentIndex(nm);
153 size_t speciesIndex(
const string& nm)
const override {
154 return m_speciesIndex(nm);
180 R::m_thermo->restoreState(R::m_state);
184 R::m_surfaces.at(n)->syncState();
188 function<void(
double)> m_initialize;
189 function<void()> m_syncState;
190 function<void(std::array<size_t, 1>,
double*)> m_getState;
191 function<void(std::array<size_t, 1>,
double*)> m_updateState;
192 function<void(std::array<size_t, 1>,
double*)> m_updateSurfaceState;
193 function<void(std::array<size_t, 1>,
double*)> m_getSurfaceInitialConditions;
194 function<void(
bool)> m_updateConnected;
195 function<void(std::array<size_t, 2>,
double,
double*,
double*)> m_eval;
196 function<void(
double)> m_evalWalls;
197 function<void(std::array<size_t, 3>,
double*,
double*,
double*)> m_evalSurfaces;
198 function<string(
size_t)> m_componentName;
199 function<size_t(
const string&)> m_componentIndex;
200 function<size_t(
const string&)> m_speciesIndex;