Loading...
Searching...
No Matches
levelSetProxyObject.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_PROXY_OBJECT_HPP__
26# define __BITPIT_LEVELSET_PROXY_OBJECT_HPP__
27
28#include <levelSetObject.hpp>
29
30#include <bitpit_common.hpp>
31
32#include <array>
33
34namespace bitpit{
35
37 public:
38 virtual int getCellReferenceObjectId( long id ) const = 0;
39 virtual int getCellReferencePrimaryObjectId( long id ) const = 0;
40
41 virtual int getReferenceObjectId( const std::array<double, 3> &point ) const = 0;
42 virtual int getReferencePrimaryObjectId( const std::array<double, 3> &point ) const = 0;
43
44 virtual std::vector<int> getSourceObjectIds() const = 0;
45 virtual std::vector<int> getPrimarySourceObjectIds() const = 0;
46
47};
48
49template<typename SourceLevelSetObject, typename BaseLevelSetObject = LevelSetObject>
50class LevelSetProxyObject : public BaseLevelSetObject, public LevelSetProxyBaseObject {
51 protected:
53
54 void fillCellLocationCache() override;
55 void fillCellLocationCache(const std::vector<adaption::Info> &adaptionData) override;
56
57 virtual void replaceSourceObject(const SourceLevelSetObject *current, const SourceLevelSetObject *updated) = 0;
58
59 public:
60 bool isPrimary() const override;
61
62 bool isCellInNarrowBand(long id) const override;
63 bool isInNarrowBand(const std::array<double,3> &point) const override;
64
65 virtual const SourceLevelSetObject * getCellReferenceObject( long id ) const =0;
66 virtual const SourceLevelSetObject * getCellReferencePrimaryObject( long id ) const;
67
68 virtual const SourceLevelSetObject * getReferenceObject( const std::array<double, 3> &point ) const =0;
69 virtual const SourceLevelSetObject * getReferencePrimaryObject( const std::array<double, 3> &point ) const;
70
71 int getCellReferenceObjectId( long id ) const override;
72 int getCellReferencePrimaryObjectId( long id ) const override;
73
74 int getReferenceObjectId( const std::array<double, 3> &point ) const override;
75 int getReferencePrimaryObjectId( const std::array<double, 3> &point ) const override;
76
77 virtual std::vector<const SourceLevelSetObject *> getSourceObjects() const =0;
78 virtual std::vector<const SourceLevelSetObject *> getPrimarySourceObjects() const;
79
80 std::vector<int> getSourceObjectIds() const override;
81 std::vector<int> getPrimarySourceObjectIds() const override;
82
83 BITPIT_DEPRECATED(int getPrimaryObjectId( long ) const);
84
85};
86
87// Compatibility with older versions
89
90}
91
92// Include template implementations
93#include "levelSetProxyObject.tpp"
94
95#endif
Interface class for all objects, which depend on other LevelSetObjects.
virtual const SourceLevelSetObject * getCellReferencePrimaryObject(long id) const
int getReferencePrimaryObjectId(const std::array< double, 3 > &point) const override
int getCellReferenceObjectId(long id) const override
std::vector< int > getPrimarySourceObjectIds() const override
bool isCellInNarrowBand(long id) const override
virtual std::vector< const SourceLevelSetObject * > getPrimarySourceObjects() const
int getCellReferencePrimaryObjectId(long id) const override
bool isInNarrowBand(const std::array< double, 3 > &point) const override
int getReferenceObjectId(const std::array< double, 3 > &point) const override
std::vector< int > getSourceObjectIds() const override
virtual const SourceLevelSetObject * getReferencePrimaryObject(const std::array< double, 3 > &point) const
#define BITPIT_DEPRECATED(func)
Definition compiler.hpp:87
--- layout: doxygen_footer ---