Go to the documentation of this file.
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_)
141 nTotal += sizes_[typei];
169 sizes_[typei] = size(
elemType(typei));
178 if (faceOrder_.size() != size())
182 if (flipMap_.size() != size())
190 for (
int typei=0; typei < nTypes; ++typei)
199 ids = reorder<labelList>(order, ids);
202 if (!flipMap_.empty())
205 flips = reorder<boolList>(order, flips);
209 if (!faceOrder_.empty())
212 faceOrder = reorder<labelList>(order, faceOrder);
221 const label len = faces.
size();
226 for (label listi = 0; listi < len; ++listi)
228 const auto etype = whatType(faces[listi]);
238 for (label listi = 0; listi < len; ++listi)
240 const auto etype = whatType(faces[listi]);
259 incrAddressing(slice.
start());
271 const label len = addr.
size();
272 const bool useFlip = (len == flipMap.size());
277 for (label listi = 0; listi < len; ++listi)
279 const label
faceId = addr[listi];
283 const auto etype = whatType(faces[
faceId]);
292 label nUsed = addressing().size();
296 flipMap_.resize(nUsed);
300 faceOrder_.resize(nUsed);
306 for (label listi = 0; listi < len; ++listi)
308 const label
faceId = addr[listi];
312 const bool doFlip = useFlip && flipMap.test(listi);
314 const auto etype = whatType(faces[
faceId]);
316 const label idx =
add(etype,
faceId, doFlip);
318 faceOrder_[nUsed] = idx;
const labelList & addressing() const noexcept
Element addressing.
static constexpr int nTypes
Number of 'Face' element types (3)
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void rename(const string &value)
Change the part name or description.
void resize(const label len)
Adjust allocated size of list.
static constexpr const zero Zero
Global zero (0)
A List obtained as a section of another List.
static const char * key(const elemType etype)
The ensight element name for the specified 'Face' type.
void clearOut()
Clear any demand-driven data.
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
bool test(const label pos) const
Test value at specified position, never auto-vivify entries.
Sorting/classification of faces (2D) into corresponding ensight types.
virtual void writeDict(Ostream &os, const bool full=false) const
#define forAll(list, i)
Loop across all elements in list.
label total() const
The global size of all element types.
iterator begin() noexcept
Return an iterator to begin traversing the FixedList.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
void reduce()
Sum element counts across all processes.
FixedList< label, nTypes > sizes() const
Processor-local sizes per element type.
bool empty() const noexcept
True if range is empty (zero-sized)
A range or interval of labels defined by a start and a size.
virtual Ostream & endBlock()
Write end block group.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
OBJstream os(runTime.globalPath()/outputName)
virtual Ostream & writeKeyword(const keyType &kw)
Write the keyword followed by an appropriate indentation.
ensightFaces()
Default construct, with part index 0.
elemType
Supported ensight 'Face' element types.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Base class for ensightCells, ensightFaces, ensightOutputSurfaces.
Ostream & endEntry(Ostream &os)
Write end entry (';') followed by newline.
void clear()
Set addressable sizes to zero, free up addressing memory.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
A 1D vector of objects of type <T> with a fixed length <N>.
void sort()
Inplace sort element lists numerically.
static const char * elemNames[nTypes]
The ensight 'Face' element type names.
void clear()
Clear the list, i.e. set size to zero.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A face is a list of labels corresponding to mesh vertices.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
void size(const label n)
Older name for setAddressableSize.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void clear()
Clear element addressing.
IntType start() const noexcept
The (inclusive) lower value of the range.
defineTypeNameAndDebug(combustionModel, 0)
void classify(const UList< face > &faces)
Classify the face types and set the element lists.