18 const std::string& lua_func_name,
23 lua_getglobal(L, lua_func_name.c_str());
26 if (not lua_isfunction(L, -1))
27 throw std::logic_error(
"CallLua_iXYZFunction attempted to access lua-function, " +
28 lua_func_name +
", but it seems the function"
29 " could not be retrieved.");
32 lua_pushinteger(L, imat);
33 lua_pushnumber(L, xyz.
x);
34 lua_pushnumber(L, xyz.
y);
35 lua_pushnumber(L, xyz.
z);
40 if (lua_pcall(L,4,1,0) == 0)
42 LuaCheckNumberValue(
"CallLua_iXYZFunction", L, -1);
43 lua_return = lua_tonumber(L,-1);
46 throw std::logic_error(
"CallLua_iXYZFunction attempted to call lua-function, " +
47 lua_func_name +
", but the call failed." +
60 auto& ff = *field_functions_.front();
61 ff.UpdateFieldVector(x_);
static double CallLua_iXYZFunction(lua_State *L, const std::string &, int, const chi_mesh::Vector3 &)
void UpdateFieldFunctions()
std::string PrintStr() const