Chi-Tech
chi_ffinter_volume_calllua.cc
Go to the documentation of this file.
1
#include "
chi_ffinter_volume.h
"
2
3
#include "
chi_runtime.h
"
4
#include "
console/chi_console.h
"
5
6
//###################################################################
7
/**Calls the designated lua function*/
8
double
chi_mesh::FieldFunctionInterpolationVolume::
9
CallLuaFunction
(
double
ff_value,
int
mat_id)
const
10
{
11
lua_State* L =
Chi::console
.
GetConsoleState
();
12
double
ret_val = 0.0;
13
14
lua_getglobal(L,
op_lua_func_
.c_str());
15
lua_pushnumber(L,ff_value);
16
lua_pushnumber(L,mat_id);
17
18
//2 arguments, 1 result, 0=original error object
19
if
(lua_pcall(L,2,1,0) == 0)
20
{
21
ret_val = lua_tonumber(L,-1);
22
}
23
lua_pop(L,1);
24
25
26
return
ret_val;
27
}
chi_console.h
chi_ffinter_volume.h
chi_runtime.h
Chi::console
static chi::Console & console
Definition:
chi_runtime.h:80
chi::Console::GetConsoleState
lua_State *& GetConsoleState()
Definition:
chi_console.h:130
chi_mesh::FieldFunctionInterpolationVolume::op_lua_func_
std::string op_lua_func_
Definition:
chi_ffinter_volume.h:27
chi_mesh::FieldFunctionInterpolationVolume::CallLuaFunction
double CallLuaFunction(double ff_value, int mat_id) const
Definition:
chi_ffinter_volume_calllua.cc:9
framework
mesh
FieldFunctionInterpolation
Volume
chi_ffinter_volume_calllua.cc
Generated by
1.9.3