90 const shared_ptr<StructuredBlockForest> &blocks, BlockDataID fieldID_,
91 std::function<
float(
const Cell &,
92 const shared_ptr<StructuredBlockForest> &, IBlock &)>
94 : elementInitaliser(dirichletCallback),
fieldID(fieldID_) {
95 auto createIdxVector = [](IBlock *
const, StructuredBlockStorage *
const) {
98 indexVectorID = blocks->addStructuredBlockData<
IndexVectors>(
99 createIdxVector,
"IndexField_Dirichlet_single_precision");
124 ConstBlockDataID flagFieldID, FlagUID boundaryFlagUID,
125 FlagUID domainFlagUID) {
126 for (
auto blockIt = blocks->begin(); blockIt != blocks->end(); ++blockIt)
127 fillFromFlagField<FlagField_T>(blocks, &*blockIt, flagFieldID,
128 boundaryFlagUID, domainFlagUID);
133 IBlock *
block, ConstBlockDataID flagFieldID,
134 FlagUID boundaryFlagUID, FlagUID domainFlagUID) {
140 auto *flagField =
block->getData<FlagField_T>(flagFieldID);
142 if (!(flagField->flagExists(boundaryFlagUID) &&
143 flagField->flagExists(domainFlagUID)))
146 auto boundaryFlag = flagField->getFlag(boundaryFlagUID);
147 auto domainFlag = flagField->getFlag(domainFlagUID);
149 auto inner = flagField->xyzSize();
150 inner.expand(cell_idx_t(-1));
152 indexVectorAll.clear();
153 indexVectorInner.clear();
154 indexVectorOuter.clear();
156 auto flagWithGLayers = flagField->xyzSizeWithGhostLayer();
157 for (
auto it = flagField->beginWithGhostLayerXYZ(); it != flagField->end();
160 if (!isFlagSet(it, boundaryFlag))
162 if (flagWithGLayers.contains(it.x() + cell_idx_c(0),
163 it.y() + cell_idx_c(0),
164 it.z() + cell_idx_c(0)) &&
165 isFlagSet(it.neighbor(0, 0, 0, 0), domainFlag)) {
167 auto element =
IndexInfo(it.x(), it.y(), it.z(), 0);
168 float InitialisatonAdditionalData =
169 elementInitaliser(
Cell(it.x(), it.y(), it.z()), blocks, *
block);
170 element.value = InitialisatonAdditionalData;
171 indexVectorAll.push_back(element);
172 if (
inner.contains(it.x(), it.y(), it.z()))
173 indexVectorInner.push_back(element);
175 indexVectorOuter.push_back(element);