- 01 Jun, 2018 1 commit
-
-
Mark Olesen authored
-
- 30 May, 2018 2 commits
-
-
Mark Olesen authored
- resolve in favour of "inline explicit", which had marginally more uses and provides consistent prefixing for inline methods.
-
Mark Olesen authored
- make the purpose more explicit, and reduces some work for the compiler as well.
-
- 16 May, 2018 1 commit
-
-
Mark Olesen authored
- use refCount instead of the tmp<...>::refCount alias
-
- 15 May, 2018 1 commit
-
-
Mark Olesen authored
-
- 05 Mar, 2018 1 commit
-
-
Mark Olesen authored
- The iterator for a HashSet dereferences directly to its key. - Eg, for (const label patchi : patchSet) { ... } vs. forAllConstIter(labelHashSet, patchSet, iter) { const label patchi = iter.key(); ... }
-
- 12 Apr, 2018 1 commit
-
-
Mark Olesen authored
- IOstreamOption class to encapsulate format, compression, version. This is ordered to avoid internal padding in the structure, which reduces several bytes of memory overhead for stream objects and other things using this combination of data. Byte-sizes: old IOstream:48 PstreamBuffers:88 Time:928 new IOstream:24 PstreamBuffers:72 Time:904 ==== STYLE: remove support for deprecated uncompressed/compressed selectors In older versions, the system/controlDict used these types of specifications: writeCompression uncompressed; writeCompression compressed; As of DEC-2009, these were deprecated in favour of using normal switch names: writeCompression true; writeCompression false; writeCompression on; writeCompression off; Now removed these deprecated names and treat like any other unknown input and issue a warning. Eg, Unknown compression specifier 'compressed', assuming no compression ==== STYLE: provide Enum of stream format names (ascii, binary) ==== COMP: fixed incorrect IFstream construct in FIREMeshReader - spurious bool argument (presumably meant as uncompressed) was being implicitly converted to a versionNumber. Now caught by making IOstreamOption::versionNumber constructor explicit. - bad version specifier in changeDictionary
-
- 28 Mar, 2018 1 commit
-
-
Andrew Heather authored
-
- 21 Mar, 2018 1 commit
-
-
Mark Olesen authored
- specialize transfer and swap to ensure allocated capacity isn't forgotten.
-
- 19 Mar, 2018 1 commit
-
-
Mark Olesen authored
- can assist the compiler in producing tighter code.
-
- 16 Mar, 2018 1 commit
-
-
Mark Olesen authored
- when constructing dimensioned fields that are to be zero-initialized, it is preferrable to use a form such as dimensionedScalar(dims, Zero) dimensionedVector(dims, Zero) rather than dimensionedScalar("0", dims, 0) dimensionedVector("zero", dims, vector::zero) This reduces clutter and also avoids any suggestion that the name of the dimensioned quantity has any influence on the field's name. An even shorter version is possible. Eg, dimensionedScalar(dims) but reduces the clarity of meaning. - NB: UniformDimensionedField is an exception to these style changes since it does use the name of the dimensioned type (instead of the regIOobject).
-
- 05 Mar, 2018 1 commit
-
-
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.
-
- 26 Feb, 2018 3 commits
-
-
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_();
-
- 22 Feb, 2018 1 commit
-
-
Mark Olesen authored
- the wordHashSet typedef is always available when HashSet has been included. - use default HashTable key (word) instead of explicitly mentioning it
-
- 19 Feb, 2018 1 commit
-
-
Mark Olesen authored
-
- 27 Nov, 2017 1 commit
-
-
Mark Olesen authored
- support move construct/assignment for linked-lists themselves and when moving into a 'normal' list - better consistency with begin/end signatures and the various iterators. - for indirect linked-lists, provide iterator access to the underlying data element address: iter.get() vs &(iter()) - add standard '->' indirection for iterators (as per normal STL definitions)
-
- 05 Nov, 2017 1 commit
-
-
Mark Olesen authored
- makes for clearer code ENH: make writeIfDifferent part of Ostream
-
- 22 Nov, 2017 1 commit
-
-
Mark Olesen authored
- in most cases already checked valid() so don't need additional check for setting an existing pointer
-
- 25 Oct, 2017 1 commit
-
-
Mark Olesen authored
- makes it accessible for containers that manage their own storage and derive directly from UList. - DynamicList::min_size() method to access the corresponding SizeMin template parameter. - ensure consistency in the reserve size for the constructor DynamicList<..> lst(N); now has identical sizing as DynamicList<..> lst(); reserve(N);
-
- 24 Oct, 2017 1 commit
-
-
Mark Olesen authored
- now use public functions instead of direct access of private 'capacity_' information
-
- 20 Sep, 2017 2 commits
-
-
Mark Olesen authored
- improve functional compatibility with DynList (remove methods) * eg, remove an element from any position in a DynamicList * reduce the number of template parameters * remove/subset regions of DynamicList - propagate Swap template specializations for lists, hashtables - move construct/assignment to various containers. - add find/found methods for FixedList and UList for a more succinct (and clearer?) usage than the equivalent global findIndex() function. - simplify List_FOR_ALL loops
-
Mark Olesen authored
-
- 05 Jul, 2017 1 commit
-
-
Mark Olesen authored
-
- 03 Jul, 2017 1 commit
-
-
Mark Olesen authored
-
- 29 Jun, 2017 1 commit
-
-
Andrew Heather authored
-
- 26 Jun, 2017 1 commit
-
-
for consistency with reactingTwoPhaseEulerFoam and to ensure correct operation of models requiring formal boundedness of phase-fractions. Resolves bug-report https://bugs.openfoam.org/view.php?id=2589
-
- 26 May, 2017 1 commit
-
-
Mark Olesen authored
-
- 24 May, 2017 1 commit
-
-
Andrew Heather authored
-
- 19 May, 2017 1 commit
-
-
Andrew Heather authored
-
- 22 Jun, 2017 1 commit
-
-
"pos" now returns 1 if the argument is greater than 0, otherwise it returns 0. This is consistent with the common mathematical definition of the "pos" function: https://en.wikipedia.org/wiki/Sign_(mathematics) However the previous implementation in which 1 was also returned for a 0 argument is useful in many situations so the "pos0" has been added which returns 1 if the argument is greater or equal to 0. Additionally the "neg0" has been added which returns 1 if if the argument is less than or equal to 0.
-
- 13 Jul, 2017 1 commit
-
-
Avoids potential problems with derived classes which do not define a clone function.
-
- 07 Jul, 2017 1 commit
-
-
Andrew Heather authored
Original commit message: ------------------------ Parallel IO: New collated file format When an OpenFOAM simulation runs in parallel, the data for decomposed fields and mesh(es) has historically been stored in multiple files within separate directories for each processor. Processor directories are named 'processorN', where N is the processor number. This commit introduces an alternative "collated" file format where the data for each decomposed field (and mesh) is collated into a single file, which is written and read on the master processor. The files are stored in a single directory named 'processors'. The new format produces significantly fewer files - one per field, instead of N per field. For large parallel cases, this avoids the restriction on the number of open files imposed by the operating system limits. The file writing can be threaded allowing the simulation to continue running while the data is being written to file. NFS (Network File System) is not needed when using the the collated format and additionally, there is an option to run without NFS with the original uncollated approach, known as "masterUncollated". The controls for the file handling are in the OptimisationSwitches of etc/controlDict: OptimisationSwitches { ... //- Parallel IO file handler // uncollated (default), collated or masterUncollated fileHandler uncollated; //- collated: thread buffer size for queued file writes. // If set to 0 or not sufficient for the file size threading is not used. // Default: 2e9 maxThreadFileBufferSize 2e9; //- masterUncollated: non-blocking buffer size. // If the file exceeds this buffer size scheduled transfer is used. // Default: 2e9 maxMasterFileBufferSize 2e9; } When using the collated file handling, memory is allocated for the data in the thread. maxThreadFileBufferSize sets the maximum size of memory in bytes that is allocated. If the data exceeds this size, the write does not use threading. When using the masterUncollated file handling, non-blocking MPI communication requires a sufficiently large memory buffer on the master node. maxMasterFileBufferSize sets the maximum size in bytes of the buffer. If the data exceeds this size, the system uses scheduled communication. The installation defaults for the fileHandler choice, maxThreadFileBufferSize and maxMasterFileBufferSize (set in etc/controlDict) can be over-ridden within the case controlDict file, like other parameters. Additionally the fileHandler can be set by: - the "-fileHandler" command line argument; - a FOAM_FILEHANDLER environment variable. A foamFormatConvert utility allows users to convert files between the collated and uncollated formats, e.g. mpirun -np 2 foamFormatConvert -parallel -fileHandler uncollated An example case demonstrating the file handling methods is provided in: $FOAM_TUTORIALS/IO/fileHandling The work was undertaken by Mattijs Janssens, in collaboration with Henry Weller.
-
- 22 May, 2017 1 commit
-
-
vectorField or vector2DField from scalarField components. To do this properly and have it work for field-type combinations would require some new field function macros.
-
- 04 May, 2017 1 commit
-
-
Andrew Heather authored
-
- 27 Apr, 2017 2 commits
-
-
Andrew Heather authored
-
Mark Olesen authored
-
- 25 Apr, 2017 1 commit
-
-
Mark Olesen authored
- can be used to reduce copying
-
- 24 Apr, 2017 1 commit
-
-
Andrew Heather authored
-