Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
bitpit::SurfaceKernel Class Reference

The SurfaceKernel class provides an interface for defining surface patches. More...

Inheritance diagram for bitpit::SurfaceKernel:
Inheritance graph
[legend]
Collaboration diagram for bitpit::SurfaceKernel:
Collaboration graph
[legend]

Public Types

typedef double(SurfaceKernel::* eval_f_) (long, int &) const
 
- Public Types inherited from bitpit::PatchKernel
enum  AdaptionMode { ADAPTION_DISABLED = -1 , ADAPTION_AUTOMATIC , ADAPTION_MANUAL }
 
enum  AdaptionStatus { ADAPTION_CLEAN , ADAPTION_DIRTY , ADAPTION_PREPARED , ADAPTION_ALTERED }
 
enum  AdjacenciesBuildStrategy { ADJACENCIES_NONE = -1 , ADJACENCIES_AUTOMATIC }
 
typedef PiercedVector< Cell >::const_iterator CellConstIterator
 
typedef PiercedVector< Cell >::const_range CellConstRange
 
typedef PiercedVector< Cell >::iterator CellIterator
 
typedef PiercedVector< Cell >::range CellRange
 
typedef PiercedVector< Interface >::const_iterator InterfaceConstIterator
 
typedef PiercedVector< Interface >::const_range InterfaceConstRange
 
typedef PiercedVector< Interface >::iterator InterfaceIterator
 
typedef PiercedVector< Interface >::range InterfaceRange
 
enum  InterfacesBuildStrategy { INTERFACES_NONE = -1 , INTERFACES_AUTOMATIC }
 
enum  PartitioningMode { PARTITIONING_DISABLED = -1 , PARTITIONING_ENABLED }
 
enum  PartitioningStatus { PARTITIONING_CLEAN , PARTITIONING_PREPARED , PARTITIONING_ALTERED }
 
typedef PiercedVector< Vertex >::const_iterator VertexConstIterator
 
typedef PiercedVector< Vertex >::const_range VertexConstRange
 
typedef PiercedVector< Vertex >::iterator VertexIterator
 
typedef PiercedVector< Vertex >::range VertexRange
 
enum  WriteTarget { WRITE_TARGET_CELLS_ALL , WRITE_TARGET_CELLS_INTERNAL }
 

Public Member Functions

bool adjustCellOrientation ()
 
bool adjustCellOrientation (long id, bool invert=false)
 
bool areFacetEdgesOrdered (const Cell &facet) const
 
bool areFacetVerticesOrdered (const Cell &facet) const
 
std::vector< double > computeHistogram (eval_f_ funct_, std::vector< double > &bins, long &count, int n_intervals=8, unsigned short mask=SELECT_ALL) const
 
void displayQualityStats (std::ostream &, unsigned int padding=0) const
 
virtual double evalAngleAtVertex (long, int) const
 
virtual double evalAspectRatio (long, int &) const
 
void evalBarycentricCoordinates (long id, const std::array< double, 3 > &point, double *lambda) const
 
virtual double evalCellArea (long) const
 
double evalCellSize (long id) const override
 
virtual double evalEdgeLength (long, int) const
 
std::array< double, 3 > evalEdgeNormal (long, int) const
 
virtual void evalEdgeNormals (long id, int edge, double limit, std::array< double, 3 > *unlimitedNormal, std::array< double, 3 > *limitedNormal) const
 
virtual std::array< double, 3 > evalFacetNormal (long, const std::array< double, 3 > &orientation={{0., 0., 1.}}) const
 
std::array< double, 3 > evalLimitedVertexNormal (long, int, double) const
 
std::array< double, 3 > evalLimitedVertexNormal (long, int, std::size_t, const long *, double) const
 
virtual double evalMaxAngleAtVertex (long, int &) const
 
virtual double evalMaxEdgeLength (long, int &) const
 
virtual double evalMinAngleAtVertex (long, int &) const
 
virtual double evalMinEdgeLength (long, int &) const
 
std::array< double, 3 > evalVertexNormal (long, int) const
 
std::array< double, 3 > evalVertexNormal (long, int, std::size_t, const long *) const
 
virtual void evalVertexNormals (long id, int vertex, std::size_t nVertexNeighs, const long *vertexNeighs, double limit, std::array< double, 3 > *unlimitedNormal, std::array< double, 3 > *limitedNormal) const
 
void extractEnvelope (LineKernel &envelope) const
 
void flipCellOrientation (long id)
 
ConstProxyVector< long > getFacetOrderedEdgeIds (const Cell &facet) const
 
int getFacetOrderedLocalEdge (const Cell &facet, std::size_t n) const
 
int getFacetOrderedLocalVertex (const Cell &facet, std::size_t n) const
 
ConstProxyVector< long > getFacetOrderedVertexIds (const Cell &facet) const
 
int getLineCodimension () const override
 
int getPointCodimension () const override
 
int getSpaceDimension (void) const
 
int getSurfaceCodimension () const override
 
int getVolumeCodimension () const override
 
bool isCellOrientationConsistent () const
 
void setSpaceDimension (int dimension)
 
- Public Member Functions inherited from bitpit::PatchKernel
 PatchKernel (PatchKernel &&other)
 
virtual ~PatchKernel ()
 
std::vector< adaption::Infoadaption (bool trackAdaption=true, bool squeezeStorage=false)
 
std::vector< adaption::InfoadaptionAlter (bool trackAdaption=true, bool squeezeStorage=false)
 
void adaptionCleanup ()
 
std::vector< adaption::InfoadaptionPrepare (bool trackAdaption=true)
 
CellIterator addCell (Cell &&source, int owner, int haloLayer, long id=Element::NULL_ID)
 
CellIterator addCell (Cell &&source, int owner, long id=Element::NULL_ID)
 
CellIterator addCell (Cell &&source, long id=Element::NULL_ID)
 
CellIterator addCell (const Cell &source, int owner, int haloLayer, long id=Element::NULL_ID)
 
CellIterator addCell (const Cell &source, int owner, long id=Element::NULL_ID)
 
CellIterator addCell (const Cell &source, long id=Element::NULL_ID)
 
CellIterator addCell (ElementType type, const std::vector< long > &connectivity, int owner, int haloLayer, long id=Element::NULL_ID)
 
CellIterator addCell (ElementType type, const std::vector< long > &connectivity, int owner, long id=Element::NULL_ID)
 
CellIterator addCell (ElementType type, const std::vector< long > &connectivity, long id=Element::NULL_ID)
 
CellIterator addCell (ElementType type, int owner, int haloLayer, long id=Element::NULL_ID)
 
CellIterator addCell (ElementType type, int owner, long id=Element::NULL_ID)
 
CellIterator addCell (ElementType type, long id=Element::NULL_ID)
 
CellIterator addCell (ElementType type, std::unique_ptr< long[]> &&connectStorage, int owner, int haloLayer, long id=Element::NULL_ID)
 
CellIterator addCell (ElementType type, std::unique_ptr< long[]> &&connectStorage, int owner, long id=Element::NULL_ID)
 
CellIterator addCell (ElementType type, std::unique_ptr< long[]> &&connectStorage, long id=Element::NULL_ID)
 
InterfaceIterator addInterface (const Interface &source, long id=Element::NULL_ID)
 
