27#include "bitpit_common.hpp"
28#include "bitpit_operators.hpp"
31#include "interface.hpp"
50 _initialize(NULL_ID, -1, NULL_ID, -1);
62 _initialize(NULL_ID, -1, NULL_ID, -1);
74 :
Element(id, type, connectSize)
76 _initialize(NULL_ID, -1, NULL_ID, -1);
88 :
Element(id, type, std::move(connectStorage))
90 _initialize(NULL_ID, -1, NULL_ID, -1);
104 std::swap(other.m_owner, m_owner);
105 std::swap(other.m_ownerFace, m_ownerFace);
106 std::swap(other.m_neigh, m_neigh);
107 std::swap(other.m_neighFace, m_neighFace);
120 _initialize(NULL_ID, -1, NULL_ID, -1);
135 _initialize(NULL_ID, -1, NULL_ID, -1);
150 _initialize(NULL_ID, -1, NULL_ID, -1);
161void Interface::_initialize(
long owner,
long ownerFace,
long neigh,
long neighFace)
164 m_ownerFace = ownerFace;
167 m_neighFace = neighFace;
201 std::array<std::array<double, 3>, 3> R = {{{{0., 0., 0.}}, {{0., 0., 0.}}, {{0., 0., 0.}}}};
204 for (
int k = 0; k < 3; ++k) {
209 if (std::abs(std::abs(versor[2]) - 1.) > 1e-8) {
210 std::array<double, 3> z = {{0.0, 0.0, 1.0}};
213 std::array<double, 3> x = {{1.0, 0.0, 0.0}};
216 R[1] = R[1] /
norm2(R[1]);
220 R[2] = R[2] /
norm2(R[2]);
270 std::array<std::array<double, 3>, 3> R_transposed = {{{{0., 0., 0.}}, {{0., 0., 0.}}, {{0., 0., 0.}}}};
271 for (
int i = 0; i < 3; i++) {
272 for (
int j = 0; j < 3; j++) {
273 R_transposed[j][i] = R[i][j];
287 return (m_neigh < 0);
299 m_ownerFace = onwerFace;
307 m_owner = Element::NULL_ID;
340 m_neighFace = neighFace;
348 m_neigh = Element::NULL_ID;
380 return {{m_owner, m_neigh}};
392 std::string t_s = std::string(indent,
' ');
395 if (
getType() == ElementType::UNDEFINED) {
396 out << t_s <<
"interface type: (unknown)" << std::endl;
401 out << t_s <<
"interface type: " <<
getType() << std::endl;
402 out << t_s <<
"ID: " <<
getId() << std::endl;
403 out << t_s <<
"is border: ";
404 if (
getNeigh() >= 0) { out <<
"(false)"; }
405 else { out <<
"(true)"; }
411 out << t_s <<
"connectivity: [ ";
412 for (
int i = 0; i < nVertices - 1; ++i) {
413 out << cellVertexIds[i] <<
", ";
415 out << cellVertexIds[nVertices - 1] <<
" ]" << std::endl;
418 out << t_s <<
"onwer ID: " <<
getOwner() << std::endl;
419 out << t_s <<
"owner face: " <<
getOwnerFace() << std::endl;
423 out << t_s <<
"neighbour ID: " <<
getNeigh() << std::endl;
424 out << t_s <<
"neighbour face: " <<
getNeighFace() << std::endl;
The Element class provides an interface for defining elements.
ElementType getType() const
void swap(Element &other) noexcept
ConstProxyVector< long > getVertexIds() const
void initialize(long id, ElementType type, int connectSize=0)
int getVertexCount() const
The Interface class defines the interfaces among cells.
static std::array< std::array< double, 3 >, 3 > evalRotationInverse(const std::array< std::array< double, 3 >, 3 > &R)
void setOwner(long owner, int onwerFace)
void initialize(long id, ElementType type)
void setNeigh(long neigh, int neighFace)
std::array< long, 2 > getOwnerNeigh() const
static std::array< std::array< double, 3 >, 3 > evalRotationTranspose(const std::array< std::array< double, 3 >, 3 > &R)
static std::array< std::array< double, 3 >, 3 > evalRotationToCartesian(std::array< double, 3 > &versor)
void swap(Interface &other) noexcept
static std::array< std::array< double, 3 >, 3 > evalRotationFromCartesian(std::array< double, 3 > &versor)
void display(std::ostream &out, unsigned short int indent) const
Metafunction for generating a pierced vector.
Metafunction for generating a list of elements that can be either stored in an external vectror or,...
The QualifiedInterfaceHalfEdge class defines interface half-edges.
std::array< T, 3 > crossProduct(const std::array< T, 3 > &x, const std::array< T, 3 > &y)
double norm2(const std::array< T, d > &x)