Commit Graph

57 Commits

Author SHA1 Message Date
Mark Olesen
13352861c8 ENH: improve consistency in handling of global IOobjects (#3045)
- replace typeGlobal() global function with is_globalIOobject
  traits for more consistent and easier overriding.

- relocate typeFilePath() global function as a member of IOobject
  for consistency with typeHeaderOk.

BUG: faSchemes, fvSchemes not marked as global file types

- caused issues with collated
2023-12-07 17:42:25 +01:00
Mark Olesen
5eebc75845 ENH: improved UPstream gather/scatter functionality
- added UPstream::allGatherValues() with a direct call to MPI_Allgather.
  This enables possible benefit from a variety of internal algorithms
  and simplifies the caller

    Old:
        labelList nPerProc
        (
            UPstream::listGatherValues<label>(patch_.size(), myComm)
        );
        Pstream::broadcast(nPerProc, myComm);

    New:

        const labelList nPerProc
        (
            UPstream::allGatherValues<label>(patch_.size(), myComm)
        );

- Pstream::allGatherList uses MPI_Allgather for contiguous values
  instead of the hand-rolled tree walking involved with
  gatherList/scatterList.

-
- simplified the calling parameters for mpiGather/mpiScatter.

  Since send/recv data types are identical, the send/recv count
  is also always identical. Eliminates the possibility of any
  discrepancies.

  Since this is a low-level call, it does not affect much code.
  Currently just Foam::profilingPstream and a UPstream internal.

BUG: call to MPI_Allgather had hard-coded MPI_BYTE (not the data type)

- a latent bug since it is currently only passed char data anyhow
2023-05-22 17:18:35 +02:00
Mark Olesen
8e32db2b5f STYLE: more explicit use of REGISTER when storing fields
ENH: add phaseScopedName convenience method

- unites IOobject::scopedName + phasePropertyName
2023-05-09 19:30:57 +02: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
473e14418a ENH: more consistent use of broadcast, combineReduce etc.
- broadcast           : (replaces scatter)
  - combineReduce       == combineGather + broadcast
  - listCombineReduce   == listCombineGather + broadcast
  - mapCombineReduce    == mapCombineGather + broadcast
  - allGatherList       == gatherList + scatterList

  Before settling on a more consistent naming convention,
  some intermediate namings were used in OpenFOAM-v2206:

    - combineReduce       (2206: combineAllGather)
    - listCombineReduce   (2206: listCombineAllGather)
    - mapCombineReduce    (2206: mapCombineAllGather)
2022-11-08 16:48:08 +00:00
Mark Olesen
d38de84d21 ENH: bundle Pstream:: AllGather methods
- bundles frequently used 'gather/scatter' patterns more consistently.

  - combineAllGather     -> combineGather + broadcast
  - listCombineAllGather -> listCombineGather + broadcast
  - mapCombineAllGather  -> mapCombineGather + broadcast
  - allGatherList        -> gatherList + scatterList
  - reduce               -> gather + broadcast (ie, allreduce)

- The allGatherList currently wraps gatherList/scatterList, but may be
  replaced with a different algorithm in the future.

STYLE: PstreamCombineReduceOps.H is mostly unneeded now
2022-03-31 15:56:04 +02:00
Mark Olesen
af8161925b ENH: use mpi gather for list values in a few places
- avoid gatherList/scatterList when value are only need on master
2022-03-04 17:49:23 +00:00
Mark Olesen
b62437081e ENH: support optional fallback content for IOdictionary 2021-04-26 17:09:38 +02:00
Mark Olesen
b060378dca ENH: improve consistency of fileName handling windows/non-windows (#2057)
- wrap command-line retrieval of fileName with an implicit validate.

  Instead of this:
      fileName input(args[1]);
      fileName other(args["someopt"]);

  Now use this:
      auto input = args.get<fileName>(1);
      auto other = args.get<fileName>("someopt");

  which adds a fileName::validate on the inputs

  Because of how it is implemented, it will automatically also apply
  to argList getOrDefault<fileName>, readIfPresent<fileName> etc.

- adjust fileName::validate and clean to handle backslash conversion.
  This makes it easier to ensure that path names arising from MS-Windows
  are consistently handled internally.

- dictionarySearch: now check for initial '/' directly instead of
  relying on fileName isAbsolute(), which now does more things

BREAKING: remove fileName::clean() const method

- relying on const/non-const to control the behaviour (inplace change
  or return a copy) is too fragile and the const version was
  almost never used.

  Replace:
      fileName sanitized = constPath.clean();

  With:
      fileName sanitized(constPath);
      sanitized.clean());

STYLE: test empty() instead of comparing with fileName::null
2021-04-19 16:33:42 +00:00
Mark Olesen
9a2a22a03a ENH: provide setter methods for IOobject read/write options etc.
- simplifies local toggling.

- centralize fileModification static variables into IOobject.
  They were previously scattered between IOobject and regIOobject
2021-03-17 15:10:00 +01:00
Mark Olesen
9c7aa9727a ENH: add UPstream::parRun(const bool)
- slightly neater code when disabling/restoring parallel state

  New
      const bool oldParRun = Pstream::parRun(false);
      ...
      Pstream::parRun(oldParRun);

  Old
      const bool oldParRun = Pstream::parRun();
      Pstream::parRun() = false;
      ...
      Pstream::parRun() = oldParRun;
2020-10-12 12:51:22 +02:00
Mark Olesen
31b172217c ENH: support predicate checks for argList (similar to dictionary methods)
- Favour use of argList methods that are more similar to dictionary
  method names with the aim of reducing the cognitive load.

  * Silently deprecate two-parameter get() method in favour of the
    more familiar getOrDefault.
  * Silently deprecate opt() method in favour of get()

  These may be verbosely deprecated in future versions.
2020-06-02 13:51:18 +02:00
Mark Olesen
1310e85225 ENH: support 'get()' for retrieving argList options
- previously only had 'opt<..>()' for options, but 'get<..>()'
  provides more similarity with dictionary methods.
  The 'opt<..>()' method is retained.
2019-11-26 21:07:11 +01:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
Mark Olesen
beefee48d4 COMP: adjust compilation order with updated interdependencies
- Eg, with surface writers now in surfMesh, there are fewer libraries
  depending on conversion and sampling.

COMP: regularize linkage ordering and avoid some implicit linkage (#1238)
2019-04-28 14:44:33 +02:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
29a5793b5b STYLE: argList::opt method instead of the longer argList::lookupOrDefault
- also replaced a few instances of readIfPresent with opt<> for
  constant values.
2018-12-12 12:10:39 +01:00
Mark Olesen
68ec561df8 STYLE: add usage notes to more utilities and solvers 2018-12-11 15:25:27 +01:00
Mark Olesen
3cf177e759 Work-package-09 geometric constraint 2018-11-08 20:50:47 +00:00
Mark Olesen
88e5334a9f ENH: IOobject::selectIO helper method
- centralizes IOobject handling and treatment of alternative locations.
  If an alternative file location is specified, it will be used instead.

- provide decompositionMethod::canonicalName instead of using
  "decomposeParDict" in various places.
2018-08-02 17:39:17 +02:00
Mark Olesen
cb919a6c41 ENH: tag some options as 'advanced' (only shown with -help-full)
General:
    * -roots, -hostRoots, -fileHandler

Specific:
    * -to <coordinateSystem> -from <coordinateSystem>

- Display -help-compat when compatibility or ignored options are available

STYLE: capitalization of options text
2018-07-31 11:54:15 +02:00
Mark Olesen
345a2a42f1 ENH: simplify method names for reading argList options and arguments
- use succincter method names that more closely resemble dictionary
  and HashTable method names. This improves method name consistency
  between classes and also requires less typing effort:

    args.found(optName)        vs.  args.optionFound(optName)
    args.readIfPresent(..)     vs.  args.optionReadIfPresent(..)
    ...
    args.opt<scalar>(optName)  vs.  args.optionRead<scalar>(optName)
    args.read<scalar>(index)   vs.  args.argRead<scalar>(index)

- the older method names forms have been retained for code compatibility,
  but are now deprecated
2018-01-08 15:35:18 +01:00
mattijs
abb332df6d BUG: surfaceRedistributePar: hang in collated. See #686. 2017-12-28 12:45:49 +00:00
Mark Olesen
f2ba618c19 STYLE: consistency in using argList::addArgument, argList::addOption 2017-11-22 12:54:28 +01:00
Mark Olesen
139edb2468 ENH: add input surface scaling (issue #514)
- surfaceFeatureExtract
  * dictionary "scale" entry

- triSurface
- triSurfaceLoader
  * optional scaleFactor on reading

- surfaceAdd
- surfaceBooleanFeatures
- surfaceClean
- surfaceCoarsen
  * scale option

- surfaceTransformPoints, transformPoints
  * scale option as scalar or vector quantity
2017-08-14 09:18:15 +02:00
Mark Olesen
3814762785 ENH: relocate triSurface classes into surfMesh library (issue #294)
- simplifies organization, includes, linkage etc.
2017-05-18 10:42:05 +02:00
Mark Olesen
58fad3ab79 BUG: snappyHexMesh with -decomposeParDict option (issue #265)
- only occurs in combination with distributedTriSurfaceMesh in snappy.

- workaround similar to that previously used for surfaceRedistributePar
  (issue #60).

Minor adjustment of incompressible motorBike tutorial to detect use of
distributedTriSurfaceMesh.
2016-11-24 12:02:11 +01:00
Mark Olesen
55ed6ec776 STYLE: use MUST_READ consistently for decomposeParDict
- there was a slight mix of MUST_READ and MUST_READ_IF_MODIFIED
  but with no obvious code to handle runtime modified values
  of the decomposition, or how this works with alternative
  dictionaries.
2016-11-24 11:26:03 +01:00
Mark Olesen
8b4dfe24f1 Merge remote-tracking branch 'origin/decomposeParDict' into develop 2016-11-19 15:34:36 +01:00
Mark Olesen
52d0289ee1 BUG: resolve some decomposeParDict problems (issues #60, #265).
- Cleanup/centralize handling of -decomposeParDict by relocating
  common code into argList. Ensures that all processes receive
  identical information about the -decomposeParDict opton.

- Only use alternative decomposeParDict for simpleFoam/motorBike
  tutorial so that this will be included in the test loop for snappy.

- Added Mattijs' fix for surfaceRedistributePar.
2016-10-25 18:19:19 +02:00
Andrew Heather
9fbd612672 GIT: Initial state after latest Foundation merge 2016-09-20 14:49:08 +01:00
Henry Weller
450728ea84 Standardized cell, patch, face and processor loop index names 2016-04-25 12:00:53 +01:00
Andrew Heather
efb39a8790 ENH: (further) Doxygen documentation updates for module support 2016-06-27 20:34:19 +01:00
andy
fd9d801e2d GIT: Initial commit after latest foundation merge 2016-04-25 11:40:48 +01:00
mattijs
9e3ce4ec7f Merge branch 'master' of develop.openfoam.com:Development/OpenFOAM-plus into feature-shared-file
Conflicts:
	applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C
	applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/pointFile/pointFile.C
	applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundary.C
	applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C
	applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/vtkPV4Foam/vtkPV4FoamUpdateInfo.C
	applications/utilities/postProcessing/turbulence/createTurbulenceFields/createTurbulenceFields.C
	applications/utilities/postProcessing/velocityField/Co/Co.C
	applications/utilities/postProcessing/velocityField/Pe/Pe.C
	applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C
	applications/utilities/preProcessing/changeDictionary/changeDictionary.C
	applications/utilities/preProcessing/setFields/setFields.C
	applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C
	applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C
	applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C
	applications/utilities/surface/surfaceRedistributePar/surfaceRedistributePar.C
	src/OpenFOAM/db/IOobject/IOobject.C
	src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.C
	src/OpenFOAM/db/IOobjects/IOField/IOField.C
	src/OpenFOAM/db/IOobjects/IOList/IOList.C
	src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.C
	src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C
	src/OpenFOAM/db/Time/findInstance.C
	src/OpenFOAM/db/regIOobject/regIOobject.C
	src/OpenFOAM/db/regIOobject/regIOobjectI.H
	src/OpenFOAM/db/regIOobject/regIOobjectRead.C
	src/OpenFOAM/db/regIOobject/regIOobjectWrite.C
	src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/IOmapDistribute.C
	src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C
	src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C
	src/dynamicMesh/fvMeshDistribute/IOmapDistributePolyMesh.C
	src/dynamicMesh/motionSolver/componentDisplacement/componentDisplacementMotionSolver.C
	src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8Data.C
	src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/refinementHistory.C
	src/dynamicMesh/polyTopoChange/polyTopoChanger/polyTopoChanger.C
	src/edgeMesh/edgeMeshFormats/edgeMesh/edgeMeshFormat.C
	src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/extendedEdgeMeshFormat/extendedEdgeMeshFormat.C
	src/edgeMesh/extendedEdgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C
	src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.C
	src/fvMotionSolver/pointPatchFields/derived/uniformInterpolatedDisplacement/uniformInterpolatedDisplacementPointPatchVectorField.C
	src/lagrangian/basic/Cloud/CloudIO.C
	src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C
	src/postProcessing/foamCalcFunctions/basic/addSubtract/addSubtract.C
	src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C
	src/postProcessing/functionObjects/field/readFields/readFieldsTemplates.C
	src/thermophysicalModels/radiation/radiationModels/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C
	src/triSurface/triSurface/surfacePatch/surfacePatchIOList.C
2016-01-25 16:29:04 +00:00
mattijs
e424059208 ENH: glboal file handling: initial commit
Moved file path handling to regIOobject and made it type specific so
now every object can have its own rules. Examples:
- faceZones are now processor local (and don't search up anymore)
- timeStampMaster is now no longer hardcoded inside IOdictionary
  (e.g. uniformDimensionedFields support it as well)
- the distributedTriSurfaceMesh is properly processor-local; no need
  for fileModificationChecking manipulation.
2016-01-25 13:03:15 +00:00
Henry Weller
56fa7c0906 Update code to use the simpler C++11 template syntax removing spaces between closing ">"s 2016-01-10 22:41:16 +00:00
mattijs
ca834a93c8 BUG: triSurfaceMesh: operate non-parallel so not do a reduction of points
Also redistributePar:
- recognise going from undecomposed to many
- read on master only
2015-12-14 09:36:52 +00:00
mattijs
8a724e82a9 Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-dev-OpenCFD into develop 2015-12-09 11:02:22 +00:00
mattijs
6510e5ce49 ENH: surfaceRedistributePar: switch off file modification checking. 2015-12-09 10:53:17 +00:00
Andrew Heather
3f55f752fc GIT: Resolve conflict with upstream merge from Foundation 2015-12-07 17:07:20 +00:00
Henry Weller
e2ef006b91 applications: Update ...ErrorIn -> ...ErrorInFunction
Avoids the clutter and maintenance effort associated with providing the
function signature string.
2015-11-10 17:53:31 +00:00
mattijs
c6a3d4f3c5 ENH: surface: various updates to the surface utilities
surfaceBooleanFeatures: use CGAL for intersection
surfaceCheck: write surface zoning as vtk file
surfaceInflate: new utility to offset surface
surfacePatch: replacement for surfaceAutoPatch. Also does cutting of surfaces.
2015-11-10 15:04:32 +00:00
andy
951c8436aa ENH: Applying Gijs' patch: Update header documentation for utilities 2013-02-21 10:54:34 +00:00
Henry
5682987dc7 Updated headers 2012-04-17 16:49:03 +01:00
Henry
cd51a5eea3 Consistency: Changed exponent FORTRAN style 'E' to C style 'e' 2012-04-17 16:48:27 +01:00
Henry
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
andy
eaef8d482b STYLE: Updated 1991 start copyright year to 2004 2011-01-14 16:08:00 +00: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