InterfaceIterator addInterface (ElementType type, const std::vector< long > &connectivity, long id=Element::NULL_ID)
 
InterfaceIterator addInterface (ElementType type, long id=Element::NULL_ID)
 
InterfaceIterator addInterface (ElementType type, std::unique_ptr< long[]> &&connectStorage, long id=Element::NULL_ID)
 
InterfaceIterator addInterface (Interface &&source, long id=Element::NULL_ID)
 
VertexIterator addVertex (const std::array< double, 3 > &coords, long id=Vertex::NULL_ID)
 
VertexIterator addVertex (const Vertex &source, long id=Vertex::NULL_ID)
 
VertexIterator addVertex (Vertex &&source, long id=Vertex::NULL_ID)
 
bool areAdjacenciesDirty (bool global=false) const
 
bool areInterfacesDirty (bool global=false) const
 
bool arePartitioningInfoDirty (bool global=true) const
 
void buildAdjacencies ()
 
void buildInterfaces ()
 
CellIterator cellBegin ()
 
CellConstIterator cellConstBegin () const
 
CellConstIterator cellConstEnd () const
 
CellIterator cellEnd ()
 
virtual std::unique_ptr< PatchKernelclone () const =0
 
std::vector< long > collapseCoincidentVertices ()
 
void consecutiveRenumber (long offsetVertices, long offsetCells, long offsetInterfaces)
 
void consecutiveRenumberCells (long offset=0)
 
void consecutiveRenumberInterfaces (long offset=0)
 
void consecutiveRenumberVertices (long offset=0)
 
long countBorderCells () const
 
long countBorderFaces () const
 
long countBorderInterfaces () const
 
long countBorderVertices () const
 
long countDuplicateCells () const
 
long countFaces () const
 
long countFreeCells () const
 
long countFreeFaces () const
 
long countFreeInterfaces () const
 
long countFreeVertices () const
 
long countOrphanCells () const
 
long countOrphanInterfaces () const
 
long countOrphanVertices () const
 
bool deleteCell (long id)
 
template<typename IdStorage >
bool deleteCells (const IdStorage &ids)
 
bool deleteCoincidentVertices ()
 
bool deleteInterface (long id)
 
template<typename IdStorage >
bool deleteInterfaces (const IdStorage &ids)
 
bool deleteOrphanInterfaces ()
 
bool deleteOrphanVertices ()
 
void destroyAdjacencies ()
 
void destroyInterfaces ()
 
void displayCells (std::ostream &out, unsigned int padding=0) const
 
void displayInterfaces (std::ostream &out, unsigned int padding=0) const
 
void displayTopologyStats (std::ostream &out, unsigned int padding=0) const
 
void displayVertices (std::ostream &out, unsigned int padding=0) const
 
bool dump (std::ostream &stream)
 
bool dump (std::ostream &stream) const
 
bool empty (bool global=true) const
 
void enableCellBalancing (long id, bool enabled)
 
virtual void evalCellBoundingBox (long id, std::array< double, 3 > *minPoint, std::array< double, 3 > *maxPoint) const
 
virtual std::array< double, 3 > evalCellCentroid (long id) const
 
void evalElementBoundingBox (const Element &element, std::array< double, 3 > *minPoint, std::array< double, 3 > *maxPoint) const
 
std::array< double, 3 > evalElementCentroid (const Element &element) const
 
virtual void evalInterfaceBoundingBox (long id, std::array< double, 3 > *minPoint, std::array< double, 3 > *maxPoint) const
 
virtual std::array< double, 3 > evalInterfaceCentroid (long id) const
 
double evalPartitioningUnbalance () const
 
double evalPartitioningUnbalance (const std::unordered_map< long, double > &cellWeights) const
 
void findCellEdgeNeighs (long id, bool complete, std::vector< long > *neighs) const
 
std::vector< long > findCellEdgeNeighs (long id, bool complete=true) const
 
std::vector< long > findCellEdgeNeighs (long id, int edge) const
 
void findCellEdgeNeighs (long id, int edge, std::vector< long > *neighs) const
 
std::vector< long > findCellFaceNeighs (long id) const
 
std::vector< long > findCellFaceNeighs (long id, int face) const
 
void findCellFaceNeighs (long id, int face, std::vector< long > *neighs) const
 
void findCellFaceNeighs (long id, std::vector< long > *neighs) const
 
std::vector< long > findCellNeighs (long id) const
 
void findCellNeighs (long id, int codimension, bool complete, std::vector< long > *neighs) const
 
std::vector< long > findCellNeighs (long id, int codimension, bool complete=true) const
 
void findCellNeighs (long id, std::vector< long > *neighs) const
 
void findCellVertexNeighs (long id, bool complete, std::vector< long > *neighs) const
 
std::vector< long > findCellVertexNeighs (long id, bool complete=true) const
 
std::vector< long > findCellVertexNeighs (long id, int vertex) const
 
void findCellVertexNeighs (long id, int vertex, std::vector< long > *neighs) const
 
std::vector< long > findCellVertexOneRing (long id, int vertex) const
 
void findCellVertexOneRing (long id, int vertex, std::vector< long > *neighs) const
 
std::vector< long > findDuplicateCells () const
 
bool findFaceNeighCell (long cellId, long neighId, int *cellFace, int *cellAdjacencyId) const
 
std::vector< long > findOrphanCells () const
 
std::vector< long > findOrphanInterfaces () const
 
std::vector< long > findOrphanVertices ()
 
std::vector< long > findVertexOneRing (long vertexId) const
 
void findVertexOneRing (long vertexId, std::vector< long > *ring) const
 
void flushData (std::fstream &stream, const std::string &name, VTKFormat format) override
 
AdaptionMode getAdaptionMode () const
 
AdaptionStatus getAdaptionStatus (bool global=false) const
 
AdjacenciesBuildStrategy getAdjacenciesBuildStrategy () const
 
void getBoundingBox (bool global, std::array< double, 3 > &minPoint, std::array< double, 3 > &maxPoint) const
 
void getBoundingBox (std::array< double, 3 > &minPoint, std::array< double, 3 > &maxPoint) const
 
CellgetCell (long id)
 
const CellgetCell (long id) const
 
adaption::Marker getCellAdaptionMarker (long id)
 
CellConstIterator getCellConstIterator (long id) const
 
virtual long getCellCount () const
 
int getCellHaloLayer (long id) const
 
CellIterator getCellIterator (long id)
 
int getCellOwner (long id) const
 
int getCellRank (long id) const
 
PiercedVector< Cell > & getCells ()
 
const PiercedVector< Cell > & getCells () const
 
virtual ElementType getCellType (long id) const
 
ConstProxyVector< std::array< double BITPIT_COMMA 3 > > getCellVertexCoordinates (long id) const
 
void getCellVertexCoordinates (long id, std::array< double, 3 > *coordinates) const
 
void getCellVertexCoordinates (long id, std::unique_ptr< std::array< double, 3 >[]> *coordinates) const
 
const MPI_Comm & getCommunicator () const
 
int getDimension () const
 
int getDumpVersion () const
 
ConstProxyVector< std::array< double BITPIT_COMMA 3 > > getElementVertexCoordinates (const Element &element) const
 
void getElementVertexCoordinates (const Element &element, std::array< double, 3 > *coordinates) const
 
void getElementVertexCoordinates (const Element &element, std::unique_ptr< std::array< double, 3 >[]> *coordinates) const
 
