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)
192 const labelRange sub(
range(elemType(typei)));
196 SubList<label> ids(sub, addressing());
199 ids = reorder<labelList>(order, ids);
202 if (!flipMap_.empty())
204 SubList<bool> flips(flipMap_, sub);
205 flips = reorder<boolList>(order, flips);
209 if (!faceOrder_.empty())
211 SubList<label> faceOrder(faceOrder_, sub);
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]);
249 const UList<face>& faces,
250 const labelRange&
range
253 const labelRange slice(
range.subset0(faces.size()));
256 classify(SubList<face>(slice, faces));
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;
List< label > labelList
A List of labels.
const labelList & addressing() const noexcept
static constexpr int nTypes
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void rename(const string &value)
void resize(const label len)
static constexpr const zero Zero
A List obtained as a section of another List.
static const char * key(const elemType etype)
virtual Ostream & beginBlock(const keyType &kw)
bool test(const label pos) const
Sorting/classification of faces (2D) into corresponding ensight types.
virtual void writeDict(Ostream &os, const bool full=false) const
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
FixedList< label, nTypes > sizes() const
bool empty() const noexcept
A range or interval of labels defined by a start and a size.
virtual Ostream & endBlock()
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)
unsigned int count(const UList< bool > &bools, const bool val=true)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Base class for ensightCells, ensightFaces, ensightOutputSurfaces.
Ostream & endEntry(Ostream &os)
fileName::Type type(const fileName &name, const bool followLink=true)
A 1D vector of objects of type <T> with a fixed length <N>.
static const char * elemNames[nTypes]
Ostream & writeEntry(const keyType &key, const T &value)
word name(const expressions::valueTypeCode typeCode)
A face is a list of labels corresponding to mesh vertices.
iterator begin() noexcept
labelList sortedOrder(const UList< T > &input)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
defineTypeNameAndDebug(combustionModel, 0)
IntType start() const noexcept
void classify(const UList< face > &faces)