27# include "bitpit_IO.hpp"
28# include "bitpit_common.hpp"
30# include "levelSetObject.hpp"
31# include "levelSetProxyObject.hpp"
32# include "levelSetComplementObject.hpp"
49template<
typename SourceLevelSetObject>
52 m_sourceObject(source)
61template<
typename SourceLevelSetObject>
64 return m_sourceObject->empty();
73template<
typename SourceLevelSetObject>
76 if (current != m_sourceObject) {
77 throw std::runtime_error(
"Unable to find the source that should be replaced.");
80 m_sourceObject = updated;
86template<
typename SourceLevelSetObject>
92 bool useSourceSign =
false;
102 useSourceSign =
true;
107 if (!useSourceSign) {
108 SourceLevelSetObject::fillCellPropagatedSignCache();
113 const VolumeKernel &mesh = *(this->getKernel()->getMesh()) ;
118 typedef typename SourceLevelSetObject::CellCacheCollection::template ValueCache<char> ZoneCache;
119 ZoneCache *propagatedSignCache = this->
template getCellCache<char>(this->m_cellPropagatedSignCacheId);
123 long cellId = cellItr.getId();
124 short cellSign = - m_sourceObject->evalCellSign(cellId);
126 propagatedSignCache->insertEntry(cellId,
static_cast<char>(cellSign));
136template<
typename SourceLevelSetObject>
139 return (-1 * m_sourceObject->evalCellSign(
id));
149template<
typename SourceLevelSetObject>
152 double value = m_sourceObject->evalCellValue(
id, signedLevelSet);
153 if (signedLevelSet) {
167template<
typename SourceLevelSetObject>
170 std::array<double,3> gradient = m_sourceObject->evalCellGradient(
id, signedLevelSet);
171 if (signedLevelSet) {
184template<
typename SourceLevelSetObject>
187 return (-1 * m_sourceObject->evalSign(point));
197template<
typename SourceLevelSetObject>
200 double value = m_sourceObject->evalValue(point, signedLevelSet);
201 if (signedLevelSet) {
215template<
typename SourceLevelSetObject>
218 std::array<double,3> gradient = m_sourceObject->evalGradient(point, signedLevelSet);
219 if (signedLevelSet) {
233template<
typename SourceLevelSetObject>
238 return m_sourceObject;
248template<
typename SourceLevelSetObject>
253 return m_sourceObject;
262template<
typename SourceLevelSetObject>
265 return m_sourceObject;
274template<
typename SourceLevelSetObject>
277 return std::vector<const SourceLevelSetObject *>(1, m_sourceObject);
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
short _evalCellSign(long id) const override
double _evalCellValue(long id, bool signedLevelSet) const override
void replaceSourceObject(const SourceLevelSetObject *current, const SourceLevelSetObject *updated) override
LevelSetComplementBaseObject(int id, const SourceLevelSetObject *source)
bool empty() const override
short _evalSign(const std::array< double, 3 > &point) const override
std::vector< const SourceLevelSetObject * > getSourceObjects() const override
void fillCellPropagatedSignCache() override
Interface class for all objects, which depend on other LevelSetObjects.
CellConstIterator cellConstBegin() const
CellConstIterator cellConstEnd() const
Iterator for the class PiercedStorage.
The VolumeKernel class provides an interface for defining volume patches.
#define BITPIT_UNUSED(variable)
LevelSetBulkEvaluationMode
@ FULL
Data are cached in the whole domain.
@ SIGN_PROPAGATION
Sign is propagated from the narrow band, no other data will be evaluated.
@ EXACT
Exact data is evaluated.