V37ACC7MAD57VQOKAT5FBO2ITNX73AWD2DUEIHMF7UPKV63YRTQAC
// TODO: Update Saxpy call when using AMReX 19.12 or later
const auto nghosts = y.mfabs.at(n)->nGrowVect();
for (int d = 0; d < 3; ++d)
assert(nghosts[d] == nghosts[0]);
assert(x.mfabs.at(n)->nGrowVect() == y.mfabs.at(n)->nGrowVect());
if (x.mfabs.at(n)->contains_nan())
CCTK_VERROR("statecomp_t::axpy.x: Variable %s contains nans",
x.varnames.at(n).c_str());
// TODO: Update Lincomb call when using AMReX 19.12 or later
const auto nghosts = z.mfabs.at(n)->nGrowVect();
for (int d = 0; d < 3; ++d)
assert(nghosts[d] == nghosts[0]);
assert(x.mfabs.at(n)->nGrowVect() == z.mfabs.at(n)->nGrowVect());
assert(y.mfabs.at(n)->nGrowVect() == z.mfabs.at(n)->nGrowVect());
if (x.mfabs.at(n)->contains_nan())
CCTK_VERROR("statecomp_t::lincomb.x: Variable %s contains nans",
x.varnames.at(n).c_str());
if (y.mfabs.at(n)->contains_nan())
CCTK_VERROR("statecomp_t::lincomb.y: Variable %s contains nans",
y.varnames.at(n).c_str());
int get_group_rhs(const int gi) {
assert(gi >= 0);
const int tags = CCTK_GroupTagsTableI(gi);
assert(tags >= 0);
vector<char> rhs_buf(1000);
const int iret =
Util_TableGetString(tags, rhs_buf.size(), rhs_buf.data(), "rhs");
if (iret == UTIL_ERROR_TABLE_NO_SUCH_KEY) {
rhs_buf[0] = '\0'; // default: empty (no RHS)
} else if (iret >= 0) {
// do nothing
} else {
assert(0);
}
const string str(rhs_buf.data());
if (str.empty())
return -1; // No RHS specified
auto str1 = str;
if (str1.find(':') == string::npos) {
const char *impl = CCTK_GroupImplementationI(gi);
str1 = string(impl) + "::" + str1;
}
const int gi1 = CCTK_GroupIndex(str1.c_str());
assert(gi1 >= 0); // Check fluxes are valid groups
const int flux = gi1;