Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kirill Terekhov
INMOST
Commits
ca446f32
Commit
ca446f32
authored
Aug 12, 2016
by
Kirill Terekhov
Browse files
Always use volume calculation algorithm for non-oriented non-convex cells.
parent
fb24de0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/Mesh/geometry.cpp
View file @
ca446f32
...
...
@@ -761,8 +761,8 @@ namespace INMOST
//can copy orientation-independent algorithm from
//incident_matrix.hpp: incident_matrix::compute_measure
//assume mdim is of size 3 at most
bool
repeatme
=
false
;
dynarray
<
Storage
::
real
,
3
>
fcnt
(
mdim
),
fnrm
(
mdim
),
ccnt
(
mdim
);
/*
me->Centroid(ccnt.data());
for(ElementArray<Face>::size_type i = 0; i < faces.size(); i++)
{
...
...
@@ -773,8 +773,9 @@ namespace INMOST
*ret += vec_dot_product(fcnt.data(),fnrm.data(),mdim);
}
if( *ret < 0.0 ) //a robust algorithm that can handle unoriented cell
*/
{
real
was
=
*
ret
/
3.0
;
//
real was = *ret/3.0;
*
ret
=
0
;
Face
cur
=
faces
[
0
];
Cell
c1
=
me
;
...
...
@@ -866,16 +867,15 @@ namespace INMOST
}
while
(
true
);
faces
.
RemPrivateMarker
(
mrk
);
mesh
->
ReleasePrivateMarker
(
mrk
);
Storage
::
real
nrm
[
3
],
cnt
[
3
],
ccnt
[
3
];
c1
->
Centroid
(
ccnt
);
c1
->
Centroid
(
ccnt
.
data
());
for
(
unsigned
j
=
0
;
j
<
faces
.
size
();
j
++
)
{
//compute normal to face
faces
[
j
].
Centroid
(
cnt
);
faces
[
j
].
Normal
(
nrm
);
for
(
int
r
=
0
;
r
<
3
;
++
r
)
cnt
[
r
]
=
cnt
[
r
]
-
ccnt
[
r
];
*
ret
+=
(
faces
[
j
]
->
GetPrivateMarker
(
rev
)
?
-
1.0
:
1.0
)
*
vec_dot_product
(
cnt
,
nrm
,
3
);
faces
[
j
].
Centroid
(
f
cnt
.
data
()
);
faces
[
j
].
Normal
(
f
nrm
.
data
()
);
for
(
int
r
=
0
;
r
<
mdim
;
++
r
)
f
cnt
[
r
]
=
f
cnt
[
r
]
-
ccnt
[
r
];
*
ret
+=
(
faces
[
j
]
->
GetPrivateMarker
(
rev
)
?
-
1.0
:
1.0
)
*
vec_dot_product
(
f
cnt
.
data
(),
fnrm
.
data
()
,
3
);
}
*
ret
=
fabs
(
*
ret
);
faces
.
RemPrivateMarker
(
rev
);
...
...
Write
Preview
Markdown
is supported
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