Commit Graph

48 Commits

Author SHA1 Message Date
Mark Olesen
16591012e9 ENH: add -verbose option to surface conversion, cleanup
- by default, reduce the amount of output

ENH: support default text description for -verbose option

- simplifies use in more places.
2023-05-09 19:30:57 +02:00
Mark Olesen
25bc7d65f7 STYLE: prefer REGISTER/NO_REGISTER instead of true/false for IOobject
- self-documenting
2023-03-10 14:16:32 +00:00
Mark Olesen
779a2ca084 ENH: adjust fileName methods for similarity to std::filesystem::path
- stem(), replace_name(), replace_ext(), remove_ext() etc

- string::contains() method - similar to C++23 method

  Eg,
      if (keyword.contains('/')) ...
  vs
      if (keyword.find('/') != std::string::npos) ...
2022-10-11 17:58:22 +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
f721b5344f ENH: report dictionary name actually used (for -dict option) 2020-06-02 14:29:36 +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
560c053bc8 ENH: support independent specification of surface read/write format (#1600)
- adjustments to internal handling to improve run-time addition of
  other formats (eg, with additional user library)

  For example, to write a binary STL with a '.stl' extension:

    $ surfaceMeshConvert input.obj  -write-format stlb  output.stl

  Or in a sampler,
  to specify the input type without ambiguity:

  surf
  {
      type        meshedSurface;
      surface     sampling.inp;

      fileType    starcd;
      scale       0.001;
      ...
  }

STYLE: regularize naming for input/output scaling

  * -read-scale   (compat: -scaleIn)
  * -write-scale  (compat: -scaleOut)

CONFIG: change edge/surface selection name for STARCD format

- now select as "starcd" instead of "inp" to avoid naming ambiguity
  with abaqus
2020-04-03 19:11:50 +02:00
Mark Olesen
8e27022ea2 STYLE: find(), cfind() methods instead of lookupPtr()
- coordinateSystems, DictionaryBase
2020-03-11 22:05:15 +01: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
919fa3a541 STYLE: ensure help for -dict matches its intended usage 2018-12-17 10:39:59 +01: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
f38190213c ENH: support usage descriptions for command arguments 2018-12-12 11:58:56 +01:00
Mark Olesen
496e1cd0d2 STYLE: enforce Cartesian transform (issue #1027)
- searchable surfaces
- pointToPointPlanarInterpolation
- sampled planes
- surfaceMeshConvert, surfaceMeshExport, surfaceMeshImport
2018-10-01 22:55:59 +02: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
3d608bf06a ENH: remove reliance on the Xfer class (issue #639)
This class is largely a pre-C++11 holdover. It is now possible to
simply use move construct/assignment directly.

In a few rare cases (eg, polyMesh::resetPrimitives) it has been
replaced by an autoPtr.
2018-03-05 13:28:53 +01: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
Mark Olesen
416a3790ea STYLE: prefer autoPtr::reset() to autoPtr::set()
- in most cases already checked valid() so don't need additional check
  for setting an existing pointer
2017-11-22 19:11:11 +01:00
Mark Olesen
f2ba618c19 STYLE: consistency in using argList::addArgument, argList::addOption 2017-11-22 12:54:28 +01:00
Mark Olesen
3e0e4532fd STYLE: minor adjustments to doxygen comments 2016-10-04 09:16:08 +02:00
Andrew Heather
9fbd612672 GIT: Initial state after latest Foundation merge 2016-09-20 14:49:08 +01:00
Henry Weller
1319df48d9 Rationalized Doxygen documentation of command-line options 2016-06-17 09:11:58 +01:00
Andrew Heather
efb39a8790 ENH: (further) Doxygen documentation updates for module support 2016-06-27 20:34:19 +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
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
andy
951c8436aa ENH: Applying Gijs' patch: Update header documentation for utilities 2013-02-21 10:54:34 +00:00
mattijs
9ccd5809b8 BUG: sampleDict: missing type 2012-12-05 15:21:00 +00:00
mattijs
dfa8cf417a BUG: setFields: timeSelector overrides controlDict setting
(more general: timeSelector should only be used for postprocessing utils)
2012-07-26 16:55:25 +01:00
Henry
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
Henry
c3cb632c24 Documentation: converted javadoc @ to LaTeX style \ in Doxygen code docs 2011-02-08 18:22:00 +00: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
Mark Olesen
12837a67d5 ENH: add ZoneMesh::findIndices() method
STYLE: use findIndices instead of findAll for coordinateSystems
2010-07-26 13:18:59 +02:00
Mark Olesen
147fa2a75d STYLE: add notes to some (most) command-line options
- mapFields and splitMeshRegions need more clarification
2010-04-27 10:50:15 +02:00
Mark Olesen
d29c438657 STYLE: use url for FSF license instead of postal address, switch to GPL v3 2010-03-29 14:07:56 +02:00
Mark Olesen
689d4b2860 ENH: provide operator[] for accessing argList options.
- operator[] with label -> get args at index
- operator[] with word  -> get named option
2010-02-17 11:43:42 +01:00
Mark Olesen
d857d671ac STYLE: use new argList argRead() method and operator[] for cleaner code.
- deprecate argList::additionalArgs() method and remove uses of it
2010-02-16 17:57:49 +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
d1295da31f adjust solvers and utilities to use new argList methods
- also drop various unused time options from src/OpenFOAM/include
2009-05-19 20:21:50 +02:00
Mark Olesen
6a3d9effa0 fixed typo in surface utils 2009-04-17 11:16:44 +02:00
Mark Olesen
ffd9bb08a8 OSspecific: altered file tests
- removed the previously added fileName type(), isDir(), isFile() methods.

- added optional bool parameter to isFile() function to explicitly
  enable/disable the check for gzip files.

- fixed minor bugginess where the default usage of isFile() would result in
  false positive matches.

- be slightly more stringent and use isDir() and isFile() instead of
  exists() function when we actually know the expected type.
2009-02-06 10:25:41 +01:00
Mark Olesen
3aba0e28ff surfMesh, surfaceRegistry re-working 2009-02-05 16:12:35 +01:00
Mark Olesen
a4d0094e48 added surfaceMeshImport, surfaceMeshExport 2009-02-05 00:08:24 +01:00