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
f8211313
Commit
f8211313
authored
18 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
46858a0c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Geo/GEntity.h
+4
-13
4 additions, 13 deletions
Geo/GEntity.h
Geo/GModel.cpp
+16
-42
16 additions, 42 deletions
Geo/GModel.cpp
Geo/GModel.h
+12
-12
12 additions, 12 deletions
Geo/GModel.h
with
32 additions
and
67 deletions
Geo/GEntity.h
+
4
−
13
View file @
f8211313
...
@@ -83,7 +83,7 @@ class GEntity {
...
@@ -83,7 +83,7 @@ class GEntity {
virtual
~
GEntity
()
{};
virtual
~
GEntity
()
{};
// Spatial dimension of the entity
// Spatial dimension of the entity
virtual
int
dim
()
const
=
0
;
virtual
int
dim
()
const
{
throw
;}
// Returns true if ent is in the closure of this entity
// Returns true if ent is in the closure of this entity
virtual
int
inClosure
(
GEntity
*
ent
)
const
{
throw
;}
virtual
int
inClosure
(
GEntity
*
ent
)
const
{
throw
;}
...
@@ -101,7 +101,7 @@ class GEntity {
...
@@ -101,7 +101,7 @@ class GEntity {
virtual
std
::
list
<
GVertex
*>
vertices
()
const
{
throw
;}
virtual
std
::
list
<
GVertex
*>
vertices
()
const
{
throw
;}
/// Underlying geometric representation of this entity.
/// Underlying geometric representation of this entity.
virtual
GeomType
geomType
()
const
=
0
;
virtual
GeomType
geomType
()
const
{
throw
;}
// True if parametric space is continuous in the "dim" direction.
// True if parametric space is continuous in the "dim" direction.
virtual
bool
continuous
(
int
dim
)
const
{
return
true
;}
virtual
bool
continuous
(
int
dim
)
const
{
return
true
;}
...
@@ -122,7 +122,7 @@ class GEntity {
...
@@ -122,7 +122,7 @@ class GEntity {
virtual
int
containsPoint
(
const
SPoint3
&
pt
)
const
{
throw
;}
virtual
int
containsPoint
(
const
SPoint3
&
pt
)
const
{
throw
;}
// Get the native pointer of the particular representation
// Get the native pointer of the particular representation
virtual
void
*
getNativePtr
()
const
=
0
;
virtual
void
*
getNativePtr
()
const
{
throw
;}
// The model owning this entity.
// The model owning this entity.
GModel
*
model
()
const
{
return
_model
;}
GModel
*
model
()
const
{
return
_model
;}
...
@@ -178,16 +178,7 @@ class GEntity {
...
@@ -178,16 +178,7 @@ class GEntity {
virtual
std
::
string
getAdditionalInfoString
()
{
return
std
::
string
(
""
);
}
virtual
std
::
string
getAdditionalInfoString
()
{
return
std
::
string
(
""
);
}
};
};
// A minimal, non-abstract entity that can be used for sorting
class
GEntityLessThan
{
class
dummyEntity
:
public
GEntity
{
public:
dummyEntity
(
GModel
*
model
,
int
tag
)
:
GEntity
(
model
,
tag
){}
virtual
int
dim
()
const
{
return
-
1
;}
virtual
GeomType
geomType
()
const
{
return
Unknown
;}
virtual
void
*
getNativePtr
()
const
{
return
0
;}
};
class
EntityLessThan
{
public:
public:
bool
operator
()(
const
GEntity
*
ent1
,
const
GEntity
*
ent2
)
const
bool
operator
()(
const
GEntity
*
ent1
,
const
GEntity
*
ent2
)
const
{
{
...
...
This diff is collapsed.
Click to expand it.
Geo/GModel.cpp
+
16
−
42
View file @
f8211313
#include
"GModel.h"
#include
"GModel.h"
int
GModel
::
numRegion
()
const
{
return
regions
.
size
();
}
int
GModel
::
numFace
()
const
{
return
faces
.
size
();
}
int
GModel
::
numEdge
()
const
{
return
edges
.
size
();
}
int
GModel
::
numVertex
()
const
{
return
vertices
.
size
();
}
int
GModel
::
meshStatus
()
int
GModel
::
meshStatus
()
{
{
for
(
riter
it
=
firstRegion
();
it
!=
lastRegion
();
++
it
)
for
(
riter
it
=
firstRegion
();
it
!=
lastRegion
();
++
it
)
...
@@ -35,40 +15,40 @@ int GModel::meshStatus()
...
@@ -35,40 +15,40 @@ int GModel::meshStatus()
GRegion
*
GModel
::
regionByTag
(
int
n
)
const
GRegion
*
GModel
::
regionByTag
(
int
n
)
const
{
{
dummy
Entity
tmp
((
GModel
*
)
this
,
n
);
G
Entity
tmp
((
GModel
*
)
this
,
n
);
riter
it
=
regions
.
find
((
GRegion
*
)
&
tmp
);
riter
it
=
regions
.
find
((
GRegion
*
)
&
tmp
);
if
(
it
!=
regions
.
end
())
if
(
it
!=
regions
.
end
())
return
(
GRegion
*
)
(
*
it
)
;
return
*
it
;
else
else
return
0
;
return
0
;
}
}
GFace
*
GModel
::
faceByTag
(
int
n
)
const
GFace
*
GModel
::
faceByTag
(
int
n
)
const
{
{
dummy
Entity
tmp
((
GModel
*
)
this
,
n
);
G
Entity
tmp
((
GModel
*
)
this
,
n
);
fiter
it
=
faces
.
find
((
GFace
*
)
&
tmp
);
fiter
it
=
faces
.
find
((
GFace
*
)
&
tmp
);
if
(
it
!=
faces
.
end
())
if
(
it
!=
faces
.
end
())
return
(
GFace
*
)
(
*
it
)
;
return
*
it
;
else
else
return
0
;
return
0
;
}
}
GEdge
*
GModel
::
edgeByTag
(
int
n
)
const
GEdge
*
GModel
::
edgeByTag
(
int
n
)
const
{
{
dummy
Entity
tmp
((
GModel
*
)
this
,
n
);
G
Entity
tmp
((
GModel
*
)
this
,
n
);
eiter
it
=
edges
.
find
((
GEdge
*
)
&
tmp
);
eiter
it
=
edges
.
find
((
GEdge
*
)
&
tmp
);
if
(
it
!=
edges
.
end
())
if
(
it
!=
edges
.
end
())
return
(
GEdge
*
)
(
*
it
)
;
return
*
it
;
else
else
return
0
;
return
0
;
}
}
GVertex
*
GModel
::
vertexByTag
(
int
n
)
const
GVertex
*
GModel
::
vertexByTag
(
int
n
)
const
{
{
dummy
Entity
tmp
((
GModel
*
)
this
,
n
);
G
Entity
tmp
((
GModel
*
)
this
,
n
);
viter
it
=
vertices
.
find
((
GVertex
*
)
&
tmp
);
viter
it
=
vertices
.
find
((
GVertex
*
)
&
tmp
);
if
(
it
!=
vertices
.
end
())
if
(
it
!=
vertices
.
end
())
return
(
GVertex
*
)
(
*
it
)
;
return
*
it
;
else
else
return
0
;
return
0
;
}
}
...
@@ -93,20 +73,15 @@ int GModel::renumberMeshVertices()
...
@@ -93,20 +73,15 @@ int GModel::renumberMeshVertices()
bool
GModel
::
noPhysicals
()
bool
GModel
::
noPhysicals
()
{
{
bool
somePhysicals
=
false
;
for
(
viter
it
=
firstVertex
();
it
!=
lastVertex
();
++
it
)
for
(
viter
it
=
firstVertex
();
it
!=
lastVertex
();
++
it
)
if
((
*
it
)
->
physicals
.
size
()){
somePhysicals
=
true
;
break
;
}
if
((
*
it
)
->
physicals
.
size
())
return
false
;
if
(
!
somePhysicals
)
for
(
eiter
it
=
firstEdge
();
it
!=
lastEdge
();
++
it
)
for
(
eiter
it
=
firstEdge
();
it
!=
lastEdge
();
++
it
)
if
((
*
it
)
->
physicals
.
size
())
return
false
;
if
((
*
it
)
->
physicals
.
size
()){
somePhysicals
=
true
;
break
;
}
for
(
fiter
it
=
firstFace
();
it
!=
lastFace
();
++
it
)
if
(
!
somePhysicals
)
if
((
*
it
)
->
physicals
.
size
())
return
false
;
for
(
fiter
it
=
firstFace
();
it
!=
lastFace
();
++
it
)
for
(
riter
it
=
firstRegion
();
it
!=
lastRegion
();
++
it
)
if
((
*
it
)
->
physicals
.
size
()){
somePhysicals
=
true
;
break
;
}
if
((
*
it
)
->
physicals
.
size
())
return
false
;
if
(
!
somePhysicals
)
return
true
;
for
(
riter
it
=
firstRegion
();
it
!=
lastRegion
();
++
it
)
if
((
*
it
)
->
physicals
.
size
()){
somePhysicals
=
true
;
break
;
}
return
!
somePhysicals
;
}
}
static
void
addInGroup
(
GEntity
*
ge
,
std
::
map
<
int
,
std
::
vector
<
GEntity
*>
>
&
group
)
static
void
addInGroup
(
GEntity
*
ge
,
std
::
map
<
int
,
std
::
vector
<
GEntity
*>
>
&
group
)
...
@@ -146,4 +121,3 @@ SBoundingBox3d GModel::recomputeBounds()
...
@@ -146,4 +121,3 @@ SBoundingBox3d GModel::recomputeBounds()
boundingBox
=
bb
;
boundingBox
=
bb
;
return
bounds
();
return
bounds
();
}
}
This diff is collapsed.
Click to expand it.
Geo/GModel.h
+
12
−
12
View file @
f8211313
...
@@ -16,20 +16,20 @@ class GModel
...
@@ -16,20 +16,20 @@ class GModel
{
{
protected:
protected:
std
::
string
modelName
;
std
::
string
modelName
;
std
::
set
<
GRegion
*
,
EntityLessThan
>
regions
;
std
::
set
<
GRegion
*
,
G
EntityLessThan
>
regions
;
std
::
set
<
GFace
*
,
EntityLessThan
>
faces
;
std
::
set
<
GFace
*
,
G
EntityLessThan
>
faces
;
std
::
set
<
GEdge
*
,
EntityLessThan
>
edges
;
std
::
set
<
GEdge
*
,
G
EntityLessThan
>
edges
;
std
::
set
<
GVertex
*
,
EntityLessThan
>
vertices
;
std
::
set
<
GVertex
*
,
G
EntityLessThan
>
vertices
;
SBoundingBox3d
boundingBox
;
SBoundingBox3d
boundingBox
;
public:
public:
GModel
(
const
std
::
string
&
name
)
:
modelName
(
name
)
{}
GModel
(
const
std
::
string
&
name
)
:
modelName
(
name
)
{}
virtual
~
GModel
()
{}
virtual
~
GModel
()
{}
typedef
std
::
set
<
GRegion
*
,
EntityLessThan
>::
iterator
riter
;
typedef
std
::
set
<
GRegion
*
,
G
EntityLessThan
>::
iterator
riter
;
typedef
std
::
set
<
GFace
*
,
EntityLessThan
>::
iterator
fiter
;
typedef
std
::
set
<
GFace
*
,
G
EntityLessThan
>::
iterator
fiter
;
typedef
std
::
set
<
GEdge
*
,
EntityLessThan
>::
iterator
eiter
;
typedef
std
::
set
<
GEdge
*
,
G
EntityLessThan
>::
iterator
eiter
;
typedef
std
::
set
<
GVertex
*
,
EntityLessThan
>::
iterator
viter
;
typedef
std
::
set
<
GVertex
*
,
G
EntityLessThan
>::
iterator
viter
;
// Returns the geometric tolerance for the entire model.
// Returns the geometric tolerance for the entire model.
virtual
double
tolerance
()
const
{
return
1.e-14
;
}
virtual
double
tolerance
()
const
{
return
1.e-14
;
}
...
@@ -38,10 +38,10 @@ class GModel
...
@@ -38,10 +38,10 @@ class GModel
virtual
int
meshStatus
();
virtual
int
meshStatus
();
// Get the number of regions in this model.
// Get the number of regions in this model.
int
numRegion
()
const
;
int
numRegion
()
const
{
return
regions
.
size
();
}
int
numFace
()
const
;
int
numFace
()
const
{
return
faces
.
size
();
}
int
numEdge
()
const
;
int
numEdge
()
const
{
return
edges
.
size
();
}
int
numVertex
()
const
;
int
numVertex
()
const
{
return
vertices
.
size
();
}
// Get an iterator initialized to the first entity in this model.
// Get an iterator initialized to the first entity in this model.
riter
firstRegion
()
{
return
regions
.
begin
();
}
riter
firstRegion
()
{
return
regions
.
begin
();
}
...
...
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