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
544db988
Commit
544db988
authored
15 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
create api in base element class for hierarchical meshes : getParent, getChild
parent
d5af0cf1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Geo/MElement.h
+5
-0
5 additions, 0 deletions
Geo/MElement.h
Geo/MElementCut.h
+11
-45
11 additions, 45 deletions
Geo/MElementCut.h
with
16 additions
and
45 deletions
Geo/MElement.h
+
5
−
0
View file @
544db988
...
...
@@ -140,6 +140,11 @@ class MElement
v
.
resize
(
0
);
}
// get parent and children for hierarchial grids
virtual
MElement
*
getParent
()
const
{
return
0
;
}
virtual
int
getNumChildren
()
const
{
return
0
;
}
virtual
MElement
*
getChild
(
int
i
)
const
{
return
0
;
}
//get the type of the element
virtual
int
getType
()
const
=
0
;
...
...
This diff is collapsed.
Click to expand it.
Geo/MElementCut.h
+
11
−
45
View file @
544db988
...
...
@@ -26,41 +26,7 @@ class MPolyhedron : public MElement {
void
_init
();
public:
MPolyhedron
(
std
::
vector
<
MVertex
*>
v
,
int
num
=
0
,
int
part
=
0
)
:
MElement
(
num
,
part
),
_owner
(
false
),
_orig
(
0
)
{
/*_parts.push_back(new MTetrahedron(v[0], v[1], v[2], v[3]));
for(unsigned int i = 4; i < v.size(); i++) {
unsigned int k;
double xyz[3] = {v[i]->x(), v[i]->y(), v[i]->z()};
for(k = 0; k < _parts.size(); k++) {
double uvw[3]; _parts[k]->xyz2uvw(xyz,uvw);
if(_parts[k]->isInside(uvw[0],uvw[1],uvw[2])) break;
}
if(k < _parts.size()) {
MTetrahedron tmp = *(_parts[k]);
delete _parts[k];
_parts.erase(_parts.begin() + k);
for(int t = 0; t < 4; t++) {
MTetrahedron *tet = new MTetrahedron(tmp.getFace(t).getVertex(0), tmp.getFace(t).getVertex(1),
tmp.getFace(t).getVertex(2), v[i]);
if(tet->getVolume() != 0) _parts.push_back(tet);
else delete tet;
}
}
else {
double dmin = 0.; int tet, face;
for(k = 0; k < _parts.size(); k++) {
for(int f = 0; f < 4; f++) {
double dist = v[i]->distance(_parts[k]->getFace(f).getVertex(0))
+ v[i]->distance(_parts[k]->getFace(f).getVertex(1))
+ v[i]->distance(_parts[k]->getFace(f).getVertex(2));
if(dmin == 0 || dist < dmin) {dmin = dist; tet = k; face = f;}
}
}
//_parts.push_back(new MTetrahedron());
}
}*/
}
:
MElement
(
num
,
part
),
_owner
(
false
),
_orig
(
0
)
{}
MPolyhedron
(
std
::
vector
<
MTetrahedron
*>
vT
,
int
num
=
0
,
int
part
=
0
)
:
MElement
(
num
,
part
),
_owner
(
false
),
_orig
(
0
)
{
...
...
@@ -87,8 +53,8 @@ class MPolyhedron : public MElement {
virtual
int
getNumVolumeVertices
()
const
{
return
_innerVertices
.
size
();
}
virtual
MVertex
*
getVertex
(
int
num
)
{
return
(
num
<
_vertices
.
size
())
?
_vertices
[
num
]
:
_innerVertices
[
num
-
_vertices
.
size
()];
return
(
num
<
(
int
)
_vertices
.
size
())
?
_vertices
[
num
]
:
_innerVertices
[
num
-
_vertices
.
size
()];
}
virtual
int
getNumEdges
()
{
return
_edges
.
size
();
}
virtual
MEdge
getEdge
(
int
num
)
{
return
_edges
[
num
];
}
...
...
@@ -156,9 +122,9 @@ class MPolyhedron : public MElement {
}
virtual
void
writeMSH
(
FILE
*
fp
,
double
version
=
1.0
,
bool
binary
=
false
,
int
num
=
0
,
int
elementary
=
1
,
int
physical
=
1
);
virtual
MElement
*
get
Father
()
const
{
return
_orig
;
}
virtual
int
getNum
Parts
()
const
{
return
_parts
.
size
();
}
virtual
MElement
*
get
Part
(
int
i
)
const
{
return
_parts
[
i
];
}
virtual
MElement
*
get
Parent
()
const
{
return
_orig
;
}
virtual
int
getNum
Children
()
const
{
return
_parts
.
size
();
}
virtual
MElement
*
get
Child
(
int
i
)
const
{
return
_parts
[
i
];
}
};
class
MPolygon
:
public
MElement
{
...
...
@@ -212,8 +178,8 @@ class MPolygon : public MElement {
virtual
int
getNumFaceVertices
()
const
{
return
_innerVertices
.
size
();
}
virtual
MVertex
*
getVertex
(
int
num
)
{
return
(
num
<
_vertices
.
size
())
?
_vertices
[
num
]
:
_innerVertices
[
num
-
_vertices
.
size
()];
return
(
num
<
(
int
)
_vertices
.
size
())
?
_vertices
[
num
]
:
_innerVertices
[
num
-
_vertices
.
size
()];
}
virtual
int
getNumEdges
()
{
return
_vertices
.
size
();
}
virtual
MEdge
getEdge
(
int
num
)
...
...
@@ -272,9 +238,9 @@ class MPolygon : public MElement {
}
virtual
void
writeMSH
(
FILE
*
fp
,
double
version
=
1.0
,
bool
binary
=
false
,
int
num
=
0
,
int
elementary
=
1
,
int
physical
=
1
);
virtual
MElement
*
get
Father
()
const
{
return
_orig
;
}
virtual
int
getNum
Parts
()
const
{
return
_parts
.
size
();
}
virtual
MElement
*
get
Part
(
int
i
)
const
{
return
_parts
[
i
];
}
virtual
MElement
*
get
Parent
()
const
{
return
_orig
;
}
virtual
int
getNum
Children
()
const
{
return
_parts
.
size
();
}
virtual
MElement
*
get
Child
(
int
i
)
const
{
return
_parts
[
i
];
}
};
class
MTriangleBorder
:
public
MTriangle
{
...
...
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