Commit Graph

303 Commits

Author SHA1 Message Date
mattijs
4e3efc9d0c STYLE: explain only collocated points addressed 2010-02-08 17:35:39 +00:00
Mark Olesen
00616b72ff ENH: Add functionEntry '#calc' to dictionary
- handles basic operations, references to other dictionary entries
  (with '$name' syntax) and assorted mathematical functions:

      pi(), degToRad, radToDeg, asin, acos, atan, sin, cos, tan, log,
      log10, mag, atan2, pow

The basic syntax: #calc{ ... };

NOTE the trailing ';' is required for the primitiveEntry to be
properly defined.
2010-02-07 13:58:10 +01:00
Mark Olesen
7dd1ad1e23 Adjust Make options for calcEntry. 2010-01-15 19:25:12 +01:00
Mark Olesen
6a8db69cf7 Merge remote branch 'bundle/olesenm' into home 2010-01-15 18:51:21 +01:00
Mark Olesen
cf3e2a8abf Update calcEntry grammar to include copyright.
Include character class (wchar_t or char) as a template parameter in
CocoParserErrors.
2010-01-06 12:27:14 +01:00
mattijs
aac29d740a Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev 2010-01-04 13:37:37 +00:00
mattijs
c6d4035ced Added master-slave addressing for coupled points.
- Rewrote globalPoints to use globalIndex class so now only transfers
single label instead of labelPair
- Added addressing in globalMeshData
    - from coupled master points to slave points
    -         ,,          edges     ,,    edges
    - from coupled points (master or slave) to uncoupled boundary faces
    -               ,,                    ,,                      cells
- See test/globalMeshData for simple test
2010-01-04 13:25:30 +00:00
Mark Olesen
e0ba4cbb02 Adjust line number before/after #calc{} scanner for improved error messages. 2010-01-03 21:45:32 +01:00
Mark Olesen
ebfdafad7f Add preliminary wmake rule for using CoCo/R. 2010-01-03 00:39:28 +01:00
Mark Olesen
d1a2be7872 Reorganize runTimeSelection to include new macros from calcEntry.
Added globalFunctionSelectionTables, staticMemberFunctionSelectionTables
2010-01-02 16:09:08 +01:00
Mark Olesen
cf91174880 Use global lookup tables for the calcEntry scalar functions.
Handle leading signs on functions etc.
2010-01-02 15:09:17 +01:00
Mark Olesen
f8147f5bb5 Add basic scalar functions to calcEntry. 2010-01-02 13:01:37 +01:00
Mark Olesen
c0d37d9a6b Merge commit 'OpenCFD/master' into olesenm 2009-12-21 15:06:31 +01:00
Mark Olesen
8bf3807c3e Update dictionary calcEntry testing for updated CoCo/R 2009-12-21 15:02:33 +01:00
Mark Olesen
ccdbf4735f Move CocoParserErrors.H template class into src/OpenFOAM/db/error 2009-12-21 14:14:30 +01:00
graham
d241c43ac7 Adding hard-coded tetraherdal solid inertia calculation. Can be used
in a similar way to calculate the inertia of cells.
2009-12-21 10:29:05 +00:00
Mark Olesen
438a83fc81 Update experimental dictionary #calc for new Coco pragmas 2009-12-21 09:28:17 +01:00
mattijs
3bfec62cee Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev 2009-12-17 15:55:21 +00:00
Mark Olesen
e434b51914 Add namespace qualifier to WarningIn, FatalErrorIn, etc. macros.
- Previously had just 'Warning' instead of '::Foam::Warning', which
  meant that an identically named class method would inadvertently be
  used - resulting in a compile failure.
2009-12-16 08:55:04 +01:00
Mark Olesen
a5217d7be3 Merge commit 'bundle/home' into olesenm 2009-12-16 08:08:23 +01:00
Mark Olesen
ad2204a818 Add in calcEntry as a very rough draft
- needs Coco/R 16 Dec 2009 version
2009-12-16 01:31:44 +01:00
mattijs
e325814c80 Test application for syncTools functionality 2009-12-15 16:00:47 +00:00
Mark Olesen
2760c3db5f Merge commit 'OpenCFD/master' into olesenm 2009-12-15 10:48:51 +01:00
Mark Olesen
bf2865a087 Add missing low-level peek() to ISstream. 2009-12-11 17:31:15 +01:00
Mark Olesen
497ec32ed8 Add missing low-level peek() to ISstream. 2009-12-11 17:31:15 +01:00
andy
d058c7ceb8 Added Polynomial class test 2009-12-10 12:50:20 +00:00
Mark Olesen
d2d39c32be HashSet and PackedList get an unset() method
- provides a convenient (and lazy) means of removing entries
2009-12-08 10:01:48 +01:00
Mark Olesen
16c715ceec Applied Mattijs' PackedList improvements
- resize with factor 2 as per DynamicList

