Commit Graph

592 Commits

Author SHA1 Message Date
Mark Olesen
e623e6a865 STYLE: favour include word.H instead of string.H
- in many places the string.H include is redundant anyhow.
  May wish to change to foamString.H (or equiv) in the future
2023-02-27 15:41:25 +01:00
Mark Olesen
d88272f031 ENH: relocate zero_one to pTraits, allows reuse for scalar clamping
ENH: add pTraits and IO for std::int8_t

STYLE: cull some implicitly available includes

- pTraits.H is included by label/scalar etc
- zero.H is included by UList

STYLE: cull redundant forward declarations for Istream/Ostream
2023-02-27 15:41:25 +01:00
Mark Olesen
68bbd8f3a8 Merge remote-tracking branch 'origin/master' into develop 2023-02-21 10:21:31 +01:00
Mark Olesen
ba6667a344 STYLE: use clamp/clamp_range instead of max(min(..., upper), lower) 2023-02-21 10:10:43 +01:00
Mark Olesen
3d8a6a5433 ENH: use GeometricField clamp_min, clamp_max, clamp_range
- newer naming allows for less confusing code.
  Eg,
      max(lower)  ->  clamp_min(lower)
      min(upper)  ->  clamp_max(upper)

- prefer combined method, for few operations.
  Eg,
      max(lower) + min(upper) -> clamp_range(lower, upper)

  The updated naming also helps avoid some obvious coding errors.
  Eg,

     Re.min(1200.0);
     Re.max(18800.0);

  instead of
     Re.clamp_range(1200.0, 18800.0);

- can also use implicit conversion of zero_one to MinMax<Type> for
  this type of code:

      lambda_.clamp_range(zero_one{});
2023-02-21 10:05:26 +01:00
Mark Olesen
d597b3f959 STYLE: check iterator validity with good() instead of found()
- aligns better with other container checks
2023-02-10 17:12:48 +01:00
Mark Olesen
ea2bedf073 ENH: add coupledFaPatch::delta()
- symmetrical evaluation for processor patches, eliminates
  scalar/vector multiply followed by projection.

STYLE: use evaluateCoupled instead of local versions
2023-01-31 12:36:41 +01:00
Mark Olesen
ba153df8db ENH: improved handling for clamping
- proper component-wise clamping for MinMax clamp().

- construct clampOp from components

- propagate clamp() method from GeometricField to FieldField and Field

- clamp_min() and clamp_max() for one-sided clamping,
  as explicit alternative to min/max free functions which can
  be less intuitive and often involve additional field copies.

- top-level checks to skip applying invalid min/max ranges
  and bypass the internal checks of MinMax::clamp() etc.
