- 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");
- Include newline in beginBlock/endBlock, since this corresponds to
the standard usage. The beginBlock now takes keyType instead of word.
- Provide Ostream::writeEntry method to reduce clutter and simplify
writing of entries.
Before
======
os << indent << "name" << nl
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
os.writeKeyword("key1") << val1 << token::END_STATEMENT << nl;
os.writeKeyword("key2") << val2 << token::END_STATEMENT << nl;
os << decrIndent << indent << token::END_BLOCK << nl;
After
=====
os.beginBlock("name");
os.writeEntry("key1", val1);
os.writeEntry("key2", val2);
os.endBlock();
- For completeness, support inline use of various Ostream methods.
For example,
os << beginBlock;
os.writeEntry("key1", val1);
os.writeEntry("key2", val2);
os << endBlock;
- For those who wish to write in long form, can also use endEntry inline:
os.beginBlock("name");
os.writeKeyword("key1") << val2 << endEntry;
os.writeKeyword("key2") << val2 << endEntry;
os.endBlock();
The endEntry encapsulates a semi-colon, newline combination.
- CGAL itself includes its library dependencies, we only need to
provide the -L... option to the proper ThirdParty locations.
Should help improve general build robustness.
- instead we use the CGAL settings directly since they have the
same option of (version | system | none)
- may wish to review this again in the future.
blockMesh -help
Usage: blockMesh [OPTIONS]
options:
-blockTopology write block edges and centres as .obj files
-case <dir> specify alternate case directory, default is the cwd
-dict <file> specify alternative dictionary for the blockMesh description
-noFunctionObjects
do not execute functionObjects
-region <name> specify alternative mesh region
-srcDoc display source code in browser
-doc display application documentation in browser
-help print the usage
Block description
For a given block, the correspondence between the ordering of
vertex labels and face labels is shown below.
For vertex numbering in the sequence 0 to 7 (block, centre):
faces 0 (f0) and 1 are left and right, respectively;
faces 2 and 3 are bottom and top;
and faces 4 and 5 are front the back:
4 ---- 5
f3 |\ |\ f5
| | 7 ---- 6 \
| 0 |--- 1 | \
| \| \| f4
f2 3 ---- 2
f0 ----- f1
Using: OpenFOAM-dev (see www.OpenFOAM.org)
Build: dev-dc59c63351e7
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2267
1. Spaced ending of multi-level template parameters are not allowed, such as:
List<List<scalar> >
which instead should be:
List<List<scalar>>
2. The use of the 'NULL' macro should be replaced by 'nullptr'
to ensure 'patchType' is set as specified.
Required substantial change to the organization of the reading of the
'value' entry requiring careful testing and there may be some residual
issues remaining. Please report any problems with the reading and
initialization of patch fields.
Resolves bug-report http://bugs.openfoam.org/view.php?id=2266
e.g. for the cavity tutorial the moving wall patch can be specified in
terms of the block vertices as before:
boundary
(
movingWall
{
type wall;
faces
(
(3 7 6 2)
);
}
.
.
.
or the new specification of the face as block 0, block face 3:
boundary
(
movingWall
{
type wall;
faces
(
(0 3)
);
}
- Less looping when detecting lagrangian clouds and their fields.
- Avoid using Time::setTime() and IOobjectList in tight loops.
They both kill performance immensely.
ENH: provide a -noLagrangian option to foamToEnsight and foamToEnsightParts
for even more control.
- The new field needs initialization with a dimensioned<Type> not just
the dimensionSet.
- The new field was also incorrectly being registered, which could
cause issues later.