Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions include/bout/mask.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include "bout/globals.hxx"
#include "bout/mesh.hxx"
#include "bout/region.hxx"

/**
* 3D array of bools to mask Field3Ds
Expand Down Expand Up @@ -80,4 +81,12 @@ inline std::unique_ptr<Region<Ind3D>> regionFromMask(const BoutMask& mask,
}
return std::make_unique<Region<Ind3D>>(indices);
}

inline BoutMask maskFromRegion(const Region<Ind3D>& region, const Mesh* mesh) {
BoutMask mask{mesh, false};

BOUT_FOR(i, region) { mask[i] = true; }
Comment thread
dschwoerer marked this conversation as resolved.
return mask;
}

#endif //BOUT_MASK_H
Loading