CellgetFirstGhost ()
 
const CellgetFirstGhost () const
 
CellgetFirstGhostCell ()
 
const CellgetFirstGhostCell () const
 
VertexgetFirstGhostVertex ()
 
const VertexgetFirstGhostVertex () const
 
long getGhostCellCount () const
 
const std::unordered_map< int, std::vector< long > > & getGhostCellExchangeSources () const
 
const std::vector< long > & getGhostCellExchangeSources (int rank) const
 
const std::unordered_map< int, std::vector< long > > & getGhostCellExchangeTargets () const
 
const std::vector< long > & getGhostCellExchangeTargets (int rank) const
 
long getGhostCount () const
 
const std::unordered_map< int BITPIT_COMMA std::vector< long > > & getGhostExchangeSources () const
 
const std::vector< long > & getGhostExchangeSources (int rank) const
 
const std::unordered_map< int BITPIT_COMMA std::vector< long > > & getGhostExchangeTargets () const
 
const std::vector< long > & getGhostExchangeTargets (int rank) const
 
long getGhostVertexCount () const
 
const std::unordered_map< int, std::vector< long > > & getGhostVertexExchangeSources () const
 
const std::vector< long > & getGhostVertexExchangeSources (int rank) const
 
const std::unordered_map< int, std::vector< long > > & getGhostVertexExchangeTargets () const
 
const std::vector< long > & getGhostVertexExchangeTargets (int rank) const
 
std::size_t getHaloSize () const
 
int getId () const
 
InterfacegetInterface (long id)
 
const InterfacegetInterface (long id) const
 
InterfaceConstIterator getInterfaceConstIterator (long id) const
 
virtual long getInterfaceCount () const
 
InterfaceIterator getInterfaceIterator (long id)
 
PiercedVector< Interface > & getInterfaces ()
 
const PiercedVector< Interface > & getInterfaces () const
 
InterfacesBuildStrategy getInterfacesBuildStrategy () const
 
virtual ElementType getInterfaceType (long id) const
 
ConstProxyVector< std::array< double BITPIT_COMMA 3 > > getInterfaceVertexCoordinates (long id) const
 
void getInterfaceVertexCoordinates (long id, std::array< double, 3 > *coordinates) const
 
void getInterfaceVertexCoordinates (long id, std::unique_ptr< std::array< double, 3 >[]> *coordinates) const
 
long getInternalCellCount () const
 
std::set< int > getInternalCellPIDs ()
 
std::vector< long > getInternalCellsByPID (int pid)
 
long getInternalCount () const
 
long getInternalVertexCount () const
 
CellgetLastInternalCell ()
 
const CellgetLastInternalCell () const
 
VertexgetLastInternalVertex ()
 
const VertexgetLastInternalVertex () const
 
std::vector< int > getNeighbourRanks ()
 
int getOwner (bool allowDirty=false) const
 
PartitioningMode getPartitioningMode () const
 
PartitioningStatus getPartitioningStatus (bool global=false) const
 
int getProcessorCount () const
 
int getRank () const
 
double getTol () const
 
VertexgetVertex (long id)
 
const VertexgetVertex (long id) const
 
VertexConstIterator getVertexConstIterator (long id) const
 
const std::array< double, 3 > & getVertexCoords (long id) const
 
void getVertexCoords (std::size_t nVertices, const long *ids, std::array< double, 3 > *coordinates) const
 
void getVertexCoords (std::size_t nVertices, const long *ids, std::unique_ptr< std::array< double, 3 >[]> *coordinates) const
 
virtual long getVertexCount () const
 
VertexIterator getVertexIterator (long id)
 
int getVertexOwner (long id) const
 
int getVertexRank (long id) const
 
PiercedVector< Vertex > & getVertices ()
 
const PiercedVector< Vertex > & getVertices () const
 
VTKUnstructuredGridgetVTK ()
 
const VTKUnstructuredGridgetVTK () const
 
const CellConstRange getVTKCellWriteRange () const
 
WriteTarget getVTKWriteTarget () const
 
CellIterator ghostBegin ()
 
CellIterator ghostCell2InternalCell (long id)
 
CellIterator ghostCellBegin ()
 
CellConstIterator ghostCellConstBegin () const
 
CellConstIterator ghostCellConstEnd () const
 
CellIterator ghostCellEnd ()
 
CellConstIterator ghostConstBegin () const
 
CellConstIterator ghostConstEnd () const
 
CellIterator ghostEnd ()
 
VertexIterator ghostVertexBegin ()
 
VertexConstIterator ghostVertexConstBegin () const
 
VertexConstIterator ghostVertexConstEnd () const
 
VertexIterator ghostVertexEnd ()
 
void initializeAdjacencies (AdjacenciesBuildStrategy strategy=ADJACENCIES_AUTOMATIC)
 
void initializeInterfaces (InterfacesBuildStrategy strategy=INTERFACES_AUTOMATIC)
 
InterfaceIterator interfaceBegin ()
 
InterfaceConstIterator interfaceConstBegin () const
 
InterfaceConstIterator interfaceConstEnd () const
 
InterfaceIterator interfaceEnd ()
 
CellIterator internalBegin ()
 
CellIterator internalCell2GhostCell (long id, int owner, int haloLayer)
 
CellIterator internalCellBegin ()
 
CellConstIterator internalCellConstBegin () const
 
CellConstIterator internalCellConstEnd () const
 
CellIterator internalCellEnd ()
 
CellConstIterator internalConstBegin () const
 
CellConstIterator internalConstEnd () const
 
CellIterator internalEnd ()
 
VertexIterator internalVertexBegin ()
 
VertexConstIterator internalVertexConstBegin () const
 
VertexConstIterator internalVertexConstEnd () const
 
VertexIterator internalVertexEnd ()
 
bool isAdaptionSupported () const
 
bool isBoundingBoxDirty (bool global=false) const
 
bool isCellAutoIndexingEnabled () const
 
bool isDirty (bool global=false) const
 
bool isDistributed (bool allowDirty=false) const
 
bool isExpert () const
 
bool isInterfaceAutoIndexingEnabled () const
 
bool isInterfaceOrphan (long id) const
 
bool isPartitioned () const
 
bool isPartitioningSupported () const
 
bool isRankNeighbour (int rank)
 
bool isThreeDimensional () const
 
bool isTolCustomized () const
 
bool isVertexAutoIndexingEnabled () const
 
virtual long locatePoint (const std::array< double, 3 > &point) const =0
 
long locatePoint (double x, double y, double z) const
 
void markCellForCoarsening (long id)
 
void markCellForRefinement (long id)
 
PatchKerneloperator= (PatchKernel &&other)
 
std::vector< adaption::Infopartition (bool trackPartitioning, bool squeezeStorage=false)
 
std::vector< adaption::Infopartition (const std::unordered_map< long, double > &cellWeights, bool trackPartitioning, bool squeezeStorage=false)
 
std::vector< adaption::Infopartition (const std::unordered_map< long, int > &cellRanks, bool trackPartitioning, bool squeezeStorage=false)
 
std::vector< adaption::Infopartition (MPI_Comm communicator, bool trackPartitioning, bool squeezeStorage=false, std::size_t haloSize=1)
 
std::vector< adaption::Infopartition (MPI_Comm communicator, const std::unordered_map< long, double > &cellWeights, bool trackPartitioning, bool squeezeStorage=false, std::size_t haloSize=1)
 
std::vector< adaption::Infopartition (MPI_Comm communicator, const std::unordered_map< long, int > &cellRanks, bool trackPartitioning, bool squeezeStorage=false, std::size_t haloSize=1)
 
std::vector< adaption::InfopartitioningAlter (bool trackPartitioning=true, bool squeezeStorage=false)
 
void partitioningCleanup ()
 
std::vector< adaption::InfopartitioningPrepare (bool trackPartitioning)
 
std::vector< adaption::InfopartitioningPrepare (const std::unordered_map< long, double > &cellWeights, bool trackPartitioning)
 
std::vector< adaption::InfopartitioningPrepare (const std::unordered_map< long, int > &cellRanks, bool trackPartitioning)
 
std::vector< adaption::InfopartitioningPrepare (MPI_Comm communicator, bool trackPartitioning, std::size_t haloSize=1)
 
std::vector< adaption::InfopartitioningPrepare (MPI_Comm communicator, const std::unordered_map< long, double > &cellWeights, bool trackPartitioning, std::size_t haloSize=1)
 
std::vector< adaption::InfopartitioningPrepare (MPI_Comm communicator, const std::unordered_map< long, int > &cellRanks, bool trackPartitioning, std::size_t haloSize=1)
 
template<typename Function >
void processCellFaceNeighbours (long seedId, int nLayers, Function function) const
 
template<typename Selector , typename Function >
void processCellFaceNeighbours (long seedId, int nLayers, Selector isSelected, Function function) const
 
template<typename Function >
void processCellNeighbours (long seedId, int nLayers, Function function) const
 
template<typename Selector , typename Function >
void processCellNeighbours (long seedId, int nLayers, Selector isSelected, Function function) const
 
template<typename Function , typename SeedContainer >
void processCellsFaceNeighbours (const SeedContainer &seedIds, int nLayers, Function function) const
 
template<typename Selector , typename Function , typename SeedContainer >
void processCellsFaceNeighbours (const SeedContainer &seedIds, int nLayers, Selector isSelected, Function function) const
 
template<typename Function , typename SeedContainer >
void processCellsNeighbours (const SeedContainer &seedIds, int nLayers, Function function) const
 
template<typename Selector , typename Function , typename SeedContainer >
void processCellsNeighbours (const SeedContainer &seedIds, int nLayers, Selector isSelected, Function function) const
 
bool reserveCells (size_t nCells)
 
bool reserveInterfaces (size_t nInterfaces)
 
bool reserveVertices (size_t nVertices)
 
virtual void reset ()
 
void resetCellAdaptionMarker (long id)
 
virtual void resetCells ()
 
virtual void resetInterfaces ()
 
void resetTol ()
 
virtual void resetVertices ()
 
void restore (std::istream &stream, bool reregister=false)
 
virtual void rotate (const std::array< double, 3 > &n0, const std::array< double, 3 > &n1, double angle)
 
void rotate (double n0x, double n0y, double n0z, double n1x, double n1y, double n1z, double angle)
 
void scale (const std::array< double, 3 > &scaling)
 
virtual void scale (const std::array< double, 3 > &scaling, const std::array< double, 3 > &origin)
 
void scale (double scaling)
 
void scale (double scaling, const std::array< double, 3 > &origin)
 
void scale (double sx, double sy, double sz)
 
void scale (double sx, double sy, double sz, const std::array< double, 3 > &origin)
 
void setCellAutoIndexing (bool enabled)
 
virtual void setDimension (int dimension)
 
void setHaloSize (std::size_t haloSize)
 
void setId (int id)
 
void setInterfaceAutoIndexing (bool enabled)
 
virtual void settleAdaptionMarkers ()
 
void setTol (double tolerance)
 
void setVertexAutoIndexing (bool enabled)
 
void setVTKWriteTarget (WriteTarget targetCells)
 
virtual void simulateCellUpdate (const long id, adaption::Marker marker, std::vector< Cell > *virtualCells, PiercedVector< Vertex, long > *virtualVertices) const
 
bool sort ()
 
bool sortCells ()
 
bool sortInterfaces ()
 
bool sortVertices ()
 
bool squeeze ()
 
bool squeezeCells ()
 
bool squeezeInterfaces ()
 
bool squeezeVertices ()
 
virtual void translate (const std::array< double, 3 > &translation)
 
void translate (double sx, double sy, double sz)
 
std::vector< adaption::Infoupdate (bool trackAdaption=true, bool squeezeStorage=false)
 
void updateAdjacencies (bool forcedUpdated=false)
 
void updateBoundingBox (bool forcedUpdated=false)
 
void updateInterfaces (bool forcedUpdated=false)
 
VertexIterator vertexBegin ()
 
VertexConstIterator vertexConstBegin () const
 
VertexConstIterator vertexConstEnd () const
 
VertexIterator vertexEnd ()
 
void write (const std::string &name, VTKWriteMode mode, double time)
 
void write (const std::string &name, VTKWriteMode mode=VTKWriteMode::DEFAULT)
 
void write (VTKWriteMode mode, double time)
 
void write (VTKWriteMode mode=VTKWriteMode::DEFAULT)
 
- Public Member Functions inherited from bitpit::VTKBaseStreamer
virtual void absorbData (std::fstream &, const std::string &, VTKFormat, uint64_t, uint8_t, VTKDataType)
 
template<typename T >
void flushValue (std::fstream &, VTKFormat, const T &value) const
 
template<typename T >
void flushValue (std::fstream &, VTKFormat, const T *values, int nValues) const
 

Static Public Attributes

static BITPIT_PUBLIC_API const unsigned short SELECT_ALL = 3
 
static BITPIT_PUBLIC_API const unsigned short SELECT_QUAD = 2
 
static BITPIT_PUBLIC_API const unsigned short SELECT_TRIANGLE = 1
 

Protected Member Functions

 SurfaceKernel (int dimension, MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode, PartitioningMode partitioningMode)
 
 SurfaceKernel (int id, int dimension, MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode, PartitioningMode partitioningMode)
 
 SurfaceKernel (MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode, PartitioningMode partitioningMode)
 
- Protected Member Functions inherited from bitpit::PatchKernel
 PatchKernel (const PatchKernel &other)
 
 PatchKernel (int dimension, MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode, PartitioningMode partitioningMode)
 
 PatchKernel (int id, int dimension, MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode, PartitioningMode partitioningMode)
 
 PatchKernel (MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode, PartitioningMode partitioningMode)
 
virtual std::vector< adaption::Info_adaptionAlter (bool trackAdaption)
 
virtual void _adaptionCleanup ()
 
virtual std::vector< adaption::Info_adaptionPrepare (bool trackAdaption)
 
virtual void _dump (std::ostream &stream) const =0
 
virtual bool _enableCellBalancing (long id, bool enabled)
 
virtual void _findCellEdgeNeighs (long id, int edge, const std::vector< long > *blackList, std::vector< long > *neighs) const
 
virtual void _findCellFaceNeighs (long id, int face, const std::vector< long > *blackList, std::vector< long > *neighs) const
 
virtual void _findCellNeighs (long id, const std::vector< long > *blackList, std::vector< long > *neighs) const
 
virtual void _findCellVertexNeighs (long id, int vertex, const std::vector< long > *blackList, std::vector< long > *neighs) const
 
virtual std::vector< long > _findGhostCellExchangeSources (int rank)
 
virtual adaption::Marker _getCellAdaptionMarker (long id)
 
virtual long _getCellNativeIndex (long id) const
 
virtual int _getDumpVersion () const =0
 
virtual std::size_t _getMaxHaloSize ()
 
virtual bool _markCellForCoarsening (long id)
 
virtual bool _markCellForRefinement (long id)
 
virtual std::vector< adaption::Info_partitioningAlter (bool trackPartitioning)
 
virtual void _partitioningCleanup ()
 
virtual std::vector< adaption::Info_partitioningPrepare (const std::unordered_map< long, double > &cellWeights, double defaultWeight, bool trackPartitioning)
 
virtual std::vector< adaption::Info_partitioningPrepare (const std::unordered_map< long, int > &cellRanks, bool trackPartitioning)
 
virtual void _resetAdjacencies (bool release)
 
virtual bool _resetCellAdaptionMarker (long id)
 
virtual void _resetInterfaces (bool release)
 
virtual void _resetTol ()
 
virtual void _restore (std::istream &stream)=0
 
virtual void _setHaloSize (std::size_t haloSize)
 
virtual void _setTol (double tolerance)
 
virtual void _updateAdjacencies ()
 
virtual void _updateInterfaces ()
 
virtual void _writeFinalize ()
 
virtual void _writePrepare ()
 
void addPointToBoundingBox (const std::array< double, 3 > &point)
 
std::unordered_map< long, std::vector< long > > binGroupVertices (const PiercedVector< Vertex > &vertices, int nBins)
 
std::unordered_map< long, std::vector< long > > binGroupVertices (int nBins)
 
void clearBoundingBox ()
 
template<typename item_t , typename id_t = long>
std::unordered_map< id_t, id_t > consecutiveItemRenumbering (PiercedVector< item_t, id_t > &container, long offset)
 
bool deleteVertex (long id)
 
template<typename IdStorage >
bool deleteVertices (const IdStorage &ids)
 
void dumpCells (std::ostream &stream) const
 
void dumpInterfaces (std::ostream &stream) const
 
void dumpVertices (std::ostream &stream) const
 
void extractEnvelope (PatchKernel &envelope) const
 
virtual int findAdjoinNeighFace (const Cell &cell, int cellFace, const Cell &neigh) const
 
AlterationFlags getCellAlterationFlags (long id) const
 
AlterationFlags getInterfaceAlterationFlags (long id) const
 
VertexIterator ghostVertex2InternalVertex (long id)
 
VertexIterator internalVertex2GhostVertex (long id, int owner)
 
bool isBoundingBoxFrozen () const
 
bool isCommunicatorSet () const
 
virtual bool isSameFace (const Cell &cell_A, int face_A, const Cell &cell_B, int face_B) const
 
template<typename item_t , typename id_t = long>
void mappedItemRenumbering (PiercedVector< item_t, id_t > &container, const std::unordered_map< id_t, id_t > &renumberMap)
 
PatchKerneloperator= (const PatchKernel &other)=delete
 
void pruneStaleAdjacencies ()
 
void pruneStaleInterfaces ()
 
void removePointFromBoundingBox (const std::array< double, 3 > &point)
 
void resetAdjacencies ()
 
void resetCellAlterationFlags (long id, AlterationFlags flags=FLAG_NONE)
 
void resetInterfaceAlterationFlags (long id, AlterationFlags flags=FLAG_NONE)
 
CellIterator restoreCell (ElementType type, std::unique_ptr< long[]> &&connectStorage, int owner, int haloLayer, long id)
 
void restoreCells (std::istream &stream)
 
InterfaceIterator restoreInterface (ElementType type, std::unique_ptr< long[]> &&connectStorage, long id)
 
void restoreInterfaces (std::istream &stream)
 
VertexIterator restoreVertex (const std::array< double, 3 > &coords, int owner, long id)
 
void restoreVertices (std::istream &stream)
 
void setAdaptionMode (AdaptionMode mode)
 
void setAdaptionStatus (AdaptionStatus status)
 
void setAdjacenciesBuildStrategy (AdjacenciesBuildStrategy status)
 
void setBoundingBox (const std::array< double, 3 > &minPoint, const std::array< double, 3 > &maxPoint)
 
void setBoundingBoxDirty (bool dirty)
 
void setBoundingBoxFrozen (bool frozen)
 
void setCellAlterationFlags (AlterationFlags flags)
 
void setCellAlterationFlags (long id, AlterationFlags flags)
 
virtual void setCommunicator (MPI_Comm communicator)
 
void setExpert (bool expert)
 
void setInterfaceAlterationFlags (AlterationFlags flags)
 
void setInterfaceAlterationFlags (long id, AlterationFlags flags)
 
void setInterfacesBuildStrategy (InterfacesBuildStrategy status)
 
void setPartitioned (bool partitioned)
 
void setPartitioningMode (PartitioningMode mode)
 
void setPartitioningStatus (PartitioningStatus status)
 
bool testAlterationFlags (AlterationFlags availableFlags, AlterationFlags requestedFlags) const
 
bool testCellAlterationFlags (long id, AlterationFlags flags) const
 
bool testInterfaceAlterationFlags (long id, AlterationFlags flags) const
 
void unsetCellAlterationFlags (AlterationFlags flags)
 
void unsetCellAlterationFlags (long id, AlterationFlags flags)
 
void unsetInterfaceAlterationFlags (AlterationFlags flags)
 
void unsetInterfaceAlterationFlags (long id, AlterationFlags flags)
 
void updateFirstGhostCellId ()
 
void updateFirstGhostVertexId ()
 
void updateLastInternalCellId ()
 
void updateLastInternalVertexId ()
 

Additional Inherited Members

- Static Public Member Functions inherited from bitpit::PatchKernel
template<typename patch_t >
static std::unique_ptr< patch_t > clone (const patch_t *original)
 
- Protected Types inherited from bitpit::PatchKernel
typedef uint16_t AlterationFlags
 
typedef std::unordered_map< long, AlterationFlags > AlterationFlagsStorage
 
- Protected Attributes inherited from bitpit::PatchKernel
AlterationFlagsStorage m_alteredCells
 
AlterationFlagsStorage m_alteredInterfaces
 
PiercedVector< Cellm_cells
 
PiercedVector< Interfacem_interfaces
 
PiercedVector< Vertexm_vertices
 
- Static Protected Attributes inherited from bitpit::PatchKernel
static const double DEFAULT_PARTITIONING_WEIGTH = 1.
 
static const AlterationFlags FLAG_ADJACENCIES_DIRTY = (1u << 1)
 
static const AlterationFlags FLAG_DANGLING = (1u << 3)
 
static const AlterationFlags FLAG_DELETED = (1u << 0)
 
static const AlterationFlags FLAG_INTERFACES_DIRTY = (1u << 2)
 
static const AlterationFlags FLAG_NONE = 0x0
 

Detailed Description

The SurfaceKernel class provides an interface for defining surface patches.

SurfaceKernel is the base class for defining surface patches.

Definition at line 35 of file surface_kernel.hpp.

Member Typedef Documentation

◆ eval_f_

typedef double(SurfaceKernel::* bitpit::SurfaceKernel::eval_f_) (long, int &) const

Definition at line 44 of file surface_kernel.hpp.

Constructor & Destructor Documentation

◆ SurfaceKernel() [1/3]

bitpit::SurfaceKernel::SurfaceKernel ( MPI_Comm communicator,
std::size_t haloSize,
AdaptionMode adaptionMode,
PartitioningMode partitioningMode )
protected

Creates a patch.

If a null comunicator is provided, a serial patch will be created, this means that each processor will be unaware of the existence of the other processes.

Parameters
communicatoris the communicator to be used for exchanging data among the processes. If a null comunicator is provided, a serial patch will be created
haloSizeis the size, expressed in number of layers, of the ghost cells halo
adaptionModeis the adaption mode that will be used for the patch
partitioningModeis the partitioning mode that will be used for the patch

Definition at line 78 of file surface_kernel.cpp.

◆ SurfaceKernel() [2/3]

bitpit::SurfaceKernel::SurfaceKernel ( int dimension,
MPI_Comm communicator,
std::size_t haloSize,
AdaptionMode adaptionMode,
PartitioningMode partitioningMode )
protected

Creates a patch.

If a null comunicator is provided, a serial patch will be created, this means that each processor will be unaware of the existence of the other processes.

Parameters
dimensionis the dimension of the patch
communicatoris the communicator to be used for exchanging data among the processes. If a null comunicator is provided, a serial patch will be created
haloSizeis the size, expressed in number of layers, of the ghost cells halo
adaptionModeis the adaption mode that will be used for the patch
partitioningModeis the partitioning mode that will be used for the patch

Definition at line 112 of file surface_kernel.cpp.

◆ SurfaceKernel() [3/3]

bitpit::SurfaceKernel::SurfaceKernel ( int id,
int dimension,
MPI_Comm communicator,
std::size_t haloSize,
AdaptionMode adaptionMode,
PartitioningMode partitioningMode )
protected

Creates a patch.

If a null comunicator is provided, a serial patch will be created, this means that each processor will be unaware of the existence of the other processes.

Parameters
idis the id that will be assigned to the patch
dimensionis the dimension of the patch
communicatoris the communicator to be used for exchanging data among the processes. If a null comunicator is provided, a serial patch will be created
haloSizeis the size, expressed in number of layers, of the ghost cells halo
adaptionModeis the adaption mode that will be used for the patch
partitioningModeis the partitioning mode that will be used for the patch

Definition at line 148 of file surface_kernel.cpp.

Member Function Documentation

◆ adjustCellOrientation() [1/2]

bool bitpit::SurfaceKernel::adjustCellOrientation ( )

Adjust the orientation of all facets of the local partition according to the orientation of the first facet stored.

The routine checks whether the surface is orientable; if the surface is not orientable false is returned (with some normals flipped until the orientablity condition has been violated), otherwise true is returned (with all facet orientations coherent with the reference facet).

Returns
Returns true if the surface is orientable, false otherwise.

Definition at line 1165 of file surface_kernel.cpp.

◆ adjustCellOrientation() [2/2]

bool bitpit::SurfaceKernel::adjustCellOrientation ( long seed,
bool invert = false )

Adjust the orientation of all facets of the local partition according to the orientation of a given facet.

The routine checks whether the surface is orientable; if the surface is not orientable false is returned (with some normals flipped until the orientablity condition has been violated), otherwise true is returned (with all facet orientations coherent with the reference facet).

Parameters
[in]seedis the id of reference facet. For parallel computaions, if a partition does not know how to orient its facets, Element::NULL_ID should be passed for these partitions
[in]invertcontrols if the orientation should be the same of the seed of should be inverted with respect to the seed
Returns
Returns true if the surface is orientable, false otherwise.

Definition at line 1215 of file surface_kernel.cpp.

◆ areFacetEdgesOrdered()

bool bitpit::SurfaceKernel::areFacetEdgesOrdered ( const Cell & facet) const

Check if the edges of the specified facet are counter-clockwise ordered.

Parameters
[in]facetis the facet
Returns
Return true if the edges of the specified facet are counter-clockwise ordered, false otherwise.

Definition at line 2103 of file surface_kernel.cpp.

◆ areFacetVerticesOrdered()

bool bitpit::SurfaceKernel::areFacetVerticesOrdered ( const Cell & facet) const

Check if the vertices of the specified facet are counter-clockwise ordered.

Parameters
[in]facetis the facet
Returns
Return true if the vertices of the specified facet are counter-clockwise ordered, false otherwise.

Definition at line 2017 of file surface_kernel.cpp.

◆ computeHistogram()

std::vector< double > bitpit::SurfaceKernel::computeHistogram ( eval_f_ funct_,
std::vector< double > & bins,
long & count,
int n_intervals = 8,
unsigned short mask = SELECT_ALL ) const

Compute the histogram showing the distribution of aspect ratio among elements

Parameters
[in]funct_pointer to member function to be used to compute stats
[in,out]binsbins used to construct histogram. If an empty vector is passed as input, uniform bins will be generated in the interval [1.0, 5.0)
[in]countpopulation size used to build histogram (depends on the selection mask used). For instant, if the selection mask is set to the value SelectionMask::SELECT_QUAD | SelectionMask::SELECT_TRIANGLE, only quad and tria element will be considered and count will returns the number of such elements.
[in]n_intervals(default = 8), number of intervals to be used for histogram construction. If bins is a non-empty vector, the number of intervals will be set equal to bins.size()-1
[in]mask(default = SelectionMask::ALL) selection mask for element type
Returns
on output returns a vector of dimensions n_internvals+2, storing the histogram for the distribution of aspect ratio among cells. hist[0] stores the % of element having aspect ratio below bins[0] ... hist[i] stores the % of element having aspect ratio between [bins[i], bins[i+1]) ... hist[n_internvals+1] stores the % of element having aspect ratio above bins[n_intervals].

Definition at line 1832 of file surface_kernel.cpp.

◆ displayQualityStats()

void bitpit::SurfaceKernel::displayQualityStats ( std::ostream & out,
unsigned int padding = 0 ) const

Display quality stats for the mesh currently stored.

Parameters
[in,out]outoutput stream where stats will be printed out
[in]padding(default = 0) number of trailing spaces

Definition at line 1744 of file surface_kernel.cpp.

◆ evalAngleAtVertex()

double bitpit::SurfaceKernel::evalAngleAtVertex ( long id,
int vertex ) const
virtual

Evaluate the angle at specified vertex for a cell with specified id.

The function will return zero if the cell is of type ElementType::UNDEFINED or ElementType::VERTEX. It will also return zero if the cell is of type ElementType::LINE and the codimension of the surface with respect to the space in which it is embedded is not one.

Parameters
[in]idis the cell id
[in]vertexis the local vertex id

Definition at line 532 of file surface_kernel.cpp.

◆ evalAspectRatio()

double bitpit::SurfaceKernel::evalAspectRatio ( long id,
int & edge_id ) const
virtual

Evalute the aspect ratio for a cell with specified ID. The aspect ratio is defined as the ratio between the longest and the shortest edge. If cell is of type ElementType::VERTEX or ElementType::LINE, returns 0.0

Parameters
[in]idcell ID
[in,out]edge_idon output stores the index of the shortest edge
Returns
cell aspect ratio

