Loading...
Searching...
No Matches
levelSetComplementObject.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_LEVELSET_COMPLEMENT_OBJECT_HPP__
26# define __BITPIT_LEVELSET_COMPLEMENT_OBJECT_HPP__
27
28# include <array>
29
30# include "levelSetCommon.hpp"
31# include "levelSetProxyObject.hpp"
32
33namespace bitpit{
34
35class LevelSetObject ;
36
37template<typename SourceLevelSetObject>
38class LevelSetComplementBaseObject : public LevelSetProxyObject<SourceLevelSetObject, SourceLevelSetObject> {
39
40 private:
41 const SourceLevelSetObject * m_sourceObject;
43 protected:
44 LevelSetComplementBaseObject(int id, const SourceLevelSetObject *source);
45
46 void replaceSourceObject(const SourceLevelSetObject *current, const SourceLevelSetObject *updated) override;
47
48 void fillCellPropagatedSignCache() override;
49
50 short _evalCellSign(long id) const override;
51 double _evalCellValue(long id, bool signedLevelSet) const override;
52 std::array<double,3> _evalCellGradient(long id, bool signedLevelSet) const override;
53
54 short _evalSign(const std::array<double,3> &point) const override;
55 double _evalValue(const std::array<double,3> &point, bool signedLevelSet) const override;
56 std::array<double,3> _evalGradient(const std::array<double,3> &point, bool signedLevelSet) const override;
57
58 public:
59 bool empty() const override;
60
61 const SourceLevelSetObject * getCellReferenceObject(long id) const override;
62
63 const SourceLevelSetObject * getReferenceObject(const std::array<double, 3> &point) const override;
64
65 virtual const SourceLevelSetObject * getSourceObject() const;
66 std::vector<const SourceLevelSetObject *> getSourceObjects() const override;
67
68};
69
70template<typename SourceLevelSetObject>
71class LevelSetComplementObject : public LevelSetComplementBaseObject<SourceLevelSetObject> {
72
73};
74
75template<>
77
78public:
79 LevelSetComplementObject(int id, const LevelSetObject *source);
80
81 LevelSetComplementObject<LevelSetObject> * clone() const override;
82
83};
84
85}
86
87#endif
Base class that allows to evaluate the complement of a LevelSetObjects.
std::array< double, 3 > _evalGradient(const std::array< double, 3 > &point, bool signedLevelSet) const override
const SourceLevelSetObject * getReferenceObject(const std::array< double, 3 > &point) const override
double _evalValue(const std::array< double, 3 > &point, bool signedLevelSet) const override
const SourceLevelSetObject * getCellReferenceObject(long id) const override
std::array< double, 3 > _evalCellGradient(long id, bool signedLevelSet) const override
virtual const SourceLevelSetObject * getSourceObject() const
double _evalCellValue(long id, bool signedLevelSet) const override
void replaceSourceObject(const SourceLevelSetObject *current, const SourceLevelSetObject *updated) override
LevelSetComplementBaseObject(int id, const SourceLevelSetObject *source)
short _evalSign(const std::array< double, 3 > &point) const override
std::vector< const SourceLevelSetObject * > getSourceObjects() const override
Class that allows to evaluate the complement of a LevelSetObjects.
Interface class for all objects with respect to whom the levelset function may be computed.
Interface class for all objects, which depend on other LevelSetObjects.
--- layout: doxygen_footer ---