Old insertion speed:
    1000000 in 0.61 s
    2000000 in 2.24 s
    3000000 in 3.97 s
    4000000 in 5.76 s
    5000000 in 7.54 s
    6000000 in 9.41 s
    7000000 in 11.5 s

New insertion speed:
    1000000 in 0.01 s
    2000000 in 0.02 s
    3000000 in 0.01 s
    4000000 in 0.02 s
    5000000 in 0.01 s
    6000000 in 0.01 s
    7000000 in 0.01 s
2009-12-08 09:42:38 +01:00
Mark Olesen
45f17a9e6c Merge commit 'OpenCFD/master' into olesenm 2009-12-07 10:41:19 +01:00
Mark Olesen
73f9f7f780 Remove legacy splines code and use CatmullRomSpline as 'spline'
- compatibility:
  * 'polySpline' and 'simpleSpline' accepted
  * detect and discard end tangent specifications

- a BSpline is also included (eg, for future support of NURBS), but is
  not selectable from blockMesh since it really isn't as nice as the
  Catmull-Rom (ie, doesn't *exactly* go through each point).
2009-12-07 06:54:06 +01:00
graham
f23e3eb3ea Changing linked library from finiteVolume to meshTools. 2009-12-04 17:11:30 +00:00
graham
6b7dd8160d Adding a function to calculate the moment of inertia of a triangle to
triangle, from:

http://en.wikipedia.org/wiki/Inertia_tensor_of_triangle

Adding the ability to calculate the inertia tensor of a polygon face
by summing the triangle inertias.

Added a test application to draw a test face with its principal
axes and moments of inertia.
2009-12-04 16:33:46 +00:00
Mark Olesen
1b0cf102cc testing on fileName Istream construction 2009-12-04 16:22:59 +01:00
Mark Olesen
066b3158e7 quickly implemented BSpline2 as an alternative B-Spline implementation
- also looks reasonable and doesn't deviate much from Catmull-Rom
2009-12-04 15:34:42 +01:00
Mark Olesen
79b53a9c6c rename BSplineTest to splineTest and add Catmull-Rom to it
- the current B-Splines deliver rubbish
2009-12-04 12:54:15 +01:00
Mark Olesen
063d8edea1 PackedBoolList specializaton for operator=
- now that I re-examined the code, the note in commit 51fd6327a6
  can be mostly ignored

  PackedList isMaster(nPoints, 1u);
  is not really inefficient at all, since the '1u' is packed into
  32/64-bits before the subsequent assignment and doesn't involve
  shifts/masking for each index

  The same misinformation applies to the PackedList(size, 0u) form.
  It isn't much slower at all.

  Nonetheless, add bool specialization so that it is a simple assign.
2009-12-03 16:33:58 +01:00
Mark Olesen
67b79d9206 commit existing sizeof test 2009-12-03 14:40:12 +01:00
Mark Olesen
c091d856ae pedantic changes: 'forAll (' -> 'forAll(' in applications/
- to match coding guidelines
2009-12-03 14:12:08 +01:00
Mark Olesen
58b7e64185 Use argList::addOption, argList::addBoolOption (almost) everywhere
- ensure that the standard options (eg, from timeSelector) also have
  some usage information
2009-12-03 13:32:12 +01:00
Mark Olesen
c3457b5152 argList - specializations for optionRead<string> etc.
- new optionLookupOrDefault and additional form of optionReadIfPresent
  with a default value
2009-12-02 13:45:11 +01:00
Mark Olesen
a4f4a904f4 HashSet enhancement
- allow insert() and set() from a UList of Key
  This complements the existing erase(const UList<Key>&) method
2009-12-01 18:26:18 +01:00
Mark Olesen
28345f7e97 fixup #remove functionEntry and revert e15e32fdb7d515b
- forgot to use readList in removeEntry, which caused the test failure.

- remaining problem:

it doesn't work as might be expected
This is the problem:

dict
{
   foo xxx;
   bar yyy;
}

dict
{
   baz zzz;
   #remove foo
}

This only removes 'foo' from the current scope (the second dict), since
it occurs before the dictionary merge does.

To remove from the final, merged dictionary, we'd need a new
deleteEntry type that would do the right thing on the merge before
self-destructing (ie, removing itself too).
2009-12-01 13:50:51 +01:00
henry
80a27fb9da Removed the "#remove" statements which do not appear to work. 2009-12-01 12:04:28 +00:00
Mark Olesen
909e6b27e4 Apply coding style recommendations:
- space between keyword and bracket in 'for(..)', 'if(..)', 'while(..)'
2009-11-30 08:55:03 +01:00
Mark Olesen
fa93ce8cd7 coding style adherence
- markup codingStyleGuide.org examples so they actually indent correctly

- use 'Info<<' as per codingStyleGuide instead of 'Info <<'
2009-11-27 15:39:14 +01:00
henry
35c9d7bbd5 Corrected test applications. 2009-11-20 12:40:19 +00:00
mattijs
b7845edeba updated to new thermo 2009-11-13 16:09:27 +00:00
mattijs
cad5a703fc Merge branch 'olesenm' 2009-11-06 11:05:21 +00:00
mattijs
2268ea38a0 Added Container template argument for e.g. construct from faceList 2009-11-04 11:40:12 +00:00
Mark Olesen
ebe39c4ea4 Merge commit 'OpenCFD/master' into olesenm 2009-11-04 08:56:20 +01:00
Mark Olesen
53a9208d9f Merge commit 'bundle/home' into olesenm
Conflicts:
	src/OpenFOAM/matrices/simpleMatrix/simpleMatrix.C
	src/OpenFOAM/matrices/simpleMatrix/simpleMatrix.H
	tutorials/incompressible/simpleFoam/airFoil2D/Allclean
	tutorials/multiphase/settlingFoam/ras/tank3D/Allclean
2009-11-04 08:54:34 +01:00
mattijs
baea3d76a8 CompactListList to use offsets sized one beyond nRows 2009-11-03 18:04:24 +00:00
mattijs
fe17dd2d1f globalIndex to use procI+1 scheme 2009-11-03 18:02:52 +00:00
Mark Olesen
946aac500a HashTbl changes
- iterators store pointers instead of references to the HashTbl.
  This lets us use the default bitwise copy/assignment

- add empty constructor for iterators. It returns the equivalent to end().
  This lets us do this:
      HashTbl<label>::iterator iter;
      // some time later
      iter = find(Value);

- erase(const HashTbl<AnyType, Key, AnyHash>&) is now more generous.
  Only the Key type matters, not the hashing function.
2009-10-30 22:37:35 +01:00
Mark Olesen
1fbcb6e2c0 Added HashTbl::shrink() - but it only be useful in particular situations
- for the hashTableTest3, it seemed to slow things down a bit

loop 0 - Erased 100000 elements (size 2900000 capacity 4194304) 0.31 s
loop 1 - Erased 100000 elements (size 2800000 capacity 4194304) 0.01 s
loop 2 - Erased 100000 elements (size 2700000 capacity 4194304) 0 s
loop 3 - Erased 100000 elements (size 2600000 capacity 4194304) 0 s
loop 4 - Erased 100000 elements (size 2500000 capacity 4194304) 0.01 s
loop 5 - Erased 100000 elements (size 2400000 capacity 4194304) 0 s
loop 6 - Erased 100000 elements (size 2300000 capacity 4194304) 0 s
loop 7 - Erased 100000 elements (size 2200000 capacity 4194304) 0 s
loop 8 - Erased 100000 elements (size 2100000 capacity 4194304) 0.01 s
loop 9 - Erased 100000 elements (size 2000000 capacity 4194304) 0.44 s
loop 10 - Erased 100000 elements (size 1900000 capacity 4194304) 0.44 s
loop 11 - Erased 100000 elements (size 1800000 capacity 4194304) 0.39 s
loop 12 - Erased 100000 elements (size 1700000 capacity 4194304) 0.4 s
loop 13 - Erased 100000 elements (size 1600000 capacity 2097152) 0.15 s
loop 14 - Erased 100000 elements (size 1500000 capacity 2097152) 0.01 s
loop 15 - Erased 100000 elements (size 1400000 capacity 2097152) 0 s
loop 16 - Erased 100000 elements (size 1300000 capacity 2097152) 0 s
loop 17 - Erased 100000 elements (size 1200000 capacity 2097152) 0.01 s
loop 18 - Erased 100000 elements (size 1100000 capacity 2097152) 0 s
loop 19 - Erased 100000 elements (size 1000000 capacity 2097152) 0.27 s
loop 20 - Erased 100000 elements (size 900000 capacity 2097152) 0.2 s
loop 21 - Erased 100000 elements (size 800000 capacity 1048576) 0.1 s
loop 22 - Erased 100000 elements (size 700000 capacity 1048576) 0 s
loop 23 - Erased 100000 elements (size 600000 capacity 1048576) 0 s
loop 24 - Erased 100000 elements (size 500000 capacity 1048576) 0.12 s
loop 25 - Erased 100000 elements (size 400000 capacity 524288) 0.04 s
loop 26 - Erased 100000 elements (size 300000 capacity 524288) 0.01 s
loop 27 - Erased 100000 elements (size 200000 capacity 262144) 0.02 s
loop 28 - Erased 100000 elements (size 100000 capacity 131072) 0.02 s
loop 29 - Erased 100000 elements (size 0 capacity 2) 0 s
2009-10-30 19:28:39 +01:00
Mark Olesen
2c73afb6ec HashTbl avoid backward search in erase()
- The ideas as discussed in email

- The speedup is really there.

Before
loop 0 - Erased 100000 elements:   3.82 s
loop 1 - Erased 100000 elements:   11.45 s
loop 2 - Erased 100000 elements:   19.46 s
loop 3 - Erased 100000 elements:   27.73 s
loop 4 - Erased 100000 elements:   38.74 s
^C

After
loop 0 - Erased 100000 elements (size 2900000 capacity 8388608) 0.01 s
loop 1 - Erased 100000 elements (size 2800000 capacity 8388608) 0 s
loop 2 - Erased 100000 elements (size 2700000 capacity 8388608) 0.01 s
loop 3 - Erased 100000 elements (size 2600000 capacity 8388608) 0 s
loop 4 - Erased 100000 elements (size 2500000 capacity 8388608) 0 s
loop 5 - Erased 100000 elements (size 2400000 capacity 8388608) 0 s
loop 6 - Erased 100000 elements (size 2300000 capacity 8388608) 0 s
loop 7 - Erased 100000 elements (size 2200000 capacity 8388608) 0 s
...
2009-10-30 18:54:51 +01:00
Mark Olesen
55a89e9db3 added HashTbl as development replacement for HashTable
- rename to HashTable later when it is considered stable
2009-10-30 18:31:28 +01:00
mattijs
02e73e2530 Merge branch 'master' of /home/hunt2/mattijs/OpenFOAM/OpenFOAM-dev/. 2009-10-27 16:44:41 +00:00
Mark Olesen
c100ffc957 Merge commit 'OpenCFD/master' into olesenm
Conflicts:
	src/OpenFOAM/matrices/simpleMatrix/simpleMatrix.C
	src/OpenFOAM/matrices/simpleMatrix/simpleMatrix.H
	src/mesh/blockMesh/curvedEdges/BSpline.C
	src/mesh/blockMesh/curvedEdges/spline.C
	src/mesh/blockMesh/curvedEdges/spline.H

- Also adjusted chemistrySolver/EulerImplicit/EulerImplicit.C
  to use simpleMatrix with initialized values
2009-10-27 08:29:33 +01:00
Mark Olesen
2b7dee2c8b add applications/test/BSpline - it fails! 2009-10-26 13:14:40 +01:00
mattijs
9a139812ed Merge branch 'master' of /home/hunt2/mattijs/OpenFOAM/OpenFOAM-dev/. 2009-10-26 09:59:18 +00:00
mattijs
46f1df810c unallocated Pstream 2009-10-26 09:59:07 +00:00
henry
427bbd8174 Changed the interface for the upToDate check to avoid unnecessary object lookups
by providing the independent objects directly.
2009-10-20 22:17:37 +01:00
henry
dfd82248e2 First level of support for cached temporary fields. 2009-10-20 18:30:55 +01:00
andy
a8f7488e0f Merge branch 'olesenm' 2009-10-13 12:39:35 +01:00
henry
e9da288118 Reverted the Americanism "math" back to the original "mathematical" and reverted name of
the include file back to mathematicalConstants.H to make upgrading code slightly easier.
2009-10-10 22:58:58 +01:00
Mark Olesen
f7d9174738 Merge commit 'OpenCFD/master' into olesenm 2009-10-08 16:50:34 +02:00
mattijs
88e0887a47 fix indentation 2009-10-08 15:09:47 +01:00
Mark Olesen
c45ea2c4f1 reworked stringListOps to improve the flexibility
- added subsetStrings and inplaceSubsetString

- added class wordReListMatcher to wrap a match() for a UList<wordRe>
2009-10-08 11:32:26 +02:00
mattijs
2e558acf65 TypeName instead of ClassName 2009-09-22 15:24:59 +01:00
mattijs
791b5aaeaa replacing isType with isA to enable directMappedWall to work 2009-09-15 17:51:59 +01:00
andy
8dcea0f8cd using new constant definitions 2009-08-28 18:04:22 +01:00
mattijs
5c90c347f9 mapDistribute non-blocking of non-contiguous data 2009-08-13 17:28:33 +01:00
mattijs
601f2831ec Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev 2009-08-11 23:08:34 +01:00
mattijs
638c52120e test app for passiveParticle 2009-08-11 22:53:47 +01:00
Mark Olesen
c832d635b1 ISstream::read improvements
- following Andy's idea to return values as label whenever possible
      eg, 1.2e6 -> 1200000
  but left it commented out

- avoid buffer overflow in ISstream::read(word&).
  Is the 'if (fail())' check itself actually in the correct place??

- other minor cosmetic changes
2009-08-11 11:55:46 +02:00
Mark Olesen
8a884892bc version tokenize scalar that stops reading on invalid input 2009-08-10 15:30:48 +02:00
Mark Olesen
7d30766d18 consistency update BiIndirectList, IndirectList
- allow construct with Xfer container for the addressing

- Replaced non-const addressing() method in BiIndirectList with
  resetAddressing() method as per IndirectList
2009-08-10 11:08:35 +02:00
Mark Olesen
df90d1abf8 Merge commit 'OpenCFD/master' into olesenm 2009-08-07 15:09:02 +02:00
andy
85f11fa7cc added sortedToc() 2009-08-06 17:43:39 +01:00
Mark Olesen
5872f2a7e6 added test/ensightFoamReader with udr_checker.c from ensight80
- it looks okay to include: same copyrights as the other ensight headers
2009-08-06 15:34:55 +02:00
henry
1e6e335f5b Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev 2009-08-04 10:13:06 +01:00
henry
268574393a Removed orphaned files. 2009-08-04 10:12:25 +01:00
Mark Olesen
b8c4e1f49e added proof-of-concept test/fvSolutionCombine
- could also move to utilities/miscellaneous

- the dictionary compare contents might be useful enough to move
  into dictionary code.

- usage example (w/o -rewrite):

      for i in $(find -name fvSolution)
      do
          fvSolutionCombine -case "${i%/system/fvSolution}"
      done
2009-08-01 13:03:49 +02:00
Mark Olesen
655608678e Merge commit 'OpenCFD/master' into olesenm 2009-07-27 08:31:06 +02:00
Mark Olesen
35986a3972 implement fileName::clean() method
* remove repeated slashes
      /abc////def        -->   /abc/def

* remove '/./'
      /abc/def/./ghi/.   -->   /abc/def/./ghi
      abc/def/./         -->   abc/def

* remove '/../'
      /abc/def/../ghi/jkl/nmo/..   -->   /abc/ghi/jkl
      abc/../def/ghi/../jkl        -->   abc/../def/jkl

* remove trailing '/'
2009-07-25 20:40:52 +02:00
Mark Olesen
f8d87e2ab4 first implementation of filename clean method
- test as independent application first
2009-07-25 20:32:29 +02:00
henry
816f6b3488 Updated the headers. 2009-07-24 17:01:31 +01:00
Mark Olesen
2ec8908377 bugfix PackedList for non-optimized compilation
- use shift-right instead of shift-left formulation to avoid wrong behaviour
  with non-optimized compilation when the packed items fit exactly in the
  available number of bits.
2009-07-23 22:46:52 +02:00
Mark Olesen
ceaaabab56 bugfix PackedList for non-optimized compilation
- use shift-right instead of shift-left formulation to avoid wrong behaviour
  with non-optimized compilation when the packed items fit exactly in the
  available number of bits.
2009-07-23 22:46:52 +02:00
Mark Olesen
6c9f2520e1 added another PackedListTest 2009-07-23 15:36:46 +02:00
Mark Olesen
0b7832e37c qualify exported FOAM_CASE
- avoid ambiguities caused by relative paths
2009-07-23 09:43:05 +02:00
Mark Olesen
4f6f570d6d versatility improvement: #includeIfPresent dictionary directive
- similar to the #include directive, but does not generate an error if the
  file does not exist.

Note: opted for an explicit naming #includeIfPresent rather than #cinclude
2009-07-21 08:44:25 +02:00
Mark Olesen
8ff026095d added mvBak() to POSIX
- Rename to a corresponding backup file
  If the backup file already exists, attempt with "01" .. "99" suffix.

- git ignore indexed backup files too
2009-07-20 11:04:48 +02:00
henry
94b8290593 Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev 2009-06-23 20:44:29 +01:00
henry
fc608c0594 Better speed test with indirect addressing. 2009-06-23 20:44:27 +01:00
mattijs
7dd1530497 testapp for DynamicField 2009-06-22 10:29:10 +01:00
andy
6a9dfcdc82 merge of thermo branch into master 2009-06-19 13:21:55 +01:00
mattijs
72ac1c7328 ptrList test app replaced by PtrList test app 2009-06-19 12:02:10 +01:00
andy
9af9f9c478 merging master into local branch 2009-06-11 17:29:19 +01:00
andy
c3c36e6b16 updated name change of combustion->reaction lib 2009-06-10 19:37:52 +01:00
mattijs
6cd9e92d45 new test app 2009-06-08 17:59:02 +01:00
mattijs
fd17f2bdb7 test application for extended stencils 2009-06-04 17:30:57 +01:00
Mark Olesen
724b034cc7 argList enhancement: added convenience methods for accessing options
Oriented somewhat on dictionary methods.

Return the argument string associated with the named option:
    Info<< "-foo: " << args.option("foo") << nl;

Return true if the named option is found
    if (args.optionFound("foo")) ...

Return an IStringStream to the named option
    old:      value = readScalar(IStringStream(args.options()["foo"])());
    newer:    value = readScalar(args.optionLookup("foo")());
    also:     List<scalar> lst(args.optionLookup("foo")());

Read a value from the named option
    newest:   value = args.optionRead<scalar>("foo");

Read a value from the named option if present.
    old:  if (args.options().found("foo"))
          {
              value = readScalar(IStringStream(args.options()["foo"])());
          }
    new:  args.optionReadIfPresent("foo", value);

Read a List of values from the named option
    patches = args.optionReadList<word>("patches");

Didn't bother adding optionReadListIfPresent<T>(const word&), since it
probably wouldn't be common anyhow.
2009-05-19 18:19:49 +02:00
Mark Olesen
a0a9cd3366 introduce readList<T> function
- Read a bracket-delimited list, or handle a single value as list of size 1.
  Mostly useful for handling command-line arguments.
  eg,
      if (args.options().found("patches"))
      {
          patches = readList<word>(IStringStream(args.options()["patches"])());
      }
  can handle both of these:
      -patches  patch0
      -patches \( patch1 patch2 patch3 \)
2009-05-18 12:05:52 +02:00
Mark Olesen
20c1a673e7 'rebrand' OSspecific Unix -> POSIX
- change name of environment variable from $WM_OS -> $WM_OSTYPE
  as a better description
2009-05-18 10:26:11 +02:00
Mark Olesen
19d951ce86 minor cleanup of turbulence models
- added constructor dictionary(const dictionary*) that also handles NULL
  pointers and makes it convenient to construct from a possibly nonexistent
  sub-dictionary:
  eg,
      dictionary dict2(dict1.subDictPtr("someDict"));

- make some of the turbulence Coeffs sub-dictionary optional.
  Their contents are all 'lookupOrAddDefault' anyhow.

- in turbulentMixingLength BCs, skip namespace qualifier in template
  (eg, <RASModel> vs. <compressible::RASModel>)

- change comments from 'turbulenceProperties' to RASProperties/LESProperties

- consistency between compressible/incompressible - no separate file for
  'New' selector etc

- consistency in accessing the model coefficients.
  Use method coeffDict() for const access.
  Use protected data member coeffDict_ for read/write access.

- document model coefficients in etc/constant/RASProperties.
  Need the same for LESProperties before we can prune these from the
  tutorials.
2009-05-08 17:27:42 +02:00
Mark Olesen
6e10b0defd adjusted dictionary #inputMode directive
- #inputMode error
  now issues a FatalError on duplicate entries

- #inputMode warn
  issues a warning on duplicate entries, corresponds to the
  old behaviour of 'error'

- #inputMode protect
  prevents overwriting existing entries

The 'protect' mode provides a simple mechanism for supplying default values.
eg,
    in file1:
        #inputMode  protect
        intensity       0.1;
        mixingLength    0.005;
        #inputMode  merge

        inlet
        {
            type        turbulentIntensityKineticEnergyInlet;
            intensity   $intensity;
        }

    which is included from file2:

        intensity   0.05;
        #include    "file1"
2009-05-05 13:18:29 +02:00
Mark Olesen
48247a3d62 consistency update
- DynamicList gets append methods as per List
- misc cosmetic changes
2009-04-27 10:08:29 +02:00
Mark Olesen
6ce8e7d0c0 added List::append() methods 2009-04-22 16:11:52 +02:00
Mark Olesen
81cce6950a Merge commit 'OpenCFD/master' into olesenm 2009-03-18 14:49:37 +01:00
mattijs
f6a7d95124 interpolation mesh objects 2009-03-16 10:45:27 +00:00
Mark Olesen
e45dc31892 UIndirectList output operator
- TODO: binary output is still a bit silly
2009-03-16 11:14:31 +01:00
Mark Olesen
fb1e155eed Merge commit 'OpenCFD/master' into olesenm 2009-03-16 08:28:08 +01:00
mattijs
0128b2be68 UIndirectList 2009-03-12 19:25:21 +00:00
mattijs
6c387489d7 subset constructor 2009-03-12 15:59:27 +00:00
Mark Olesen
b968e62ef9 objectRegistry fixes
- objectRegistry gets a rename() that also adjusts the dbDir
- cloud reworked to use static variables subInstance and defaultName.
  This avoids writing "lagrangian" everywhere

string fixes
- avoid masking of std::string::replace in string.H
- avoid old strstream in PV3FoamReader
2009-03-06 15:18:00 +01:00
Mark Olesen
9ce984d1dc added edge/triFace to the hashing tests 2009-03-05 12:39:22 +01:00
Mark Olesen
7544164d53 regIOobject, Hasher, IOobject tweak
- regIOobject: don't re-register an unregister object on rename/assignment
- Hasher: split-off HasherInt with uint32_t specializations
- IOobject: writeBanner/writeDivider return Stream for easier chaining.

... also dropped some namespace bracketing while I was at it.
2009-03-05 12:06:57 +01:00
Mark Olesen
17548296be Switched from old hashing functions to use Bob Jenkins' hash routine
- If the underlying type is contiguous, FixedList hashes its storage directly.
- Drop labelPairHash (non-commutative) from fvMeshDistribute since
  FixedList::Hash does the right thing anyhow.
- Hash<edge> specialization is commutative, without multiplication.
- Hash<triFace> specialization kept multiplication (but now uLabel).
  There's not much point optimizing it, since it's not used much anyhow.

Misc. changes

- added StaticAssert to NamedEnum.H
- label.H / uLabel.H : define FOAM_LABEL_MAX, FOAM_ULABEL_MAX with the
  values finally used for the storage.  These can be useful for pre-processor
  checks elsewhere (although I stopped needing them in the meantime).
2009-03-04 10:50:14 +01:00
Mark Olesen
44a86232af Added Jenkin's hash functions in C++ form
- not much speed difference between SuperFastHash and Jenkin's lookup3 but
  both are 5-10% faster than what is currently implemented in Foam::string,
  albeit inlining probably helps there.

- TODO: integration with existing infrastructure
2009-03-02 19:57:17 +01:00
Mark Olesen
106d417de0 StaticAssert added
- catch people using silly template sizes for FixedList, PackedList
2009-02-27 16:41:51 +01:00
Mark Olesen
dbc9b7427a PackedList iterator bugfix
- compare iteratorBase == iteratorBase by value, not position
  thus this works
      list[a] == list[b] ...

- compare iterator == iteratorBase and const_iterator == iteratorBase
  by position, not value. The inheritance rules means that this works:
      iter == list.end() ...
  this will compare positions:
      iter == list[5];
  Of course, this will still compare values:
      *iter == list[5];
2009-02-27 13:43:43 +01:00
Mark Olesen
2aeee852e8 PackedList bugfix, HashTable tweak
- it was possible to create a PackedList::iterator from a
  PackedList::const_iterator and violate const-ness

- added HashTable::printInfo for emitting some information

- changed default table sizes from 100 -> 128 in preparation for future
  2^n table sizes
2009-02-26 15:32:47 +01:00
Mark Olesen
e562aecb73 HashTable performance: find(), found() check nElmts_ instead of tableSize_
- much better performance on empty tables (4-6x speedup), neutral
  performance change on filled tables. Since tableSize_ is non-zero when
  nElmts_ is, there is no modulus zero problem.
2009-02-25 18:58:48 +01:00
Mark Olesen
4b60453cf1 use while (runTime.loop() { .. } where possible in solvers
- change system/controlDict to use functions {..} instead of functions (..);
  * This is internally more efficient
- fixed formatting of system/controlDict functions entry

- pedantic change: use 'return 0' instead of 'return(0)' in the applications,
  since return is a C/C++ keyword, not a function.
2009-02-18 08:57:10 +01:00
Mark Olesen
c2256e51f3 change solvers, utilities, etc. to use while (..) time-looping idiom
- this (now deprecated) idiom:
      for (runTime++; !runTime.end(); runTime++) { ... }
  has a few problems:
    * stop-on-next-write will be off-by-one (ie, doesn't work)
    * function objects are not executed on exit with runTime.end()
  Fixing these problems is not really possible.

- this idiom
      while (runTime.run())
      {
          runTime++;
          ...
      }
  works without the above problems.
2009-02-17 08:47:42 +01:00
Mark Olesen
28872c4432 moved SHA1::Digest class to SHA1Digest to allow forward declarations 2009-02-11 10:34:45 +01:00
Mark Olesen
adfd825441 SHA1, dictionary improvements
- added class OSHA1stream for a stream-based calculation method
- dictionary gets digest() method
- dictionaryEntry tweak: avoid trailing space after dictionary keyword
2009-02-11 00:46:01 +01:00
Mark Olesen
8e3b458231 added SHA1 class 2009-02-10 13:58:00 +01:00
Mark Olesen
69918f23c5 consistency update
- OSspecific: chmod() -> chMod(), even although it's not used anywhere

- ListOps get subset() and inplaceSubset() templated on BoolListType

- added UList<bool>::operator[](..) const specialization.
  Returns false (actually pTraits<bool>::zero) for out-of-range elements.
  This lets us use List<bool> with lazy evaluation and no noticeable
  change in performance.

- use rcIndex() and fcIndex() wherever possible.
  Could check if branching or modulus is faster for fcIndex().

- UList and FixedList get 'const T* cdata() const' and 'T* data()' members.
  Similar to the STL front() and std::string::data() methods, they return a
  pointer to the first element without needing to write '&myList[0]', recast
  begin() or violate const-ness.
2009-02-06 20:43:09 +01:00
Mark Olesen
fe6a83a3a8 moved fileName::IOobjectComponents -> IOobject::fileNameComponents 2009-01-30 09:06:47 +01:00
Mark Olesen
1f6733d91d PackedList - activated lazy evaluation
- moving back to original flat addressing in iterators means there is no
  performance issue with using lazy evaluation
- set() method now has ~0 for a default value.
  We can thus simply write 'set(i) to trun on all of the bits.
  This means we can use it just like labelHashSet::set(i)
- added flip() method for inverting bits. I don't know where we might need
  it, but the STL has it so we might as well too.
2009-01-30 00:07:53 +01:00
Mark Olesen
4e56643efe PackedList improvements
- dropped auto-vivification for now (performance issue), but reworked to
  allow easy reinstatement
- derived both iterator and const_iterator from iteratorBase and use
  iteratorBase as our proxy for non-const access to the list elements.
  This allows properly chaining assignments:
     list[1] = list[2];
     list[1] = list[2] = 10;
- assigning iterators from iteratorBase or other iterators works:
     iterator iter = list[20];
- made template parameter nBits=1 the default
2009-01-29 14:03:53 +01:00
Mark Olesen
7c739978b1 PackedList gets count() and trim() methods
- the bit counting is relatively fast:
  under 0.2 seconds for 1M bits counted 1000 times

- trim()'ing the final zero elements tested for a few cases,
  but might need more attention
2009-01-28 16:32:47 +01:00
Mark Olesen
c6e9b323f5 added HashSet::operator[]() const
- can use the same syntax for boolList, PackedBoolList and labelHashSet
    if (myHashedSet[x]) ...
    if (myBoolList[x]) ...
    if (myPackedList[x]) ...
2009-01-27 21:55:03 +01:00
Mark Olesen
defe13e205 fileName gets additional convenience methods
- exists() = forward to OSspecific exists(...)
- isDir()  = forward to OSspecific dir(...)
- isFile() = forward to OSspecific file(...)
- IOobjectComponents() - split into instance, local, name following rules
  set out for IOobject.

- added IOobject(path, registry, ...) constructor that uses
  fileName::IOobjectComponents(). This hides the complexity we otherwise need.
2009-01-27 13:28:45 +01:00
Mark Olesen
94dc33da2e Merge commit 'bundle/home' into olesenm 2009-01-26 08:28:15 +01:00
Mark Olesen
84ec272d23 PackedList changes
- added Mattijs' speed tests
- optimized resize() and assignment operators to avoid set() method
- add const_iterator and re-did the proxy handling.

Reading/writing by looping across iterators is still somewhat slow, but
might be acceptable.
2009-01-26 00:33:28 +01:00
Mark Olesen
ce14f243c6 Removed handling of single-quoted strings. 2009-01-23 15:17:01 +01:00
Mark Olesen
cc4cd0a171 PackedList: encapsulate calculations in an iterator
- eliminated previous PackedBitRef class, the iterator does all of that and
  can also be used to (forward) traverse the list
- no const_iterator yet

- Note that PackedList is also a bit like DynamicList in terms of storage
  management and the append() method. Since the underlying storage in
  integer, any auto-vivified elements will also flood-fill the gaps with
  zero.
2009-01-23 01:40:55 +01:00
Mark Olesen
173607fd2d PackedList gets functionality akin to DynamicList 2009-01-22 16:24:05 +01:00
Mark Olesen
6d57bb4e7b added PackedBoolList typedef (used everywhere) and improved PackedList
- new members:  capacity(), two-argument resize()/setSize(), const storage()
- new static members: max_value(), packing(), etc.
2009-01-21 11:30:10 +01:00
Mark Olesen
d9096c1e47 cosmetics 2009-01-20 17:14:53 +01:00
Mark Olesen
96751f7e02 Applied Mattijs' DynamicList copy constructor patch 2009-01-19 14:31:31 +01:00
Mark Olesen
f0341171ff renamed 'empty' class to 'nil', added missing empty() member to some containers 2009-01-09 13:10:10 +01:00
Mark Olesen
990a9e7f57 added HashTable::erase(const HashTable&) method 2009-01-09 09:35:53 +01:00
Mark Olesen
0061e9ed03 added Foam::FOAMbuild to Foam::FOAMversion
- avoids problems with finding files based on FOAMversion
  (reported by Mattijs)
2009-01-09 09:11:50 +01:00
Mark Olesen
7ae9a0d0d9 added tiny applications/test/foamVersion/foamVersionString.C 2009-01-08 14:48:48 +01:00
Mark Olesen
3c5852ebfc reworked regExp + wordRe a bit, minor change to keyType
regExp:
- added optional ignoreCase for constructor.
- the compile() methods is now exposed as set(...) method with an optional
  ignoreCase argument.  Not currently much use for the other regex compile
  flags though. The set() method can be used directly instead of the
  operator=() assignment.

keyType + wordRe:
- it's not clear that any particular characters are valid/invalid (compared
  to string or word), so just drop the valid(char) method for now

wordRe:
- a bool doesn't suffice, added enum compOption (compile-option)
- most constructors now have a compOption. In *all* cases it defaults to
  LITERAL - ie, the same behaviour for std::string and Foam::string
- added set(...) methods that do much the same as operator=(...), but the
  compOption can be specified.  In all cases, it defaults to DETECT.

 In Summary
    By default the constructors will generally preserve the argument as
    string literal and the assignment operators will use the wordRe::DETECT
    compOption to scan the string for regular expression meta characters
    and/or invalid word characters and react accordingly.

    The exceptions are when constructing/assigning from another
    Foam::wordRe (preserve the same type) or from a Foam::word (always
    literal).
2009-01-05 17:02:58 +01:00