![]() |
GemaLuaCoreLib
The GeMA Lua Core library
|
Implementation of the Declaration of the function used to prepare an environment with the core Lua functions. More...
#include "gmLuaEnv.h"#include "gmLuaModelData.h"#include "gmLuaMatrix.h"#include "gmLuaValueInfo.h"#include "gmLuaInterpolator.h"#include "gmLuaCellGroupSet.h"#include "gmLuaNodeSet.h"#include "gmLuaValueAccessor.h"#include "gmLuaMesh.h"#include "gmLuaShape.h"#include "gmLuaIntegrationRule.h"#include "gmLuaCellGeometry.h"#include "gmLuaSpatialIndex.h"#include "gmLuaTask.h"#include "gmLuaStateDump.h"#include "gmLuaUtils.h"#include <gmLuaDiscontinuitySet.h>#include <gmMesh.h>#include <gmInterpolator.h>#include <gmGaussToElementNodeInterpolator.h>#include <gmPointCloudToPointInterpolator.h>#include <gmPointCloudToMeshInterpolator.h>#include <gmNumSolver.h>#include <gmSpatialIndex.h>#include <gmTrace.h>#include <gmLog.h>#include <gmSimulationData.h>#include <gmSolutionData.h>#include <gmValueInfo.h>#include <gmGaussAccessor.h>#include <gmCellGroupSet.h>#include <gmPath.h>#include <gmShape.h>#include <gmBorderIntegrationRule.h>#include <gmShapeOrthogonalPol.h>#include <gmTaskManager.h>#include <gmStateDump.h>#include <gmRunProgressStats.h>#include <gmPluginData.h>#include "gmThreadLocalBuffer.h"#include "gmAcTraversalUtils.h"#include <luaEnv.h>#include <luaTable.h>#include <luaTableTraverse.h>#include <luaStackBalancer.h>#include <unit.h>#include <unitConverter.h>#include <QDir>#include <QElapsedTimer>
Functions | |
| static int | LuaCreateMatrix (lua_State *L) |
| Function used to create a matrix inside Lua. | |
| static int | LuaCreateVector (lua_State *L) |
| Function used to create a vector (matrix with a single column) inside Lua. | |
| static int | LuaCreateNodeToCellPointInterpolator (lua_State *L) |
| Function used to create a "NodeToCellPointInterpolator" inside Lua. | |
| static int | LuaCreateNodeToElementPointInterpolator (lua_State *L) |
| Function used to create a "NodeToElementPointInterpolator" inside Lua. | |
| static int | LuaCreateGaussToElementPointInterpolator (lua_State *L) |
| Function used to create a "GaussToElementPointInterpolator" inside Lua. | |
| static int | LuaCreateGaussToElementNodeInterpolator (lua_State *L) |
| Function used to create a "GaussToNodeInterpolator" inside Lua. | |
| static int | LuaCreateGaussNeighborsToNodeInterpolator (lua_State *L) |
| Function used to create a "GaussNeighborsToNodeInterpolator" inside Lua. | |
| static int | LuaCreateNodeCloudToPointInterpolator (lua_State *L) |
| Function used to create a "NodeCloudToPointInterpolator" inside Lua. | |
| static int | LuaCreateGaussCloudToPointInterpolator (lua_State *L) |
| Function used to create a "GaussCloudToPointInterpolator" inside Lua. | |
| static int | LuaNodeBasedMeshGaussToNodesInterpolation (lua_State *L) |
| Function used to interpolate mesh node values from Gauss points with a node based approach. | |
| static int | LuaElementBasedMeshGaussToNodesInterpolation (lua_State *L) |
| Function used to interpolate mesh node values from Gauss points with an element based approach. | |
| static int | LuaSplineMeshNodesToMeshNodesInterpolation (lua_State *L) |
| Function used to transfer node values from a source mesh to node values of a destination mesh using the spline interpolation method. Each destination node value is calculated via a spline interpolation. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes. | |
| static int | LuaSplineMeshNodesToMeshGaussInterpolation (lua_State *L) |
| Function used to transfer node values from a source mesh to Gauss values of a destination mesh using the spline interpolation method. Each destination Gauss value is calculated via a spline interpolation. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes. | |
| static int | LuaSplineMeshGaussToMeshNodesInterpolation (lua_State *L) |
| Function used to transfer Gauss values from a source mesh to node values of a destination mesh using the spline interpolation method. Each destination node value is calculated via a spline interpolation. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes. | |
| static int | LuaSplineMeshGaussToMeshGaussInterpolation (lua_State *L) |
| Function used to transfer Gauss values from a source mesh to Gauss values of a destination mesh using the spline interpolation method. Each destination Gauss value is calculated via a spline interpolation. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes. | |
| static int | LuaMeshNodesToMeshNodesInterpolation (lua_State *L) |
| Function used to transfer node values from a source mesh to node values of a destination mesh using the given interpolation method. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes. | |
| static int | LuaMeshNodesToMeshGaussInterpolation (lua_State *L) |
| Function used to transfer node values from a source mesh to Gauss values of a destination mesh using the given interpolation method. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes. | |
| static int | LuaMeshGaussToMeshNodesInterpolation (lua_State *L) |
| Function used to transfer Gauss values from a source mesh to node values of a destination mesh using the given interpolation method. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes. | |
| static int | LuaMeshGaussToMeshGaussInterpolation (lua_State *L) |
| Function used to transfer Gauss values from a source mesh to Gauss values of a destination mesh using the given interpolation method. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes. | |
| static int | LuaMeshNodesToMeshNodesConformInterpolation (lua_State *L) |
| Function used to transfer node values from a source mesh to node values of a destination mesh using the given interpolation method. The destination mesh is expected to be conform with the discontinuitySet. | |
| static int | LuaLogMsg (lua_State *L) |
| Function used to print messages using the logger infrastructure. | |
| static int | LuaLogMemory (lua_State *L) |
| Function used to print used memory using the logger infrastructure. | |
| static int | LuaCreateValueInfo (lua_State *L) |
| Function used to create a new value info object. | |
| static int | LuaCreateShapeFunction (lua_State *L) |
| Function used to create a shape function object. | |
| static int | LuaCreateCellGeometry (lua_State *L) |
| Function used to create a cell geometry object. | |
| static int | LuaCreateIntegrationRule (lua_State *L) |
| Returns a new integration rule object suited for the given kind of element or nil if the rules are invalid. | |
| static int | LuaCreateBorderIntegrationRule (lua_State *L) |
| Returns a new border integration rule object suited for the given kind of element or nil if the rules are invalid. | |
| static int | LuaCreateEdgeIntegrationRule (lua_State *L) |
| Returns a new edge integration rule object suited for the given kind of element or nil if the rules are invalid. | |
| static int | LuaCreateFaceIntegrationRule (lua_State *L) |
| Returns a new face integration rule object suited for the given kind of element or nil if the rules are invalid. | |
| static int | LuaConvert (lua_State *L) |
| Function used to convert a value between two units. | |
| static int | LuaCheckUnit (lua_State *L) |
| Function used to check if a unit is a known unit or not. | |
| static int | LuaStartTimer (lua_State *L) |
| Function used to start a timer, returned by the function. | |
| static int | LuaResetTimer (lua_State *L) |
| Resets the given timer object. | |
| static int | LuaElapsedTime (lua_State *L) |
| Returns the elapsed time in seconds since startTimer() was called on the given timer object. | |
| static int | LuaCurrentTime (lua_State *L) |
| Returns the current simulation time + the simulation time unit. | |
| static int | LuaPreviousTime (lua_State *L) |
| Returns the previous simulation time + the simulation time unit. | |
| static int | LuaSetCurrentTime (lua_State *L) |
| Updates the current simulation time. A second boolean para,eter defines if the previous time will be updated or not. Default (when missing) = true. | |
| static int | LuaSetPreviousTime (lua_State *L) |
| Updates the previous simulation time. | |
| static int | LuaSetCurrentTimeUnit (lua_State *L) |
| Updates the unit for the current simulation time. | |
| static int | LuaTranslatePath (lua_State *L) |
| Given a path / file name, converts any macros and returns the expanded AND cleaned value. | |
| static int | LuaCleanPath (lua_State *L) |
| Given a path / file name, returns the cleaned value. | |
| static int | LuaIsMeshGhostNode (lua_State *L) |
| Returns true if the given index is a ghost index (has its highest bit set) | |
| static int | LuaSetMeshGhostFlag (lua_State *L) |
| Returns the given index with the ghost node bit set. | |
| static int | LuaClearMeshGhostFlag (lua_State *L) |
| Returns the given index with the ghost node bit cleared. | |
| static int | LuaCreateCellGroupSet (lua_State *L) |
| Returns a new cell group set. Parameters are the mesh, an optional table with cell group names and a boolean stating if the groups are disjoint or not. | |
| static int | LuaCellTypeList (lua_State *L) |
| Returns a table filled with the set of cell type names. | |
| static int | LuaCreateStateDump (lua_State *L) |
| Function used to create a new state dump object. | |
| static int | LuaEvalResults (lua_State *L) |
| Function used to trigger the evaluation of result rules. For rules associated with time sets, the rule execution depends on the attribute values that control when the rule can be executed. For ules with no time sets, or if the force optional parameter is true, the rule will be always executed. | |
| static int | LuaResetEvalAttrValue (lua_State *L) |
| Resets the current attribute values used for time set evaluation so that the time set execution rule times evaluation starts again. An optional attribute id specifies that only that attribute value should be reset. | |
| static int | LuaNextEvalAttrValue (lua_State *L) |
| Returns the next attribute value where a result rule will be activated. Receives as parameter either the attribute name or its id. A second optional parameter tells if the value can come from the intervals time set table, from the moments table or both (default when missing). A third optional parameter can filter the result by a time set name if the attribute is tied to more than one time set. | |
| static int | LuaLastEvalAttrValue (lua_State *L) |
| Returns the last attribute value where a result rule will be activated. Receives as parameter either the attribute name or its id. A second optional parameter tells if the value can come from the intervals time set table, from the moments table or both (default when missing). A third optional parameter can filter the result by a time set name if the attribute is tied to more than one time set. | |
| static int | LuaRegisterResultAttribute (lua_State *L) |
| Registers a new result attribute. Gets as parameters the attribute name, an optional description, the value unit, number of lines an columns and the value format string. | |
| static int | LuaRemoveResultAttribute (lua_State *L) |
| Given the id of an attribute that was registered from Lua, removes the attribute. | |
| static int | LuaResultAttributeId (lua_State *L) |
| Given an attribute name, returns the attribute id, or nil if no attribute with that name was registered. Works for attributes registered in Lua or in C++. | |
| static int | LuaSetResultAttribute (lua_State *L) |
| Given an attribute id, sets its value. The given value must be of the correct dimension and expressed in the attribute's unit. Multidimensional values should be provided either as a Lua table or a matrix object. Can also be used to set the value of string attributes. | |
| static int | LuaResultAttribute (lua_State *L) |
| Given an attribute id, returns its value. Returns a number for scalar values, a matrix object for vectors / matrices or a string for string attributes. | |
| static int | LuaRegisterProgressItem (lua_State *L) |
| Registers a new result result progress stats item. Gets as parameters the item name. It will be registered as a child of the lua "process item", created at the first registerProgressItem call. Item options follow the default configuration with a second optional attribute defining whether the memory usage should be tracked or not for the detailed level. | |
| static int | LuaProgressItemId (lua_State *L) |
| Returns the id of the named progress item or nil if not found. Remember that for Lua registered items, the name should be prefixed by "lua.". | |
| static int | LuaProgressItemStart (lua_State *L) |
| Start the monitoring of the given progress item id. | |
| static int | LuaProgressItemEnd (lua_State *L) |
| End the monitoring of the given progress item id. | |
| static int | LuaParallelCall (lua_State *L) |
| Executes the named function in a parallel environment. | |
| static int | LuaNodeParallelCall (lua_State *L) |
| Executes a parallel node loop, calling the given function in each thread with a partition of the mesh nodes. | |
| static int | LuaCellParallelCall (lua_State *L) |
| Executes a parallel cell loop, calling the given function in each thread with a partition of the mesh cells. | |
| static int | LuaLastParallelCallAffinity (lua_State *L) |
| Returns a table with task affinity for the last parallel call. | |
| static int | LuaCheckForCancelation (lua_State *L) |
| Checks for a pending cancelation request. If there is one, aborts the script processing by raising a Lua error. | |
| static int | LuaThreadGlobal (lua_State *L) |
| Queries the value of the named global variable in the given thread environment. | |
| static int | LuaSetThreadGlobal (lua_State *L) |
| Sets the value of the named global variable in the given thread environment. | |
| static int | getAccessor (lua_State *L, int index, const GmCellMesh *cmesh, GmValueAccessor **pv, GmCellAccessor **pc, GmGaussAccessor **pg) |
| Gets the accessor from the Lua stack and returns its value size (dim) | |
| static int | LuaReduceAccessor (lua_State *L) |
| Parallel processing for accessor data in a 'map reduce' fashion. | |
| static int | LuaUndocCallPluginDataFunction (lua_State *L) |
| Undocumented function used by regression tests to call a plugin data function. Important to enable regression tests for calling functions from different threads. NOT part of the official orchestration API. | |
| static int | LuaUndocGetPluginDataValue (lua_State *L) |
| Undocumented function used by regression tests to retriev a plugin data field value. Important to enable regression tests testing plugin data parsing. Get as parameters the plugin data id, alias and field name. | |
| void | GmLuaRegisterSimulationFunctions (LuaEnv *env, GmSimulationData *simData, const GmLogCategory &logger) |
| Registers simulation functions in the Lua Environment. | |
| void | GmLuaRegisterResultFunctions (LuaEnv *env, GmSimulationData *simData, const GmLogCategory &logger) |
| Registers result related functions in the Lua Environment. | |
| void | GmLuaRegisterMatrixFunctions (LuaEnv *env, const GmLogCategory &logger) |
| Registers matrix handling functions in the Lua Environment. | |
| void | GmLuaRegisterInterpolatorFunctions (LuaEnv *env, GmSimulationData *simData, const GmLogCategory &logger) |
| Registers interpolation handling functions in the Lua Environment. | |
| GML_API_EXPORT void | GmLuaRegisterPathFunctions (LuaEnv *env, GmSimulationData *simData) |
| Registers path handling functions in the Lua Environment. | |
| void | GmLuaRegisterLoggerFunctions (LuaEnv *env, const GmLogCategory &logger) |
| Registers logger handling functions in the Lua Environment. | |
| void | GmLuaRegisterConvFunctions (LuaEnv *env) |
| Registers unit handling functions in the Lua Environment. | |
| void | GmLuaRegisterTimeFunctions (LuaEnv *env) |
| Registers time measuring functions in the Lua Environment. | |
| void | GmLuaRegisterCancelationFunctions (LuaEnv *env, GmSimulationData *simData) |
| Registers the script cancelation check funtion. If simData is NULL, the registered function can only be called from the main thread. | |
| void | GmLuaRegisterThreadFunctions (LuaEnv *env, GmSimulationData *simData, const GmLogCategory &logger) |
| Registers parallel execution and thread handling functions in the Lua Environment. | |
| void | GmLuaPrepareEnvironment (LuaEnv *env, GmSimulationData *simData, const GmLogCategory &logger, bool mainEnv) |
| Adds to the environment env the set of global definitions that allows us to use Gema core objects in the Lua environment during a call to ProcessScript(). | |
| void | GmLuaPrepareMathEnvironment (LuaEnv *env, const GmLogCategory &logger) |
| Adds to the environment env the set of global definitions that allows us to use Gema core Matrix and conversion objects in the Lua environment. | |
Implementation of the Declaration of the function used to prepare an environment with the core Lua functions.
| void GmLuaPrepareEnvironment | ( | LuaEnv * | env, |
| GmSimulationData * | simData, | ||
| const GmLogCategory & | logger, | ||
| bool | mainEnv ) |
Adds to the environment env the set of global definitions that allows us to use Gema core objects in the Lua environment during a call to ProcessScript().
Creates the following global variables:
It also overloads some Lua functions to extend their funcionality by the way of the basicDefinitions.lua resource script, which also defines the following functions:
IMPORTANT: This function REQUIRES that the supplied logger MUST exist during the whole lifetime of the lua environment.
| void GmLuaPrepareMathEnvironment | ( | LuaEnv * | env, |
| const GmLogCategory & | logger ) |
Adds to the environment env the set of global definitions that allows us to use Gema core Matrix and conversion objects in the Lua environment.
Creates the following global variables:
IMPORTANT: This function REQUIRES that the supplied logger MUST exist during the whole lifetime of the lua environment.
| void GmLuaRegisterCancelationFunctions | ( | LuaEnv * | env, |
| GmSimulationData * | simData ) |
Registers the script cancelation check funtion. If simData is NULL, the registered function can only be called from the main thread.
Creates the following global variables:
| void GmLuaRegisterConvFunctions | ( | LuaEnv * | env | ) |
Registers unit handling functions in the Lua Environment.
Creates the following global variables:
| void GmLuaRegisterInterpolatorFunctions | ( | LuaEnv * | env, |
| GmSimulationData * | simData, | ||
| const GmLogCategory & | logger ) |
Registers interpolation handling functions in the Lua Environment.
Creates the following global variables:
IMPORTANT: This function REQUIRES that the supplied logger MUST exist during the whole lifetime of the lua environment.
| void GmLuaRegisterLoggerFunctions | ( | LuaEnv * | env, |
| const GmLogCategory & | logger ) |
Registers logger handling functions in the Lua Environment.
Creates the following global variables:
IMPORTANT: This function REQUIRES that the supplied logger MUST exist during the whole lifetime of the lua environment.
| void GmLuaRegisterMatrixFunctions | ( | LuaEnv * | env, |
| const GmLogCategory & | logger ) |
Registers matrix handling functions in the Lua Environment.
Creates the following global variables:
IMPORTANT: This function REQUIRES that the supplied logger MUST exist during the whole lifetime of the lua environment.
| GML_API_EXPORT void GmLuaRegisterPathFunctions | ( | LuaEnv * | env, |
| GmSimulationData * | simData ) |
Registers path handling functions in the Lua Environment.
Creates the following global variables:
| void GmLuaRegisterResultFunctions | ( | LuaEnv * | env, |
| GmSimulationData * | simData, | ||
| const GmLogCategory & | logger ) |
Registers result related functions in the Lua Environment.
Creates the following global variables:
| void GmLuaRegisterSimulationFunctions | ( | LuaEnv * | env, |
| GmSimulationData * | simData, | ||
| const GmLogCategory & | logger ) |
Registers simulation functions in the Lua Environment.
Creates the following global variables:
IMPORTANT: This function REQUIRES that the supplied logger MUST exist during the whole lifetime of the lua environment.
| void GmLuaRegisterThreadFunctions | ( | LuaEnv * | env, |
| GmSimulationData * | simData, | ||
| const GmLogCategory & | logger ) |
Registers parallel execution and thread handling functions in the Lua Environment.
IMPORTANT: This functions should NOT be made available for worker thread environments, only for the main thread.
Creates the following global variables:
IMPORTANT: This function REQUIRES that the supplied logger MUST exist during the whole lifetime of the lua environment.
| void GmLuaRegisterTimeFunctions | ( | LuaEnv * | env | ) |
Registers time measuring functions in the Lua Environment.
Creates the following global variables:
|
static |
Executes a parallel cell loop, calling the given function in each thread with a partition of the mesh cells.
Parameters are the mesh, a flag defining if only active cells should be returned, the name of the function to execute and an optional table with execution parameters. It can also receive additional parameters that are forwarded to the called function.
MUST be called from the main thread only.
The call to cellParallelCall() will itself return true if the worker executions ended ok, and false if any thread aborted. Notice that this function will not return at all (raising a "script canceled" error) if there is a pending cancelation request, as is common to all other API functions.
|
static |
Checks for a pending cancelation request. If there is one, aborts the script processing by raising a Lua error.
Can be called either in the main thread or in worker threads. In the later case, will also raise an error if any other thread has aborted.
|
static |
Function used to check if a unit is a known unit or not.
Parameters: The unit string
Returns true if the unit is known, false otherwise
|
static |
Function used to convert a value between two units.
Parameters: The value to be converted + the source unit string and the destination unit string
Returns the converted value or nil if the conversion is not possible
|
static |
Function used to create a cell geometry object.
Parameters: A string describing the element type
Returns the cell geometry object
|
static |
Function used to create a "GaussCloudToPointInterpolator" inside Lua.
Please check the documentation for GmLuaGaussCloudToPointInterpolator::createInterpolator() for a detailed list of the possible parameter layouts.
|
static |
Function used to create a "GaussNeighborsToNodeInterpolator" inside Lua.
Please check the documentation for GmLuaGaussNeighborsToNodeInterpolator::createInterpolator() for a detailed list of the possible parameter layouts.
|
static |
Function used to create a "GaussToNodeInterpolator" inside Lua.
Please check the documentation for GmLuaGaussToNodeInterpolator::createInterpolator() for a detailed list of the possible parameter layouts.
|
static |
Function used to create a "GaussToElementPointInterpolator" inside Lua.
Please check the documentation for GmLuaGaussToPointInterpolator::createInterpolator() for a detailed list of the possible parameter layouts.
|
static |
Function used to create a matrix inside Lua.
Parameters: Either of two options: 1) The number of lines + the number of columns. The matrix will be initialized with zeros 2) A single table with matrix data. The table can be a table of tables or a simple linear table. In the second case, the matrix will have a single column.
|
static |
Function used to create a "NodeCloudToPointInterpolator" inside Lua.
Please check the documentation for GmLuaNodeCloudToPointInterpolator::createInterpolator() for a detailed list of the possible parameter layouts.
|
static |
Function used to create a "NodeToCellPointInterpolator" inside Lua.
Please check the documentation for GmLuaNodeToPointInterpolator::createInterpolator() for a detailed list of the possible parameter layouts.
|
static |
Function used to create a "NodeToElementPointInterpolator" inside Lua.
Please check the documentation for GmLuaNodeToPointInterpolator::createInterpolator() for a detailed list of the possible parameter layouts.
|
static |
Function used to create a shape function object.
Parameters: A string describing the element type + an optional flag for requesting a linear shape function (default = false) or a string describing the element type + P and Q parameters + optional flag for linear shape function.
Returns the shape function object
|
static |
Function used to create a new state dump object.
Parameters: A table with the state options Returns the created object
|
static |
Function used to create a new value info object.
Parameters: A string describing the value kind + a table with the value description with the same syntax as used in the model definition.
Returns the created object
|
static |
Function used to create a vector (matrix with a single column) inside Lua.
Parameters: Either of two options: 1) The number of lines. The vector will be initialized with zeros 2) A single table with vector data
|
static |
Returns the current simulation time + the simulation time unit.
Can receive as a parameter a desired time unit (the current time will be converted to the requested unit – if no conversion is possible, returns nil)
|
static |
Function used to interpolate mesh node values from Gauss points with an element based approach.
Expected parameters on the Lua stack are: 1) A string with the desired interpolator type. 2) A type parameter whose value depends on the chosen interpolator. Can be nil but must be explicitly provided. 3) A string with the desired averaging method (options are: 'mean' and 'area') 4) A single Gauss value accessor proxy or a table with multiple accessors 5) A single node attribute accessor proxy or a table with multiple accessors 6) An accessor for coordinate values 7) An element mesh object or a CellGroupSet object 8) Optional the discontinuitySet to consider in the interpolation
Returns true on success or false if the interpolation type is not supported.
|
static |
Function used to trigger the evaluation of result rules. For rules associated with time sets, the rule execution depends on the attribute values that control when the rule can be executed. For ules with no time sets, or if the force optional parameter is true, the rule will be always executed.
Parameters:
|
static |
Function used to print used memory using the logger infrastructure.
Parameters: The log message passed to GmLogMemoryUsage()
|
static |
Function used to print messages using the logger infrastructure.
Parameters: the logger level (a string) + the log message
|
static |
Function used to transfer Gauss values from a source mesh to Gauss values of a destination mesh using the given interpolation method. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes.
Expected parameters on the Lua stack are: 1) A string with the desired interpolator type. 2) A type parameter whose value depends on the chosen interpolator. Can be nil but must be explicitly provided. 3) The search domain, specified by either the search radius or the number of closest nodes 4) A string defining the type of the previous parameter. Can be 'radius' or 'closest'. 5) The spatial index object used to find the nearest mesh nodes 6) A single source Gauss attribute accessor proxy (or a table with multiple accessors) 7) The destination mesh or the destination group of cells 8) A flag stating whether only active cells of the mesh should receive interpolated values 9) A single destination Gauss attribute accessor proxy (or a table with multiple accessors) 10) Optional the DiscontinuitySet to conside in the interpolation
Returns false if the interpolation could not be performed (solver error, for example).
|
static |
Function used to transfer Gauss values from a source mesh to node values of a destination mesh using the given interpolation method. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes.
Expected parameters on the Lua stack are: 1) A string with the desired interpolator type. 2) A type parameter whose value depends on the chosen interpolator. Can be nil but must be explicitly provided. 3) The search domain, specified by either the search radius or the number of closest nodes 4) A string defining the type of the previous parameter. Can be 'radius' or 'closest'. 5) The spatial index object used to find the nearest mesh nodes 6) A single source Gauss attribute accessor proxy (or a table with multiple accessors) 7) The destination mesh or the destination node set 8) A single destination node attribute accessor proxy (or a table with multiple accessors) 9) Optional the DiscontinuitySet to consider in the interpolation
Returns false if the interpolation could not be performed (solver error, for example).
|
static |
Function used to transfer node values from a source mesh to Gauss values of a destination mesh using the given interpolation method. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes.
Expected parameters on the Lua stack are: 1) A string with the desired interpolator type. 2) A type parameter whose value depends on the chosen interpolator. Can be nil but must be explicitly provided. 3) The search domain, specified by either the search radius or the number of closest nodes 4) A string defining the type of the previous parameter. Can be 'radius' or 'closest'. 5) The spatial index object used to find the nearest mesh nodes 6) A single source node attribute accessor proxy (or a table with multiple accessors) 7) The destination mesh or the destination group of cells 8) A flag stating whether only active cells of the mesh should receive interpolated values 9) A single destination Gauss attribute accessor proxy (or a table with multiple accessors) 10) Optional the DiscontinuitySet to consider in the interpolation
Returns false if the interpolation could not be performed (solver error, for example).
|
static |
Function used to transfer node values from a source mesh to node values of a destination mesh using the given interpolation method. The destination mesh is expected to be conform with the discontinuitySet.
Expected parameters on the Lua stack are: 1) A string with the desired interpolator type. 2) A type parameter whose value depends on the chosen interpolator. Can be nil but must be explicitly provided. 3) The search domain, specified by either the search radius or the number of closest nodes 4) A string defining the type of the previous parameter. Can be 'radius' or 'closest'. 5) The spatial index object used to find the nearest mesh nodes 6) A single source node attribute accessor proxy (or a table with multiple accessors) 7) The destination cell mesh 8) A single destination node attribute accessor proxy (or a table with multiple accessors) 9) The DiscontinuitySet to consider in the interpolation
Returns false if the interpolation could not be performed (solver error, for example).
|
static |
Function used to transfer node values from a source mesh to node values of a destination mesh using the given interpolation method. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes.
Expected parameters on the Lua stack are: 1) A string with the desired interpolator type. 2) A type parameter whose value depends on the chosen interpolator. Can be nil but must be explicitly provided. 3) The search domain, specified by either the search radius or the number of closest nodes 4) A string defining the type of the previous parameter. Can be 'radius' or 'closest'. 5) The spatial index object used to find the nearest mesh nodes 6) A single source node attribute accessor proxy (or a table with multiple accessors) 7) The destination mesh or the destination node set 8) A single destination node attribute accessor proxy (or a table with multiple accessors) 9) Optional the DiscontinuitySet to consider in the interpolation
Returns false if the interpolation could not be performed (solver error, for example).
|
static |
Function used to interpolate mesh node values from Gauss points with a node based approach.
Expected parameters on the Lua stack are: 1) A string with the desired interpolator type. 2) A type parameter whose value depends on the chosen interpolator. Can be nil but must be explicitly provided. 3) A boolean parameter specifying if only closests Gauss points should be used or not 4) A single Gauss value accessor proxy or a table with multiple accessors 5) A single node attribute accessor proxy or a table with multiple accessors 6) An accessor for coordinate values 7) An element mesh object or a CellGroupSet object 8) Optional the discontinuitySet to consider
Returns true on success or false if the interpolation type is not supported.
|
static |
Executes a parallel node loop, calling the given function in each thread with a partition of the mesh nodes.
Parameters are the mesh, the type of nodes that should be traversed, the name of the function to execute and an optional table with execution parameters. It can also receive additional parameters that are forwarded to the called function.
MUST be called from the main thread only.
The call to nodeParallelCall() will itself return true if the worker executions ended ok, and false if any thread aborted. Notice that this function will not return at all (raising a "script canceled" error) if there is a pending cancelation request, as is common to all other API functions.
|
static |
Executes the named function in a parallel environment.
Parameters are the name of the function to be executed, the number of worker threads, a table with per task parameters and an optional table with task affinity info. It can also receive additional parameters that are forwarded to the called function, besides the per task parameters.
MUST be called from the main thread only.
Keep in mind that any parameter forwarded to the function MUST be a value that can be transfered to another Lua environment, which rules out Lua functions, for example. Allowed values are:
The call to parallelCall() will itself return true if the worker executions ended ok, and false if any thread aborted. Notice that this function will not return at all (raising a "script canceled" error) if there is a pending cancelation request, as is common to all other API functions.
|
static |
Returns the previous simulation time + the simulation time unit.
Can receive as a parameter a desired time unit (the previous time will be converted to the requested unit)
|
static |
Parallel processing for accessor data in a 'map reduce' fashion.
For now we have only 2 options
|
static |
Registers a new result result progress stats item. Gets as parameters the item name. It will be registered as a child of the lua "process item", created at the first registerProgressItem call. Item options follow the default configuration with a second optional attribute defining whether the memory usage should be tracked or not for the detailed level.
Returns the item id or nil if the item could not be registered.
|
static |
Registers a new result attribute. Gets as parameters the attribute name, an optional description, the value unit, number of lines an columns and the value format string.
Returns the attribute id or nil if the attribute could not be registered.
|
static |
Sets the value of the named global variable in the given thread environment.
Parameters are the thread id (a value between 0 and maxWorkerThreads), the name of the global variable to be set and its new value. If the thread id parameter is missing, the same value will be used to initialize the global variable in every thread (including the main one, represented by thread id 0).
Keep in mind that the value being set MUST be a value that can be transfered to another Lua environment, which rules out Lua functions. See the documentation for parallelCall() for a description of the allowed values and their behaviour.
MUST be called from the main thread only.
|
static |
Function used to transfer Gauss values from a source mesh to Gauss values of a destination mesh using the spline interpolation method. Each destination Gauss value is calculated via a spline interpolation. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes.
Expected parameters on the Lua stack are: 1) The search domain, specified by either the search radius or the number of closest nodes 2) A string defining the type of the previous parameter. Can be 'radius' or 'closest'. 3) The spatial index object used to find the nearest mesh nodes 4) A single source Gauss attribute accessor proxy (or a table with multiple accessors) 5) The destination mesh or the destination group of cells 6) A flag stating whether only active cells of the mesh should receive interpolated values 7) A single destination Gauss attribute accessor proxy (or a table with multiple accessors) 8) A string with the name of the desired solver used to compute the spline radial coefficients 9) Optional double the alpha value 10) Optional the DiscontinuitySet to conside in the interpolation
Returns false if the interpolation could not be performed (solver error, for example).
|
static |
Function used to transfer Gauss values from a source mesh to node values of a destination mesh using the spline interpolation method. Each destination node value is calculated via a spline interpolation. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes.
Expected parameters on the Lua stack are: 1) The search domain, specified by either the search radius or the number of closest nodes 2) A string defining the type of the previous parameter. Can be 'radius' or 'closest'. 3) The spatial index object used to find the nearest mesh nodes 4) A single source Gauss attribute accessor proxy (or a table with multiple accessors) 5) The destination mesh or the destination node set 6) A single destination node attribute accessor proxy (or a table with multiple accessors) 7) A string with the name of the desired solver used to compute the spline radial coefficients 8) Optional the DiscontinuitySet to conside in the interpolation
Returns false if the interpolation could not be performed (solver error, for example).
|
static |
Function used to transfer node values from a source mesh to Gauss values of a destination mesh using the spline interpolation method. Each destination Gauss value is calculated via a spline interpolation. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes.
Expected parameters on the Lua stack are: 1) The search domain, specified by either the search radius or the number of closest nodes 2) A string defining the type of the previous parameter. Can be 'radius' or 'closest'. 3) The spatial index object used to find the nearest mesh nodes 4) A single source node attribute accessor proxy (or a table with multiple accessors) 5) The destination mesh or the destination group of cells 6) A flag stating whether only active cells of the mesh should receive interpolated values 7) A single destination Gauss attribute accessor proxy (or a table with multiple accessors) 8) A string with the name of the desired solver used to compute the spline radial coefficients 9) Optional double the alpha value 10) Optional the DiscontinuitySet to consider in the interpolation
Returns false if the interpolation could not be performed (solver error, for example).
|
static |
Function used to transfer node values from a source mesh to node values of a destination mesh using the spline interpolation method. Each destination node value is calculated via a spline interpolation. The CDR (compact domain radius) of the method can be both constant or defined using a constant number of closest nodes.
Expected parameters on the Lua stack are: 1) The search domain, specified by either the search radius or the number of closest nodes 2) A string defining the type of the previous parameter. Can be 'radius' or 'closest'. 3) The spatial index object used to find the nearest mesh nodes 4) A single source node attribute accessor proxy (or a table with multiple accessors) 5) The destination mesh or the destination node set 6) A single destination node attribute accessor proxy (or a table with multiple accessors) 7) A string with the name of the desired solver used to compute the spline radial coefficients 8) Double the alpha value 9) Optional the DiscontinuitySet to consider in the interpolation
Returns false if the interpolation could not be performed (solver error, for example).
|
static |
Queries the value of the named global variable in the given thread environment.
Parameters are the thread id (a value between 0 and maxWorkerThreads) and the name of the global variable to be queried. If the thread id parameter is missing, all threads will be queried and the results packed in a table indexed by thread id (including the main one, represented by thread id 0).
MUST be called from the main thread only.
|
static |
Undocumented function used by regression tests to call a plugin data function. Important to enable regression tests for calling functions from different threads. NOT part of the official orchestration API.
Get as parameters the plugin data id, alias and function field name. Passes no parameters to the function and returns no results.