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
df526bc5
Commit
df526bc5
authored
14 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fix crash in octree for high-order model-based views
parent
375d5cd0
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Geo/GModel.cpp
+4
-5
4 additions, 5 deletions
Geo/GModel.cpp
Geo/MElementOctree.cpp
+3
-4
3 additions, 4 deletions
Geo/MElementOctree.cpp
Plugin/CutGrid.cpp
+1
-1
1 addition, 1 deletion
Plugin/CutGrid.cpp
Post/OctreePost.cpp
+3
-3
3 additions, 3 deletions
Post/OctreePost.cpp
with
11 additions
and
13 deletions
Geo/GModel.cpp
+
4
−
5
View file @
df526bc5
...
@@ -99,9 +99,8 @@ static int connected_bounds(std::set<MEdge, Less_Edge> &edges,
...
@@ -99,9 +99,8 @@ static int connected_bounds(std::set<MEdge, Less_Edge> &edges,
return
boundaries
.
size
();
return
boundaries
.
size
();
}
}
//--------------------------------------------------------------
static
int
connectedRegions
(
std
::
vector
<
MElement
*>
&
elements
,
static
int
connectedRegions
(
std
::
vector
<
MElement
*>
&
elements
,
std
::
vector
<
std
::
vector
<
MElement
*>
>
&
regions
)
std
::
vector
<
std
::
vector
<
MElement
*>
>
&
regions
)
{
{
std
::
multimap
<
MEdge
,
MElement
*
,
Less_Edge
>
e2e
;
std
::
multimap
<
MEdge
,
MElement
*
,
Less_Edge
>
e2e
;
for
(
unsigned
int
i
=
0
;
i
<
elements
.
size
();
++
i
){
for
(
unsigned
int
i
=
0
;
i
<
elements
.
size
();
++
i
){
...
@@ -122,11 +121,11 @@ static int connectedRegions (std::vector<MElement*> &elements,
...
@@ -122,11 +121,11 @@ static int connectedRegions (std::vector<MElement*> &elements,
return
regions
.
size
();
return
regions
.
size
();
}
}
//-----------------------------------------------------------------------------
GModel
::
GModel
(
std
::
string
name
)
GModel
::
GModel
(
std
::
string
name
)
:
_name
(
name
),
_visible
(
1
),
_octree
(
0
),
:
_name
(
name
),
_visible
(
1
),
_octree
(
0
),
_geo_internals
(
0
),
_occ_internals
(
0
),
_acis_internals
(
0
),
_fm_internals
(
0
),
_factory
(
0
),
_fields
(
0
),
_currentMeshEntity
(
0
),
normals
(
0
)
_geo_internals
(
0
),
_occ_internals
(
0
),
_acis_internals
(
0
),
_fm_internals
(
0
),
_factory
(
0
),
_fields
(
0
),
_currentMeshEntity
(
0
),
normals
(
0
)
{
{
partitionSize
[
0
]
=
0
;
partitionSize
[
1
]
=
0
;
partitionSize
[
0
]
=
0
;
partitionSize
[
1
]
=
0
;
list
.
push_back
(
this
);
list
.
push_back
(
this
);
...
...
This diff is collapsed.
Click to expand it.
Geo/MElementOctree.cpp
+
3
−
4
View file @
df526bc5
...
@@ -47,7 +47,7 @@ static int MElementInEle(void *a, double *x)
...
@@ -47,7 +47,7 @@ static int MElementInEle(void *a, double *x)
return
e
->
isInside
(
uvw
[
0
],
uvw
[
1
],
uvw
[
2
])
?
1
:
0
;
return
e
->
isInside
(
uvw
[
0
],
uvw
[
1
],
uvw
[
2
])
?
1
:
0
;
}
}
Octree
*
buildMElementOctree
(
GModel
*
m
)
Octree
*
buildMElementOctree
(
GModel
*
m
)
{
{
SBoundingBox3d
bb
=
m
->
bounds
();
SBoundingBox3d
bb
=
m
->
bounds
();
double
min
[
3
]
=
{
bb
.
min
().
x
(),
bb
.
min
().
y
(),
bb
.
min
().
z
()};
double
min
[
3
]
=
{
bb
.
min
().
x
(),
bb
.
min
().
y
(),
bb
.
min
().
z
()};
...
@@ -69,8 +69,8 @@ Octree *buildMElementOctree (GModel *m)
...
@@ -69,8 +69,8 @@ Octree *buildMElementOctree (GModel *m)
Octree
*
buildMElementOctree
(
std
::
vector
<
MElement
*>
&
v
)
Octree
*
buildMElementOctree
(
std
::
vector
<
MElement
*>
&
v
)
{
{
SBoundingBox3d
bb
;
SBoundingBox3d
bb
;
for
(
unsigned
int
i
=
0
;
i
<
v
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
v
.
size
();
i
++
){
for
(
int
j
=
0
;
j
<
v
[
i
]
->
getNumVertices
();
j
++
){
for
(
int
j
=
0
;
j
<
v
[
i
]
->
getNumVertices
();
j
++
){
bb
+=
SPoint3
(
v
[
i
]
->
getVertex
(
j
)
->
x
(),
bb
+=
SPoint3
(
v
[
i
]
->
getVertex
(
j
)
->
x
(),
v
[
i
]
->
getVertex
(
j
)
->
y
(),
v
[
i
]
->
getVertex
(
j
)
->
y
(),
v
[
i
]
->
getVertex
(
j
)
->
z
());
v
[
i
]
->
getVertex
(
j
)
->
z
());
...
@@ -88,4 +88,3 @@ Octree *buildMElementOctree(std::vector<MElement*> &v)
...
@@ -88,4 +88,3 @@ Octree *buildMElementOctree(std::vector<MElement*> &v)
Octree_Arrange
(
_octree
);
Octree_Arrange
(
_octree
);
return
_octree
;
return
_octree
;
}
}
This diff is collapsed.
Click to expand it.
Plugin/CutGrid.cpp
+
1
−
1
View file @
df526bc5
...
@@ -299,7 +299,7 @@ PView *GMSH_CutGridPlugin::GenerateView(PView *v1, int connect)
...
@@ -299,7 +299,7 @@ PView *GMSH_CutGridPlugin::GenerateView(PView *v1, int connect)
if
(
getNbU
()
<=
0
||
getNbV
()
<=
0
)
if
(
getNbU
()
<=
0
||
getNbV
()
<=
0
)
return
v1
;
return
v1
;
PViewData
*
data1
=
v1
->
getData
(
);
PViewData
*
data1
=
v1
->
getData
(
true
);
// get adaptive data if available
PView
*
v2
=
new
PView
();
PView
*
v2
=
new
PView
();
PViewDataList
*
data2
=
getDataList
(
v2
);
PViewDataList
*
data2
=
getDataList
(
v2
);
...
...
This diff is collapsed.
Click to expand it.
Post/OctreePost.cpp
+
3
−
3
View file @
df526bc5
...
@@ -227,7 +227,7 @@ OctreePost::OctreePost(PView *v)
...
@@ -227,7 +227,7 @@ OctreePost::OctreePost(PView *v)
PViewDataList
*
l
=
_theViewDataList
;
PViewDataList
*
l
=
_theViewDataList
;
if
(
l
->
haveInterpolationMatrices
()
&&
!
_theView
->
getData
()
->
isAdaptive
()){
if
(
l
->
haveInterpolationMatrices
()
&&
!
_theView
->
getData
()
->
isAdaptive
()){
Msg
::
Error
(
"Cannot create octree for non-adapted high-order view: you need"
);
Msg
::
Error
(
"Cannot create octree for non-adapted high-order
list-based
view: you need"
);
Msg
::
Error
(
"to select 'Adapt visualization grid' first"
);
Msg
::
Error
(
"to select 'Adapt visualization grid' first"
);
return
;
return
;
}
}
...
@@ -351,7 +351,7 @@ bool OctreePost::_getValue(void *in, int nbComp, double P[3], int timestep,
...
@@ -351,7 +351,7 @@ bool OctreePost::_getValue(void *in, int nbComp, double P[3], int timestep,
MElement
*
e
=
(
MElement
*
)
in
;
MElement
*
e
=
(
MElement
*
)
in
;
int
dataIndex
[
8
]
;
std
::
vector
<
int
>
dataIndex
(
e
->
getNumVertices
())
;
if
(
_theViewDataGModel
->
getType
()
==
PViewDataGModel
::
NodeData
)
if
(
_theViewDataGModel
->
getType
()
==
PViewDataGModel
::
NodeData
)
for
(
int
i
=
0
;
i
<
e
->
getNumVertices
();
i
++
)
for
(
int
i
=
0
;
i
<
e
->
getNumVertices
();
i
++
)
dataIndex
[
i
]
=
e
->
getVertex
(
i
)
->
getNum
();
dataIndex
[
i
]
=
e
->
getVertex
(
i
)
->
getNum
();
...
@@ -362,7 +362,7 @@ bool OctreePost::_getValue(void *in, int nbComp, double P[3], int timestep,
...
@@ -362,7 +362,7 @@ bool OctreePost::_getValue(void *in, int nbComp, double P[3], int timestep,
double
U
[
3
];
double
U
[
3
];
e
->
xyz2uvw
(
P
,
U
);
e
->
xyz2uvw
(
P
,
U
);
double
nodeval
[
8
*
9
]
;
std
::
vector
<
double
>
nodeval
(
e
->
getNumVertices
()
*
9
)
;
for
(
int
step
=
0
;
step
<
_theViewDataGModel
->
getNumTimeSteps
();
step
++
){
for
(
int
step
=
0
;
step
<
_theViewDataGModel
->
getNumTimeSteps
();
step
++
){
if
(
timestep
<
0
||
step
==
timestep
){
if
(
timestep
<
0
||
step
==
timestep
){
for
(
int
nod
=
0
;
nod
<
e
->
getNumVertices
();
nod
++
){
for
(
int
nod
=
0
;
nod
<
e
->
getNumVertices
();
nod
++
){
...
...
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