Commit Graph

18335 Commits

Author SHA1 Message Date
cae7ce37f5 ENH: provide formatting version of Foam::name() (issue #253)
- 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.
2016-07-01 08:23:13 +02:00
6d5db96ad9 ENH: subdict output with leading name (issue #255)
- Introduce dictionary::writeEntries for better code-reuse.

  Before
  ======
      os << nl << indent << "name";
      dict.write(os);

  After
  =====
      dict.write(os, "name");
2016-06-09 18:33:56 +01:00
06f22a9bf3 ENH: cleanup Ostream to ease usage (issue #254)
- 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.
2016-06-06 11:51:05 +01:00
182f0a72ae MRG: Incremental foundation merge 2016-10-03 08:27:06 +01:00
3df66b25ec STYLE: minor updates 2016-10-03 08:24:22 +01:00
3f4f05b6e0 Map, SortableList: Added constructors from and assignment to initializer list
Patch based on contribution from Mattijs Janssens
Resolves http://bugs.openfoam.org/view.php?id=2276
2016-09-30 18:49:38 +01:00
ec9883f389 Field: Added constructor from UIndirectList
Patch contributed by Mattijs Janssens
2016-09-30 18:48:26 +01:00
6a3d6e52ea Merge branch 'adjust-config-foundation-merge' into 'merge-foundation'
Adjust config foundation merge

Rationalize config files, foamy build, tutorials.

See merge request !63
2016-09-30 17:06:34 +01:00
22a7a70256 Merge remote-tracking branch 'origin/merge-foundation' into adjust-config-foundation-merge 2016-09-30 17:50:20 +02:00
4bdf712b35 triangle storage: Return barycentric coordinates as FixedList instead of List
Patch contributed by Mattijs Janssens
Resolves bug-report http://bugs.openfoam.org/view.php?id=2278
2016-09-30 16:22:55 +01:00
e98e372f8e ENH: Tutorial updates 2016-09-30 15:31:35 +01:00
54042b08df ENH: Function objects - first pass at updating read functionality
Note: should be using the result of the parent::read(dict) when
deciding whether to read local entries...
2016-09-30 13:24:58 +01:00
839f14afcd ENH: Code clean-up 2016-09-30 12:30:02 +01:00
e072a2be33 ENH: add -noZero option for foamToEnsight* conversion
- The zero directory is incomplete, skip these entries.
2016-09-30 12:44:00 +02:00
bd0e982d99 MRG: Initial commit after latest Foundation merge 2016-09-30 11:16:28 +01:00
1e00bd7f45 GIT: resolve merge errors to ddt2, zeroGradient functionObjects
- the function objects are from issue #224 and issue #235
2016-09-30 11:26:58 +02:00
3c86995198 COMP: remove boost/mpfr/gmp linkage for foamyMesh components.
- 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.
2016-09-30 17:00:05 +02:00
f3888f0a2a Merge branch 'merge-foundation' of develop.openfoam.com:Development/OpenFOAM-plus into merge-foundation 2016-09-29 16:24:12 +01:00
60d7a71eaf STYLE: forceCoeffs - minor code updates 2016-09-29 16:24:08 +01:00
aa78b03011 ENH: functionObjects - do not add to list if error on read 2016-09-29 16:19:15 +01:00
6d380dddf6 ENH: Updated kOmegaSST family of models 2016-09-29 11:40:30 +01:00
84683b5f90 CONFIG: remove foundation use of FOAMY_HEX_MESH control.
- 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.
2016-09-29 12:36:27 +02:00
5c921caa55 fvOptions: Corrected docs: 'fieldName' -> 'fields'
Resolves bug-report http://bugs.openfoam.org/view.php?id=2273
2016-09-28 19:42:07 +01:00
3c790e2316 Correcting Typo in SolarLoad radiation model 2016-09-28 10:42:21 -07:00
3dbd39146c STYLE: consistency updates 2016-09-27 15:17:55 +01:00
89d9fd1550 ENH: Tutorial updates 2016-09-26 13:00:49 +01:00
47eb24bed5 GIT: Resolved conflicts arising from merge with develop branch 2016-09-26 10:57:34 +01:00
ad1e798293 ENH: Initial testing updates 2016-09-26 09:28:31 +01:00
ba249f8e76 STYLE: minor adjustment to echoed information 2016-09-26 08:02:03 +02:00
3c935ca89e Fix tensor names in foamToEnsightParts case file (fixes #243) 2016-09-26 07:41:02 +02:00
025791559d blockMesh: Added printing of the block description to the '-help' output
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
2016-09-25 20:05:12 +01:00
abb4d67134 pre-commit-hook: Added checks for multi-level template parameters and 'NULL'
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'
2016-09-25 18:43:50 +01:00
a2a6fedf9f blockMesh::blockDescriptor: Added block indexing description 2016-09-25 18:38:31 +01:00
1649b57a40 processorFvPatchField: If the value is not supplied set to the internal field 2016-09-25 18:38:06 +01:00
dc59c63351 processorFvPatchField: Reinstate 'value' as an optional entry 2016-09-25 16:54:20 +01:00
fdece9b2ce tutorials/incompressible/shallowWaterFoam/squareBump/.gmtcommands4: deleted
Resolves bug-report http://bugs.openfoam.org/view.php?id=2268
2016-09-25 16:53:37 +01:00
b6feaea53b fvPatchFields: Constructors from dictionary now call the corresponding constructor of the fvPatchField base-class
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
2016-09-25 09:11:53 +01:00
93530f1747 blockMesh: Added support for (<block> <face>) specification of patch faces
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)
        );
    }
2016-09-24 08:40:13 +01:00
cff8efb98b ENH: reduce startup time for foamToVTK conversion
- Similar to ensight converters (issue #240),
  improve speed for detection of lagrangian clouds.

- provide a -noLagrangian option for symmetry
2016-09-23 18:45:06 +02:00
1fbcb686ff STYLE: Consistency updates 2016-09-23 16:52:46 +01:00
88ca081c8c ENH: reduce startup time for ensight conversion (issue #240).
- 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.
2016-09-23 17:45:47 +02:00
b9940cbbb1 COMP: Multiple changes - first clean build after latest merge - UNTESTED 2016-09-23 15:36:53 +01:00
3503c872a5 STYLE: add OpenFOAM version to ensight geom file description.
- More informative than a horizonal line, can help when debugging.

STYLE: remove unused write field methods from ensightParts
2016-09-23 14:53:01 +02:00
06699f17f5 BUG: ensight output failing with dimensioned field (fixes #244)
- 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.
2016-09-23 13:13:12 +02:00
3c25f26aab BUG: incorrect symmTensor order for some ensight output (fixes #243)
- affects foamToEnsightParts, sampled surfaces

- Use ensightPTraits mechanism throughout to avoid this issue
2016-09-23 09:10:57 +02:00
f066a9b54e Updated template formatting
Resolves bug-report http://bugs.openfoam.org/view.php?id=2264
2016-09-22 21:03:30 +01:00
447cdc2098 globalMeshData: Revert NULL -> nullptr 2016-09-22 14:22:26 +01:00
c0f841e4f7 globalIndexAndTransform: Support any number of transforms but no more than 3 per point
Patch contributed by Mattijs Janssens
Resolves bug-report http://bugs.openfoam.org/view.php?id=1815
2016-09-22 14:10:45 +01:00
40f8709488 wmake: export WM_SCHEDULER from sub-shell for non-POSIX bash compliance 2016-09-22 08:34:15 +01:00
9e1e9011a5 decomposePar: Corrected construction of cloud for processors
Resolves bug-report http://bugs.openfoam.org/view.php?id=2239
2016-09-21 17:19:58 +01:00