Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F88533746
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
Sat, Oct 19, 08:48
Size
1 KB
Mime Type
text/x-c
Expires
Mon, Oct 21, 08:48 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
21757788
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 & element) {
const auto & element_to_subelement =
mesh.getElementToSubelement(element.type)(element.element);
// for regular boundary elements
if (element_to_subelement.size() == 1 and
element_to_subelement[0].kind() == _ek_regular) {
return true;
}
// for cohesive boundary elements
UInt nb_subelements_regular = 0;
for (auto subelem : element_to_subelement) {
if (subelem == ElementNull)
continue;
if (subelem.kind() == _ek_regular)
++nb_subelements_regular;
}
auto nb_subelements = element_to_subelement.size();
if (nb_subelements_regular < nb_subelements)
return true;
return false;
}
/* -------------------------------------------------------------------------- */
inline bool GeometryUtils::isValidProjection(const Vector<Real> & projection) {
UInt nb_xi_inside = 0;
Real tolerance = 1e-3;
for (auto xi : projection) {
if (xi >= -1.0 - tolerance and xi <= 1.0 + tolerance)
nb_xi_inside++;
}
if (nb_xi_inside == projection.size())
return true;
return false;
}
} //namespace akantu
#endif
Event Timeline
Log In to Comment