GemaLuaCoreLib
The GeMA Lua Core library
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | List of all members
GmLuaShape Class Reference

A proxy class to export GmShape methods to the Lua environment. More...

#include <gmLuaShape.h>

Inheritance diagram for GmLuaShape:
Inheritance graph
[legend]
Collaboration diagram for GmLuaShape:
Collaboration graph
[legend]

Public Member Functions

 GmLuaShape (const GmShape *Shape, const GmLogCategory &logger)
 Constructor. Receives the shape to be wrapped.
 
virtual ~GmLuaShape ()
 Destructor.
 
virtual const char * typeName () const
 Returns the object type as will be stored in the object metatable.
 
virtual void fillMetatable (lua_State *L, int index)
 Prepares the object metatable for calling methods.
 
virtual void * getClassMetatableID ()
 Returns an unique identifier to identify an user object as a GmLuaShape object.
 
- Public Member Functions inherited from GmLuaObject
virtual ~GmLuaObject ()
 Destrutor.
 
virtual void populateMetatable (lua_State *L, int index)
 Fills the object metatable to allow for the proxy to export its methods.
 
QVariant ptrToVariant ()
 Constructs a QVariant storing a POINTER to the current object.
 
void ref ()
 Increments the object reference count. Use with care.
 

Static Public Member Functions

static int pushShapeProxy (lua_State *L, const GmShape *shape, const GmLogCategory &logger)
 Pushes on the Lua stack a Shape proxy wrapping a shape object with the same type as the supplied object. Returns 1.
 

Protected Attributes

const GmShape_shape
 The shape 'wrapped' by this proxy object.
 
GmCellGeometry _geom
 The geometry corresponding to this shape.
 
- Protected Attributes inherited from GmLuaObject
const GmLogCategory_logger
 A logger used by the proxy when needed.
 
QAtomicInteger< int > _refCount
 Lua objects are reference counted to enable sharing them among different states. This is needed to allow for passing objects as parameters in a parallel call. The garbage collection method releases memory only for the last reference.
 

Private Member Functions

int elemType (lua_State *L)
 Returns a string decribing the shape function associated element type ('quad4', 'quad9', 'tri3', etc)
 
int numFunctions (lua_State *L)
 Returns the number of shape functions of this element type.
 
int numNaturalCoord (lua_State *L)
 Returns the number of natural coordinates used by this element type.
 
int numCartesianCoord (lua_State *L)
 Returns the number of cartesian coordinates expected by this element type.
 
int naturalCoordLimits (lua_State *L)
 Returns the domain limits (min, max) for the given natural coordinate (between 1 and numNaturalCoord())
 
int nodeNaturalCoord (lua_State *L)
 Returns a vector filled with the natural coordinates of the given node.
 
int naturalCenter (lua_State *L)
 Returns a vector filled with the natural coordinates of the element center.
 
int translateEdgePoint (lua_State *L)
 Given an element edge and an edge natural coordinate, returns the equivalent element natural coordinate or nil if the edge should not be integrated.
 
int translateFacePoint (lua_State *L)
 Given an elements face and a face natural coordinate, returns the equivalent element natural coordinate or nil if the face should not be integrated.
 
int fillNaturalCoordinates (lua_State *L)
 Returns a n x m matrix filled with node natural coordinates (n = num nodes, m = num natural coords)
 
int cartesianToNatural (lua_State *L)
 Given a set of cartesian coordinates 'coord' and a matrix with node coordinates 'X', calculates the corresponding natural coordinate. It can optionaly receive as further parameters (all missing or all required), a boolean indicating if geometric methods are preferred, the gradient tolerance and maximum number of iterations (for gradient based methods) and the outside natural tolerance for snapping close to the border outside points. Returns true if the given cartesian coordinate is inside the element, false otherwise,. More...
 
int naturalToCartesian (lua_State *L)
 Given a set of natural coordinates 'ncoord' and a matrix with node coordinates 'X', returns the corresponding cartesian coordinates.
 
int shapeValues (lua_State *L)
 Evaluates the set of shape functions over a point defined by its natural coordinates.
 
int shapePartials (lua_State *L)
 Calculates shape function partial derivatives with respect to its natural coordinates, evaluated at the given point.
 
int shapeCartesianPartialsFromCoord (lua_State *L)
 Given a set of natural coordinates 'ncoord' and a matrix with node coordinates 'X', returns the corresponding shape function partial derivatives with respect to its cartesian coordinates, evaluated at the given point + the scaled jacobian determinant.
 
int shapeCartesianPartialsFromJacobian (lua_State *L)
 Given a set of natural coordinates 'ncoord' and a Jacobian matrix 'J', returns the corresponding shape function partial derivatives with respect to its cartesian coordinates, evaluated at the given point + the scaled jacobian determinant.
 
int jacobian (lua_State *L)
 Given a set of natural coordinates 'ncoord' and a matrix with node coordinates 'X', returns the jacobian matrix, relating cartesian coordinates to natural coordinates, evaluated at the given point.
 
int scaledJacobianDet (lua_State *L)
 Returns the Jacobian determinant multiplied by a scaling factor due to different natural coordinate ranges.
 
int jacobianAndPartials (lua_State *L)
 Given a set of natural coordinates 'ncoord' and a matrix with node coordinates 'X', returns the jacobian matrix, relating cartesian coordinates to natural coordinates, evaluated at the given point and also the shape function partial derivatives matrix.
 
int borderScalingFactor (lua_State *L)
 Returns the scaling factor needed when calculating integrals over borders (edges or faces).
 
int edgeScalingFactor (lua_State *L)
 Returns the scaling factor needed when calculating integrals over edges.
 
int faceScalingFactor (lua_State *L)
 Returns the scaling factor needed when calculating integrals over faces.
 
int gaussExtrapolationMatrix (lua_State *L)
 Returns an extrap. matrix used while extrapolating values at Gauss points to nodes for the given integration rule.
 
int interpolate (lua_State *L)
 Given a set of node values and a set of natural coordinates, interpolates the node values on the given coordinate.
 
int parseScalingFactorParams (lua_State *L, const char *name, int *border, GmLuaMatrix **bcoordProxy, GmLuaMatrix **ecoordProxy, GmLuaMatrix **XProxy, bool *transposed)
 Parses the set of parameters used when returning a scaling factor.
 

Additional Inherited Members

- Protected Member Functions inherited from GmLuaObject
 GmLuaObject (const GmLogCategory &logger)
 Construtor protegido. Somente classes derivadas devem ser instanciadas.
 
virtual QString toString () const
 Default method used by the __tostring metamethod to capture the result of tostring() over an object.
 

Detailed Description

A proxy class to export GmShape methods to the Lua environment.

Member Function Documentation

◆ cartesianToNatural()

int GmLuaShape::cartesianToNatural ( lua_State *  L)
private

Given a set of cartesian coordinates 'coord' and a matrix with node coordinates 'X', calculates the corresponding natural coordinate. It can optionaly receive as further parameters (all missing or all required), a boolean indicating if geometric methods are preferred, the gradient tolerance and maximum number of iterations (for gradient based methods) and the outside natural tolerance for snapping close to the border outside points. Returns true if the given cartesian coordinate is inside the element, false otherwise,.

  • the natural coordinate vector

The documentation for this class was generated from the following files: