13#include <Eigen/Geometry>
26inline std::vector<Node*>
getBaseNodes(std::vector<Element*>
const& elements)
28 std::vector<Node*> base_nodes;
29 base_nodes.reserve(elements.size() * 2);
31 for (
auto*
const e : elements)
33 std::copy(e->getNodes(), e->getNodes() + e->getNumberOfBaseNodes(),
34 std::back_inserter(base_nodes));
39 base_nodes.shrink_to_fit();
47 Eigen::Vector3d surface_element_normal;
52 surface_element_normal =
57 auto const bulk_element_normal =
61 Eigen::Vector3d
const edge_vector = v1 - v0;
62 surface_element_normal = -bulk_element_normal.cross(edge_vector);
84 surface_element_normal = a + b - 2 * x;
88 surface_element_normal.normalize();
93 surface_element_normal *= -1;
95 return surface_element_normal;
Definition of the Element class.
Definition of the Node class.
Eigen::Vector3d const & asEigenVector3d() const
virtual CellType getCellType() const =0
virtual const Node * getNode(unsigned idx) const =0
virtual constexpr unsigned getDimension() const =0
Get dimension of the mesh element.
static Eigen::Vector3d getSurfaceNormal(Element const &e)
Returns the surface normal of a 2D element.
void makeVectorUnique(std::vector< T > &v)
std::vector< Node * > getBaseNodes(std::vector< Element * > const &elements)
bool idsComparator(T const a, T const b)
Eigen::Vector3d calculateNormalizedSurfaceNormal(MeshLib::Element const &surface_element, MeshLib::Element const &bulk_element)