2023-01-23 14:52:29 +01:00
Mark Olesen
03ab6c1a9d COMP: remove commented Make/options item (#2668)
COMP: update include for CGAL-5.5 (#2665)

  old:  Robust_circumcenter_filtered_traits_3
  new:  Robust_weighted_circumcenter_filtered_traits_3

COMP: adjust CGAL rule for OSX (#2664)

- since CGAL is now header-only, the previous OSX-specific rules have
  become redundant
2023-01-23 09:39:30 +01:00
Andrew Heather
7e61f36c12 RELEASE: Updated headers to v2212 2022-12-21 16:16:18 +00:00
Mark Olesen
4cccd5f854 COMP: smoothSurfaceData was building into FOAM_USER_APPBIN 2022-12-21 16:16:17 +00:00
Mark Olesen
4b94ac97c2 ENH: dimensioned/dimensionedSet handle optional read as per dictionary 2022-12-13 10:09:46 +01:00
mattijs
69be54107d ENH: IOobject headerClassName now initialised to empty value
- was previously populated with "IOobject" (the typeName) but then
  cannot easily detect if the object was actually read.
  Also clear the headerClassName on a failed read

BUG: parallel inconsistency in regIOobject::readHeaderOk

- headerOk() checked with master, but possible parallel operations
  within it
2022-11-25 12:48:45 +01:00
Mark Olesen
cb4e026aed ENH: add support for additional filter/mapping (#2609)
- comprises a few different elements:

FilterField (currently packaged in PatchFunction1Types namespace)
~~~~~~~~~~~

  The FilterField helper class provides a multi-sweep median filter
  for a Field of data associated with a geometric point cloud.

  The points can be freestanding or the faceCentres (or points)
  of a meshedSurface, for example.

  Using an initial specified search radius, the nearest point
  neighbours are gathered and addressing/weights are built for them.
  This currently uses an area-weighted, linear RBF interpolator
  with provision for quadratic RBF interpolator etc.

  After the weights and addressing are established,
  the evaluate() method can be called to apply a median filter
  to data fields, with a specified number of sweeps.

boundaryDataSurfaceReader
~~~~~~~~~~~~~~~~~~~~~~~~~

- a surfaceReader (similar to ensightSurfaceReader) when a general
  point data reader is needed.

MappedFile
~~~~~~~~~~
- has been extended to support alternative surface reading formats.
  This allows, for example, sampled ensight data to be reused for
  mapping.  Cavaet: multi-patch entries may still needs some work.

- additional multi-sweep median filtering of the input data.
  This can be used to remove higher spatial frequencies when
  sampling onto a coarse mesh.

smoothSurfaceData
~~~~~~~~~~~~~~~~~
- standalone application for testing of filter radii/sweeps
2022-11-24 13:30:16 +01:00
Mark Olesen
e5006a62d7 ENH: use simpler boundBox handling
- use default initialize boundBox instead of invertedBox
- reset() instead of assigning from invertedBox
- extend (three parameter version) and grow method
- inflate(Random) instead of extend + re-assigning
2022-11-24 12:21:01 +00:00
Mark Olesen
1339c3357b ENH: general boundBox/treeBoundBox improvements
- null() static method
  * as const reference to the invertedBox with the appropriate casting.

- boundBox inflate(random)
  * refactored from treeBoundBox::extend, but allows in-place modification

- boundBox::hexFaces() instead of boundBox::faces
  * rarely used, but avoids confusion with treeBoundBox::faces
    and reuses hexCell face definitions without code duplication

- boundBox::hexCorners() for corner points corresponding to a hexCell.
  Can also be accessed from a treeBoundBox without ambiguity with
  points(), which could be hex corners (boundBox) or octant corners
  (treeBoundBox)

- boundBox::add with pairs of points
  * convenient (for example) when adding edges or a 'box' that has
    been extracted from a primitive mesh shape.

- declare boundBox nPoints(), nFaces(), nEdges() as per hexCell

ENH: return invertedBox instead of FatalError for empty trees

- similar to #2612

ENH: cellShape(HEX, ...) + boundBox hexCorners for block meshes

STYLE: cellModel::ref(...) instead of de-reference cellModel::ptr(...)
2022-11-24 12:21:01 +00:00
Mark Olesen
27c2cdc040 ENH: vector mag(), magSqr() methods - complementary to dist(), distSqr()
ENH: use direct access to pointHit as point(), use dist(), distSqr()

- if the pointHit has already been checked for hit(), can/should
  simply use point() noexcept access subsequently to avoid redundant
  checks. Using vector distSqr() methods provides a minor optimization
  (no itermediate temporary), but can also make for clearer code.

ENH: copy construct pointIndexHit with different index

- symmetric with constructing from a pointHit with an index

STYLE: prefer pointHit point() instead of rawPoint()
2022-11-24 12:21:01 +00:00
Mark Olesen
25e874a4f0 ENH: provide MPI native minOp, maxOp reduce multiple values
- consistent with sumOp

ENH: globalIndex with gatherNonLocal tag, and use leading dispatch tags

- useful for gather/write where the master data can be written
 separately.  Leading vs trailing dispatch tags for more similarity to
 other C++ conventions.
2022-11-15 14:00:18 +01:00
Mark Olesen
70208a7399 ENH: use returnReduceAnd(), returnReduceOr() functions
DOC: document which MPI send/recv are associated with commType
2022-11-08 16:48:08 +00:00
Mark Olesen
2202995f5c ENH: expose IntRange {begin,end}_value() methods
- end_value() corresponds to the infrequently used after() method, but
  with naming that corresponds better to iterator naming conventions.

  Eg,

     List<Type> list = ...;
     labelRange range = ...;

     std::transform
     (
         (list.data() + range.begin_value()),
         (list.data() + range.end_value()),

         outIter,
         op
     );

- promote min()/max() methods from labelRange to IntRange base class

STYLE: change timeSelector from "is-a" to "has-a" scalarRanges.
2022-10-31 18:36:15 +01:00
Mark Olesen
b145e59049 STYLE: viewFactorsGen with std::vector (reserve) instead of std::list 2022-10-26 18:04:56 +02:00
Mark Olesen
65dc440f3c COMP: silence clang -Wbitwise-instead-of-logical (triggered by boost/cgal) 2022-10-12 19:44:01 +02:00
Mark Olesen
55f5f8774b ENH: use dictionary findDict() instead of isDict() + subDict()
- avoids redundant dictionary searching

STYLE: remove dictionary lookupOrDefaultCompat wrapper

- deprecated and replaced by getOrDefaultCompat (2019-05).
  The function is usually specific to internal keyword upgrading
  (version compatibility) and unlikely to exist in any user code.
2022-10-04 15:51:26 +02:00
Mark Olesen
9d5a3a5c54 STYLE: remove duplicate dimensionSet dictionary read constructor
STYLE: make dimensionedTypes access inline noexcept
2022-10-04 15:51:26 +02:00
Mark Olesen
ee9119f436 ENH: rationalize expression string reading
- read construct from dictionary.
  Calling syntax similar to dimensionedType, dimensionedSet,...

  Replaces the older getEntry(), getOptional() static methods

- support readIfPresent
2022-10-04 15:51:26 +02:00
mattijs
c59b6db3c4 ENH: viewFactorsGen: re-enable 2D. See #2560
This reverts the v2206 behaviour so does not include
the edge-integration (2LI) optimisation - it uses
the exact same code as v2206.
2022-10-03 16:54:58 +01:00
Mark Olesen
a7ef33da6b ENH: add finite-area support to setFields (#2591)
- for example,

    defaultFieldValues
    (
        areaScalarFieldValue h 0.00014
    );

    regions
    (
        clipPlaneToFace
        {
            point  (0 0 0);
            normal (1 0 0);

            fieldValues
            (
                areaScalarFieldValue h 0.00015
            );
        }
    );

ENH: additional clipPlaneTo{Cell,Face,Point} topo sets

- less cumbersome than defining a semi-infinite bounding box
2022-09-26 18:03:23 +02:00
Mark Olesen
88061f3b28 ENH: improved argList handling of libs, functionObjects
- include -no-libs option by default, similar to '-lib',
  which makes it available to all solvers/utilities.
  Add argList allowLibs() method to query it.

- relocate with/no functionObjects logic from Time to argList
  itself as argList allowFunctionObjects()

- add libs/functionObjects override handling to decomposePar etc

ENH: report the stream relativeName for IOerrors (see c9333a5ac8)
2022-09-22 16:08:52 +02:00
Mark Olesen
47e172e6ef ENH: add internal parRun guards to some UPstream methods
- simplifies coding
  * finishedRequest(), waitRequest(), waitRequests() with parRun guards
  * nRequests() is noexcept

- more consistent use of UPstream::defaultCommsType in branching
2022-09-22 11:50:50 +02:00
mattijs
a964c364b6 ENH: viewFactorsGen: stabilise calculation. Fixes #2583 2022-09-14 13:26:05 +01:00
Mark Olesen
5218bfd721 Merge remote-tracking branch 'origin/master' into develop 2022-08-19 12:50:50 +02:00
mattijs
1e02a4ae92 ENH: faceAgglomerate: read patch-based agglomeration. Fixes #2558.
Read from optional subdictionary.
2022-08-11 11:12:55 +01:00
mattijs
c08fc5ecd9 ENH: viewFactorGen: revert to v2206 without CGAL 2022-08-04 14:59:12 +01:00
sergio
994addc543 ENH: Changing key entry name to GaussQuadTol 2022-08-04 14:59:12 +01:00
mattijs
f2f71f6847 ENH: viewFactor: compile without lib 2022-08-04 14:59:12 +01:00
sergio
c652af4b82 STY: Minor style changes 2022-08-04 14:59:12 +01:00
sergio
bfef08a89f ENH: Using globalIndex to create full triSurface 2022-08-04 14:59:12 +01:00
sergio
457979a7b7 ENH: Adding new viewFactor utility using CGAL 2022-08-04 14:59:11 +01:00
sergio
565c68f454 ENH: Adding intersection margen 2022-08-04 14:59:11 +01:00
sergio
b9507c21f9 ENH: Adding viewFactorsGenExt which uses pbrt for ray tracing 2022-08-04 14:59:11 +01:00
mattijs
c2cae92fc5 ENH: changeDictionary: support collated format. Fixes #2533 2022-08-01 15:16:28 +01:00
Mark Olesen
c4d18e97a3 ENH: additional methods for OBJstream
- write point fields
- writeLine (takes two points)
- writeFace (takes list of face loop points)
2022-07-19 11:17:51 +02:00
Mark Olesen
3d892ace29 STYLE: set readOpt(..), writeOpt(..) by parameter, not by assignment
STYLE: qualify format/version/compression with IOstreamOption not IOstream

STYLE: reduce number of lookups when scanning {fa,fv}Solution

STYLE: call IOobject::writeEndDivider as static
2022-07-19 11:17:47 +02:00
Kutalmis Bercin
de21a6bc0e BUG: setTurbulenceFields: update processor boundaries (fixes #2527) 2022-07-04 13:34:13 +01:00
Andrew Heather
7792501a01 RELEASE: Updated headers for v2206 2022-06-24 15:41:02 +01:00
sergio
ddb3e394ec ENH: functionObjects: rearrange the location of phaseSystemModels function objects
phaseSystemModels function objects are relocated within
functionObjects in order to enable broader usage.

ENH: multiphaseInterHtcModel: new heatTransferCoeff function object model
COMP: createExternalCoupledPatchGeometry: add new dependencies
COMP: alphaContactAngle: avoid duplicate entries between multiphaseEuler and reactingEuler
TUT: damBreak4Phase: rename alphaContactAngle as multiphaseEuler::alphaContactAngle
2022-06-21 09:30:02 +01:00
sergio
9a80d0d5ef ENH: thermoTools: new library for thermophysics tools
thermoTools is a relocation of various existing tools:

- src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/
- src/semiPermeableBaffle/derivedFvPatchFields/
- src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/

ENH: Allwmake: reordering various compilation steps

Co-authored-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2022-06-21 09:29:13 +01:00
sergio
c8538ee49e ENH: Adding iterative solver to S2S equations
ENH: Adding report after matrix smoothing
2022-06-15 12:25:58 +00:00
Kutalmis Bercin
a371f1792b ENH: setTurbulenceFields: new automatic initialisation method for turbulence fields 2022-06-14 13:21:53 +00:00
Mark Olesen
cc47a37ed1 ENH: add external surface handling to meshedSurfRef (#2505)
- previously just handled surface components
- move/scale mesh points (copy)

STYLE: pass in dummy faces/points to writer

STYLE: use tensor is_identity()
2022-06-03 17:26:38 +02:00