Chi-Tech
Logical Volumes

Modules

 chi_mesh.BooleanLogicalVolume
 
 chi_mesh.RCCLogicalVolume
 
 chi_mesh.RPPLogicalVolume
 
 chi_mesh.SphereLogicalVolume
 
 chi_mesh.SurfaceMeshLogicalVolume
 

Functions

Handle chi_lua::chiLogicalVolumeCreate (int TypeIndex, varying Values)
 
Sense chi_lua::chiLogicalVolumePointSense (int LVHandle, double Point_x, double Point_y, double Point_z)
 

Detailed Description

Function Documentation

◆ chiLogicalVolumeCreate()

Handle chi_lua::chiLogicalVolumeCreate ( int  TypeIndex,
varying  Values 
)

Creates a logical volume.

Parameters
TypeIndexint Volume type.
Valuesvarying Parameters.
Warning
This function is deprecated

_

TypeIndex

SPHERE_ORIGIN = Sphere at the origin. [Requires: R]
SPHERE = Sphere at user supplied location. [Requires: x,y,z,R]
RPP= Rectangular ParalleliPiped. [Requires: xmin,xmax,ymin,ymax,zmin,zmax]
RCC= Right Circular Cylinder. [Requires: x0,y0,z0, vx,vy,vz and R]
SURFACE= Logical volume determined from a surface mesh. [Requires: a handle to a surface mesh]
BOOLEAN= Boolean combination of other volumes. [Requires pairs of values: bool,volumeHandle]

Examples

Example usage:

-- Sphere at origin radius 1.0
lv1 = chiLogicalVolumeCreate(SPHERE_ORIGIN, 1.0)
-- Sphere centered at (0.1,0.2,0.3) with radius 1.0
lv2 = chiLogicalVolumeCreate(SPHERE, 0.1, 0.2, 0.3, 1.0)
-- Rectangular parallelepiped
xmin = -1.0; xmax = 1.0
ymin = -2.0; ymax = 1.0
zmin = -1000.0, zmax = 1000.0
lv3 = chiLogicalVolumeCreate(RPP, xmin, xmax, ymin, ymax, zmin, zmax)
-- Right Circular Cylinder
basex = 1.0; basey = 0.0; basez = 0.5
upvecx = 0.0; upvecy = 0.0; upvecz = 1.0
R = 1.0
lv4 = chiLogicalVolumeCreate(RPP, basex, basey, basez, upvecx, upvecy, upvecz,
R)
-- Surface mesh
lv_surfmesh = chiSurfaceMeshCreate()
chiSurfaceMeshImportFromOBJFile(lv_surfmesh, "MeshFile3D.obj", false)
lv5 = chiLogicalVolumeCreate(SURFACE, lv_surfmesh)
-- Boolean combination
lv6 = chiLogicalVolumeCreate(BOOLEAN, {{true , lv5}, -- inside logical volume 5
{false, lv1}, -- outside logical volume
1 {false, lv2}}) -- outside logical volume 2
Handle chiLogicalVolumeCreate(int TypeIndex, varying Values)
Handle chiSurfaceMeshCreate()
success chiSurfaceMeshImportFromOBJFile(int SurfaceHandle, string FileName, bool polyflag, table3 transform)
Returns
Handle int Handle to the created logical volume.
Author
Jan

Definition at line 1582 of file lua_functions.c.

◆ chiLogicalVolumePointSense()

Sense chi_lua::chiLogicalVolumePointSense ( int  LVHandle,
double  Point_x,
double  Point_y,
double  Point_z 
)

Evaluates whether a point is within the logical volume.

Parameters
LVHandleint Handle to the logical volume.
Point_xdouble X-coordinate of the point.
Point_ydouble Y-coordinate of the point.
Point_zdouble Z-coordinate of the point.
Returns
Sense true if inside the logical volume and false if outside.

Usage Examples:

test/framework/chi_mesh/LogicalVolume/lv_sphere_test1.lua
test/framework/chi_mesh/LogicalVolume/lv_rpp_test1.lua

Definition at line 1595 of file lua_functions.c.