41 "tria3",
"quad4",
"nsided" 47 "Support exactly 3 face types (tria3, quad4, nsided)" 62 ? Foam::ensightFaces::elemType::TRIA3
64 ? Foam::ensightFaces::elemType::QUAD4
65 : Foam::ensightFaces::elemType::NSIDED
74 void Foam::ensightFaces::resizeAll()
86 auto iter = offsets_.
begin();
89 for (
const label
n : sizes_)
127 for (
int typei = 0; typei < nTypes; ++typei)
139 for (label
n : sizes_)
166 for (
int typei = 0; typei < nTypes; ++typei)
168 sizes_[typei] = size(
elemType(typei));
177 if (faceOrder_.size() != size())
181 if (flipMap_.size() != size())
189 for (
int typei=0; typei < nTypes; ++typei)
191 const labelRange sub(
range(elemType(typei)));
195 SubList<label> ids(sub, addressing());
198 ids = reorder<labelList>(order, ids);
201 if (!flipMap_.empty())
203 SubList<bool> flips(flipMap_, sub);
204 flips = reorder<boolList>(order, flips);
208 if (!faceOrder_.empty())
210 SubList<label> faceOrder(faceOrder_, sub);
211 faceOrder = reorder<labelList>(order, faceOrder);
220 const label len = faces.size();
225 for (label listi = 0; listi < len; ++listi)
227 const auto etype = whatType(faces[listi]);
237 for (label listi = 0; listi < len; ++listi)
239 const auto etype = whatType(faces[listi]);
248 const UList<face>& faces,
249 const labelRange&
range 252 const labelRange slice(
range.subset0(faces.size()));
255 classify(SubList<face>(slice, faces));
258 incrAddressing(slice.start());
270 const label len = addr.
size();
271 const bool useFlip = (len == flipMap.
size());
276 for (label listi = 0; listi < len; ++listi)
278 const label
faceId = addr[listi];
282 const auto etype = whatType(faces[
faceId]);
291 label nUsed = addressing().size();
295 flipMap_.resize(nUsed);
299 faceOrder_.resize(nUsed);
305 for (label listi = 0; listi < len; ++listi)
307 const label
faceId = addr[listi];
311 const bool doFlip = useFlip && flipMap.
test(listi);
313 const auto etype = whatType(faces[
faceId]);
315 const label idx =
add(etype,
faceId, doFlip);
317 faceOrder_[nUsed] = idx;
void clear()
Clear element addressing.
void size(const label n)
Older name for setAddressableSize.
void clear()
Set addressable sizes to zero, free up addressing memory.
static const char * elemNames[nTypes]
The ensight 'Face' element type names.
A face is a list of labels corresponding to mesh vertices.
A 1D vector of objects of type <T> with a fixed length <N>.
void resize(const label len)
Adjust allocated size of list.
iterator begin() noexcept
Return an iterator to begin traversing the FixedList.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
FixedList< label, nTypes > sizes() const
Processor-local sizes per element type.
Sorting/classification of faces (2D) into corresponding ensight types.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Ostream & endEntry(Ostream &os)
Write end entry (';') followed by newline.
void clearOut()
Clear any demand-driven data.
void reduce()
Sum element counts across all processes.
label totalSize() const noexcept
The global size of all element types.
void classify(const UList< face > &faces)
Classify the face types and set the element lists.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
void clear()
Clear the list, i.e. set size to zero.
virtual Ostream & endBlock()
Write end block group.
ensightFaces()
Default construct, with part index 0.
bool test(const label pos) const
Test for True value at specified position, never auto-vivify entries.
const labelList & addressing() const noexcept
Element addressing.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Base class for ensightCells, ensightFaces, ensightOutputSurfaces.
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
static constexpr int nTypes
Number of 'Face' element types (3)
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type test(const label i) const
Test bool value at specified position, always false for out-of-range access.
static const char * key(const elemType etype) noexcept
The ensight element name for the specified 'Face' type.
elemType
Supported ensight 'Face' element types.
void sort()
Inplace sort element lists numerically.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
List< label > labelList
A List of labels.
virtual void writeDict(Ostream &os, const bool full=false) const
Write information about the object as a dictionary, optionally write all element addresses.
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.
virtual Ostream & writeKeyword(const keyType &kw)
Write the keyword followed by an appropriate indentation.
static constexpr const zero Zero
Global zero (0)