- Feb 21, 2018
-
-
mattijs authored
-
- Mar 07, 2018
-
-
Mark OLESEN authored
-
Mark OLESEN authored
-
Andrew Heather authored
Feature memory containers See merge request OpenFOAM-plus!192
-
- Mar 06, 2018
-
-
Andrew Heather authored
-
- Mar 05, 2018
-
-
Mark OLESEN authored
- primary points for an external user are the polyMesh constructor - add config info for gcc-7.3.0 COMP: intel-2017. Ignore unknown pragmas. Disambiguate method resolution.
-
Mark OLESEN authored
This class is largely a pre-C++11 holdover. It is now possible to simply use move construct/assignment directly. In a few rare cases (eg, polyMesh::resetPrimitives) it has been replaced by an autoPtr.
-
- Feb 28, 2018
-
-
Mark OLESEN authored
- downgrades some diagnostics about nonconformant code from errors to warnings. Oddly enough, the errors actually arise from STL library elements shipped with gcc itself. Affects kahip compilation with gcc-6, gcc-7
-
Mark OLESEN authored
-
Mark OLESEN authored
-
Mark OLESEN authored
- rvalue() is a (transitional) means of converting Xfer content to a reference for move construct, move assign semantics. - valid() method for consistency with autoPtr and tmp classes
-
- Feb 27, 2018
-
-
Mark OLESEN authored
STYLE: simplified output logic, reduced duplicate code in CompactIOList
-
- Feb 26, 2018
-
-
Mark OLESEN authored
-
Mark OLESEN authored
Improve alignment of its behaviour with std::shared_ptr - element_type typedef - swap, reset methods * additional reference access methods: cref() returns a const reference, synonymous with operator(). This provides a more verbose alternative to using the '()' operator when that is desired. Mnemonic: a const form of 'ref()' constCast() returns a non-const reference, regardless if the underlying object itself is a managed pointer or a const object. This is similar to ref(), but more permissive. Mnemonic: const_cast<> Using the constCast() method greatly reduces the amount of typing and reading. And since the data type is already defined via the tmp template parameter, the type deduction is automatically known. Previously, const tmp<volScalarField>& tfld; const_cast<volScalarField&>(tfld()).rename("name"); volScalarField& fld = const_cast<volScalarField&>(tfld()); Now, tfld.constCast().rename("name"); auto& fld = tfld.constCast(); -- BUG: attempts to move tmp value that may still be shared. - old code simply checked isTmp() to decide if the contents could be transfered. However, this means that the content of a shared tmp would be removed, leaving other instances without content. * movable() method checks that for a non-null temporary that is unique (not shared).
-
Mark OLESEN authored
Improve alignment of its behaviour with std::unique_ptr - element_type typedef - release() method - identical to ptr() method - get() method to get the pointer without checking and without releasing it. - operator*() for dereferencing Method name changes - renamed rawPtr() to get() - renamed rawRef() to ref(), removed unused const version. Removed methods/operators - assignment from a raw pointer was deleted (was rarely used). Can be convenient, but uncontrolled and potentially unsafe. Do allow assignment from a literal nullptr though, since this can never leak (and also corresponds to the unique_ptr API). Additional methods - clone() method: forwards to the clone() method of the underlying data object with argument forwarding. - reset(autoPtr&&) as an alternative to operator=(autoPtr&&) STYLE: avoid implicit conversion from autoPtr to object type in many places - existing implementation has the following: operator const T&() const { return operator*(); } which means that the following code works: autoPtr<mapPolyMesh> map = ...; updateMesh(*map); // OK: explicit dereferencing updateMesh(map()); // OK: explicit dereferencing updateMesh(map); // OK: implicit dereferencing for clarity it may preferable to avoid the implicit dereferencing - prefer operator* to operator() when deferenced a return value so it is clearer that a pointer is involve and not a function call etc Eg, return *meshPtr_; vs. return meshPtr_();
-
- Mar 04, 2018
-
-
Mark OLESEN authored
- constexpr, noexcept. Added an 'at()' method for returning an iterator within the range and changed operator()(label) to have behaviour as per found(). This makes the labelRange usable as a unary predicate. - added templated conversion class 'toLabelRange' - add range() method to polyPatch and surfZone classes, and corresponding templated conversion functors. For example, auto patchDims = ListOps::create<labelRange> ( mesh.boundaryMesh(), toLabelRange<polyPatch>() ); to create a List<labelRange> representing the patch extents.
-
- Mar 06, 2018
-
-
Mark OLESEN authored
- relocated HashSetPlusEqOp and HashTablePlusEqOp to HashSetOps::plusEqOp and HashTableOps::plusEqOp, respectively - additional functions for converting between a labelHashSet and a PackedBoolList or List<bool>: From lists selections to labelHashSet indices: HashSetOps::used(const PackedBoolList&); HashSetOps::used(const UList<bool>&); From labelHashSet to list forms: PackedBoolList bitset(const labelHashSet&); List<bool> bools(const labelHashSet&);
-
- Mar 01, 2018
-
-
Mark OLESEN authored
- relocated ListAppendEqOp and ListUniqueEqOp to ListOps::appendEqOp and ListOps::UniqueEqOp, respectively for better code isolation and documentation of purpose. - relocated setValues to ListOps::setValue() with many more alternative selectors possible - relocated createWithValues to ListOps::createWithValue for better code isolation. The default initialization value is itself now a default parameter, which allow for less typing. Negative indices in the locations to set are now silently ignored, which makes it possible to use an oldToNew mapping that includes negative indices. - additional ListOps::createWithValue taking a single position to set, available both in copy assign and move assign versions. Since a negative index is ignored, it is possible to combine with the output of List::find() etc. STYLE: changes for PackedList - code simplication in the PackedList iterators, including dropping the unused operator() on iterators, which is not available in plain list versions either. - improved sizing for PackedBoolList creation from a labelUList. ENH: additional List constructors, for handling single element list. - can assist in reducing constructor ambiguity, but can also helps memory optimization when creating a single element list. For example, labelListList labels(one(), identity(mesh.nFaces()));
-
- Mar 02, 2018
-
-
Mark OLESEN authored
-
Mark OLESEN authored
-
- Mar 03, 2018
-
-
Mark OLESEN authored
- rationalized some method naming. Eg, c_str() instead of asText()
-
- Mar 02, 2018
-
-
Mark OLESEN authored
- constexpr, noexcept on various bits - addition of a 'one::minus' class that returns '-1' instead of '1'. There are no additional operations defined for this class, but it can be used in various places to signal alternative behaviour such as "initialize to a negative or other invalid value"
-
- Mar 04, 2018
-
-
Mark OLESEN authored
- This class is largely a pre-C++11 holdover, prior to having movable references. - align internals with autoPtr instead of always unconditionally allocating memory. The valid() method can be used to check for a null pointer. - Consolidate into a single file, in anticipation of future removal.
-
- Feb 23, 2018
-
-
Mark OLESEN authored
-
Andrew Heather authored
The minimum number of particles per parcel can now be set in the injection model input, e.g.: model1 { type ...; massTotal ...; parcelBasisType ...; minParticlesPerParcel 1; <-- new optional entry SOI ...; ... Uses a value of 1 by default if the entry is not present. The value of 1 is generally recommended and beneficial for coupled cases where small time steps can lead to the injection of too many parcels and subsequently greatly over-predict the particle source contributions (momentum, heat, mass transfer etc)
-
Andrew Heather authored
-
- Feb 22, 2018
-
-
Mark OLESEN authored
-
- Feb 28, 2018
-
-
Mark OLESEN authored
- now also handles negative indices without issue. This increases its robustness for predicate type of use.
-
Mark OLESEN authored
-
- Feb 23, 2018
-
-
sergio authored
-
sergio authored
-
Andrew Heather authored
several improvements for linked-lists See merge request OpenFOAM-plus!177
-
- Feb 22, 2018
-
-
Mark OLESEN authored
- deprecated MAR-2017 subset(const UList<T>& select, const T& value, const ListType&); inplaceSubset(const UList<T>& select, const T& value, ListType&); The subsetList/inplaceSubsetList variants with a unary predicate provide more flexible and robuster solutions. - deprecated MAR-2017 initList(const T[mRows]); initListList(const T[mRows][nColumns]); Required prior to the addition of constructors with std::initializer_list
-
Mark OLESEN authored
- the wordHashSet typedef is always available when HashSet has been included. - use default HashTable key (word) instead of explicitly mentioning it
-
Mark OLESEN authored
-
Mark OLESEN authored
-
Mark OLESEN authored
-
Mark OLESEN authored
* For most cases, this conversion would be largely unintentional and also less efficient. If the regex is desirable, the caller should invoke it explicitly. For example, findStrings(regExp(str), listOfStrings); Or use one of the keyType, wordRe, wordRes variants instead. If string is to be used as a plain (non-regex) matcher, this can be directly invoked findMatchingStrings(str, listOfStrings); or using the ListOps instead: findIndices(listOfStrings, str); * provide function interfaces for keyType.
-
- Feb 21, 2018
-
-
Mark OLESEN authored
- subsetList, inplaceSubsetList with optional inverted logic. - use moveable elements where possible. - allow optional starting offset for the identity global function. Eg, 'identity(10, start)' vs 'identity(10) + start'
-
Mark OLESEN authored
-