Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
d0ecfb08
Commit
d0ecfb08
authored
20 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
2dd91eea
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Plugin/o_internals.h
+87
-0
87 additions, 0 deletions
Plugin/o_internals.h
with
87 additions
and
0 deletions
Plugin/o_internals.h
0 → 100644
+
87
−
0
View file @
d0ecfb08
#ifndef OCTCLASSIFY
#define OCTCLASSIFY
#include
<list>
/* file of function prototypes and macro constants */
typedef
void
(
*
BBFunction
)(
void
*
,
double
*
,
double
*
);
typedef
int
(
*
InEleFunction
)(
void
*
,
double
*
);
typedef
void
(
*
CentroidFunction
)(
void
*
,
double
*
);
/* structure for list of elements in an octant */
typedef
struct
elem
{
void
*
region
;
/* the pointer to a mesh Db region */
double
centroid
[
3
];
/* centroid of element bounding box inside of the octant */
double
minPt
[
3
];
/* corner of element bounding box nearest the origin */
double
maxPt
[
3
];
/* corner of elem bound box furthest from the origin */
struct
elem
*
next
;
/* link to next item in list, NULL if end */
}
Elem
;
typedef
Elem
*
ELink
;
/* stucture for octant buckets */
struct
bucket
{
double
minPt
[
3
];
/* the point with the smallest coordinates */
double
maxPt
[
3
];
/* the point with the biggest coordinates */
int
numElements
;
/* number of elements contained by bucket */
int
precision
;
/* the level of precision of the bucket */
ELink
lhead
;
/* list of elements in bucket, if NULL -> no elements */
std
::
list
<
void
*>
listBB
;
/* list of elements in bucket by Bounding Box */
struct
bucket
*
next
;
/* link to ragged digit extensions to bucket array */
struct
bucket
*
parent
;
/* link to the parent bucket */
};
typedef
struct
bucket
octantBucket
;
/* octantBucket *buckets=NULL; */
/* structure for global information and requirment */
struct
global
{
int
numBuckets
;
/* number of octant buckets in initial grid array */
int
maxElements
;
/* max. number of elements allowed in an octant */
int
maxPrecision
;
/* current maximum octant precision for model */
double
origin
[
3
];
/* smallest x,y, z of model's bounding box */
double
size
[
3
];
/* size in x, y, z of model bounding box */
void
*
ptrToPrevElement
;
std
::
list
<
void
*>
listAllElements
;
};
typedef
struct
global
globalInfo
;
typedef
struct
{
globalInfo
*
info
;
octantBucket
*
root
;
BBFunction
function_BB
;
InEleFunction
function_inElement
;
CentroidFunction
function_centroid
;
}
Octree
;
void
refineOctants
(
octantBucket
*
buckets
,
globalInfo
*
globalPara
);
int
addElement2Bucket
(
octantBucket
*
bucket
,
void
*
element
,
double
*
minBB
,
double
*
maxBB
,
double
*
ele_centroid
,
globalInfo
*
globalPara
);
int
subdivideOctantBucket
(
octantBucket
*
bucket
,
globalInfo
*
globalPara
);
int
initializeOctantBuckets
(
double
*
orig
,
double
*
size
,
int
maxElem
,
octantBucket
**
buckets
,
globalInfo
**
globalPara
);
int
checkElementInBucket
(
octantBucket
*
bucket
,
void
*
element
);
octantBucket
*
findElementBucket
(
octantBucket
*
buckets
,
double
*
pt
);
void
*
searchElement
(
octantBucket
*
buckets
,
double
*
pt
,
globalInfo
*
globalPara
,
BBFunction
BBElement
,
InEleFunction
xyzInElement
);
int
xyzInElementBB
(
double
*
xyz
,
void
*
region
,
BBFunction
BBElement
);
void
insertOneBB
(
void
*
,
double
*
,
double
*
,
octantBucket
*
);
void
*
searchAllElements
(
octantBucket
*
_buckets_head
,
double
*
_pt
,
globalInfo
*
_globalPara
,
BBFunction
BBElement
,
InEleFunction
xyzInElement
,
std
::
list
<
void
*>
*
_elements
);
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment