25# include "levelSetUnstructuredKernel.hpp"
27# include "bitpit_CG.hpp"
81 if (cacheEntry.isValid()) {
91 cache->insertEntry(
id, centroid);
113 if (cacheEntry.isValid()) {
124 int nCellVertices = cellVertexIds.
size();
127 BITPIT_CREATE_WORKSPACE(vertexCoordinates, std::array<double BITPIT_COMMA 3>, nCellVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
139 cache->insertEntry(
id, tangentRadius);
142 return tangentRadius;
161 if (cacheEntry.isValid()) {
172 int nCellVertices = cellVertexIds.
size();
175 BITPIT_CREATE_WORKSPACE(vertexCoordinates, std::array<double BITPIT_COMMA 3>, nCellVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
183 double boundingRadius = 0.;
184 for (
int k = 0; k < nCellVertices; ++k) {
185 double vertexDistance = 0.;
186 for (
int d = 0; d < 3; ++d) {
187 vertexDistance +=
uipow(centroid[d] - vertexCoordinates[k][d], 2);
190 boundingRadius = std::max(vertexDistance, boundingRadius);
192 boundingRadius = std::sqrt(boundingRadius);
196 cache->insertEntry(
id, boundingRadius);
199 return boundingRadius;
The Cell class defines the cells.
The class ElementCacheCollection allows to store a collection of caches for the elements of a mesh.
std::size_t insert(std::size_t index, Args &&... args)
static ConstProxyVector< long > getVertexIds(ElementType type, const long *connectivity)
double evalPointDistance(const std::array< double, 3 > &point, const std::array< double, 3 > *coordinates) const
static const std::size_t NULL_CACHE_ID
Base class for defining kernels that need to cache data.
CellCacheCollection & getCellCacheCollection()
virtual VolumeKernel * getMesh() const
std::array< double, 3 > computeCellCentroid(long) const override
double computeCellBoundingRadius(long) const override
double computeCellTangentRadius(long) const override
LevelSetUnstructuredKernel(VolUnstructured &patch, LevelSetFillIn fillIn)
VolUnstructured * getMesh() const override
The class LevelSetCache is the base class for defining caches that store values.
const std::array< double, 3 > & getVertexCoords(long id) const
virtual std::array< double, 3 > evalCellCentroid(long id) const
Metafunction for generating a list of elements that can be either stored in an external vectror or,...
__PXV_POINTER__ data() noexcept
The VolUnstructured class defines a dummy unstructured volume patch.
T uipow(const T &, unsigned int)
#define BITPIT_CREATE_WORKSPACE(workspace, item_type, size, stack_size)