Loading...
Searching...
No Matches
volume_kernel.hpp
1/*---------------------------------------------------------------------------*\
2 *
3 * bitpit
4 *
5 * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6 *
7 * -------------------------------------------------------------------------
8 * License
9 * This file is part of bitpit.
10 *
11 * bitpit is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License v3 (LGPL)
13 * as published by the Free Software Foundation.
14 *
15 * bitpit is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with bitpit. If not, see <http://www.gnu.org/licenses/>.
22 *
23\*---------------------------------------------------------------------------*/
24
25#ifndef __BITPIT_VOLUME_KERNEL_HPP__
26#define __BITPIT_VOLUME_KERNEL_HPP__
27
28#include "patch_kernel.hpp"
29#include "surface_kernel.hpp"
30
31namespace bitpit {
32
33class VolumeKernel : public PatchKernel {
34
35public:
36 int getVolumeCodimension() const override;
37 int getSurfaceCodimension() const override;
38 int getLineCodimension() const override;
39 int getPointCodimension() const override;
40
41 void extractEnvelope(SurfaceKernel &envelope) const;
42
43 bool isPointInside(double x, double y, double z) const;
44 virtual bool isPointInside(const std::array<double, 3> &point) const = 0;
45 bool isPointInside(long id, double x, double y, double z) const;
46 virtual bool isPointInside(long id, const std::array<double, 3> &point) const = 0;
47
48 virtual double evalCellVolume(long id)const = 0;
49
50 virtual double evalInterfaceArea(long id)const = 0;
51 virtual std::array<double,3> evalInterfaceNormal(long id)const = 0;
52
53 ConstProxyVector<long> getFaceOrderedVertexIds(const Cell &cell, int face) const;
54 bool areFaceVerticesOrdered(const Cell &cell, int face) const;
55 int getFaceOrderedLocalVertex(const Cell &cell, int face, std::size_t n) const;
56
57protected:
58#if BITPIT_ENABLE_MPI==1
59 VolumeKernel(MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode, PartitioningMode partitioningMode);
60 VolumeKernel(int dimension, MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode, PartitioningMode partitioningMode);
61 VolumeKernel(int id, int dimension, MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode, PartitioningMode partitioningMode);
62#else
63 VolumeKernel(AdaptionMode adaptionMode);
64 VolumeKernel(int dimension, AdaptionMode adaptionMode);
65 VolumeKernel(int id, int dimension, AdaptionMode adaptionMode);
66#endif
67
68};
69
70}
71
72#endif
The Cell class defines the cells.
Definition cell.hpp:42
PatchKernel(PatchKernel &&other)
The SurfaceKernel class provides an interface for defining surface patches.
int getFaceOrderedLocalVertex(const Cell &cell, int face, std::size_t n) const
void extractEnvelope(SurfaceKernel &envelope) const
int getSurfaceCodimension() const override
int getPointCodimension() const override
int getLineCodimension() const override
int getVolumeCodimension() const override
bool isPointInside(double x, double y, double z) const
bool areFaceVerticesOrdered(const Cell &cell, int face) const
ConstProxyVector< long > getFaceOrderedVertexIds(const Cell &cell, int face) const
VolumeKernel(MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode, PartitioningMode partitioningMode)