25# ifndef __BITPIT_LEVELSET_PROXY_OBJECT_TPP__
26# define __BITPIT_LEVELSET_PROXY_OBJECT_TPP__
39template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
52template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
67template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
76 typedef typename BaseLevelSetObject::CellCacheCollection::template ValueCache<char> BaseZoneCache;
77 BaseZoneCache *locationCache = this->
template getCellCache<char>(this->m_cellLocationCacheId);
81 long cellId = cellItr.getId();
83 locationCache->insertEntry(cellId,
static_cast<char>(cellLocation));
99template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
103 typedef typename BaseLevelSetObject::CellCacheCollection::template ValueCache<char> BaseZoneCache;
104 BaseZoneCache *locationCache = this->
template getCellCache<char>(this->m_cellLocationCacheId);
108 if (adaptionInfo.entity != adaption::Entity::ENTITY_CELL) {
116 if (adaptionInfo.type == adaption::Type::TYPE_PARTITION_RECV && !locationCache->isVolatile()) {
121 for (
long cellId : adaptionInfo.current) {
123 locationCache->insertEntry(cellId,
static_cast<char>(cellLocation));
143template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
146 return getCellReferenceObject(
id)->isCellInNarrowBand(
id);
157template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
160 return getReferenceObject(point)->isInNarrowBand(point);
170template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
173 const SourceLevelSetObject *referenceObject = getCellReferenceObject(
id);
174 if (!referenceObject) {
178 if (referenceObject->isPrimary()) {
179 return referenceObject;
183 return referenceProxyObject->getCellReferencePrimaryObject(
id);
197template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
200 const SourceLevelSetObject *referenceObject = getReferenceObject(point);
201 if (!referenceObject) {
205 if (referenceObject->isPrimary()) {
206 return referenceObject;
210 return referenceProxyObject->getReferencePrimaryObject(point);
224template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
227 const SourceLevelSetObject *referenceObject = getCellReferenceObject(
id);
228 if (!referenceObject) {
232 return referenceObject->getId();
243template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
246 const SourceLevelSetObject *referenceObject = getCellReferenceObject(
id);
247 if (!referenceObject) {
251 if (referenceObject->isPrimary()) {
252 return referenceObject->getId();
256 if (!referenceProxyObject) {
260 return referenceProxyObject->getCellReferencePrimaryObjectId(
id);
270template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
273 const SourceLevelSetObject *referenceObject = getReferenceObject(point);
274 if (!referenceObject) {
278 return referenceObject->getId();
289template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
292 const SourceLevelSetObject *referenceObject = getReferenceObject(point);
293 if (!referenceObject) {
297 if (referenceObject->isPrimary()) {
298 return referenceObject->getId();
303 if (!referenceProxyObject) {
307 return referenceProxyObject->getReferencePrimaryObjectId(point);
315template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
318 std::vector<const SourceLevelSetObject *> objects;
319 for(
const SourceLevelSetObject *sourceObject : getSourceObjects()){
321 std::vector<const SourceLevelSetObject *> sourcePrimarySourceObjects = proxySourceObject->getPrimarySourceObjects();
322 objects.insert(objects.end(), sourcePrimarySourceObjects.begin(), sourcePrimarySourceObjects.end());
324 objects.push_back(sourceObject);
337template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
340 std::vector<const SourceLevelSetObject*> sourceObjects = getSourceObjects();
341 std::size_t nSourceObjects = sourceObjects.size();
343 std::vector<int> sourceIds(nSourceObjects);
344 for (std::size_t i = 0; i < nSourceObjects; ++i) {
345 const SourceLevelSetObject *sourceObject = sourceObjects[i];
346 sourceIds[i] = sourceObject->getId();
358template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
361 std::vector<const SourceLevelSetObject*> primaryObjects = getPrimarySourceObjects();
362 std::size_t nPrimaryObjects = primaryObjects.size();
364 std::vector<int> primaryIds(nPrimaryObjects);
365 for (std::size_t i = 0; i < nPrimaryObjects; ++i) {
366 const SourceLevelSetObject *primaryObject = primaryObjects[i];
367 primaryIds[i] = primaryObject->getId();
381template<
typename SourceLevelSetObject,
typename BaseLevelSetObject>
384 return getReferencePrimaryObjectId(
id);
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
bool isPrimary() 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
void fillCellLocationCache() override
virtual const SourceLevelSetObject * getReferencePrimaryObject(const std::array< double, 3 > &point) const
int getPrimaryObjectId(long) const
CellConstIterator cellConstBegin() const
CellConstIterator cellConstEnd() const
Iterator for the class PiercedStorage.
The VolumeKernel class provides an interface for defining volume patches.
The Info struct defines the information associated to an adaption.