62 ReactorDelegator(shared_ptr<Solution> phase,
bool clone,
const string& name=
"(none)")
63 : R(phase, clone, name)
65 install(
"initialize", m_initialize, [
this](
double t0) { R::initialize(t0); });
66 install(
"syncState", m_syncState, [
this]() { R::syncState(); });
68 [
this](std::array<size_t, 1> sizes,
double* y) { R::getState(y); });
69 install(
"updateState", m_updateState,
70 [
this](std::array<size_t, 1> sizes,
double* y) { R::updateState(y); });
71 install(
"updateSurfaceState", m_updateSurfaceState,
72 [
this](std::array<size_t, 1> sizes,
double* y) { R::updateSurfaceState(y); });
73 install(
"getSurfaceInitialConditions", m_getSurfaceInitialConditions,
74 [
this](std::array<size_t, 1> sizes,
double* y) {
75 R::getSurfaceInitialConditions(y);
78 install(
"updateConnected", m_updateConnected,
79 [
this](
bool updatePressure) { R::updateConnected(updatePressure); });
81 [
this](std::array<size_t, 2> sizes,
double t,
double* LHS,
double* RHS) {
85 install(
"evalWalls", m_evalWalls, [
this](
double t) { R::evalWalls(t); });
86 install(
"evalSurfaces", m_evalSurfaces,
87 [
this](std::array<size_t, 3> sizes,
double* LHS,
double* RHS,
double* sdot) {
88 R::evalSurfaces(LHS, RHS, sdot);
91 install(
"componentName", m_componentName,
92 [
this](
size_t k) {
return R::componentName(k); });
93 install(
"componentIndex", m_componentIndex,
94 [
this](
const string& nm) {
return R::componentIndex(nm); });
95 install(
"speciesIndex", m_speciesIndex,
96 [
this](
const string& nm) {
return R::speciesIndex(nm); });
101 string type()
const override {
102 return fmt::format(
"Extensible{}", R::type());
105 void initialize(
double t0)
override {
109 void syncState()
override {
113 void getState(
double* y)
override {
114 std::array<size_t, 1> sizes{R::neq()};
115 m_getState(sizes, y);
118 void updateState(
double* y)
override {
119 std::array<size_t, 1> sizes{R::neq()};
120 m_updateState(sizes, y);
123 void updateSurfaceState(
double* y)
override {
124 std::array<size_t, 1> sizes{R::m_nv_surf};
125 m_updateSurfaceState(sizes, y);
128 void getSurfaceInitialConditions(
double* y)
override {
129 std::array<size_t, 1> sizes{R::m_nv_surf};
130 m_getSurfaceInitialConditions(sizes, y);
133 void updateConnected(
bool updatePressure)
override {
134 m_updateConnected(updatePressure);
137 void eval(
double t,
double* LHS,
double* RHS)
override {
138 std::array<size_t, 2> sizes{R::neq(), R::neq()};
139 m_eval(sizes, t, LHS, RHS);
142 void evalWalls(
double t)
override {
146 void evalSurfaces(
double* LHS,
double* RHS,
double* sdot)
override {
147 std::array<size_t, 3> sizes{R::m_nv_surf, R::m_nv_surf, R::m_nsp};
148 m_evalSurfaces(sizes, LHS, RHS, sdot);
151 string componentName(
size_t k)
override {
152 return m_componentName(k);
155 size_t componentIndex(
const string& nm)
const override {
156 return m_componentIndex(nm);
159 size_t speciesIndex(
const string& nm)
const override {
160 return m_speciesIndex(nm);
186 R::m_thermo->restoreState(R::m_state);
190 R::m_surfaces.at(n)->syncState();
194 function<void(
double)> m_initialize;
195 function<void()> m_syncState;
196 function<void(std::array<size_t, 1>,
double*)> m_getState;
197 function<void(std::array<size_t, 1>,
double*)> m_updateState;
198 function<void(std::array<size_t, 1>,
double*)> m_updateSurfaceState;
199 function<void(std::array<size_t, 1>,
double*)> m_getSurfaceInitialConditions;
200 function<void(
bool)> m_updateConnected;
201 function<void(std::array<size_t, 2>,
double,
double*,
double*)> m_eval;
202 function<void(
double)> m_evalWalls;
203 function<void(std::array<size_t, 3>,
double*,
double*,
double*)> m_evalSurfaces;
204 function<string(
size_t)> m_componentName;
205 function<size_t(
const string&)> m_componentIndex;
206 function<size_t(
const string&)> m_speciesIndex;