Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91658462
geometry_utils_inline_impl.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Nov 13, 04:32
Size
1 KB
Mime Type
text/x-c
Expires
Fri, Nov 15, 04:32 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22299681
Attached To
rAKA akantu
geometry_utils_inline_impl.cc
View Options
#include "geometry_utils.hh"
#ifndef __AKANTU_GEOMETRY_UTILS_INLINE_IMPL_CC__
#define __AKANTU_GEOMETRY_UTILS_INLINE_IMPL_CC__
namespace
akantu
{
/* -------------------------------------------------------------------------- */
inline
bool
GeometryUtils
::
isBoundaryElement
(
const
Mesh
&
mesh
,
const
Element
&
subelement
)
{
const
auto
&
element_to_subelement
=
mesh
.
getElementToSubelement
(
subelement
.
type
)(
subelement
.
element
);
// for regular boundary elements when surfaceselector is set to
// physical surfaces, the mesh contains only 1 element attached to a
// boundary subelement
if
(
element_to_subelement
.
size
()
==
1
and
element_to_subelement
[
0
].
kind
()
==
_ek_regular
)
{
return
true
;
}
// for cohesive interface elements when surfaceSelector is set
// either cohesive surface selector or all surface selector, in this
// case mesg passes is actually mesh_facet and for boundary or
// cohesive interface 2 elements are associated to a subelement
// we want only one regular element attached to the subelement
UInt
nb_elements_regular
=
0
;
UInt
nb_elements_cohesive
=
0
;
for
(
auto
elem
:
element_to_subelement
)
{
if
(
elem
==
ElementNull
)
continue
;
if
(
elem
.
kind
()
==
_ek_regular
)
++
nb_elements_regular
;
if
(
elem
.
kind
()
==
_ek_cohesive
)
++
nb_elements_cohesive
;
}
auto
nb_elements
=
element_to_subelement
.
size
();
if
(
nb_elements_regular
<
nb_elements
)
return
true
;
return
false
;
}
/* -------------------------------------------------------------------------- */
inline
bool
GeometryUtils
::
isValidProjection
(
const
Vector
<
Real
>
&
projection
,
Real
extension_tolerance
)
{
UInt
nb_xi_inside
=
0
;
for
(
auto
xi
:
projection
)
{
if
(
xi
>=
-
1.0
-
extension_tolerance
and
xi
<=
1.0
+
extension_tolerance
)
nb_xi_inside
++
;
}
if
(
nb_xi_inside
==
projection
.
size
())
return
true
;
return
false
;
}
}
//namespace akantu
#endif
Event Timeline
Log In to Comment