Commit Graph

19 Commits

Author SHA1 Message Date
mattijs
1513a049e0 BUG: swirl: decide based on global properties. Fixes #824. 2018-05-10 11:12:19 +01:00
Mark Olesen
660f3e5492 ENH: cleanup autoPtr class (issue #639)
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_();
2018-02-26 12:00:00 +01:00
sergio
543ac07774 BUG: Fixing constructors from dictionary to avoid hanging in parallel when patch size is zero 2018-02-21 10:31:49 -08:00
Mark Olesen
c0ba7bf05a STYLE: use Ostream writeEntry when writing key/value entries
- makes for clearer code

ENH: make writeIfDifferent part of Ostream
2017-11-06 00:49:24 +01:00
Henry Weller
542151b1fa swirlFlowRateInletVelocityFvPatchVectorField: Avoid calculating origin and axis for patches with no faces
Resolves problem with reconstructPar
2017-08-16 14:14:24 +01:00
Henry Weller
77b7beb6af swirlFlowRateInletVelocity: Added support for specifying the origin and axis of rotation 2017-07-13 16:08:30 +01:00
Henry Weller
3c053c2fe6 GeometricField: Renamed internalField() -> primitiveField() and dimensionedInternalField() -> internalField()
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.
2016-04-30 21:40:09 +01:00
Henry Weller
968c888fc4 Rename DataEntry -> Function1
Function1 is an abstract base-class of run-time selectable unary
functions which may be composed of other Function1's allowing the user
to specify complex functions of a single scalar variable, e.g. time.
The implementations need not be a simple or continuous functions;
interpolated tables and polynomials are also supported.  In fact form of
mapping between a single scalar input and a single primitive type output
is supportable.

The primary application of Function1 is in time-varying boundary
conditions, it also used for other functions of time, e.g. injected mass
is spray simulations but is not limited to functions of time.
2016-02-08 16:18:07 +00:00
Henry Weller
6a0df8a470 fvPatchFields: Rationalized the construction of DataEntry values 2015-11-24 16:35:11 +00:00
Henry Weller
735ce9cce7 src/finiteVolume: Update ...ErrorIn -> ...ErrorInFunction
Avoids the clutter and maintenance effort associated with providing the
function signature string.
2015-11-10 16:55:03 +00:00
andy
097bb7221d ENH: Added DataEntry input for cylindricalInletVelocity and swirlFlowRateInletVelocity BCs 2011-12-08 11:39:28 +00:00
Henry
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
andy
099cc39e2e Revert "STYLE: 2011 copyright date."
This reverts commit b18f6cc1ce.
2011-01-05 18:24:29 +00:00
graham
b18f6cc1ce STYLE: 2011 copyright date. 2011-01-05 11:14:26 +00:00
Mark Olesen
da439f5484 STYLE: consistent naming for templated/non-templated patch field construction
eg,
    - makePatchTypeField -> makeTemplatePatchTypeField
    - makeNonTemplatedPatchTypeField -> makePatchTypeField
2010-12-30 09:36:09 +01:00
Mark Olesen
4c5ce4c8fb COMP: avoid ambiguous construct from tmp - fvPatchFields/derived 2010-12-17 16:54:24 +01:00
Mark Olesen
5e4c5c9469 COMP: macros for non-templated boundary conditions 2010-12-17 16:05:22 +01:00
andy
c4d9fcc4f1 STYLE: minor code formattig changes 2010-06-23 17:50:34 +01:00
Mark Olesen
402f17f73f STYLE: swirlMassFlowRateInletVelocity -> swirlFlowRateInletVelocity
- improve documentation, use GPL version 3
2010-05-18 10:47:27 +02:00