- 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
-
- 11 Apr, 2018 1 commit
-
-
Mark Olesen authored
-
- 09 Apr, 2018 1 commit
-
-
Mark Olesen authored
- a partial selection from https://github.com/mrklein/openfoam-os-x with adjustments. The primary purpose is to reduce header-level incompatibilities and to provide a common set of make rules to allow easier patching (or re-integration).
-
- 12 Apr, 2018 1 commit
-
-
mattijs authored
-
- 03 Apr, 2018 1 commit
-
-
Mark Olesen authored
-
- 28 Mar, 2018 1 commit
-
-
mattijs authored
-
- 26 Mar, 2018 2 commits
-
-
Mark Olesen authored
- avoid clockTime in favour of clockValue. - avoid allocations when profiling is not active. - replace hashing with manual pointer lists
-
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.
-
- 14 Mar, 2018 1 commit
-
-
Mark Olesen authored
- this also provides a better separation of the intent (ie, inserting a single value, or inserting multiply values)
-
- 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.
-
- 27 Feb, 2018 1 commit
-
-
Mark Olesen authored
STYLE: simplified output logic, reduced duplicate code in CompactIOList
-
- 26 Feb, 2018 2 commits
-
-
Mark Olesen authored
-
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
-
- 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
-
- 20 Feb, 2018 1 commit
-
-
Mark Olesen authored
-
- 19 Feb, 2018 1 commit
-
-
Mark Olesen authored
- remove writeLagrangianCoordinates as InfoSwitch, since this is something that a regular user should not be able to disable.
-
- 08 Feb, 2018 2 commits
-
-
Mark Olesen authored
- reduces some ambiguity and clarifies the expected output and behaviour. STYLE: reduce some automatic conversions of char to string
-
Mark Olesen authored
- add copy construct from UList - remove copy construct from dissimilar types. This templated constructor was too generous in what it accepted. For the special cases where a copy constructor is required with a change in the data type, now use the createList factory method, which accepts a unary operator. Eg, auto scalars = scalarList::createList ( labels, [](const label& val){ return 1.5*val; } );
-
- 24 Jan, 2018 1 commit
-
-
Mark Olesen authored
- runTimeModifiable change to the dictionary not being propagated to the underlying functionObjects
-
- 22 Jan, 2018 1 commit
-
-
Mark Olesen authored
- simplify structure. - protect against nullptr when resetting memory streams - make UIListStream swappable - add uiliststream as an example of using a plain std::istream
-
- 17 Jan, 2018 1 commit
-
-
Mark Olesen authored
-
- 15 Jan, 2018 1 commit
-
-
Mark Olesen authored
- can tag the version compatibility with a negative number to suppress the warnings but retain some information about which version was supported.
-
- 08 Jan, 2018 3 commits
-
-
Mark Olesen authored
- use succincter method names that more closely resemble dictionary and HashTable method names. This improves method name consistency between classes and also requires less typing effort: args.found(optName) vs. args.optionFound(optName) args.readIfPresent(..) vs. args.optionReadIfPresent(..) ... args.opt<scalar>(optName) vs. args.optionRead<scalar>(optName) args.read<scalar>(index) vs. args.argRead<scalar>(index) - the older method names forms have been retained for code compatibility, but are now deprecated
-
Mark Olesen authored
- direct parsing of -funcs to ITstream. - use direct lookup when the option is a word/string
-
Mark Olesen authored
- now avoid Istream and token mechanism in favour of a simpler string parser. This makes the code clearer, smaller, robuster. - provide convenience ge/gt/le/lt static constructors for scalarRange for using bounds directly with specifying via a string parameter. - scalarRange, scalarRanges now follow the unary predicate pattern (using an operator() for testing). This allows their reuse in other contexts. Eg, for filtering operations: myHash.filterValues(scalarRange::ge(100)); - remove unused scalarRanges methods that were specific to handling lists of time values. These were superseded by timeSelector methods several versions ago.
-
- 20 Dec, 2017 1 commit
-
-
mattijs authored
-
- 14 Dec, 2017 1 commit
-
-
Mark Olesen authored
-
- 13 Dec, 2017 1 commit
-
-
Andrew Heather authored
-
- 11 Dec, 2017 1 commit
-
-
Mark Olesen authored
-
- 28 Nov, 2017 1 commit
-
-
Mark Olesen authored
- this is a provision for defining execute actions that can be called largely independently of the normal time-loop constraints. This can be useful to provide hooks for sub-cycling, or to define an action that can be triggered manually or on some other event.
-
- 13 Nov, 2017 1 commit
-
-
Mark Olesen authored
- allows changing the format of the sending OPstream at an arbitrary point in the transmission. The information is passed through the buffer and the receiving IPstream changes its format accordingly. This allows a temporary toggling of ASCII/BINARY mid-stream.
-
- 12 Nov, 2017 2 commits
-
-
Mark Olesen authored
-
Mark Olesen authored
- the return value signals if this method handled this particular type of token. This minor change allows this method to be used as a succinct prefilter an output token stream. It also provides better encapsulation of what the particular output stream handles. Eg, bool ok = os.write(tok); if (!ok) // or if (!ok && os.good()) { os << tok; } instead of if (tok.type() == typeA || tok.type() == typeB || ...) { os.write(tok); } else { os << tok; }
-
- 09 Nov, 2017 2 commits
-
-
Mark Olesen authored
-
Mark Olesen authored
-
- 08 Nov, 2017 2 commits
-
-
Mark Olesen authored
- when dictionary keywords change between versions, the programmer can use these compatibility methods to help with migration. * csearchCompat, foundCompat, lookupEntryPtrCompat, lookupEntryCompat, lookupCompat, lookupOrDefaultCompat, readIfPresentCompat, ... They behave like their similarly named base versions, but accept an additional list of older keyword names augmented by a version number. For example, dict.readIfPresentCompat ( "key", {{"olderName", 1612}, {"veryOld", 240}}, myscalar ); where 1612=OpenFOAM-v1612, 240=OpenFOAM-v2.4.x, etc.
-
Mark Olesen authored
- If the entry could be directly inserted: a pointer to the inserted entry. - If a dictionary merge was required: a pointer to the dictionary that received the entry. - Return nullptr on any type of insertion failure. This change is code compatible with existing code since it only alters a bool return value to be a pointer return value.
-