ENH: Support more C++11 initializer lists (issue #261)
DynamicList
-----------
- construction, assignment and append
HashSet
-------
- construction, insert, set.
- assignment will use the implicit List constructor
hashedWordList
--------------
- construction, assignment
- additional sort() and uniq() methods.
- Readonly access to HashTable information via lookup() method.
- NB: could avoid 'const char**' constructors in the future
Some tests are included
See merge request !67
DynamicList
-----------
- construction, assignment and append
HashSet
-------
- construction, insert, set.
- assignment will use the implicit List constructor
hashedWordList
--------------
- construction, assignment
- additional sort() and uniq() methods.
- Readonly access to HashTable information via lookup() method.
- NB: could avoid 'const char**' constructors in the future
- Place common code under OSspecific.
By including "endian.H", either one of WM_BIG_ENDIAN or WM_LITTLE_ENDIAN
will be defined.
Provides inline 32-bit and 64-bit byte swap routines that can be
used/re-used elsewhere.
The inplace memory swaps currently used by the VTK output are left for
the moment pending further cleanup of that code.
Until C++ supports 'concepts' the only way to support construction from
two iterators is to provide a constructor of the form:
template<class InputIterator>
List(InputIterator first, InputIterator last);
which for some types conflicts with
//- Construct with given size and value for all elements
List(const label, const T&);
e.g. to construct a list of 5 scalars initialized to 0:
List<scalar> sl(5, 0);
causes a conflict because the initialization type is 'int' rather than
'scalar'. This conflict may be resolved by specifying the type of the
initialization value:
List<scalar> sl(5, scalar(0));
The new initializer list contructor provides a convenient and efficient alternative
to using 'IStringStream' to provide an initial list of values:
List<vector> list4(IStringStream("((0 1 2) (3 4 5) (6 7 8))")());
or
List<vector> list4
{
vector(0, 1, 2),
vector(3, 4, 5),
vector(6, 7, 8)
};
- there are some cases in which the C-style sprintf is much more
convenient, albeit problematic for buffer overwrites.
Provide a formatting version of Foam::name() for language
primitives that is buffer-safe.
Returns a Foam::word, so that further output will be unquoted, but
without any checking that the characters are indeed entirely valid
word characters.
Example use,
i = 1234;
s = Foam::name("%08d", i);
produces '00001234'
Alternative using string streams:
std::ostringstream buf;
buf.fill('0');
buf << setw(8) << i;
s = buf.str();
Note that the format specification can also be slightly more complex:
Foam::name("output%08d.vtk", i);
Foam::name("timing=%.2fs", time);
It remains the caller's responsibility to ensure that the format mask
is valid.
- Introduce dictionary::writeEntries for better code-reuse.
Before
======
os << nl << indent << "name";
dict.write(os);
After
=====
dict.write(os, "name");
replace system() call with vfork/exec combination (issue #185)
Tested systemCall function object, dynamicCode, but should be rechecked with IB+openmpi
@Prashant
See merge request !55
ENH: OSspecific - softlink handling (fixes#164)
Links are followed in most cases, with some notable exceptions:
- mv, mvBak:
renames the link, not the underlying file/directory
- rmDir:
remove the symlink to a directory, does not recurse into the
underlying directory
See merge request !51
- Translate a list of C++ strings into C-style (argc, argv) pair.
- Translate C-style (argc, argv) pair to list of C++ strings.
Useful when interfacing to external C-code and some libraries
- basic cpuInfo (model identification, MHz, etc)
- process memInfo
- profiling is activated via the case system/controlDict by
adding a "profiling" sub-dictionary.
Simply add the following (everything enabled):
profiling
{}
Which corresponds to the longer form:
profiling
{
active true; // default: true
cpuInfo true; // default: true
memInfo true; // default: true
sysInfo true; // default: true
}
This can be used to selectively disable any extra information
(eg, you don't want anyone else to know what hardware was used).
- most notably the '%' which is used as a separator in places
caused problems.
EHN: only use valid ensight file/variable names for writers
- fixed: foamToEnsightParts, ensightSurfaceWriter
- pending: foamToEnsight
BUG: no geometry written for foamToEnsightParts with moving mesh (fixes#142)
- an incorrect path was causing the issue
- only affects transfer of C-style string with a single character
remaining after whitespace stripping. Test added into Test-parallel.
- Note some idiosyncrasies in the behaviour:
send | receives
-------------------------+-------------------------
string("a b c") | string "a b c"
string("a") | string "a"
"a b c" | word "abc"
'd' | char 'd'
"d" | char 'd'
"d " | char 'd'
These new names are more consistent and logical because:
primitiveField():
primitiveFieldRef():
Provides low-level access to the Field<Type> (primitive field)
without dimension or mesh-consistency checking. This should only be
used in the low-level functions where dimensional consistency is
ensured by careful programming and computational efficiency is
paramount.
internalField():
internalFieldRef():
Provides access to the DimensionedField<Type, GeoMesh> of values on
the internal mesh-type for which the GeometricField is defined and
supports dimension and checking and mesh-consistency checking.
Non-const access to the internal field now obtained from a specifically
named access function consistent with the new names for non-canst access
to the boundary field boundaryFieldRef() and dimensioned internal field
dimensionedInternalFieldRef().
See also commit 22f4ad32b1
both of which return the dimensionedInternalField for volFields only.
These will be useful in FV equation source term expressions which need
not evaluate boundary conditions.
inline Foam::vector Foam::septernion::transformPoint(const vector& v) const
{
return r().transform(v - t());
}
Now there is a 1:1 correspondence between septernion and
spatialTransform and a septernion constructor from spatialTransform
provided.
Additionally "septernion::transform" has been renamed
"septernion::transformPoint" to clarify that it transforms coordinate
points rather than displacements or other relative vectors.