The Cell class defines the cells. More...
Public Member Functions | |
Cell () | |
Cell (long id, ElementType type, bool interior, bool storeNeighbourhood) | |
Cell (long id, ElementType type, bool interior=true, bool storeInterfaces=true, bool storeAjacencies=true) | |
Cell (long id, ElementType type, int connectSize, bool interior, bool storeNeighbourhood) | |
Cell (long id, ElementType type, int connectSize, bool interior=true, bool storeInterfaces=true, bool storeAjacencies=true) | |
Cell (long id, ElementType type, std::unique_ptr< long[]> &&connectStorage, bool interior, bool storeNeighbourhood) | |
Cell (long id, ElementType type, std::unique_ptr< long[]> &&connectStorage, bool interior=true, bool storeInterfaces=true, bool storeAjacencies=true) | |
void | deleteAdjacencies () |
void | deleteAdjacency (int face, int i) |
void | deleteInterface (int face, int i) |
void | deleteInterfaces () |
void | display (std::ostream &out, unsigned short int indent) const |
int | findAdjacency (int adjacency) |
int | findAdjacency (int face, int adjacency) |
int | findInterface (int face, int interface) |
int | findInterface (int interface) |
long * | getAdjacencies () |
const long * | getAdjacencies () const |
long * | getAdjacencies (int face) |
const long * | getAdjacencies (int face) const |
long | getAdjacency (int face, int index=0) const |
int | getAdjacencyCount () const |
int | getAdjacencyCount (int face) const |
unsigned int | getBinarySize () const |
long | getInterface (int face, int index=0) const |
int | getInterfaceCount () const |
int | getInterfaceCount (int face) const |
long * | getInterfaces () |
const long * | getInterfaces () const |
long * | getInterfaces (int face) |
const long * | getInterfaces (int face) const |
void | initialize (long id, ElementType type, bool interior, bool storeInterfaces=true, bool storeAjacencies=true) |
void | initialize (long id, ElementType type, bool interior, bool storeNeighbourhood) |
void | initialize (long id, ElementType type, int connectSize, bool interior, bool storeInterfaces=true, bool storeAjacencies=true) |
void | initialize (long id, ElementType type, int connectSize, bool interior, bool storeNeighbourhood) |
void | initialize (long id, ElementType type, std::unique_ptr< long[]> &&connectStorage, bool interior, bool storeInterfaces=true, bool storeAjacencies=true) |
void | initialize (long id, ElementType type, std::unique_ptr< long[]> &&connectStorage, bool interior, bool storeNeighbourhood) |
bool | isFaceBorder (int face) const |
bool | isInterior () const |
bool | pushAdjacency (int face, long adjacency) |
bool | pushInterface (int face, long interface) |
void | resetAdjacencies (bool storeAdjacencies=true) |
void | resetInterfaces (bool storeInterfaces=true) |
void | setAdjacencies (const std::vector< std::vector< long > > &adjacencies) |
void | setAdjacencies (FlatVector2D< long > &&adjacencies) |
void | setAdjacency (int face, int index, long adjacencies) |
void | setInterface (int face, int index, long interface) |
void | setInterfaces (const std::vector< std::vector< long > > &interfaces) |
void | setInterfaces (FlatVector2D< long > &&interfaces) |
void | swap (Cell &other) noexcept |
Public Member Functions inherited from bitpit::Element | |
Element () | |
Element (const Element &other) | |
Element (Element &&other)=default | |
Element (long id, ElementType type, int connectSize=0) | |
Element (long id, ElementType type, std::unique_ptr< long[]> &&connectStorage) | |
double | evalArea (const std::array< double, 3 > *coordinates) const |
std::array< double, 3 > | evalCentroid (const std::array< double, 3 > *coordinates) const |
double | evalLength (const std::array< double, 3 > *coordinates) const |
std::array< double, 3 > | evalNormal (const std::array< double, 3 > *coordinates, const std::array< double, 3 > &orientation={{0., 0., 1.}}, const std::array< double, 3 > &point={{0.5, 0.5, 0.5}}) const |
double | evalPointDistance (const std::array< double, 3 > &point, const std::array< double, 3 > *coordinates) const |
void | evalPointProjection (const std::array< double, 3 > &point, const std::array< double, 3 > *coordinates, std::array< double, 3 > *projection, double *distance) const |
double | evalSize (const std::array< double, 3 > *coordinates) const |
double | evalVolume (const std::array< double, 3 > *coordinates) const |
int | findVertex (long vertexId) const |
unsigned int | getBinarySize () const |
long * | getConnect () |
const long * | getConnect () const |
int | getConnectSize () const |
int | getDimension () const |
ConstProxyVector< long > | getEdgeConnect (int edge) const |
int | getEdgeCount () const |
ConstProxyVector< int > | getEdgeLocalConnect (int edge) const |
ConstProxyVector< int > | getEdgeLocalVertexIds (int edge) const |
ElementType | getEdgeType (int edge) const |
int | getEdgeVertexCount (int edge) const |
long | getEdgeVertexId (int edge, int vertex) const |
ConstProxyVector< long > | getEdgeVertexIds (int edge) const |
ConstProxyVector< long > | getFaceConnect (int face) const |
int | getFaceCount () const |
ConstProxyVector< int > | getFaceLocalConnect (int face) const |
ConstProxyVector< int > | getFaceLocalVertexIds (int face) const |
std::vector< long > | getFaceStream () const |
int | getFaceStreamPosition (int face) const |
int | getFaceStreamSize () const |
ElementType | getFaceType (int face) const |
int | getFaceVertexCount (int face) const |
long | getFaceVertexId (int face, int vertex) const |
ConstProxyVector< long > | getFaceVertexIds (int face) const |
long | getId () const |
const ReferenceElementInfo & | getInfo () const |
int | getPID () const |
ElementType | getType () const |
int | getVertexCount () const |
long | getVertexId (int vertex) const |
ConstProxyVector< long > | getVertexIds () const |
bool | hasInfo () const |
bool | hasSameConnect (const Element &other) const |
void | initialize (long id, ElementType type, int connectSize=0) |
void | initialize (long id, ElementType type, std::unique_ptr< long[]> &&connectStorage) |
bool | isThreeDimensional () const |
Element & | operator= (const Element &other) |
Element & | operator= (Element &&other)=default |
int | renumberVertices (const std::unordered_map< long, long > &map) |
void | setConnect (std::unique_ptr< long[]> &&connect) |
void | setId (long id) |
void | setPID (int pid) |
void | setType (ElementType type) |
void | swap (Element &other) noexcept |
void | unsetConnect () |
Protected Member Functions | |
void | setInterior (bool interior) |
Friends | |
OBinaryStream & | operator<<) (OBinaryStream &buf, const Cell &cell) |
IBinaryStream & | operator>>) (IBinaryStream &buf, Cell &cell) |
class | PatchKernel |
Additional Inherited Members | |
Static Public Member Functions inherited from bitpit::Element | |
static int | getDimension (ElementType type) |
static int | getFaceStreamPosition (const long *connectivity, int face) |
static ConstProxyVector< long > | getVertexIds (ElementType type, const long *connectivity) |
static bool | isThreeDimensional (ElementType type) |
static void | renumberFaceStream (const PiercedStorage< long, long > &map, std::vector< long > *faceStream) |
Static Public Attributes inherited from bitpit::Element | |
static BITPIT_PUBLIC_API const long | NULL_ID = std::numeric_limits<long>::min() |
bitpit::Cell::Cell | ( | long | id, |
ElementType | type, | ||
bool | interior, | ||
bool | storeNeighbourhood ) |
bitpit::Cell::Cell | ( | long | id, |
ElementType | type, | ||
int | connectSize, | ||
bool | interior, | ||
bool | storeNeighbourhood ) |
Creates a new cell.
id | is the id that will be assigned to the element |
type | is the type of the element |
connectSize | is the size of the connectivity, this is only used if the element is not associated to a reference element |
interior | defines if the cell is interior or ghost |
storeNeighbourhood | defines if the cell should store neighbourhood information |
bitpit::Cell::Cell | ( | long | id, |
ElementType | type, | ||
std::unique_ptr< long[]> && | connectStorage, | ||
bool | interior, | ||
bool | storeNeighbourhood ) |
Creates a new cell.
id | is the id that will be assigned to the element |
type | is the type of the element |
connectStorage | is the storage the contains or will contain the connectivity of the element |
interior | defines if the cell is interior or ghost |
storeNeighbourhood | defines if the cell should store neighbourhood information |
bitpit::Cell::Cell | ( | long | id, |
ElementType | type, | ||
bool | interior = true, | ||
bool | storeInterfaces = true, | ||
bool | storeAdjacencies = true ) |
Creates a new cell.
id | is the id that will be assigned to the element |
type | is the type of the element |
interior | defines if the cell is interior or ghost |
storeInterfaces | defines if the cell should initialize the storage for storing interface information |
storeAdjacencies | defines if the cell should initialize the storage for storing adjacency information |
bitpit::Cell::Cell | ( | long | id, |
ElementType | type, | ||
int | connectSize, | ||
bool | interior = true, | ||
bool | storeInterfaces = true, | ||
bool | storeAdjacencies = true ) |
Creates a new cell.
id | is the id that will be assigned to the element |
type | is the type of the element |
connectSize | is the size of the connectivity, this is only used if the element is not associated to a reference element |
interior | defines if the cell is interior or ghost |
storeInterfaces | defines if the cell should initialize the storage for storing interface information |
storeAdjacencies | defines if the cell should initialize the storage for storing adjacency information |
bitpit::Cell::Cell | ( | long | id, |
ElementType | type, | ||
std::unique_ptr< long[]> && | connectStorage, | ||
bool | interior = true, | ||
bool | storeInterfaces = true, | ||
bool | storeAdjacencies = true ) |
Creates a new cell.
id | is the id that will be assigned to the element |
type | is the type of the element |
connectStorage | is the storage the contains or will contain the connectivity of the element |
interior | defines if the cell is interior or ghost |
storeInterfaces | defines if the cell should initialize the storage for storing interface information |
storeAdjacencies | defines if the cell should initialize the storage for storing adjacency information |
void bitpit::Cell::deleteAdjacencies | ( | ) |
void bitpit::Cell::deleteAdjacency | ( | int | face, |
int | i ) |
void bitpit::Cell::deleteInterface | ( | int | face, |
int | i ) |
void bitpit::Cell::deleteInterfaces | ( | ) |
void bitpit::Cell::display | ( | std::ostream & | out, |
unsigned short int | indent ) const |
int bitpit::Cell::findAdjacency | ( | int | adjacency | ) |
Find the specified adjacency among all the adjacencies of the cell.
The function returns the first position in the adjacency cell list of the specified adjacency. If the cell doesn't contain the specified adjacency the function returns a dummy position equal to -1.
adjacency | is the adjacency to look for |
int bitpit::Cell::findAdjacency | ( | int | face, |
int | adjacency ) |
Find the specified adjacency among the adjacencies of the given face.
The function returns the position in the adjacency face list of the specified adjacency. If the face doesn't contain the specified adjacency the function returns a dummy position equal to -1.
face | is the face of the cell |
adjacency | is the adjacency to look for |
int bitpit::Cell::findInterface | ( | int | face, |
int | interface ) |
Find the specified interface among the interfaces of the given face.
The function returns the position in the interface face list of the specified interface. If the face doesn't contain the specified interface the function returns a dummy position equal to -1.
face | is the face of the cell |
interface | is the interface to look for |
int bitpit::Cell::findInterface | ( | int | interface | ) |
Find the specified interface among all the interfaces of the cell.
The function returns the first position in the interface cell list of the specified interface. If the cell doesn't contain the specified interface the function returns a dummy position equal to -1.
interface | is the interface to look for |
long * bitpit::Cell::getAdjacencies | ( | ) |
const long * bitpit::Cell::getAdjacencies | ( | ) | const |
long * bitpit::Cell::getAdjacencies | ( | int | face | ) |
const long * bitpit::Cell::getAdjacencies | ( | int | face | ) | const |
long bitpit::Cell::getAdjacency | ( | int | face, |
int | index = 0 ) const |
int bitpit::Cell::getAdjacencyCount | ( | ) | const |
int bitpit::Cell::getAdjacencyCount | ( | int | face | ) | const |
Gets the number of adjacencies of the specified face of the cell.
The placeholder neighbour ids of the faces not acutally linked to a real neighbours will be counted as well.
face | the face of the cell |
unsigned int bitpit::Cell::getBinarySize | ( | ) | const |
long bitpit::Cell::getInterface | ( | int | face, |
int | index = 0 ) const |
int bitpit::Cell::getInterfaceCount | ( | ) | const |
int bitpit::Cell::getInterfaceCount | ( | int | face | ) | const |
Gets the number of interfaces of the specified face of the cell.
The placeholder interface ids of the faces not acutally linked to a real interfaces will be counted as well.
face | the face of the cell |
long * bitpit::Cell::getInterfaces | ( | ) |
const long * bitpit::Cell::getInterfaces | ( | ) | const |
long * bitpit::Cell::getInterfaces | ( | int | face | ) |
const long * bitpit::Cell::getInterfaces | ( | int | face | ) | const |
void bitpit::Cell::initialize | ( | long | id, |
ElementType | type, | ||
bool | interior, | ||
bool | storeInterfaces = true, | ||
bool | storeAdjacencies = true ) |
Initializes the data structures of the cell.
id | is the id of the element |
type | is the type of the element |
interior | if true the cell is flagged as interior |
storeInterfaces | defines if the cell should initialize the storage for storing interface information |
storeAdjacencies | defines if the cell should initialize the storage for storing adjacency information |
void bitpit::Cell::initialize | ( | long | id, |
ElementType | type, | ||
bool | interior, | ||
bool | storeNeighbourhood ) |
void bitpit::Cell::initialize | ( | long | id, |
ElementType | type, | ||
int | connectSize, | ||
bool | interior, | ||
bool | storeInterfaces = true, | ||
bool | storeAdjacencies = true ) |
Initializes the data structures of the cell.
id | is the id of the element |
type | is the type of the element |
connectSize | is the size of the connectivity, this is only used if the element is not associated to a reference element |
interior | if true the cell is flagged as interior |
storeInterfaces | defines if the cell should initialize the storage for storing interface information |
storeAdjacencies | defines if the cell should initialize the storage for storing adjacency information |
void bitpit::Cell::initialize | ( | long | id, |
ElementType | type, | ||
int | connectSize, | ||
bool | interior, | ||
bool | storeNeighbourhood ) |
Initializes the data structures of the cell.
id | is the id of the element |
type | is the type of the element |
connectSize | is the size of the connectivity, this is only used if the element is not associated to a reference element |
interior | if true the cell is flagged as interior |
storeNeighbourhood | defines if the structures to store adjacencies and interfaces will be initialized |
void bitpit::Cell::initialize | ( | long | id, |
ElementType | type, | ||
std::unique_ptr< long[]> && | connectStorage, | ||
bool | interior, | ||
bool | storeInterfaces = true, | ||
bool | storeAdjacencies = true ) |
Initializes the data structures of the cell.
id | is the id of the element |
type | is the type of the element |
connectStorage | is the storage the contains or will contain the connectivity of the element |
interior | if true the cell is flagged as interior |
storeInterfaces | defines if the cell should initialize the storage for storing interface information |
storeAdjacencies | defines if the cell should initialize the storage for storing adjacency information |
void bitpit::Cell::initialize | ( | long | id, |
ElementType | type, | ||
std::unique_ptr< long[]> && | connectStorage, | ||
bool | interior, | ||
bool | storeNeighbourhood ) |
Initializes the data structures of the cell.
id | is the id of the element |
type | is the type of the element |
connectStorage | is the storage the contains or will contain the connectivity of the element |
interior | if true the cell is flagged as interior |
storeNeighbourhood | defines if the cell should store neighbourhood information |
bool bitpit::Cell::isFaceBorder | ( | int | face | ) | const |
bool bitpit::Cell::isInterior | ( | ) | const |
bool bitpit::Cell::pushAdjacency | ( | int | face, |
long | adjacency ) |
Add an adjacency to the given face of the cell.
Before adding the adjacency a check is performed to avoid adding duplicate adjacencies. The adjacency will not be added if the face already contains it.
face | is the face of the cell |
adjacency | is the index of the adjacency that will be added |
bool bitpit::Cell::pushInterface | ( | int | face, |
long | interface ) |
Add an interface to the given face of the cell.
Before adding the interface a check is performed to avoid adding duplicate adjacencies. The interface will not be added if the face already contains it.
face | is the face of the cell |
interface | is the index of the interface that will be added |
void bitpit::Cell::resetAdjacencies | ( | bool | storeAdjacencies = true | ) |
Resets the adjacencies of the cell.
If the adjacencies are stored, there will always be at least one adjacency entry for each face. If a face is not linked with a neighbour, its entry needs to be set to the placeholder value NULL_ID. When multiple neighbours are linked to a face, all entries must point to valid cells.
The adjacency data structure can be prepared to store the neighbours only if the cell type is known.
storeAdjacencies | if true the adjacency data structure will prepared to store the neighbours, otherwise the data structure will be cleared and it will not be possible to store neighbours. |
void bitpit::Cell::resetInterfaces | ( | bool | storeInterfaces = true | ) |
Resets the interfaces of the cell.
If the interfaces are stored, there will always be at least one interface entry for each face. If a face is not linked with an interface, its entry needs to be set to the placeholder value NULL_ID. When multiple interfaces are linked to a face, all entries must point to valid interfaces.
The interface data structure can be prepared to store the interfaces only if the cell type is known.
storeInterfaces | if true the interface data structure will prepared to store the interfaces, otherwise the data structure will be cleared and it will not be possible to store interfaces. |
void bitpit::Cell::setAdjacencies | ( | const std::vector< std::vector< long > > & | adjacencies | ) |
void bitpit::Cell::setAdjacencies | ( | FlatVector2D< long > && | adjacencies | ) |
void bitpit::Cell::setAdjacency | ( | int | face, |
int | index, | ||
long | adjacency ) |
void bitpit::Cell::setInterface | ( | int | face, |
int | index, | ||
long | interface ) |
void bitpit::Cell::setInterfaces | ( | const std::vector< std::vector< long > > & | interfaces | ) |
void bitpit::Cell::setInterfaces | ( | FlatVector2D< long > && | interfaces | ) |
|
protected |
|
noexcept |
|
friend |