7. Contact Pairs, Surfaces - CPair, ASurf, RBody
The CPair module is designed to manage contacting surface and co-simulation surface pairs. All real load, constraint, contact pair and initial condition values are stored internally in double precision. The user may define and query load, constraint, contact pair and initial condition values in either single or double precision. The ASurf module is designed to manage analytic surface information. The RBody module is designed to manage rigid bodies.
Note that all contact pair and surfaces hold floating point data internally in double precision.
7.1. Contact Pair - CPair
The CPair module manages pairs of contacting surfaces, co-simulation or cyclic surfaces. The term “surface” is used loosely here in that a surface can be set of nodes or element faces or element edges or an analytic surface. The contact surfaces are termed a master or a slave surface. Master surfaces may only be defined as element faces or edges or analytic surfaces. Slave surfaces may be defined as nodes or element faces or edges. In addition to the surface entities a set of properties may also be associated with a contact pair.
The functions associated with a CPair object are the following.
Begin and end an instance of an object, return object error flag
vis_CPairBegin()
- create an instance of a CPair objectvis_CPairEnd()
- destroy an instance of a CPair objectvis_CPairError()
- return CPair object error flag
Set, manipulate and query contact pairs
vis_CPairDef()
- define master and slave entity typesvis_CPairInq()
- inquire master and slave entity typesvis_CPairSetType()
- set contact or co-simulation typevis_CPairGetType()
- get contact or co-simulation typevis_CPairMasterFlag()
- query master entity definedvis_CPairSlaveFlag()
- query slave entity definedvis_CPairMasterEnt()
- query master entityvis_CPairSlaveEnt()
- query slave entityvis_CPairSlaveNode()
- query slave node areavis_CPairSlaveNodeMaster()
- get slave node master contactsvis_CPairSetObject()
- set pointers to attribute objects.vis_CPairSetMaster()
- set master element entityvis_CPairSetMasterASurf()
- set master analytic surfacevis_CPairMasterASurf()
- get master analytic surfacevis_CPairMasterInitIter()
- prepare to visit each master entityvis_CPairMasterNextIter()
- return next master entityvis_CPairSlaveInitIter()
- prepare to visit each slave entityvis_CPairSlaveNextIter()
- return next slave entityvis_CPairSlaveNodeInitIter()
- prepare to visit each slave nodevis_CPairSlaveNodeNextIter()
- return next slave nodevis_CPairSetSlaveElem()
- set slave element entityvis_CPairSetSlaveNode()
- set slave node entity and areavis_CPairSetValuei()
- set integer propertyvis_CPairSetValuef()
- set real valued propertyvis_CPairSetValued()
- set real valued propertyvis_CPairValueFlag()
- query property type definedvis_CPairValueType()
- query property typesvis_CPairValueParams()
- query property parametersvis_CPairValueName()
- query property namevis_CPairValueFloat()
- query property float valuevis_CPairValueDouble()
- query property double valuevis_CPairValueInteger()
- query property integer valuevis_CPairEdgeIdTran()
- edge list of master or slave elementsvis_CPairFaceIdTran()
- face list of master or slave elementsvis_CPairNodeIdTran()
- node list of slave nodesvis_CPairSpecFlag()
- query any master or slave specificationsvis_CPairSetName()
- set name stringvis_CPairGetName()
- get name string
Instance a CPair object initially using vis_CPairBegin()
.
Set the master and slave surface entity types using vis_CPairDef()
.
By default, the CPair type is contact surface. Use
vis_CPairSetType()
to set the type to a cyclic or co-simulation surface. At this point a
GridFun
object must be set as an attribute object using vis_CPairSetObject()
so that the CPair
object can access finite element model information and verify element
entity specifications. The master surface entity type must be element
face or edge. The slave surface entity type may be node or element face
or edge. Master element entities are specified using vis_CPairSetMaster()
.
Slave node entities are specified using vis_CPairSetSlaveNode()
,
and slave element entities are specified using vis_CPairSetSlaveElem()
.
Slave node entities may have an effective area associated with each
node.
For the special case of self-contact set the slave entity type to SYS_NONE and define only the master surface. The slave surface is assumed to be the master surface.
Generate a face list of master or slave surface entities using vis_CPairFaceIdTran()
.
Generate an edge list of master or slave surface entities using vis_CPairEdgeIdTran()
.
Generate a node list of all nodes on a slave surface using vis_CPairNodeIdTran()
.
A set of property types is supported for a contact pair. Specify integer
or real valued properties using vis_CPairSetValuei()
, vis_CPairSetValuef()
or vis_CPairSetValued()
.
Each property type is identified by a defined constant. The user may
query for the number and type of properties defined using vis_CPairValueType()
.
The data type and number of components associated with a property type
is queried using vis_CPairValueParams()
.
A long descriptive name which is hard-wired to each property type may be
queried using vis_CPairValueName()
.
Finally the property values themselves may be recovered using vis_CPairValueInteger()
,
vis_CPairValueFloat()
or vis_CPairValueDouble()
.
The function vis_CPairValueFlag()
is used to determine how a property has been defined, if at all. The
full set of contact pair properties are the following:
CPAIR_PID, integer, Property Id
CPAIR_ADJUST, real, Adjust zone distance, used with CPAIR_PROJECT to determine slave nodes to be projected (adjusted) to master surface.
CPAIR_SMALLSLIDING, integer, Small sliding option
CPAIR_SMOOTH, real, Smooth factor
CPAIR_HCRIT, real, HCrit factor
CPAIR_EXTENSIONZONE, real, Extension zone factor
CPAIR_SYMMETRIC, integer, Symmetric contact option
CPAIR_SURFTOSURF, integer, Surface to surface technology
CPAIR_POSITIONTOL, real, Position tolerance If defined, a slave node location which lies outside the tolerance distance from the master surface is assumed to not interact with the master surface.
CPAIR_PROJECT, integer, Option to project slave nodes to master surface. If CPAIR_ADJUST is defined, only those nodes within the adjustment zone are projected.
CPAIR_CYCLICTOLERANCE, real, Node matching tolerance for cyclic sets.
The full set of cyclic pair properties are the following:
CPAIR_NUMSECTOR, integer, Number of cyclic sectors
CPAIR_CID, integer, Cyclic cylindrical coordinate system Id
7.2. Function Descriptions
The currently available CPair functions are described in detail in this section.
-
vis_CPair *vis_CPairBegin(void)
create an instance of a CPair object
Create an instance of a CPair object. Memory is allocated for the object private data and the pointer to the data is returned.
Destroy an instance of a CPair object using
void vis_CPairEnd (vis_CPair *cpair)
Return the current value of a CPair object error flag using
Vint vis_CPairError (vis_CPair *cpair)
- Returns:
The function returns a pointer to the newly created CPair object. If the object creation fails, NULL is returned.
-
void vis_CPairEnd(vis_CPair *p)
destroy an instance of a CPair object
See
vis_CPairBegin()
-
Vint vis_CPairError(vis_CPair *p)
return the current value of a CPair object error flag
See
vis_CPairBegin()
-
void vis_CPairDef(vis_CPair *p, Vint mastent, Vint slavent)
define master and slave entity types
Set the master and slave surface entity types. The master entity type may be an element edge or face or an analytic surface. Master element entities are specified using
vis_CPairSetMaster()
. Master analytic surface entities are specified usingvis_CPairSetMasterASurf()
. The slave entity type may be node or element edge or face. If the slave entity type isSYS_NODE
then slave node entities are specified usingvis_CPairSetSlaveNode()
otherwise slave element entities are defined usingvis_CPairSetSlaveElem()
.For the special case of self-contact set the slave entity type to
SYS_NONE
and define only the master surface. The slave surface is assumed to be the master surface.Inquire of defined mastent and slavent as output arguments using
void vis_CPairInq (vis_CPair *cpair, Vint *mastent, Vint *slavent)
- Errors
SYS_ERROR_ENUM
is generated if an improper mastent or slavent is specified.
- Parameters:
p – Pointer to CPair object.
mastent – Master entity type
=SYS_EDGE Element edge =SYS_FACE Element face =SYS_ASURF Analytic surface
slavent – Slave entity type
=SYS_NONE None =SYS_NODE Node =SYS_EDGE Element edge =SYS_FACE Element face
-
void vis_CPairInq(vis_CPair *p, Vint *mastent, Vint *slavent)
inquire of defined mastent and slavent as output arguments
See
vis_CPairDef()
-
void vis_CPairSetObject(vis_CPair *p, Vint objecttype, Vobject *object)
set pointers to attribute objects.
Set a pointer to an attribute object.
- Errors
VIS_ERROR_OBJECTTYPE
is generated if an improper objecttype is specified.
- Parameters:
p – Pointer to CPair object.
objecttype – The name of the object type to be set.
x=VIS_GRIDFUN GridFun object
object – Pointer to the object to be set.
-
void vis_CPairSetType(vis_CPair *p, Vint ctype)
set contact or co-simulation type
Set contact, cyclic or co-simulation surface type. By default the surface type is
CPAIR_CONTACT
.Inquire of specified ctype as an output argument using
void vis_CPairGetType (vis_CPair *cpair, Vint *ctype)
- Errors
SYS_ERROR_ENUM
is generated if an improper ctype is specified.
- Parameters:
p – Pointer to CPair object.
ctype – Contact or co-simulation surface type
x=CPAIR_CONTACT Contact pair =CPAIR_COSIM Co-simulation pair =CPAIR_CYCLIC Cyclic symmetry pair
-
void vis_CPairGetType(vis_CPair *p, Vint *ctype)
get contact or co-simulation type
-
void vis_CPairSetName(vis_CPair *p, Vchar *name)
set name string
Set a name string. The name string can contain up to 81 characters including the terminating NULL. If the name is not specified it is returned as a single NULL character using
vis_CPairGetName()
.Get name as an output argument.
void vis_CPairGetName (const vis_CPair *cpair, Vchar name[])
- Parameters:
p – Pointer to CPair object.
name – Name string
-
void vis_CPairSetSlaveNode(vis_CPair *p, Vint index, Vfloat area)
set slave node entity and area
Set slave node index and area.
- Errors
SYS_ERROR_VALUE
is generated if an improper index is specified.
- Parameters:
p – Pointer to CPair object.
index – Node index
area – Node area
-
void vis_CPairSetSlaveNodedv(vis_CPair *p, Vint index, Vdouble area)
set slave node entity and area
-
void vis_CPairSetSlaveElem(vis_CPair *p, Vint index, Vint no)
set slave element entity
Set slave element index and face or edge number, no.
- Errors
SYS_ERROR_VALUE
is generated if an improper index or no is specified.
- Parameters:
p – Pointer to CPair object.
index – Element index
no – Element edge or face number
-
void vis_CPairSetMaster(vis_CPair *p, Vint index, Vint no)
set master element entity
Set master element index and face or edge number, no.
- Errors
SYS_ERROR_VALUE
is generated if an improper index or no is specified.
- Parameters:
p – Pointer to CPair object.
index – Element index
no – Element edge or face number
-
void vis_CPairSlaveInitIter(vis_CPair *p)
prepare to visit each slave entity
Initialize the successive return of each slave entity index.
Sequential access to each slave entity index
void vis_CPairSlaveNextIter (vis_CPair *cpair, Vint *index)
- Parameters:
p – Pointer to CPair object.
-
void vis_CPairSlaveNextIter(vis_CPair *p, Vint *index)
sequential access to each slave entity index
-
void vis_CPairSlaveNodeInitIter(vis_CPair *p)
prepare to visit each slave node
Initialize the successive return of each slave node index.
Sequential access to each slave node index
void vis_CPairSlaveNodeNextIter (vis_CPair *cpair, Vint *index)
- Parameters:
p – Pointer to CPair object.
-
void vis_CPairSlaveNodeNextIter(vis_CPair *p, Vint *index)
prepare to visit each slave node
-
void vis_CPairSlaveFlag(vis_CPair *p, Vint index, Vint *flags)
query slave entity defined
If the slave entity type is node then index must be a node index, otherwise it is an element index. If it is a node index, then flags will be returned set to 1 if the node has been specified as a slave node, otherwise it is returned as 0. If it is an element index then flags is set to the edge or face flags.
- Errors
SYS_ERROR_VALUE
is generated if an improper index is specified.
- Parameters:
p – Pointer to CPair object.
index – Node or element number
flags – [out] Node or element edge or face flags.
-
void vis_CPairSlaveEnt(vis_CPair *p, Vint index, Vint *numno, Vint no[])
query slave entity
Return element edge or face numbers given an element index. If no element or node entities have been specified for the given index then numno is returned as zero. This function is functionally equivalent to
vis_CPairSlaveFlag()
except the flags argument is parsed.- Errors
SYS_ERROR_VALUE
is generated if an improper index is specified.
- Parameters:
p – Pointer to CPair object.
index – Element number
numno – [out] Number of element edges or faces or 1 if node entity
no – [out] Array of element edges or faces or no[0] = 1 if node entity
-
void vis_CPairSlaveNode(vis_CPair *p, Vint index, Vfloat *area)
query slave node area
Return slave node area. If the slave node has not been specified then area is returned as zero.
- Errors
SYS_ERROR_VALUE
is generated if an improper index is specified.
- Parameters:
p – Pointer to CPair object.
index – Node index
area – [out] Node area
-
void vis_CPairSlaveNodedv(vis_CPair *p, Vint index, Vdouble *area)
query slave node area
-
void vis_CPairMasterInitIter(vis_CPair *p)
prepare to visit each master entity
Initialize the successive return of each master entity index.
Sequential access to each master entity index
void vis_CPairMasterNextIter (vis_CPair *cpair, Vint *index)
- Parameters:
p – Pointer to CPair object.
-
void vis_CPairMasterNextIter(vis_CPair *p, Vint *index)
sequential access to each master entity index
-
void vis_CPairMasterFlag(vis_CPair *p, Vint index, Vint *flags)
query master entity defined
Return element edge or face flags given an element index. If no element entities have been specified for the given index then flags is returned as zero.
- Errors
SYS_ERROR_VALUE
is generated if an improper index is specified.
- Parameters:
p – Pointer to CPair object.
index – Element number
flags – [out] Element edge or face flags
-
void vis_CPairMasterEnt(vis_CPair *p, Vint index, Vint *numno, Vint no[])
query master entity
Return element edge or face numbers given an element index. If no element entities have been specified for the given index then numno is returned as zero. This function is functionally equivalent to a
vis_CPairMasterFlag()
except the flags argument is parsed.- Errors
SYS_ERROR_VALUE
is generated if an improper index is specified
- Parameters:
p – Pointer to CPair object.
index – Element number
numno – [out] Number of element edges or faces
no – [out] Array of element edges or faces
-
void vis_CPairSpecFlag(vis_CPair *p, Vint *flag)
query any master or slave specifications
Query if any master or slave specifications of any type have been made. The return value, flag, will be zero only if no masters or slaves have been specified of any type.
- Parameters:
p – Pointer to CPair object.
flag – [out] Flag indicating if any master or slave set
-
void vis_CPairSetValuei(vis_CPair *p, Vint type, Vint ivalue)
set integer property
Set an integer valued property. Use
vis_CPairValueInteger()
to return integer valued properties.- Errors
SYS_ERROR_ENUM
is generated if an improper type is specified.SYS_ERROR_OPERATION
is generated if a non integer valued type is specified.
- Parameters:
p – Pointer to CPair object.
type – Property type
x=CPAIR_CID Cyclic cylindrical system Id =CPAIR_PID Property Id =CPAIR_NUMSECTOR Number of cyclic sectors =CPAIR_SMALLSLIDING Small sliding option =CPAIR_SYMMETRIC Symmetric contact option =CPAIR_SURFTOSURF Surface to surface technology
ivalue – Property value
-
void vis_CPairSetValuef(vis_CPair *p, Vint type, Vfloat rvalue)
set real valued property
Set a real valued property. Use
vis_CPairValueFloat()
orvis_CPairValueDouble()
to return real valued properties.- Errors
SYS_ERROR_ENUM
is generated if an improper type is specified.SYS_ERROR_OPERATION
is generated if a non real valued type is specified.
- Parameters:
p – Pointer to CPair object.
type – Property type
x=CPAIR_ADJUST Adjust zone distance =CPAIR_SMOOTH Smooth factor =CPAIR_HCRIT HCrit factor =CPAIR_EXTENSIONZONE Extension zone factor =CPAIR_POSITIONTOL Position tolerance =CPAIR_CYCLICTOLERANCE Node matching tolerance for cyclic sets
rvalue – Property value
-
void vis_CPairSetValued(vis_CPair *p, Vint type, Vdouble dparam)
set real valued property
-
void vis_CPairValueType(vis_CPair *p, Vint *ntypes, Vint type[])
query property types
Return number of property types, ntypes, and types, type, of all defined property types. The maximum number of types which may be returned is
CPAIR_MAX
.- Parameters:
p – Pointer to CPair object.
ntypes – [out] Number of types of property values
type – [out] Array of property types
-
void vis_CPairValueFlag(vis_CPair *p, Vint type, Vint *flag)
query property type defined
Query for property definition. If a property value is not defined,
CPAIR_UNDEFINED
is returned, if the property has been defined by value thenCPAIR_VALUE
is returned.- Errors
SYS_ERROR_ENUM
is generated if an improper type is specified.
- Parameters:
p – Pointer to CPair object.
type – Property type
flag – [out] Flag indicating if property type defined or not
x=CPAIR_UNDEFINED Property value not defined =CPAIR_VALUE Property real value defined
-
void vis_CPairValueParams(vis_CPair *p, Vint type, Vint *nval, Vint *dtyp)
query property parameters
Query for the number of components and the data type associated with a property type.
- Errors
SYS_ERROR_ENUM
is generated if an improper type is specified.
- Parameters:
p – Pointer to CPair object.
type – Property type
nval – [out] Number of components
dtyp – [out] Data type
=SYS_CHAR Character =SYS_INTEGER Integer =SYS_FLOAT Float
-
void vis_CPairValueName(vis_CPair *p, Vint type, Vchar name[])
query property name
Query for the built-in name associated with a property type. The character string will not exceed 64 characters including the terminating NULL character.
- Errors
SYS_ERROR_ENUM
is generated if an improper type is specified.
- Parameters:
p – Pointer to CPair object.
type – Property type
name – [out] Property name
-
void vis_CPairValueFloat(vis_CPair *p, Vint type, Vfloat fparam[])
query property float value
Return a defined real valued property as float. The number of values returned is equal to the number of components associated with the specified type. If the value has not been defined or the value type is not real, nothing is returned.
- Errors
SYS_ERROR_ENUM
is generated if an improper type is specified.
- Parameters:
p – Pointer to CPair object.
type – Property type
fparam – [out] Float property.
-
void vis_CPairValueDouble(vis_CPair *p, Vint type, Vdouble dparam[])
query property double value
Return a defined real valued property as double. The number of values returned is equal to the number of components associated with the specified type. If the value has not been defined or the value type is not real, nothing is returned.
- Errors
SYS_ERROR_ENUM
is generated if an improper type is specified.
- Parameters:
p – Pointer to CPair object.
type – Property type
dparam – [out] Double property.
-
void vis_CPairValueInteger(vis_CPair *p, Vint type, Vint iparam[])
query property integer value
Return a defined integer valued property. If the value has not been defined or the value type is not integer, nothing is returned.
- Errors
SYS_ERROR_ENUM
is generated if an improper type is specified.
- Parameters:
p – Pointer to CPair object.
type – Property type
iparam – [out] Integer property.
-
void vis_CPairNodeIdTran(vis_CPair *p, vis_IdTran *idtran)
node idtran of slave nodes
Derive a list of nodes which have been defined as a slave surface.
Note that idtran is not cleared by this function, the derived node entities are added to any existing node in the output idtran.
-
void vis_CPairFaceIdTran(vis_CPair *p, Vint oper, vis_IdTran *idtran)
face list of master or slave elements
Derive a list of element faces which have been defined as a master or slave surface.
Note that idtran is not cleared by this function, the derived element face entities are added to any existing element faces in the output idtran.
- Errors
VIS_ERROR_ENUM
is generated if an improper oper is specified.
-
void vis_CPairEdgeIdTran(vis_CPair *p, Vint oper, vis_IdTran *idtran)
edge list of master or slave elements
Derive a list of element edges which have been defined as a master or slave surface. Note that idtran is not cleared by this function, the derived element edge entities are added to any existing element edges in the output idtran.
- Errors
VIS_ERROR_ENUM
is generated if an improper oper is specified.
-
void vis_CPairSlaveNodeMaster(vis_CPair *p, Vint index, Vint *ix, Vint *no)
get slave node master contacts
Return the master element contacting slave node index. If no master element is found then ix and no are set to zero. The
CPAIR_POSITIONTOL
is queried and if specified is used to filter out any master element which is greater that the specified distance from the slave node. Otherwise the closest master element to the slave node is returned.- Errors
SYS_ERROR_VALUE
is generated if an improper index is specified.
- Parameters:
p – Pointer to CPair object.
index – Node index
ix – [out] Element number
no – [out] Element face or edge number
-
void vis_CPairSetMasterASurf(vis_CPair *p, Vint asid)
set master analytic surface
Set master analytic surface asid.
Inquire of master analytic surface asid as an output argument using
void vis_CPairMasterASurf (vis_CPair *cpair, Vint *asid)
- Errors
SYS_ERROR_VALUE
is generated if an improper index or no is specified.
- Parameters:
p – Pointer to CPair object.
asid – Analytic surface index
-
void vis_CPairMasterASurf(vis_CPair *p, Vint *asid)
inquire of master analytic surface asid as an output argument
7.3. Analytic Surface - ASurf
The ASurf module manages an analytic surface. An analytic surface is defined by its shape and parameters. For example, a spherical surface is defined by its center and radius. ASurf allows for the definition of ruled surfaces, surfaces of revolution, standard geometric shapes such as a sphere, faceted surfaces and surfaces defined by trimmed NURBS.
The functions associated with a ASurf object are the following.
Begin and end an instance of an object, return object error flag
vis_ASurfBegin()
- create an instance of a ASurf objectvis_ASurfEnd()
- destroy an instance of a ASurf objectvis_ASurfError()
- return ASurf object error flag
Set, manipulate and query contact pairs
vis_ASurfDef()
- define surface typevis_ASurfInq()
- inquire surface typevis_ASurfSetName()
- set name stringvis_ASurfGetName()
- get name stringvis_ASurfSetPoint()
- set segment or NURBS pointvis_ASurfGetPoint()
- get segment or NURBS pointvis_ASurfNumPoints()
- query number of pointsvis_ASurfSetSegment()
- set segment type and connectivityvis_ASurfGetSegment()
- get segment type and connectivityvis_ASurfNumSegments()
- query number of segmentsvis_ASurfSetSegmentRule()
- set ruled surface directionvis_ASurfGetSegmentRule()
- get ruled surface directionvis_ASurfSetSegmentRev()
- set surface of revolution directionvis_ASurfGetSegmentRev()
- get surface of revolution directionvis_ASurfSetSegmentFillet()
- set fillet radiusvis_ASurfGetSegmentFillet()
- get fillet radiusvis_ASurfSetPlane()
- set planar surface parametersvis_ASurfGetPlane()
- get planar surface parametersvis_ASurfSetSphere()
- set spherical surface parametersvis_ASurfGetSphere()
- get spherical surface parametersvis_ASurfSetBox()
- set box surface parametersvis_ASurfGetBox()
- get box surface parametersvis_ASurfSetCone()
- set conical surface parametersvis_ASurfGetCone()
- get conical surface parametersvis_ASurfSetCylinder()
- set cylindrical surface parametersvis_ASurfGetCylinder()
- get cylindrical surface parametersvis_ASurfSetFacet()
- set facet surfacevis_ASurfGetFacet()
- get facet surfacevis_ASurfNumFacets()
- get number of facetsvis_ASurfSetNURBS()
- set NURBS surfacevis_ASurfGetNURBS()
- get NURBS surfacevis_ASurfNumNURBS()
- get number of NURBSvis_ASurfMaxNURBSOrder()
- get maximum NURBS ordervis_ASurfGetNURBSNum()
- get number of NURBS points and trim loopsvis_ASurfSetNURBSTrim()
- set NURBS surface trimming loopvis_ASurfGetNURBSTrim()
- get NURBS surface trimming loopvis_ASurfNumNURBSTrim()
- get number of NURBS trimming loopsvis_ASurfGetNURBSTrimNum()
- get number of NURBS trimming loops points
Instance an ASurf object initially using vis_ASurfBegin()
.
Specify the surface type using vis_ASurfDef()
.
Three types of surfaces can be defined: pre-defined shapes such as
planes, spheres, cones and cylinders, or surfaces generated from
segments or surfaces generated from collections of facets or NURBS.
Parameters for pre-defined surfaces are defined using their specific
functions such as vis_ASurfSetPlane()
, vis_ASurfSetSphere()
,
or vis_ASurfSetCylinder()
.
Surfaces created from segments are defined in two steps. First, a curve
profile must be defined in the x-y plane. Then the surface is defined
from the two-dimensional profile by either extruding it about an axis -
a ruled surface - or by revolving it about an axis - a surface of
revolution. Profile points are defined with vis_ASurfSetPoint()
.
Segments are defined with vis_ASurfSetSegment()
.
Supported segment types are a straight line (ASURF_SEG_LINE), an
circular arc (ASURF_SEG_ARC), or a parabola (ASURF_SEG_PARAB).
Once the profile is defined a ruled surface is created with
vis_ASurfSetSegmentRule()
.
A surface of revolution is created with vis_ASurfSetSegmentRev()
.
A fillet radius can be defined on the two-dimensional profile using
vis_ASurfSetSegmentFillet()
.
The functions vis_ASurfSetSegmentRule()
, vis_ASurfSetSegmentRev()
,
vis_ASurfSetPlane()
, vis_ASurfSetBox()
, vis_ASurfSetCone()
,
and vis_ASurfSetCylinder()
all require three points, a, b, and c, in addition to
parameters that are specific to each of them. These three points define
a local coordinate system as follows: the local x direction is given
by the vector a-b; the vector a-c lies in the local
x-y plane so that the local z-direction is given by the cross
product a-b X a-c.
Surfaces which are defined as a collection of facets or NURBS require
the defining points in 3D space to be input using vis_ASurfSetPoint()
.
Facets are defined using vis_ASurfSetFacet()
and may be linear or parabolic triangles or quadrilaterls. NURBS
surfaces are defined using vis_ASurfSetNURBS()
with optional trimming loops defined by vis_ASurfSetNURBSTrim()
.
Query functions exist to return the number of facets or NURBS defined
and the individual facet and NURBS definitions.
Use the Glyph object to draw analytic surfaces.
7.4. Function Descriptions
The currently available ASurf functions are described in detail in this section.
-
vis_ASurf *vis_ASurfBegin(void)
create an instance of an ASurf object
Create an instance of a ASurf object. Memory is allocated for the object private data and the pointer to the data is returned.
Destroy an instance of an ASurf object using
void vis_ASurfEnd (vis_ASurf *asurf)
Return the current value of an ASurf object error flag using
Vint vis_ASurfError (vis_ASurf *asurf)
- Returns:
The function returns a pointer to the newly created ASurf object. If the object creation fails, NULL is returned.
-
void vis_ASurfEnd(vis_ASurf *p)
destroy an instance of an ASurf object using
See
vis_ASurfBegin()
-
Vint vis_ASurfError(vis_ASurf *p)
return the current value of a ASurf object error flag
See
vis_ASurfBegin()
-
void vis_ASurfDef(vis_ASurf *p, Vint type)
define surface type
Set the surface type. Segmented, facetted and NURBS types require points defined with
vis_ASurfSetPoint()
and specific surface definitions defined byvis_ASurfSetSegment()
,vis_ASurfSetFacet()
andvis_ASurfSetNURBS()
respectively. All other surfaces only require the parameters defined by their own functions.Inquire of defined type as output argument using
void vis_ASurfInq (vis_ASurf *asurf, Vint *type)
- Errors
SYS_ERROR_ENUM
is generated if an improper type is specified.
- Parameters:
p – Pointer to ASurf object.
type – Surface type
x=ASURF_SEGMENT Two-dimensional segmented surface =ASURF_SEGMENT_RULE Segmented ruled surface =ASURF_SEGMENT_REV Segmented surface of revolution =ASURF_PLANE Planar surface =ASURF_BOX Box surface =ASURF_SPHERE Spherical surface =ASURF_CYLINDER Cylindrical surface =ASURF_CONE Conical surface =ASURF_FACET Facetted surface =ASURF_NURBS NURBS surface
-
void vis_ASurfInq(vis_ASurf *p, Vint *type)
inquire of defined type as output argument
See
vis_ASurfDef()
-
void vis_ASurfSetName(vis_ASurf *p, Vchar *name)
set name string
Attach a name to the surface.
Inquire of specified name as an output argument using
void vis_ASurfGetName (vis_ASurf *asurf, Vchar name[])
- Parameters:
p – Pointer to ASurf object.
name – String with surface name
-
void vis_ASurfGetName(vis_ASurf *p, Vchar name[])
get name string
-
void vis_ASurfSetPoint(vis_ASurf *p, Vint id, Vfloat x[3])
set segment or NURBS point
Specify the location of a point in the two-dimensional segmented profile or NURBS. For segments Only the first two coordinates are used.
Inquire of specified x as an output argument using
void vis_ASurfGetPoint (vis_ASurf *asurf, Vint id Vfloat x[3]) void vis_ASurfGetPointdv (vis_ASurf *asurf, Vint id Vdouble x[3])
- Errors
A
SYS_ERROR_OPERATION
is generated if points are not defined in ascending order in increments of 1.
- Parameters:
p – Pointer to ASurf object.
id – Point id
x – Point coordinates
-
void vis_ASurfSetPointdv(vis_ASurf *p, Vint id, Vdouble x[3])
set segment or NURBS point
-
void vis_ASurfGetPoint(vis_ASurf *p, Vint id, Vfloat x[3])
get segment or NURBS point
-
void vis_ASurfGetPointdv(vis_ASurf *p, Vint id, Vdouble x[3])
get segment or NURBS point
-
void vis_ASurfNumPoints(vis_ASurf *p, Vint *numpnt)
query number of points
Query for the number of points defined with
vis_ASurfSetPoint()
.- Parameters:
p – Pointer to ASurf object.
numpnt – [out] Number of defined points
-
void vis_ASurfSetSegment(vis_ASurf *p, Vint id, Vint type, Vint ix[])
set segment type and connectivity
Specify the type and connectivity for each segment in the two-dimensional profile. A segment of type
ASURF_SEG_LINE
requires two point ids in the connectivity array ix.ASURF_SEG_ARC
requires three point ids: the first point, the center of the circular arc, and the end point. Finally, the parabolic segment requires three point ids: the first, a middle point, and the last point.Inquire of specified type and connectivity ix as an output argument using
void vis_ASurfGetSegment (vis_ASurf *asurf, Vint id Vint *type, Vint ix[])
- Errors
SYS_ERROR_ENUM
is generated if an invalid type is entered.
- Parameters:
p – Pointer to ASurf object.
id – Segment id
type – Segment type
x=ASURF_SEG_LINE Straight line =ASURF_SEG_ARC Circular arc =ASURF_SEG_PARAB Parabolic line
ix – Segment connectivity
-
void vis_ASurfGetSegment(vis_ASurf *p, Vint id, Vint *type, Vint ix[])
get segment type and connectivity
-
void vis_ASurfNumSegments(vis_ASurf *p, Vint *numseg)
query number of segments
Query for the number of profile segments defined with
vis_ASurfSetSegment()
.- Parameters:
p – Pointer to ASurf object.
numseg – [out] Number of defined segments
-
void vis_ASurfSetSegmentRule(vis_ASurf *p, Vfloat a[3], Vfloat b[3], Vfloat c[3])
set ruled surface direction
Sets the local coordinate system information for a ruled surface. The ruled surface extrudes the planar profile in the z-direction.
Inquire of specified a, b, and c points for a ruled surface using
void vis_ASurfGetSegmentRule (vis_ASurf *asurf, Vfloat a[3], Vfloat b[3], Vfloat c[3]) void vis_ASurfGetSegmentRuledv (vis_ASurf *asurf, Vdouble a[3], Vdouble b[3], Vdouble c[3])
- Errors
SYS_ERROR_OPERATION
is generated if a-b is parallel to a-c.
- Parameters:
p – Pointer to ASurf object.
a – Origin of local coordinate system
b – Point such that a-b defines the local x-axis
c – Point such that a-c defines a vector in the local x-y plane
-
void vis_ASurfSetSegmentRuledv(vis_ASurf *p, Vdouble a[3], Vdouble b[3], Vdouble c[3])
set ruled surface direction
-
void vis_ASurfGetSegmentRule(vis_ASurf *p, Vfloat a[3], Vfloat b[3], Vfloat c[3])
get ruled surface direction
-
void vis_ASurfGetSegmentRuledv(vis_ASurf *p, Vdouble a[3], Vdouble b[3], Vdouble c[3])
get ruled surface direction
-
void vis_ASurfSetSegmentRev(vis_ASurf *p, Vfloat a[3], Vfloat b[3], Vfloat c[3])
set surface of revolution direction
Sets the local coordinate system information for a surface of revolution. The revolution is about the z-direction.
Inquire of specified a, b, and c points for a surface of revolution using
void vis_ASurfGetSegmentRev (vis_ASurf *asurf, Vfloat a[3], Vfloat b[3], Vfloat c[3]) void vis_ASurfGetSegmentRevdv (vis_ASurf *asurf, Vdouble a[3], Vdouble b[3], Vdouble c[3])
- Errors
SYS_ERROR_OPERATION
is generated if a-b is parallel to a-c.
- Parameters:
p – Pointer to ASurf object.
a – Origin of local coordinate system
b – Point such that a-b defines the local x-axis
c – Point such that a-c defines a vector in the local x-y plane
-
void vis_ASurfSetSegmentRevdv(vis_ASurf *p, Vdouble a[3], Vdouble b[3], Vdouble c[3])
set surface of revolution direction
-
void vis_ASurfGetSegmentRev(vis_ASurf *p, Vfloat a[3], Vfloat b[3], Vfloat c[3])
get surface of revolution direction
-
void vis_ASurfGetSegmentRevdv(vis_ASurf *p, Vdouble a[3], Vdouble b[3], Vdouble c[3])
get surface of revolution direction
-
void vis_ASurfSetSegmentFillet(vis_ASurf *p, Vfloat r)
set fillet radius
Sets the fillet radius to be used between two consecutive segments in the two-dimensional profile in order to generate a smoother contact surface. The revolution is about the z-direction.
Inquire of specified r using
void vis_ASurfGetFillet (vis_ASurf *asurf, Vfloat *r) void vis_ASurfGetFilletdv (vis_ASurf *asurf, Vdouble *r)
- Parameters:
p – Pointer to ASurf object.
r – Fillet radius
-
void vis_ASurfSetSegmentFilletdv(vis_ASurf *p, Vdouble r)
set fillet radius
-
void vis_ASurfGetSegmentFillet(vis_ASurf *p, Vfloat *r)
get fillet radius
-
void vis_ASurfGetSegmentFilletdv(vis_ASurf *p, Vdouble *r)
get fillet radius
-
void vis_ASurfSetPlane(vis_ASurf *p, Vfloat a[3], Vfloat b[3], Vfloat c[3], Vfloat length, Vfloat width)
set planar surface parameters
Sets the local coordinate system information for a planar surface, as well as its dimensions, length and width, in the local x and y axes, respectively.
Inquire of specified a, b, and c points, and the dimensions length and width for a planar surface using
void vis_ASurfGetPlane (vis_ASurf *asurf, Vfloat a[3], Vfloat b[3], Vfloat c[3], Vfloat *length, Vfloat *width) void vis_ASurfGetPlanedv (vis_ASurf *asurf, Vdouble a[3], Vdouble b[3], Vdouble c[3], Vdouble *length, Vdouble *width)
- Errors
SYS_ERROR_OPERATION
is generated if a-b is parallel to a-c.
- Parameters:
p – Pointer to ASurf object.
a – Origin of local coordinate system
b – Point such that a-b defines the local x-axis
c – Point such that a-c defines a vector in the local x-y plane
length – Length along the local x-axis
width – Length along the local y-axis
-
void vis_ASurfSetPlanedv(vis_ASurf *p, Vdouble a[3], Vdouble b[3], Vdouble c[3], Vdouble length, Vdouble width)
set planar surface parameters
-
void vis_ASurfGetPlane(vis_ASurf *p, Vfloat a[3], Vfloat b[3], Vfloat c[3], Vfloat *length, Vfloat *width)
get planar surface parameters
-
void vis_ASurfGetPlanedv(vis_ASurf *p, Vdouble a[3], Vdouble b[3], Vdouble c[3], Vdouble *length, Vdouble *width)
get planar surface parameters
-
void vis_ASurfSetBox(vis_ASurf *p, Vfloat a[3], Vfloat b[3], Vfloat c[3], Vfloat length, Vfloat width, Vfloat height)
set box surface parameters
Sets the local coordinate system information for a box surface, as well as its dimensions, length, width, and height, in the local x, y, and z axes, respectively.
Inquire of specified a, b, and c points, and the dimensions length, width, and height for a box surface using
void vis_ASurfGetBox (vis_ASurf *asurf, Vfloat a[3], Vfloat b[3], Vfloat c[3], Vfloat *length, Vfloat *width, Vfloat *height) void vis_ASurfGetBoxdv (vis_ASurf *asurf, Vdouble a[3], Vdouble b[3], Vdouble c[3], Vdouble *length, Vdouble *width, Vdouble *height)
- Errors
SYS_ERROR_OPERATION
is generated if a-b is parallel to a-c.
- Parameters:
p – Pointer to ASurf object.
a – Origin of local coordinate system
b – Point such that a-b defines the local x-axis
c – Point such that a-c defines a vector in the local x-y plane
length – Length along the local x-axis
width – Length along the local y-axis
height – Length along the local z-axis
-
void vis_ASurfSetBoxdv(vis_ASurf *p, Vdouble a[3], Vdouble b[3], Vdouble c[3], Vdouble length, Vdouble width, Vdouble height)
set box surface parameters
-
void vis_ASurfGetBox(vis_ASurf *p, Vfloat a[3], Vfloat b[3], Vfloat c[3], Vfloat *length, Vfloat *width, Vfloat *height)
get box surface parameters
-
void vis_ASurfGetBoxdv(vis_ASurf *p, Vdouble a[3], Vdouble b[3], Vdouble c[3], Vdouble *length, Vdouble *width, Vdouble *height)
get box surface parameters
-
void vis_ASurfSetCylinder(vis_ASurf *p, Vfloat a[3], Vfloat b[3], Vfloat c[3], Vfloat radius, Vfloat height)
set cylindrical surface parameters
Sets the local coordinate system information for a cylindrical surface, as well as the cylinder radius and height. The axis of the cylinder is aligned with the local z-axis.
Inquire of specified a, b, and c points, and the radius and height using
void vis_ASurfGetCylinder (vis_ASurf *asurf, Vfloat a[3], Vfloat b[3], Vfloat c[3], Vfloat *radius, Vfloat *height) void vis_ASurfGetCylinderdv (vis_ASurf *asurf, Vdouble a[3], Vdouble b[3], Vdouble c[3], Vdouble *radius, Vdouble *height)
- Errors
SYS_ERROR_OPERATION
is generated if a-b is parallel to a-c.
- Parameters:
p – Pointer to ASurf object.
a – Origin of local coordinate system
b – Point such that a-b defines the local x-axis
c – Point such that a-c defines a vector in the local x-y plane
radius – Cylinder radius
height – Cylinder height along z-axis
-
void vis_ASurfSetCylinderdv(vis_ASurf *p, Vdouble a[3], Vdouble b[3], Vdouble c[3], Vdouble r, Vdouble height)
set cylindrical surface parameters
-
void vis_ASurfGetCylinder(vis_ASurf *p, Vfloat a[3], Vfloat b[3], Vfloat c[3], Vfloat *r, Vfloat *height)
get cylindrical surface parameters
-
void vis_ASurfGetCylinderdv(vis_ASurf *p, Vdouble a[3], Vdouble b[3], Vdouble c[3], Vdouble *r, Vdouble *height)
get cylindrical surface parameters
-
void vis_ASurfSetCone(vis_ASurf *p, Vfloat a[3], Vfloat b[3], Vfloat c[3], Vfloat r1, Vfloat r2, Vfloat height)
set conical surface parameters
Sets the local coordinate system information for a conical surface, as well as the cone radii, r1 and r2 and height. The axis of the cone is aligned with the local z-axis. The cone height dimension is along the cone axis.
Inquire of specified a, b, and c points, and the radii r1, r2 and height using
void vis_ASurfGetCone (vis_ASurf *asurf, Vfloat a[3], Vfloat b[3], Vfloat c[3], Vfloat *r1, Vfloat *r2, Vfloat *height) void vis_ASurfGetConedv (vis_ASurf *asurf, Vdouble a[3], Vdouble b[3], Vdouble c[3], Vfloat *r1, Vfloat *r2, Vdouble *height)
- Errors
SYS_ERROR_OPERATION
is generated if a-b is parallel to a-c.
- Parameters:
p – Pointer to ASurf object.
a – Origin of local coordinate system
b – Point such that a-b defines the local x-axis
c – Point such that a-c defines a vector in the local x-y plane
r1 – Cone radius at origin
r2 – Cone radius at height
height – Cone height along local z-axis
-
void vis_ASurfSetConedv(vis_ASurf *p, Vdouble a[3], Vdouble b[3], Vdouble c[3], Vdouble r1, Vdouble r2, Vdouble height)
set conical surface parameters
-
void vis_ASurfGetCone(vis_ASurf *p, Vfloat a[3], Vfloat b[3], Vfloat c[3], Vfloat *r1, Vfloat *r2, Vfloat *height)
get conical surface parameters
-
void vis_ASurfGetConedv(vis_ASurf *p, Vdouble a[3], Vdouble b[3], Vdouble c[3], Vdouble *r1, Vdouble *r2, Vdouble *height)
get conical surface parameters
-
void vis_ASurfSetSphere(vis_ASurf *p, Vfloat c[3], Vfloat r)
set spherical surface parameters
Defines the center and the radius of a spherical surface.
Inquire of specified c and r using
void vis_ASurfGetSphere (vis_ASurf *asurf, Vfloat c[3], Vfloat *r) void vis_ASurfGetSpheredv (vis_ASurf *asurf, Vdouble c[3], Vdouble *r)
- Parameters:
p – Pointer to ASurf object.
c – Center of sphere
r – Sphere radius
-
void vis_ASurfSetSpheredv(vis_ASurf *p, Vdouble c[3], Vdouble r)
set spherical surface parameters
-
void vis_ASurfGetSphere(vis_ASurf *p, Vfloat c[3], Vfloat *r)
get spherical surface parameters
-
void vis_ASurfGetSpheredv(vis_ASurf *p, Vdouble c[3], Vdouble *r)
get spherical surface parameters
-
void vis_ASurfSetNURBS(vis_ASurf *p, Vint id, Vint type, Vint nptu, Vint nordu, Vint nptv, Vint nordv, Vint ix[], Vfloat homo[], Vfloat knots[], Vint ntrim, Vint trimlist[])
set NURBS surface
Specify the type, norders, connectivity, weights, knot values and trimming loops for each NURBS. If the NURBS is a line then the number of points and weights is nptu. The number of knot values is nptu + nordu. If the NURBS is a surface then the number of points and weights is nptu * nptv. The number of knot values is nptu + nordu + nptv + nordv.
Inquire of specified type, etc. as output arguments using
void vis_ASurfGetNURBS (vis_ASurf *asurf, Vint id, Vint *type, Vint *nptu, Vint *nordu, Vint *nptv, Vint *nordv, Vint ix[], Vfloat homo[], Vfloat knots[], Vint *ntrim, Vint trimlist[])
- Errors
SYS_ERROR_ENUM
is generated if an invalid type is entered.
- Parameters:
p – Pointer to ASurf object.
id – NURBS id
type – NURBS type
x=ASURF_NURBS_LINE NURBS line =ASURF_NURBS_SURF NURBS surface
nptu – Number of points in u
nordu – Order in u
nptv – Number of points in v
nordv – Order in v
ix – NURBS connectivity
homo – Homogeneous weights
knots – Knot values
ntrim – Number of trimming loops
trimlist – List of trimming loops
-
void vis_ASurfNumNURBS(vis_ASurf *p, Vint *numnurbs)
query number of NURBS
Query for the number of NURBS defined with
vis_ASurfSetNURBS()
.- Parameters:
p – Pointer to ASurf object.
numnurbs – [out] Number of defined NURBS
-
void vis_ASurfMaxNURBSOrder(vis_ASurf *p, Vint *maxord)
get maximum NURBS order
Query for the maximum order of NURBS defined in u or v direction with
vis_ASurfSetNURBS()
.- Parameters:
p – Pointer to ASurf object.
maxord – [out] Maximum order defined in a NURBS direction
-
void vis_ASurfGetNURBSNum(vis_ASurf *p, Vint id, Vint *type, Vint *nptu, Vint *nordu, Vint *nptv, Vint *nordv, Vint *ntrim)
get number of NURBS points and trim loop
Return the type, number of points and order and number of trimming loops for each NURBS.
- Errors
SYS_ERROR_ENUM
is generated if an invalid type is entered.
- Parameters:
p – Pointer to ASurf object.
id – NURBS id
type – [out] NURBS type
x=ASURF_NURBS_LINE NURBS line =ASURF_NURBS_SURF NURBS surface
nptu – [out] Number of points in u
nordu – [out] Order in u
nptv – [out] Number of points in v
nordv – [out] Order in v
ntrim – [out] Number of trimming loops
-
void vis_ASurfGetNURBS(vis_ASurf *p, Vint id, Vint *type, Vint *nptu, Vint *nordu, Vint *nptv, Vint *nordv, Vint ix[], Vfloat homos[], Vfloat knots[], Vint *ntrim, Vint trimlist[])
inquire of specified type, etc.
as output arguments
-
void vis_ASurfSetNURBSTrim(vis_ASurf *p, Vint id, Vint npts, Vint ix[])
set NURBS surface trimming loop
Specify the number of points and point connectivity of a trimming loop.
Inquire of specified npts, etc. as output arguments using
void vis_ASurfGetNURBSTrim (vis_ASurf *asurf, Vint id, Vint *npts, Vint ix[])
- Errors
SYS_ERROR_VALUE
is generated if id entry in not in strict ascending order.
- Parameters:
p – Pointer to ASurf object.
id – Trimming loop id
npts – Number of points
ix – Loop connectivity
-
void vis_ASurfNumNURBSTrim(vis_ASurf *p, Vint *numtrim)
query number of NURBS trimming loops
Query for the number of trimming loops defined with
vis_ASurfSetNURBSTrim()
.- Parameters:
p – Pointer to ASurf object.
numtrim – [out] Number of defined trimming loops
-
void vis_ASurfGetNURBSTrimNum(vis_ASurf *p, Vint id, Vint *npts)
get number of NURBS trimming loop points
Return the number of points in a trimming loop.
- Errors
SYS_ERROR_VALUE
is generated if an invalid id is entered.
- Parameters:
p – Pointer to ASurf object.
id – Trimming loop id
npts – [out] Number of points
-
void vis_ASurfGetNURBSTrim(vis_ASurf *p, Vint id, Vint *npts, Vint ix[])
get NURBS surface trimming loop
-
void vis_ASurfSetFacet(vis_ASurf *p, Vint id, Vint type, Vint ix[])
set facet type and connectivity
Specify the type and connectivity for each facet. The connectivity rules are identical to linear and parabolic Serendipity triangle and quadrilateral elements.
Inquire of specified type and connectivity ix as an output argument using
void vis_ASurfGetFacet (vis_ASurf *asurf, Vint id Vint *type, Vint ix[])
- Errors
SYS_ERROR_ENUM
is generated if an invalid type is entered.
- Parameters:
p – Pointer to ASurf object.
id – Facet id
type – Facet type
x=ASURF_FACET_TRI Linear triangle =ASURF_FACET_PARATRI Parabolic triangle =ASURF_FACET_QUAD Linear quadrilateral =ASURF_FACET_QUADTRI Parabolic quadrilateral
ix – Facet connectivity
-
void vis_ASurfNumFacets(vis_ASurf *p, Vint *numfacet)
query number of facets
Query for the number of facets defined with
vis_ASurfSetFacet()
.- Parameters:
p – Pointer to ASurf object.
numfacet – [out] Number of defined facets
-
void vis_ASurfGetFacet(vis_ASurf *p, Vint id, Vint *type, Vint ix[])
get facet type and connectivity
7.5. Rigid Body - RBody
The RBody module manages rigid bodies.
A rigid body may be defined by a set of elements, element faces or edges or an analytic surface. A set nodes may be added. It is possible to omit the element entities or analytic surface, in which case the rigid body motion is defined over a set of nodes. The overall motion of the rigid body follows the motion of a single reference node.
The functions associated with a RBody object are the following.
Begin and end an instance of an object, return object error flag
vis_RBodyBegin()
- create an instance of a RBody objectvis_RBodyEnd()
- destroy an instance of a RBody objectvis_RBodyError()
- return RBody object error flag
Set, manipulate and query rigid bodies
vis_RBodyDef()
- define rigid body entity typesvis_RBodyInq()
- inquire rigid body entity typesvis_RBodyElemFlag()
- query element entity definedvis_RBodyNodeType()
- query node entity and type definedvis_RBodySetElem()
- set element entityvis_RBodySetNode()
- set node and typevis_RBodySetObject()
- set pointers to attribute objects.vis_RBodySetASurf()
- set analytic surfacevis_RBodyASurf()
- get analytic surfacevis_RBodySetRefNode()
- set reference nodevis_RBodyGetRefNode()
- get reference nodevis_RBodySetValuei()
- set integer propertyvis_RBodyValueFlag()
- query property type definedvis_RBodyValueType()
- query property typesvis_RBodyValueParams()
- query property parametersvis_RBodyValueName()
- query property namevis_RBodyValueInteger()
- query property integer valuevis_RBodyEdgeIdTran()
- edge list of element entitiesvis_RBodyFaceIdTran()
- face list of element entitiesvis_RBodyNodeIdTran()
- node list of added node entitiesvis_RBodySpecFlag()
- query any specificationsvis_RBodySetName()
- set name stringvis_RBodyGetName()
- get name string
Instance a RBody object initially using vis_RBodyBegin()
.
Set basic entity types using vis_RBodyDef()
.
Either an element entity or analytic surface must be specified.
Nodes may be added to the basic entity type. However it is entirely
possible for the rigid body to contain only nodes by not specifying
any element entities or an analytic surface.
If element entities are specified
a GridFun object must be set as an attribute object using
vis_RBodySetObject()
so that the RBody
object can access finite element
model information and verify element entity specifications.
Element entities are specified using vis_RBodySetElem()
.
An analytic surface is specified using vis_RBodySetASurf()
.
Node entities are added using vis_RBodySetNode()
.
The rigid body reference node is defined using vis_RBodySetRefNode()
.
Generate a face list of element face entities using
vis_RBodyFaceIdTran()
.
Generate an edge list of element edge entities using
vis_RBodyEdgeIdTran()
.
Generate a node list of node entities using
vis_RBodyNodeIdTran()
.
A set of property types is supported for a rigid body.
Specify integer valued properties using vis_RBodySetValuei()
.
Each property type is identified by a defined constant.
The user may query for the number and type of properties defined
using vis_RBodyValueType()
. The data type and number of components
associated with a
property type is queried using vis_RBodyValueParams()
.
A long descriptive name which is hard-wired to each property type
may be queried using vis_RBodyValueName()
. Finally the property values
themselves may be recovered using vis_RBodyValueInteger()
.
The function vis_RBodyValueFlag()
is used to determine how a
property has been defined, if at all.
The full set of rigid body properties are the following:
RBODY_PID, integer, Property Id. Mass properties.
7.6. Function Descriptions
The currently available RBody functions are described in detail in this section.
-
vis_RBody *vis_RBodyBegin(void)
create an instance of an RBody object
Create an instance of an RBody object. Memory is allocated for the object private data and the pointer to the data is returned.
Destroy an instance of an RBody object using
void vis_RBodyEnd (vis_RBody *rbody)
Return the current value of an RBody object error flag using
Vint vis_RBodyError (vis_RBody *rbody)
- Returns:
The function returns a pointer to the newly created RBody object. If the object creation fails, NULL is returned.
-
void vis_RBodyEnd(vis_RBody *p)
destroy an instance of an RBody object
See
vis_RBodyBegin()
-
Vint vis_RBodyError(vis_RBody *p)
return the current value of an RBody object error flag
See
vis_RBodyBegin()
-
void vis_RBodyDef(vis_RBody *p, Vint enttype)
define basic entity type
Set the basic entity types. The entity type may be an element, element edge or face or an analytic surface. Element entities are specified using
vis_RBodySetElem()
. Analytic surface entities are specified usingvis_RBodySetASurf()
. Nodes may be added usingvis_RBodySetNode()
.Inquire of defined enttype as an output argument using
void vis_RBodyInq (vis_RBody *rbody, Vint *enttype)
- Errors
SYS_ERROR_ENUM
is generated if an improper enttype is specified.
- Parameters:
p – Pointer to RBody object.
enttype – Entity type
=SYS_ELEM Element =SYS_EDGE Element edge =SYS_FACE Element face =SYS_ASURF Analytic surface
-
void vis_RBodyInq(vis_RBody *p, Vint *enttype)
inquire of defined enttype as an output argument
See
vis_RBodyDef()
-
void vis_RBodySetObject(vis_RBody *p, Vint objecttype, Vobject *object)
set pointers to attribute objects.
Set a pointer to an attribute object.
- Errors
VIS_ERROR_OBJECTTYPE
is generated if an improper objecttype is specified.
- Parameters:
p – Pointer to RBody object.
objecttype – The name of the object type to be set.
x=VIS_GRIDFUN GridFun object
object – Pointer to the object to be set.
-
void vis_RBodySetName(vis_RBody *p, Vchar *name)
set name string
Set a name string. The name string can contain up to 81 characters including the terminating NULL. If the name is not specified it is returned as a single NULL character using
vis_RBodyGetName()
.Get name as an output argument.
void vis_RBodyGetName (const vis_RBody *rbody, Vchar name[])
- Parameters:
p – Pointer to RBody object.
name – Name string
-
void vis_RBodyGetName(vis_RBody *p, Vchar name[])
get name string
-
void vis_RBodySetElem(vis_RBody *p, Vint index, Vint no)
set element entity
Set element index and face or edge number, no. A face or edge number of zero indicates that the entire element is specified.
- Errors
SYS_ERROR_VALUE
is generated if an improper index or no is specified.
- Parameters:
p – Pointer to RBody object.
index – Element index
no – Element edge or face number
-
void vis_RBodyElemFlag(vis_RBody *p, Vint index, Vint *elem, Vint *flags)
query element entity defined
Return element edge or face flags given an element index. If the entity is defined the elem argument is return as 1 otherwise 0.
- Errors
SYS_ERROR_VALUE
is generated if an improper index is specified.
- Parameters:
p – Pointer to RBody object.
index – Element number
elem – [out] Element defined flag
flags – [out] Element edge or face flags
-
void vis_RBodySetNode(vis_RBody *p, Vint index, Vint type)
set node entity and type
Set node index and type.
- Errors
SYS_ERROR_VALUE
is generated if an improper index is specified.
- Parameters:
p – Pointer to RBody object.
index – Node index
type – Node type
x=RBODY_PIN Pinned node =RBODY_TIE Tied node
-
void vis_RBodyNodeType(vis_RBody *p, Vint index, Vint *type)
query node entity and type defined
If the node entity type has been defined, the type will be returned. If it has not been defined, zero is returned.
- Errors
SYS_ERROR_VALUE
is generated if an improper index is specified.
- Parameters:
p – Pointer to RBody object.
index – Node number
type – [out] Node type
x=RBODY_PIN Pinned node =RBODY_TIE Tied node =0 Node not defined
-
void vis_RBodySpecFlag(vis_RBody *p, Vint *flag)
query any entity specifications
Query if any element, node or analytic surface specifications of any type have been made. The return value, flag, will be zero only if no entity of any type have been specified.
- Parameters:
p – Pointer to RBody object.
flag – [out] Flag indicating if element, analytic or node specified
-
void vis_RBodySetRefNode(vis_RBody *p, Vint index)
set reference node
Set reference node
Inquire of reference node index as an output argument using
void vis_RBodyGetRefNode (vis_RBody *rbody, Vint *index)
- Errors
SYS_ERROR_VALUE
is generated if an improper index is specified.
- Parameters:
p – Pointer to RBody object.
index – Reference node index
-
void vis_RBodyGetRefNode(vis_RBody *p, Vint *refnode)
get reference node
-
void vis_RBodySetValuei(vis_RBody *p, Vint type, Vint ivalue)
Set an integer valued property. Use
vis_RBodyValueInteger()
to return integer valued properties.- Errors
SYS_ERROR_ENUM
is generated if an improper type is specified.
- Parameters:
p – Pointer to RBody object.
type – Property type
x=RBODY_PID Property id
ivalue – Property value
-
void vis_RBodyValueType(vis_RBody *p, Vint *ntypes, Vint type[])
query property types
Return number of property types, ntypes, and types, type, of all defined property types. The maximum number of types which may be returned is
RBODY_MAX
.- Parameters:
p – Pointer to RBody object.
ntypes – [out] Number of types of property values
type – [out] Array of property types
-
void vis_RBodyValueFlag(vis_RBody *p, Vint type, Vint *flag)
query property type defined
Query for property definition. If a property value is not defined,
RBODY_UNDEFINED
is returned, if the property has been defined by value thenRBODY_VALUE
is returned.- Errors
SYS_ERROR_ENUM
is generated if an improper type is specified.
- Parameters:
p – Pointer to RBody object.
type – Property type
flag – [out] Flag indicating if property type defined or not
x=RBODY_UNDEFINED Property value not defined =RBODY_VALUE Property real value defined
-
void vis_RBodyValueParams(vis_RBody *p, Vint type, Vint *nval, Vint *dtyp)
query property parameters
Query for the number of components and the data type associated with a property type.
- Errors
SYS_ERROR_ENUM
is generated if an improper type is specified.
- Parameters:
p – Pointer to RBody object.
type – Property type
nval – [out] Number of components
dtyp – [out] Data type
=SYS_CHAR Character =SYS_INTEGER Integer =SYS_FLOAT Float
-
void vis_RBodyValueName(vis_RBody *p, Vint type, Vchar name[])
query property name
Query for the built-in name associated with a property type. The character string will not exceed 64 characters including the terminating NULL character.
- Errors
SYS_ERROR_ENUM
is generated if an improper type is specified.
- Parameters:
p – Pointer to RBody object.
type – Property type
name – [out] Property name
-
void vis_RBodyValueInteger(vis_RBody *p, Vint type, Vint iparam[])
query property integer value
Return a defined integer valued property. If the value has not been defined or the value type is not integer, nothing is returned.
- Errors
SYS_ERROR_ENUM
is generated if an improper type is specified.
- Parameters:
p – Pointer to RBody object.
type – Property type
iparam – [out] Integer property.
-
void vis_RBodyFaceIdTran(vis_RBody *p, vis_IdTran *idtran)
face list of elements
Derive a list of element faces which have been defined.
Note that idtran is not cleared by this function, the derived element face entities are added to any existing element faces in the output idtran.
- Errors
VIS_ERROR_ENUM
is generated if an improper oper is specified.
-
void vis_RBodyEdgeIdTran(vis_RBody *p, vis_IdTran *idtran)
edge list of elements
Derive a list of element edges which have been defined. Note that idtran is not cleared by this function, the derived element edge entities are added to any existing element edges in the output idtran.
- Errors
VIS_ERROR_ENUM
is generated if an improper oper is specified.
-
void vis_RBodyNodeIdTran(vis_RBody *p, Vint type, vis_IdTran *idtran)
node idtran of nodes
Derive a list of nodes which have been defined with the specified type.
Note that idtran is not cleared by this function, the derived node entities are added to any existing node in the output idtran.
-
void vis_RBodySetASurf(vis_RBody *p, Vint asid)
set analytic surface
Set analytic surface asid.
Inquire of analytic surface asid as an output argument using
void vis_RBodyASurf (vis_RBody *rbody, Vint *asid)
- Errors
SYS_ERROR_VALUE
is generated if an improper index or no is specified.
- Parameters:
p – Pointer to RBody object.
asid – Analytic surface index
-
void vis_RBodyASurf(vis_RBody *p, Vint *asid)
inquire of analytic surface asid as an output argument