- 07 May, 2018 1 commit
-
-
Mark OLESEN authored
- improvement documentation for surface sampling. - can now specify alternative sampling scheme for obtaining the face values instead of just using the "cell" value. For example, sampleScheme cellPoint; This can be useful for cases when the surface is close to a boundary cell and there are large gradients in the sampled field. - distanceSurface now handles non-closed surfaces more robustly. Unknown regions (not inside or outside) are marked internally and excluded from consideration. This allows use of 'signed' surfaces where not previously possible.
-
- 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
-
- 26 Mar, 2018 1 commit
-
-
Mark OLESEN authored
- in many cases can just use lookupOrDefault("key", bool) instead of lookupOrDefault<bool> or lookupOrDefault<Switch> since reading a bool from an Istream uses the Switch(Istream&) anyhow STYLE: relocated Switch string names into file-local scope
-
- 21 Mar, 2018 1 commit
-
-
Mark OLESEN authored
- both autoPtr and tmp are defined with an implicit construct from nullptr (but with explicit construct from a pointer to null). Thus is it safe to use 'nullptr' when returning an empty autoPtr or tmp.
-
- 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).
-
- 07 Mar, 2018 1 commit
-
-
Mark OLESEN authored
- The bitSet class replaces the old PackedBoolList class. The redesign provides better block-wise access and reduced method calls. This helps both in cases where the bitSet may be relatively sparse, and in cases where advantage of contiguous operations can be made. This makes it easier to work with a bitSet as top-level object. In addition to the previously available count() method to determine if a bitSet is being used, now have simpler queries: - all() - true if all bits in the addressable range are empty - any() - true if any bits are set at all. - none() - true if no bits are set. These are faster than count() and allow early termination. The new test() method tests the value of a single bit position and returns a bool without any ambiguity caused by the return type (like the get() method), nor the const/non-const access (like operator[] has). The name corresponds to what std::bitset uses. The new find_first(), find_last(), find_next() methods provide a faster means of searching for bits that are set. This can be especially useful when using a bitSet to control an conditional: OLD (with macro): forAll(selected, celli) { if (selected[celli]) { sumVol += mesh_.cellVolumes()[celli]; } } NEW (with const_iterator): for (const label celli : selected) { sumVol += mesh_.cellVolumes()[celli]; } or manually for ( label celli = selected.find_first(); celli != -1; celli = selected.find_next() ) { sumVol += mesh_.cellVolumes()[celli]; } - When marking up contiguous parts of a bitset, an interval can be represented more efficiently as a labelRange of start/size. For example, OLD: if (isA<processorPolyPatch>(pp)) { forAll(pp, i) { ignoreFaces.set(i); } } NEW: if (isA<processorPolyPatch>(pp)) { ignoreFaces.set(pp.range()); }
-
- 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_();
-
- 21 Feb, 2018 1 commit
-
-
Mark OLESEN authored
- this permits direct storage of a list with additional matcher capabilities - provide wordRes::matcher class for similar behaviour as previously
-
- 08 Feb, 2018 1 commit
-
-
Mark OLESEN authored
- reduces some ambiguity and clarifies the expected output and behaviour. STYLE: reduce some automatic conversions of char to string
-
- 30 Jan, 2018 2 commits
-
-
Mark OLESEN authored
-
Mark OLESEN authored
- now warn about the following: * the bounding box does not overlap wih the global mesh * plane does not intersect the (valid) bounding box * plane does not intersect the global mesh - add bounding to the "plane" variant of a sampled plane.
-
- 17 Jan, 2018 1 commit
-
-
Mark OLESEN authored
- these were previously taken from region-local directories (eg, constant/region/triSurface), but this becomes difficult to manage when there are many files and regions.
-
- 27 Dec, 2017 1 commit
-
-
mattijs authored
-
- 30 Nov, 2017 1 commit
-
-
Andrew Heather authored
-
- 13 Nov, 2017 2 commits
-
-
Mark OLESEN authored
-
Mark OLESEN authored
- occurred when variable name exceeded the 15-char alignment format and the name run into the previous field.
-
- 06 Dec, 2017 1 commit
-
-
Prashant Sonakar authored
-
- 20 Nov, 2017 1 commit
-
-
Mark OLESEN authored
- eliminates previous code duplication and improves maintainability
-
- 19 Nov, 2017 1 commit
-
-
Mark OLESEN authored
-
- 16 Nov, 2017 1 commit
-
-
- now also fixed collated output format
-
- 22 Sep, 2017 1 commit
-
-
Mark OLESEN authored
-
- 29 Aug, 2017 1 commit
-
-
mattijs authored
There are a few issues: - error would only throw exceptions if not parallel - if we change this we also need to make sure the functionObjectList construction is synchronised - bounding box overlap was not returning the correct status so the code to avoid the issue of 'badly formed bounding box' was not triggered.
-
- 24 Oct, 2017 1 commit
-
-
Mark OLESEN authored
-
- 17 Jul, 2017 1 commit
-
-
Mark OLESEN authored
- use allocator class to wrap the stream pointers instead of passing them into ISstream, OSstream and using a dynamic cast to delete then. This is especially important if we will have a bidirectional stream (can't delete twice!). STYLE: - file stream constructors with std::string (C++11) - for rewind, explicit about in|out direction. This is not currently important, but avoids surprises with any future bidirectional access. - combined string streams in StringStream.H header. Similar to <sstream> include that has both input and output string streams.
-
- 21 Jul, 2017 1 commit
-
-
Mark OLESEN authored
- makes the purpose clearer. In some places, string::resize() is even simpler. - use C++11 string::back() in preference to str[str.size()-1]
-
- 03 Jul, 2017 2 commits
-
-
Mark OLESEN authored
-
Mark OLESEN authored
-
- 26 Jun, 2017 1 commit
-
-
Mark OLESEN authored
- disable automatically upgrading copyrights in files since changes to not automatically imply a change in copyright. Eg, fixing a typo in comments, or changing a variable from 'loopI' to 'loopi' etc.
-
- 15 Jun, 2017 1 commit
-
-
mattijs authored
-
- 07 Jun, 2017 1 commit
-
-
mattijs authored
-
- 26 May, 2017 1 commit
-
-
Mark OLESEN authored
-
- 19 May, 2017 1 commit
-
-
Andrew Heather authored
-
- 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.
-
- 17 May, 2017 1 commit
-
-
Mark OLESEN authored
-
- 04 May, 2017 1 commit
-
-
mattijs authored
-
- 10 Mar, 2017 1 commit
-
-
Henry Weller authored
-
- 21 Feb, 2017 1 commit
-
-
mark authored
- remove some spurious regExp includes
-