Definition at line 657 of file surface_kernel.cpp.

◆ evalBarycentricCoordinates()

void bitpit::SurfaceKernel::evalBarycentricCoordinates ( long id,
const std::array< double, 3 > & point,
double * lambda ) const

Evaluates the baricentric coordinates of the specified cell.

Parameters
[in]idis the id of the cell
[in]pointare the coordinates of point
[out]lambdaon output will contain the barycentric coordinates of the projection point

Definition at line 263 of file surface_kernel.cpp.

◆ evalCellArea()

double bitpit::SurfaceKernel::evalCellArea ( long id) const
virtual

Evaluate facet area for a cell with specified ID. If cell is of type ElementType::VERTEX or ElementType::LINE, returns 0.0

Parameters
[in]idcell ID
Returns
facet area

Definition at line 336 of file surface_kernel.cpp.

◆ evalCellSize()

double bitpit::SurfaceKernel::evalCellSize ( long id) const
overridevirtual

Evaluates the characteristic size of the specified cell.

Parameters
idis the id of the cell
Returns
The characteristic size of the specified cell.

Implements bitpit::PatchKernel.

Definition at line 232 of file surface_kernel.cpp.

◆ evalEdgeLength()

double bitpit::SurfaceKernel::evalEdgeLength ( long cellId,
int edgeId ) const
virtual

Evaluate the length of the edge with specified local index for the cell with specified Iid.

If the cell is of type ElementType::VERTEX or ElementType::LINE returns 0.

Parameters
[in]cellIdis the cell id
[in]edgeIdis the edge local index
Returns
The edge length.

Definition at line 395 of file surface_kernel.cpp.

◆ evalEdgeNormal()

std::array< double, 3 > bitpit::SurfaceKernel::evalEdgeNormal ( long id,
int edge_id ) const

Evaluate the normal unit vector to the edge with specified local id belonging to the surface facet with specified global id. Edge normal is computed as the arithmetic average of the normals to each facet incident to the edge. In case adjacencies are not built, the edge normal will be the same as the facet normal.

Parameters
[in]idcell global ID
[in]edge_idedge local ID on the specified cell

Definition at line 769 of file surface_kernel.cpp.

◆ evalEdgeNormals()

void bitpit::SurfaceKernel::evalEdgeNormals ( long id,
int edge,
double limit,
std::array< double, 3 > * unlimitedNormal,
std::array< double, 3 > * limitedNormal ) const
virtual

Evaluate unlimited and limited normal unit vectors at the specified local edge.

Edge normal is computed as the arithmetic average of the normals to each facet incident to the edge. In case adjacencies are not built, the edge normal will be the same as the facet normal.

When evaluating the limited normal, only the normals whose angle with respect to the considered cell is less that the specified limit are considered. Whereas, when evaluating the unlimited normal, all cells in the one-ring are considered.

Parameters
[in]idis the cell id
[in]edgeis the local edge id
[in]limitis the maximum allowed misalignment between the normal of the reference cell and the normal of facets used for evaualting the edge normal
[out]unlimitedNormalif a valid pointer is provided, on output will contain the unlimited normal
[out]limitedNormalif a valid pointer is provided, on output will contain the limited normal

Definition at line 983 of file surface_kernel.cpp.

◆ evalFacetNormal()

std::array< double, 3 > bitpit::SurfaceKernel::evalFacetNormal ( long id,
const std::array< double, 3 > & orientation = {{0., 0., 1.}} ) const
virtual

Evaluate facet normal for a cell with specified ID. If cell is of type ElementType::VERTEX or ElementType::LINE, returns 0.0

Parameters
[in]idcell ID
orientationis a vector carring the additional information needed to un-ambigously define a normal to the element (e.g., when evaluating the normal of a one-dimensional element, this versor is perpendicular to the plane where the normal should lie)
Returns
facet normal

Definition at line 705 of file surface_kernel.cpp.

◆ evalLimitedVertexNormal() [1/2]

std::array< double, 3 > bitpit::SurfaceKernel::evalLimitedVertexNormal ( long id,
int vertex,
double limit ) const

Evaluate the limited normal unit vector of the specified local vertex.

Vertex normals are evaluated as a weighted average of the normals of the cells that define the one-ring of the vertex. For each cell, the weight is the angle beteen the two side that share the specfied vertex. Only the normals whose angle with respect to the considered cell is less that the specified limit are considered.

Parameters
[in]idis the cell id
[in]vertexis the local vertex id
[in]limitis the maximum allowed misalignment between the normal of the reference cell and the normal of facets used for evaualting the vertex normal
Returns
The normal unit vector of the specified local vertex.

Definition at line 834 of file surface_kernel.cpp.

◆ evalLimitedVertexNormal() [2/2]

std::array< double, 3 > bitpit::SurfaceKernel::evalLimitedVertexNormal ( long id,
int vertex,
std::size_t nVertexNeighs,
const long * vertexNeighs,
double limit ) const

Evaluate the limited normal unit vector of the specified local vertex.

Vertex normals are evaluated as a weighted average of the normals of the cells that define the one-ring of the vertex. For each cell, the weight is the angle beteen the two side that share the specfied vertex. Only the normals whose angle with respect to the considered cell is less that the specified limit are considered.

Parameters
[in]idis the cell id
[in]vertexis the local vertex id
[in]nVertexNeighsis the number of vertex neighbours
[in]vertexNeighsare the neighbours of the vertex
[in]limitis the maximum allowed misalignment between the normal of the reference cell and the normal of facets used for evaualting the vertex normal
Returns
The normal unit vector of the specified local vertex.

Definition at line 861 of file surface_kernel.cpp.

◆ evalMaxAngleAtVertex()

double bitpit::SurfaceKernel::evalMaxAngleAtVertex ( long id,
int & vertex_id ) const
virtual

Evaluate the maximal angle at vertex for a cell with specified ID. If cell is of type ElementType::VERTEX or ElementType::LINE, a returns zero.

Parameters
[in]idcell id
[in,out]vertex_idon output stores the local index of vertex with minimal angle
Returns
maximal angle at vertex

Definition at line 615 of file surface_kernel.cpp.

◆ evalMaxEdgeLength()

double bitpit::SurfaceKernel::evalMaxEdgeLength ( long id,
int & edge_id ) const
virtual

Evaluate the maximal edge length for e cell with specified ID. If the cell is of type ElementType::VERTEX or ElementType::LINE returns 0.0.

Parameters
[in]idcell id
[in,out]edge_idon output stores the local inde xof edge with maximal edge length
Returns
maximal edge length

Definition at line 488 of file surface_kernel.cpp.

◆ evalMinAngleAtVertex()

double bitpit::SurfaceKernel::evalMinAngleAtVertex ( long id,
int & vertex_id ) const
virtual

Evaluate the minimal angle at vertex for a cell with specified ID. If cell is of type ElementType::VERTEX or ElementType::LINE, a returns zero.

Parameters
[in]idcell id
[in,out]vertex_idon output stores the local index of vertex with minimal angle
Returns
minimal angle at vertex

Definition at line 574 of file surface_kernel.cpp.

◆ evalMinEdgeLength()

double bitpit::SurfaceKernel::evalMinEdgeLength ( long id,
int & edge_id ) const
virtual

