25#include "bitpit_common.hpp"
27#include "volunstructured.hpp"
42#if BITPIT_ENABLE_MPI==1
57 :
VolumeKernel(communicator, haloSize, ADAPTION_MANUAL, PARTITIONING_ENABLED)
68#if BITPIT_ENABLE_MPI==1
97#if BITPIT_ENABLE_MPI==1
114 :
VolumeKernel(id, dimension, communicator, haloSize, ADAPTION_MANUAL, PARTITIONING_ENABLED)
149 std::size_t nCellVertices = cellVertexIds.
size();
150 BITPIT_CREATE_WORKSPACE(vertexCoordinates, std::array<double BITPIT_COMMA 3>, nCellVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
156 return cell.
evalArea(vertexCoordinates);
171 std::size_t nCellVertices = cellVertexIds.
size();
172 BITPIT_CREATE_WORKSPACE(vertexCoordinates, std::array<double BITPIT_COMMA 3>, nCellVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
175 return cell.
evalSize(vertexCoordinates);
186 const Interface &
interface = getInterface(id);
189 std::size_t nInterfaceVertices = interfaceVertexIds.
size();
190 BITPIT_CREATE_WORKSPACE(vertexCoordinates, std::array<double BITPIT_COMMA 3>, nInterfaceVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
191 getVertexCoords(nInterfaceVertices, interfaceVertexIds.data(), vertexCoordinates);
193 if (isThreeDimensional()) {
194 return interface.evalArea(vertexCoordinates);
196 return interface.evalLength(vertexCoordinates);
208 const Interface &
interface = getInterface(id);
211 std::size_t nInterfaceVertices = interfaceVertexIds.
size();
212 BITPIT_CREATE_WORKSPACE(vertexCoordinates, std::array<double BITPIT_COMMA 3>, nInterfaceVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
213 getVertexCoords(nInterfaceVertices, interfaceVertexIds.data(), vertexCoordinates);
215 std::array<double, 3> orientation = {{0., 0., 0.}};
216 if (!isThreeDimensional()) {
217 long ownerId = interface.getOwner();
218 const Cell &owner = getCell(ownerId);
221 const int nOwnerVertices = ownerVertexIds.
size();
223 const std::array<double, 3> &V_A = getVertex(ownerVertexIds[0]).getCoords();
224 const std::array<double, 3> &V_B = getVertex(ownerVertexIds[1]).getCoords();
225 const std::array<double, 3> &V_Z = getVertex(ownerVertexIds[nOwnerVertices - 1]).getCoords();
230 return interface.evalNormal(vertexCoordinates, orientation);
240 const int DUMP_VERSION = 2;
289 throw std::runtime_error (
"The function 'isPointInside' is not implemented yet");
306 throw std::runtime_error (
"The function 'isPointInside' is not implemented yet");
326 throw std::runtime_error (
"The function 'locatePoint' is not implemented yet");
328 return Cell::NULL_ID;
331#if BITPIT_ENABLE_MPI==1
341 return std::numeric_limits<uint32_t>::max();
The Cell class defines the cells.
double evalVolume(const std::array< double, 3 > *coordinates) const
double evalArea(const std::array< double, 3 > *coordinates) const
double evalSize(const std::array< double, 3 > *coordinates) const
static ConstProxyVector< long > getVertexIds(ElementType type, const long *connectivity)
The Interface class defines the interfaces among cells.
void dumpInterfaces(std::ostream &stream) const
void dumpVertices(std::ostream &stream) const
void dumpCells(std::ostream &stream) const
void restoreCells(std::istream &stream)
void restoreVertices(std::istream &stream)
void restoreInterfaces(std::istream &stream)
const std::array< double, 3 > & getVertexCoords(long id) const
bool isThreeDimensional() const
The PatchManager oversee the handling of the patches.
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.
std::array< double, 3 > evalInterfaceNormal(long id) const override
std::unique_ptr< PatchKernel > clone() const override
double evalInterfaceArea(long id) const override
std::size_t _getMaxHaloSize() override
double evalCellSize(long id) const override
bool isPointInside(const std::array< double, 3 > &point) const override
double evalCellVolume(long id) const override
void _dump(std::ostream &stream) const override
void _restore(std::istream &stream) override
VolUnstructured(MPI_Comm communicator, std::size_t haloSize=1)
long locatePoint(const std::array< double, 3 > &point) const override
int _getDumpVersion() const override
The VolumeKernel class provides an interface for defining volume patches.
std::array< T, 3 > crossProduct(const std::array< T, 3 > &x, const std::array< T, 3 > &y)
#define BITPIT_UNUSED(variable)
#define BITPIT_CREATE_WORKSPACE(workspace, item_type, size, stack_size)