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
1c09b508
Commit
1c09b508
authored
12 years ago
by
Bastien Gorissen
Browse files
Options
Downloads
Patches
Plain Diff
Improvement to P2 hex visualisation
parent
3e5f3120
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/MHexahedron.cpp
+53
-6
53 additions, 6 deletions
Geo/MHexahedron.cpp
Geo/MHexahedron.h
+8
-74
8 additions, 74 deletions
Geo/MHexahedron.h
with
61 additions
and
80 deletions
Geo/MHexahedron.cpp
+
53
−
6
View file @
1c09b508
...
...
@@ -125,9 +125,10 @@ void MHexahedron::getFaceInfo(const MFace &face, int &ithFace, int &sign, int &r
Msg
::
Error
(
"Could not get face information for hexahedron %d"
,
getNum
());
}
void
MHexahedronN
::
getEdgeRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
)
{
const
int
numSubEdges
=
CTX
::
instance
()
->
mesh
.
numSubEdges
;
static
void
_myGetEdgeRep
(
MHexahedron
*
hex
,
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
,
int
numSubEdges
)
{
//const int numSubEdges = CTX::instance()->mesh.numSubEdges;
static
double
pp
[
8
][
3
]
=
{
{
-
1
,
-
1
,
-
1
},{
1
,
-
1
,
-
1
},{
1
,
1
,
-
1
},{
-
1
,
1
,
-
1
},
{
-
1
,
-
1
,
1
},{
1
,
-
1
,
1
},{
1
,
1
,
1
},{
-
1
,
1
,
1
}
};
...
...
@@ -151,8 +152,8 @@ void MHexahedronN::getEdgeRep(int num, double *x, double *y, double *z, SVector3
double
w2
=
pp
[
iVertex1
][
2
]
*
(
1.
-
t2
)
+
pp
[
iVertex2
][
2
]
*
t2
;
SPoint3
pnt1
,
pnt2
;
pnt
(
u1
,
v1
,
w1
,
pnt1
);
pnt
(
u2
,
v2
,
w2
,
pnt2
);
hex
->
pnt
(
u1
,
v1
,
w1
,
pnt1
);
hex
->
pnt
(
u2
,
v2
,
w2
,
pnt2
);
x
[
0
]
=
pnt1
.
x
();
x
[
1
]
=
pnt2
.
x
();
y
[
0
]
=
pnt1
.
y
();
y
[
1
]
=
pnt2
.
y
();
z
[
0
]
=
pnt1
.
z
();
z
[
1
]
=
pnt2
.
z
();
...
...
@@ -162,6 +163,28 @@ void MHexahedronN::getEdgeRep(int num, double *x, double *y, double *z, SVector3
n
[
0
]
=
n
[
1
]
=
1
;
}
void
MHexahedron20
::
getEdgeRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
)
{
_myGetEdgeRep
(
this
,
num
,
x
,
y
,
z
,
n
,
CTX
::
instance
()
->
mesh
.
numSubEdges
);
}
void
MHexahedron27
::
getEdgeRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
)
{
_myGetEdgeRep
(
this
,
num
,
x
,
y
,
z
,
n
,
CTX
::
instance
()
->
mesh
.
numSubEdges
);
}
void
MHexahedronN
::
getEdgeRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
)
{
_myGetEdgeRep
(
this
,
num
,
x
,
y
,
z
,
n
,
CTX
::
instance
()
->
mesh
.
numSubEdges
);
}
int
MHexahedron20
::
getNumEdgesRep
()
{
return
12
*
CTX
::
instance
()
->
mesh
.
numSubEdges
;
}
int
MHexahedron27
::
getNumEdgesRep
()
{
return
12
*
CTX
::
instance
()
->
mesh
.
numSubEdges
;
}
int
MHexahedronN
::
getNumEdgesRep
()
{
return
12
*
CTX
::
instance
()
->
mesh
.
numSubEdges
;
...
...
@@ -245,7 +268,9 @@ const JacobianBasis* MHexahedron::getJacobianFuncSpace(int o) const
return
0
;
}
static
void
_myGetFaceRep
(
MHexahedron
*
hex
,
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
void
_myGetFaceRep
(
MHexahedron
*
hex
,
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
,
int
numSubEdges
)
{
static
double
pp
[
8
][
3
]
=
{
...
...
@@ -411,11 +436,33 @@ static void _myGetFaceRep(MHexahedron *hex, int num, double *x, double *y, doubl
n
[
2
]
=
n
[
0
];
}
void
MHexahedron20
::
getFaceRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
)
{
_myGetFaceRep
(
this
,
num
,
x
,
y
,
z
,
n
,
CTX
::
instance
()
->
mesh
.
numSubEdges
);
}
void
MHexahedron27
::
getFaceRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
)
{
_myGetFaceRep
(
this
,
num
,
x
,
y
,
z
,
n
,
CTX
::
instance
()
->
mesh
.
numSubEdges
);
}
void
MHexahedronN
::
getFaceRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
)
{
_myGetFaceRep
(
this
,
num
,
x
,
y
,
z
,
n
,
CTX
::
instance
()
->
mesh
.
numSubEdges
);
}
int
MHexahedron20
::
getNumFacesRep
()
{
return
6
*
(
CTX
::
instance
()
->
mesh
.
numSubEdges
*
CTX
::
instance
()
->
mesh
.
numSubEdges
*
2
);
}
int
MHexahedron27
::
getNumFacesRep
()
{
return
6
*
(
CTX
::
instance
()
->
mesh
.
numSubEdges
*
CTX
::
instance
()
->
mesh
.
numSubEdges
*
2
);
}
int
MHexahedronN
::
getNumFacesRep
()
{
return
6
*
(
CTX
::
instance
()
->
mesh
.
numSubEdges
*
CTX
::
instance
()
->
mesh
.
numSubEdges
*
2
);
...
...
This diff is collapsed.
Click to expand it.
Geo/MHexahedron.h
+
8
−
74
View file @
1c09b508
...
...
@@ -250,46 +250,16 @@ class MHexahedron20 : public MHexahedron {
return
getVertex
(
map
[
num
]);
}
virtual
int
getNumEdgeVertices
()
const
{
return
12
;
}
virtual
int
getNumEdgesRep
(){
return
24
;
}
virtual
void
getEdgeRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
)
{
static
const
int
e
[
24
][
2
]
=
{
{
0
,
8
},
{
8
,
1
},
{
0
,
9
},
{
9
,
3
},
{
0
,
10
},
{
10
,
4
},
{
1
,
11
},
{
11
,
2
},
{
1
,
12
},
{
12
,
5
},
{
2
,
13
},
{
13
,
3
},
{
2
,
14
},
{
14
,
6
},
{
3
,
15
},
{
15
,
7
},
{
4
,
16
},
{
16
,
5
},
{
4
,
17
},
{
17
,
7
},
{
5
,
18
},
{
18
,
6
},
{
6
,
19
},
{
19
,
7
}
};
static
const
int
f
[
12
]
=
{
0
,
0
,
1
,
0
,
1
,
0
,
3
,
2
,
1
,
2
,
3
,
4
};
_getEdgeRep
(
getVertex
(
e
[
num
][
0
]),
getVertex
(
e
[
num
][
1
]),
x
,
y
,
z
,
n
,
f
[
num
/
2
]);
}
virtual
int
getNumEdgesRep
();
virtual
void
getEdgeRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
);
virtual
void
getEdgeVertices
(
const
int
num
,
std
::
vector
<
MVertex
*>
&
v
)
const
{
v
.
resize
(
3
);
MHexahedron
::
_getEdgeVertices
(
num
,
v
);
v
[
2
]
=
_vs
[
num
];
}
virtual
int
getNumFacesRep
(){
return
36
;
}
virtual
void
getFaceRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
)
{
static
const
int
f
[
36
][
3
]
=
{
{
0
,
9
,
8
},
{
3
,
13
,
9
},
{
2
,
11
,
13
},
{
1
,
8
,
11
},
{
8
,
9
,
13
},
{
8
,
13
,
11
},
{
0
,
8
,
10
},
{
1
,
12
,
8
},
{
5
,
16
,
12
},
{
4
,
10
,
16
},
{
8
,
12
,
16
},
{
8
,
16
,
10
},
{
0
,
10
,
9
},
{
4
,
17
,
10
},
{
7
,
15
,
17
},
{
3
,
9
,
7
},
{
9
,
10
,
17
},
{
9
,
17
,
15
},
{
1
,
11
,
12
},
{
2
,
14
,
11
},
{
6
,
18
,
14
},
{
5
,
12
,
18
},
{
11
,
14
,
18
},
{
11
,
18
,
12
},
{
2
,
13
,
14
},
{
3
,
15
,
13
},
{
7
,
19
,
15
},
{
6
,
14
,
19
},
{
13
,
15
,
19
},
{
13
,
19
,
14
},
{
4
,
16
,
17
},
{
5
,
18
,
16
},
{
6
,
19
,
18
},
{
7
,
17
,
19
},
{
16
,
18
,
19
},
{
16
,
19
,
17
}
};
_getFaceRep
(
getVertex
(
f
[
num
][
0
]),
getVertex
(
f
[
num
][
1
]),
getVertex
(
f
[
num
][
2
]),
x
,
y
,
z
,
n
);
}
virtual
int
getNumFacesRep
();
virtual
void
getFaceRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
);
virtual
void
getFaceVertices
(
const
int
num
,
std
::
vector
<
MVertex
*>
&
v
)
const
{
v
.
resize
(
8
);
...
...
@@ -387,52 +357,16 @@ class MHexahedron27 : public MHexahedron {
virtual
int
getNumEdgeVertices
()
const
{
return
12
;
}
virtual
int
getNumFaceVertices
()
const
{
return
6
;
}
virtual
int
getNumVolumeVertices
()
const
{
return
1
;
}
virtual
int
getNumEdgesRep
(){
return
24
;
}
virtual
void
getEdgeRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
)
{
static
const
int
e
[
24
][
2
]
=
{
{
0
,
8
},
{
8
,
1
},
{
0
,
9
},
{
9
,
3
},
{
0
,
10
},
{
10
,
4
},
{
1
,
11
},
{
11
,
2
},
{
1
,
12
},
{
12
,
5
},
{
2
,
13
},
{
13
,
3
},
{
2
,
14
},
{
14
,
6
},
{
3
,
15
},
{
15
,
7
},
{
4
,
16
},
{
16
,
5
},
{
4
,
17
},
{
17
,
7
},
{
5
,
18
},
{
18
,
6
},
{
6
,
19
},
{
19
,
7
}
};
static
const
int
f
[
12
]
=
{
0
,
0
,
1
,
0
,
1
,
0
,
3
,
2
,
1
,
2
,
3
,
4
};
_getEdgeRep
(
getVertex
(
e
[
num
][
0
]),
getVertex
(
e
[
num
][
1
]),
x
,
y
,
z
,
n
,
f
[
num
/
2
]);
}
virtual
int
getNumEdgesRep
();
virtual
void
getEdgeRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
);
virtual
void
getEdgeVertices
(
const
int
num
,
std
::
vector
<
MVertex
*>
&
v
)
const
{
v
.
resize
(
3
);
MHexahedron
::
_getEdgeVertices
(
num
,
v
);
v
[
2
]
=
_vs
[
num
];
}
virtual
int
getNumFacesRep
(){
return
48
;
}
virtual
void
getFaceRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
)
{
static
const
int
f
[
48
][
3
]
=
{
{
0
,
9
,
20
},
{
0
,
20
,
8
},
{
3
,
13
,
20
},
{
3
,
20
,
9
},
{
2
,
11
,
20
},
{
2
,
20
,
13
},
{
1
,
8
,
20
},
{
1
,
20
,
11
},
{
0
,
8
,
21
},
{
0
,
21
,
10
},
{
1
,
12
,
21
},
{
1
,
21
,
8
},
{
5
,
16
,
21
},
{
5
,
21
,
12
},
{
4
,
10
,
21
},
{
4
,
21
,
16
},
{
0
,
10
,
22
},
{
0
,
22
,
9
},
{
4
,
17
,
22
},
{
4
,
22
,
10
},
{
7
,
15
,
22
},
{
7
,
22
,
17
},
{
3
,
9
,
22
},
{
3
,
22
,
15
},
{
1
,
11
,
23
},
{
1
,
23
,
12
},
{
2
,
14
,
23
},
{
2
,
23
,
11
},
{
6
,
18
,
23
},
{
6
,
23
,
14
},
{
5
,
12
,
23
},
{
5
,
23
,
18
},
{
2
,
13
,
24
},
{
2
,
24
,
14
},
{
3
,
15
,
24
},
{
3
,
24
,
13
},
{
7
,
19
,
24
},
{
7
,
24
,
15
},
{
6
,
14
,
24
},
{
6
,
24
,
19
},
{
4
,
16
,
25
},
{
4
,
25
,
17
},
{
5
,
18
,
25
},
{
5
,
25
,
16
},
{
6
,
19
,
25
},
{
6
,
25
,
18
},
{
7
,
17
,
25
},
{
7
,
25
,
19
}
};
_getFaceRep
(
getVertex
(
f
[
num
][
0
]),
getVertex
(
f
[
num
][
1
]),
getVertex
(
f
[
num
][
2
]),
x
,
y
,
z
,
n
);
}
virtual
int
getNumFacesRep
();
virtual
void
getFaceRep
(
int
num
,
double
*
x
,
double
*
y
,
double
*
z
,
SVector3
*
n
);
virtual
void
getFaceVertices
(
const
int
num
,
std
::
vector
<
MVertex
*>
&
v
)
const
{
v
.
resize
(
9
);
...
...
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