Evaluate the minimal edge length for e cell with specified ID. If the cell is of type ElementType::VERTEX or ElementType::LINE returns 0.0.

Parameters
[in]idcell id
[in,out]edge_idon output stores the local index of edge with minimal edge length
Returns
minimal edge length

Definition at line 445 of file surface_kernel.cpp.

◆ evalVertexNormal() [1/2]

std::array< double, 3 > bitpit::SurfaceKernel::evalVertexNormal ( long id,
int vertex ) const

Evaluate the normal unit vector of the specified local vertex.

Vertex normals are evaluated as a weighted average of the normals of the cells that define the one-ring of the vertex. For each cell, the weight is the angle beteen the two side that share the specfied vertex.

Parameters
[in]idis the cell id
[in]vertexis the local vertex id
Returns
The normal unit vector of the specified local vertex.

Definition at line 788 of file surface_kernel.cpp.

◆ evalVertexNormal() [2/2]

std::array< double, 3 > bitpit::SurfaceKernel::evalVertexNormal ( long id,
int vertex,
std::size_t nVertexNeighs,
const long * vertexNeighs ) const

Evaluate the normal unit vector of the specified local vertex.

Vertex normals are evaluated as a weighted average of the normals of the cells that define the one-ring of the vertex. For each cell, the weight is the angle beteen the two side that share the specfied vertex.

Parameters
[in]idis the cell id
[in]vertexis the local vertex id
[in]nVertexNeighsis the number of vertex neighbours
[in]vertexNeighsare the neighbours of the vertex
Returns
The normal unit vector of the specified local vertex.

Definition at line 810 of file surface_kernel.cpp.

◆ evalVertexNormals()

void bitpit::SurfaceKernel::evalVertexNormals ( long id,
int vertex,
std::size_t nVertexNeighs,
const long * vertexNeighs,
double limit,
std::array< double, 3 > * unlimitedNormal,
std::array< double, 3 > * limitedNormal ) const
virtual

Evaluate unlimited and limited normal unit vectors at the specified local vertex.

Vertex normals are evaluated as a weighted average of the normals of the cells that define the one-ring of the vertex. For each cell, the weight is the angle beteen the two side that share the specfied vertex. When evaluating the limited normal, only the normals whose angle with respect to the considered cell is less that the specified limit are considered. Whereas, when evaluating the unlimited normal, all cells in the one-ring are considered.

Parameters
[in]idis the cell id
[in]vertexis the local vertex id
[in]nVertexNeighsis the number of vertex neighbours
[in]vertexNeighsare the neighbours of the vertex
[in]limitis the maximum allowed misalignment between the normal of the reference cell and the normal of facets used for evaualting the vertex normal
[out]unlimitedNormalif a valid pointer is provided, on output will contain the unlimited normal
[out]limitedNormalif a valid pointer is provided, on output will contain the limited normal

Definition at line 893 of file surface_kernel.cpp.

◆ extractEnvelope()

void bitpit::SurfaceKernel::extractEnvelope ( LineKernel & envelope) const

Extracts the external envelope and appends it to the given patch.

The external envelope is composed by all the free faces of the patch.

Parameters
[in,out]envelopeis the patch to which the external envelope will be appended

Definition at line 221 of file surface_kernel.cpp.

◆ flipCellOrientation()

void bitpit::SurfaceKernel::flipCellOrientation ( long id)

Flips the orientation of a cell.

Parameters
[in]idis the id of cell that will be flipped

Definition at line 1590 of file surface_kernel.cpp.

◆ getFacetOrderedEdgeIds()

ConstProxyVector< long > bitpit::SurfaceKernel::getFacetOrderedEdgeIds ( const Cell & facet) const

Get the counter-clockwise ordered list of edge for the specified facet.

Parameters
facetis the facet
Returns
The counter-clockwise ordered list of edge for the specified facet.

Definition at line 2084 of file surface_kernel.cpp.

◆ getFacetOrderedLocalEdge()

int bitpit::SurfaceKernel::getFacetOrderedLocalEdge ( const Cell & facet,
std::size_t n ) const

Get the local index of the edge occupying the n-th position in the counter-clockwise ordered list of edge ids.

Parameters
[in]facetis the facet
[in]nis the requested position
Returns
The local index of the edge occupying the n-th position in the counter-clockwise ordered list of edge ids.

Definition at line 2138 of file surface_kernel.cpp.

◆ getFacetOrderedLocalVertex()

int bitpit::SurfaceKernel::getFacetOrderedLocalVertex ( const Cell & facet,
std::size_t n ) const

Get the local index of the vertex occupying the n-th position in the counter-clockwise ordered list of vertex ids.

Parameters
[in]facetis the facet
[in]nis the requested position
Returns
The local index of the vertex occupying the n-th position in the counter-clockwise ordered list of vertex ids.

Definition at line 2052 of file surface_kernel.cpp.

◆ getFacetOrderedVertexIds()

ConstProxyVector< long > bitpit::SurfaceKernel::getFacetOrderedVertexIds ( const Cell & facet) const

Get the counter-clockwise ordered list of vertex for the specified facet.

Parameters
facetis the facet
Returns
The counter-clockwise ordered list of vertex for the specified facet.

Definition at line 1992 of file surface_kernel.cpp.

◆ getLineCodimension()

int bitpit::SurfaceKernel::getLineCodimension ( ) const
overridevirtual

Get the codimension of the patch in the line space.

Returns
The codimension of the patch in the line space.

Implements bitpit::PatchKernel.

Definition at line 198 of file surface_kernel.cpp.

◆ getPointCodimension()

int bitpit::SurfaceKernel::getPointCodimension ( ) const
overridevirtual

Get the codimension of the patch in the point space.

Returns
The codimension of the patch in the point space.

Implements bitpit::PatchKernel.

Definition at line 208 of file surface_kernel.cpp.

◆ getSurfaceCodimension()

int bitpit::SurfaceKernel::getSurfaceCodimension ( ) const
overridevirtual

Get the codimension of the patch in the surface space.

Returns
The codimension of the patch in the surface space.

Implements bitpit::PatchKernel.

Definition at line 188 of file surface_kernel.cpp.

◆ getVolumeCodimension()

int bitpit::SurfaceKernel::getVolumeCodimension ( ) const
overridevirtual

Get the codimension of the patch in the volume space.

Returns
The codimension of the patch in the volume space.

Implements bitpit::PatchKernel.

Definition at line 178 of file surface_kernel.cpp.

◆ isCellOrientationConsistent()

bool bitpit::SurfaceKernel::isCellOrientationConsistent ( ) const

Check if the factes have a consistent orientation.

Returns
Returns true if the factes have a consistent orientation, false otherwise.

Definition at line 1052 of file surface_kernel.cpp.

Member Data Documentation

◆ SELECT_ALL

const unsigned short bitpit::SurfaceKernel::SELECT_ALL = 3
static

Definition at line 41 of file surface_kernel.hpp.

◆ SELECT_QUAD

const unsigned short bitpit::SurfaceKernel::SELECT_QUAD = 2
static

Definition at line 40 of file surface_kernel.hpp.

◆ SELECT_TRIANGLE

const unsigned short bitpit::SurfaceKernel::SELECT_TRIANGLE = 1
static

Definition at line 39 of file surface_kernel.hpp.


The documentation for this class was generated from the following files:
--- layout: doxygen_footer ---