Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
HexEx
libHexEx
Commits
3f76bc7e
Commit
3f76bc7e
authored
Jan 27, 2021
by
Max Lyon
Browse files
add method to compute parmametric volume
parent
e4e610a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/HexExtractor.cc
View file @
3f76bc7e
...
...
@@ -2866,6 +2866,7 @@ void HexExtractor::sanitizeParametrization(bool snapBoundary, bool extremeTrunca
computeCellTypes
();
HEXEX_DEBUG_ONLY
(
std
::
cout
<<
"Total parametric volume is "
<<
getTotalParametricVolume
()
<<
std
::
endl
;)
}
bool
HexExtractor
::
isInCell
(
CellHandle
ch
,
Parameter
param
)
...
...
@@ -3173,6 +3174,24 @@ std::vector<Parameter> HexExtractor::getParameters(HalfFaceHandle hfh, HalfEdgeH
return
getParameters
(
inputMesh
.
incident_cell
(
hfh
),
vertices
);
}
double
HexExtractor
::
getParametricVolume
(
CellHandle
ch
)
{
auto
params
=
getParameters
(
ch
);
auto
d1
=
params
[
1
]
-
params
[
0
];
auto
d2
=
params
[
2
]
-
params
[
0
];
auto
d3
=
params
[
3
]
-
params
[
0
];
auto
volume
=
1.0
/
6.0
*
dot
(
cross
(
d1
,
d2
),
d3
);
return
volume
;
}
double
HexExtractor
::
getTotalParametricVolume
()
{
double
volume
=
0.0
;
for
(
auto
ch
:
inputMesh
.
cells
())
volume
+=
getParametricVolume
(
ch
);
return
volume
;
}
Position
HexExtractor
::
getPosition
(
Parameter
param
,
CellHandle
ch
)
{
auto
vertices
=
cellVertices
[
ch
];
...
...
@@ -4031,8 +4050,8 @@ void HexExtractor::calculateEdgeSingularity(EdgeHandle eh)
std
::
cout
<<
"accumulated tran fun "
<<
std
::
endl
<<
accTranFun
<<
std
::
endl
;
for
(
auto
vh
:
vertices
)
{
std
::
cout
<<
"face 1: "
<<
parameter
(
inputMesh
.
incident_cell
(
transitionFace
),
vh
)
<<
" Cell is "
<<
to
_s
tring
(
getCellType
(
inputMesh
.
incident_cell
(
transitionFace
)))
<<
std
::
endl
;
std
::
cout
<<
"face 2: "
<<
parameter
(
currentCell
,
vh
)
<<
" Cell is "
<<
to
_s
tring
(
getCellType
(
currentCell
))
<<
std
::
endl
;
std
::
cout
<<
"face 1: "
<<
parameter
(
inputMesh
.
incident_cell
(
transitionFace
),
vh
)
<<
" Cell is "
<<
to
S
tring
(
getCellType
(
inputMesh
.
incident_cell
(
transitionFace
)))
<<
std
::
endl
;
std
::
cout
<<
"face 2: "
<<
parameter
(
currentCell
,
vh
)
<<
" Cell is "
<<
to
S
tring
(
getCellType
(
currentCell
))
<<
std
::
endl
;
}
...
...
src/HexExtractor.hh
View file @
3f76bc7e
...
...
@@ -60,7 +60,7 @@ private:
Degenerate
};
std
::
string
to
_s
tring
(
CellType
type
)
std
::
string
to
S
tring
(
CellType
type
)
{
switch
(
type
)
{
...
...
@@ -629,6 +629,8 @@ private:
std
::
vector
<
Parameter
>
getParameters
(
CellHandle
ch
);
std
::
vector
<
Parameter
>
getParameters
(
HalfFaceHandle
hfh
);
std
::
vector
<
Parameter
>
getParameters
(
HalfFaceHandle
hfh
,
HalfEdgeHandle
heh
);
double
getParametricVolume
(
CellHandle
ch
);
double
getTotalParametricVolume
();
Position
getPosition
(
Parameter
param
,
CellHandle
ch
);
Parameter
getParameter
(
Position
pos
,
CellHandle
ch
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment