Functions in sift5.c
Table of Contents
AllocateMemory()
Prototype:
void AllocateMemory()
Description: To dynamically
allocate required memory.
Input value: none
Return value: none
Global value used:
TotNumHexHedron, TotNumTetHedron, TotTrngleNum, TotNumEdge,
TotNumNode, MediaPerm, EdgeStat, MetalEdgeStat, EdgeFound,
MultFound, PlusTrngleIndex, MinusTrngleIndex,
GlobalEdgeEnds HexNode, HexEdgeNum, TetNodeNum, TetEdgeNum,
TetBoundFaceTetHedronNum, TetBoundFaceFaceNum, TetFaceNode,
TetFaceEdge, FaceNode, FaceEdge, EdgeStat, MetalEdgeStat,
PlusTrngleDetect, PlusTrngleIndex, MinusTrngleDetect,
MinusTrngleIndex, EdgeFound, MultFound ,GlobalEdgeEnds,
NodeCord
Global value modified:
HexNode, HexEdgeNum, TetNodeNum, TetEdgeNum,
TetBoundFaceTetHedronNum, TetBoundFaceFaceNum, TetFaceNode,
TetFaceEdge, FaceNode, FaceEdge, EdgeStat, MetalEdgeStat,
PlusTrngleDetect, PlusTrngleIndex, MinusTrngleDetect,
MinusTrngleIndex, EdgeFound, MultFound ,GlobalEdgeEnds,
NodeCord
Subroutines called:
INT_Matrix(), FLOAT_Matrix(), INT_Vector()
Click to go back to Table of
Contents.
AssignBoxCoordinates()
Prototype:
void AssignBoxCoordinates()
Description: To assign
Cartesian coordinates for each node of each
hexahedron
Input value: none
Return value: none
Global value used: NodeCord,
Divisor
Global value modified:
NodeCord
Subroutines called: none
Click to go back to Table of
Contents.
AssignHexHedronEdgeNum()
Prototype:
void AssignHexHedronEdgeNum()
Description: To map the
local edges to global edges for each hexahedron
Input value: none
Return value: none
Global value used: XdiM, YdiM, HexEdgeNum
Global value modified: none
Subroutines called: none
Click to go back to Table of
Contents.
AssignHexHedronNodeNum()
Prototype:
void AssignHexHedronNodeNum()
Description: To map
the local nodes to the global nodes for each
hexahedron.
Input value: none
Return value: none
Global value used:
TotNumHexHedron, HexNode, XdiM, YdiM
Global value modified:
none
Subroutines called: none
Click to go back to Table of
Contents.
ComputeEdgeMultiplicity(
)
Prototype:
void ComputeEdgeMultiplicity()
Description: To compute the
multiplicity of edges.
Input value: none
Return value: none
Global value used:
TotNumEdge, EdgeStat, MetalEdgeStat, GlobalEdgeEnds,
TotTrngleNum, PlusTrngleIndex, TetFaceEdge,
PlusTrngleDetect, MinusTrngleIndex, MinusTrngleDetect,
TotBoundEdgeNum, EdgeFound, MultFound, VSourceNum,
VsourceEdge, OperateFreq, E_Theta, E_Phi, K_Theta, K_Phi,
PlaneWaveE_Mag, ForcdEdgeStat, ForcdEdgeValueReal,
ForcdEdgeValueImage, JunctionNum, Junction,
flag_default_out, output_num, output_file,
OutFilePntr.
Global value modified:
TotBoundEdgeNum
Subroutines called: none
Click to go back to Table of
Contents.
ComputeParameters()
Prototype:
void ComputeParameters()
Description: To compute
parameters for the mesh. For example, the total node
number, the total triangular element number, the total
tetrahedron number.
Input value: none
Return value: none
Global value used:
TotCubeNumEdge, TotCubeTrngleNum, TotCubeNumNode,
TotNumHexHedron, TotNumTetHedron, TotNumEdge, TotNumNode.
TotTrngleNum, TotDipolNumEdge, TotDipolTrngleNum, Xdim,
Ydim, Zdim, ExdcondNum, Xextcond, Yextcond, DipolWid,
DipolLen, Dipolplane_YZ, Dipolplane_XY, TotInnerEdgeNum,
InnerEdgeStat
Global value modified:
TotCubeNumEdge, TotCubeTrngleNum, TotCubeNumNode,
TotNumHexHedron, TotNumTetHedron, TotNumEdge, TotNumNode.
TotTrngleNum, TotInnerEdgeNum, InnerEdgeStat
Subroutines called:
INT_Vector()
Click to go back to Table of
Contents.
ComputeTrngleCentroid()
Prototype:
void ComputeTrngleCentroid(int, double
**, int **, double **)
Description: To compute the
centroid of a triangular patch
Input value:
- int TrngleNum --- the triangle number
- double **Cord, --- the global node table
- int **BFaceNode --- the node of the triangle
- double **CenTroid --- where the results will be
stored.
Return value: none
Global value used: none
Global value modified: none
Subroutines called: VTXadd2()
Click to go back to Table of
Contents.
DetectBoundEdgeStatus()
Prototype:
void DetectBoundEdgeStatus()
Description: To find edges
located on the surface of the FEM region.
Input value: none
Return value: none
Global value used: XdiM,
ZdiM, YdiM, EdgeStat, HexEdgeNum, BndcondNum, Xbndcond,
Ybndcond, Zbndcond, MetalEdgeStat, EdgeStat, EdgeStat
Global value modified:
FrontWall, BackWall, BottomWall, TopWall, RightWall,
LeftWall
Subroutines called:
none
Click to go back to
Table of
Contents.
DetectCondBound( )
Prototype: void
DetectCondBound()
Description: To detect whether a conductor or part
of a conductor is
located on the FEM surface.
Input value:
Cond pp --- a conductor.
Return value: If ture, return 1,
otherwise return 0 none
Global value used: XBoundDim, YBoundDim,
ZBoundDim, Xintcond, Yintcond,
Zintcond, DelXintcond, DelYintcond,
DelZintcond, Xextcond, Yextcond,
Zextcond, IntcondNum, ExtcondNum,
Xbndcond, Ybndcond, Zbndcond,
DelXbndcond, DelYbndcond,
DelZbndcond,
Global value modified:
none
Subroutines called: Inetersection()
Click to go back to Table of
Contents.
DetectInnerCond()
Prototype: void
DetectInnerCond()
Description: To detect whether a conductor, or
part of the conductor is
inside the FEM volume
Input value:
Cond pp --- a conductor
Return value: none
Global value used: XBoundDim, YBoundDim,
XBoundDim, Xintcond, Yintcond,
Zintcond, DelXintcond, DelYintcond,
DelZcond, Xextcond, Yextcond,
Zextcond, IntcondNum, ExtcondNum,
Global value modified:
none
Subroutines called: Intersection()
Click to go back to Table of
Contents.
DetectISourceEdgeStatus()
Prototype:
void DetectISourceEdges()
Description: To detect edges that coincides
with the current source
Input value: none
Return value: none
Global value used: CellDimension, Xintcond,
Yintcond, Zintcond, NodeCord,
IntEsrcAxis, ISourceEdgeStat,
ISourceEdgeMag,
TotISourceEdgeNum, IntEsrcMag,
Global value modified:
none
Subroutines called: none
Click to go back to Table of
Contents.
DetectInnerEdgeStatus()
Prototype:
void DetectInnerEdgeStatus()
Description: To find edges
located within the FEM region.
Input value: none
Return value: none
Global value used: XdiM, YdiM, EdgeStat,
HexEdgeNum,
Global value modified: none
Subroutines called: none
Click to go back to Table of
Contents.
DetectVSourceEdges(
)
Prototype:
void DetectVSourceEdges()
Description: To find edges coinciding with the
source.
Input value: none
Return value: none
Global value used:
XextVsrc,YextVsrc, ZextVsrc TotNumEdge, ExtVsrcNum,
NodeCord, GlobalEdgeEnds, VsourceEdge,VSourceNum
Global value modified:
none
Subroutines called: none
Click to go back to Table of
Contents.
DiscretizeFEMVolume()
Prototype:
void DiscretizeFEMVolume()
Description: To disretize the FEM volume into
tetrahedra.
Input value: none
Return value: none
Global value used: CellUnitXNum,
CellUnitYNum, CellUnitZNum,
MediaPerm, FaceNode, FaceEdge,
TrngleNode, TrngleEdge,
Global value modified:
none
Subroutines called:
TetraEdgeDiv1(), GlobalEdgeEndsDiv1(),
TetraEdgeDiv2(), GlobalEdgeEndsDiv2(),
FindTetraHedronFaceNodes(),
ComputeTrngleCentroid(), ModifyBoundFaces();
Click to go back to
Table of
Contents.
DiscretizeExterPECPatch()
Prototype: void
DiscretizeExterPECPatch()
Description: To disretize the external
conductative surface into triangles.
Input value: none
Return value: none
Global value used: ExtcondNum, CubeNumNode,
CubeTrnglleNum, DipoleWid,
DipolLen, CellDimension,
DelXextcond, DelYextcond, DelZextcond,
Dipolplane_XY, Dipolplane_YZ,
Dipolplane_XZ, GlobalEdgeEnds
Global value modified:
none
Subroutines called: none
Click to go back to Table of
Contents.
FindInterMetalEdges()
Prototype:
void FindInterMetalEdges()
Description: To detect the inner conductive
edges
Input value: none
Return value: none
Global value used: CellDimension, Xintcond,
Yintcond, Zintcond, NodeCord
Global value modified:
none
Subroutines called: none
Click to go back to Table of
Contents.
FindTetraHedronFaceNodes()
Prototype:
void FindTetraHedronFaceNodes(int
TetHedronNum)
Description: To find
tetrahedron faces that lie on the surface of FEM
region.
Input value: int
TetHedronNum--- index of the tetrahedron
Return value: none
Global value used:
EdgeStat,TetNodeNum, NodeCord
Global value modified:
none
Subroutines called: none
Click to go back to Table of
Contents.
GlobalEdgeEndsDiv1()
Prototype:
void GlobalEdgeEndsDiv1()
Description: To assign start and end nodes for
the 18 edges associated with one hexahedron. This
subroutine is
used accompanying with Tetra-Edge_Div1().
Input value: none
Return value: none
Global value used:
GlobalEdgeEnds, HexNode, HexNum,
Global value modified:
none
Subroutines called: none
Click to go back to Table of
Contents.
GlobalEdgeEndsDiv2()
Prototype:
void GlobalEdgeEndsDiv2()
Description: To assign start and end nodes for
the 18 edges associated with one hexahedron. This
subroutine is
used accompanying with Tetra-Edge_Div2().
Input value: none
Return value: none
Global value used:
GlobalEdgeEnds, HexNode, HexNum,
Global value modified:
none
Subroutines called: none
Click to go back to Table of
Contents.
Intersection()
Prototype: int Intersection(RectAngle R1,
RectAngle R2, RectAngle *R,
int *SubRectNum, RectAngle *SubRect)
Description: detect intersection between two
rectangles R1 and R2.
If return value equal to 1, then an intersection is
found
and stored in R. Otherwise return 0. SubRectNum
returns
the number of rectangles R2 is devided by R1 into.
sub-area
stores the rectangle information.
Input value:
RectAngle R1, R2 --- two rectangles to
be detected whether there is
an intersection between them
RectAngle *R --- to store the
intersection rectangle.
int *SubRectNum --- the number of
rectangles that R2 is divided
by R1, except the intersection area.
RectAngle *SubRect --- to store the rest
rectangles except the
intersection rectangle
Global value used: none
Glboal value modified: none
Subroutines called: none
Click to go back to Table of
Contents.
ModifyBoundFaces()
Prototype:
void ModifyBoundFaces(int
TrngleFace)
Description: To orient the edges
of each tetrahedron face to consistent with the reference
direction
Input value:
- int TrngleNum--- the index of the boundary
face
Return value: none
Global value used:
TetFaceNode, GlobalEdgeEnds,
Global value modified:
none
Subroutines called: none
Click to go back to Table of
Contents.
PrintOutput( )
Prototype:
void PrintOutput()
Description: To print out the mesh data,
source information and output specifications to a file.
This file will be used by emap5.
Input value: none
Return value: none
Global value used: XdiM, YdiM, ZdiM,
TotNumEdge, TotNumTetHedron, TotNumNode, TotTrngleNum,
TotBoundEdgeNum, TotInnerEdgeNum, DielBoundEdgeNum,
TotForcdEdgeNum,TetFaceNode, TetFaceEdge, NodeCord,
TetNodeNum, MediaPerm, TetEdgeNum, GlobalEdgeEnds,
PlusTrngleIndex, PlusTrngleDetect, MinusTrngleIndex,
MinusTrngleDetect, InnerEdgeStat, BoundaryEdgeStat,
VsourceMag, VsourceNum, OperateFreq,
Global value modified:
none
Subroutines called: none
Click to go back to Table of
Contents.
ReadSIFFile( )
Prototype:
void ReadSIFFile()
Description: Reads input
file
Input value: none
Return value: none
Global value used: CellDim, XdiM, YdiM, ZdiM,
XDielmat, YDielmat, ZDielmat, Xintcond, Yintcond, Zintcond,
BndcondNum, Xextcond, Yextcond, Zextcond, XextVsrc,
YextVsrc, ZextVsrc, XintEsrc, YintEsrc, ZintEsrc,
ExtcondNum, BndcondNum, ExtVsrcNum, freq, SourceType,
PolInc, ThetaInc, PhiInc, OperateFreq, CellDimension ,
Min_X = 10000, Min_Y, Min_Z, Epsilon, Sigma, DielmatNum,
IntcondNum, VsourceMag, IntEsrcNum,
Global value modified:Min_X, Min_Y, Min_Z, XdiM,
YdiM, ZdiM, CellDim, DielmatNum, IntcondNum, BndcondNum,
ExtcondNum, ExtVsrcNum, VsourceMag, IntEsrcNum, ThetaInc,
PhiInc, OperateFreq, CellDimension ,
Subroutines called: none
Click to go back to Table of
Contents.
TetraEdgeDiv1()
Prototype:
void TetraEdgeDiv1()
Description: To divide one
hexahedron into five tetrahedra. There are two methods to
do that. This subroutine uses
one method. TetraEdgeDiv2() use the other one.
Input value: none
Return value: none
Global value used: HexNum,
TetNodeNum, HexNode, TetEdgeNum, HexEdgeNum,
Global value modified: none
Subroutines called: none
Click to go back to Table of
Contents.
TetraEdgeDiv2()
Prototype:
void TetraEdgeDiv2()
Description: To divide one
hexahedron into five tetrahedron. There are two methods to
do that. TetraEdgeDiv1() uses
one method, TetraEdgeDiv2() uses the other method.
Input value: none
Return value: none
Global value used: HexNum,
TetNodeNum, HexNode, TetEdgeNum, HexEdgeNum,
Global value modified:
none
Subroutines called: none
Click to go back to Table of
Contents.