Commit Graph

86 Commits

Author SHA1 Message Date
57a4460d08 surfaceTransformPoints, transformPoints: documented transformations in '-help' option 2021-08-14 17:42:51 +01:00
b9123328fb typeIOobject: Template typed form of IOobject for type-checked object file and header reading
used to check the existence of and open an object file, read and check the
header without constructing the object.

'typeIOobject' operates in an equivalent and consistent manner to 'regIOobject'
but the type information is provided by the template argument rather than via
virtual functions for which the derived object would need to be constructed,
which is the case for 'regIOobject'.

'typeIOobject' replaces the previous separate functions 'typeHeaderOk' and
'typeFilePath' with a single consistent interface.
2021-08-12 10:12:03 +01:00
cc92330253 IOobject, regIOobject: rationalised handling of paths for global and local objects
now all path functions in 'IOobject' are either templated on the type or require a
'globalFile' argument to specify if the type is case global e.g. 'IOdictionary' or
decomposed in parallel, e.g. almost everything else.

The 'global()' and 'globalFile()' virtual functions are now in 'regIOobject'
abstract base-class and overridden as required by derived classes.  The path
functions using 'global()' and 'globalFile()' to differentiate between global
and processor local objects are now also in 'regIOobject' rather than 'IOobject'
to ensure the path returned is absolutely consistent with the type.

Unfortunately there is still potential for unexpected IO behaviour inconsistent
with the global/local nature of the type due to the 'fileOperation' classes
searching the processor directory for case global objects before searching the
case directory.  This approach appears to be a work-around for incomplete
integration with and rationalisation of 'IOobject' but with the changes above it
is no longer necessary.  Unfortunately this "up" searching is baked-in at a low
level and mixed-up with various complex ways to pick the processor directory
name out of the object path and will take some unravelling but this work will
undertaken as time allows.
2021-08-09 21:23:12 +01:00
25d274736f MeshZones: Renamed ZoneMesh to MeshZones 2021-07-14 14:10:28 +01:00
dae463dbd8 TimePaths: Rationalised path methods 2021-06-24 14:20:00 +01:00
01494463d0 FoamFile: 'version' entry is now optional, defaulting to 2.0
The FOAM file format has not changed from version 2.0 in many years and so there
is no longer a need for the 'version' entry in the FoamFile header to be
required and to reduce unnecessary clutter it is now optional, defaulting to the
current file format 2.0.
2021-06-23 20:50:10 +01:00
3baba56734 dynamicMesh: Renamed boundaryMesh to repatchMesh and removed unused code 2021-06-22 09:48:36 +01:00
ee777e4083 Standardise on British spelling: -ize -> -ise
OpenFOAM is predominantly written in Britain with British spelling conventions
so -ise is preferred to -ize.
2021-06-01 19:11:58 +01:00
55f751641e Standardise on British spelling: initialize -> initialise
OpenFOAM is predominantly written in Britain with British spelling conventions
so -ise is preferred to -ize.
2021-06-01 14:51:48 +01:00
845d5b16e3 transformPoints: Generalised to apply a sequence of transformations
This makes usage of transformPoints the same as for
surfaceTransformPoints. Transformations are supplied as a string and are
applied in sequence.

Usage
    transformPoints "\<transformations\>" [OPTION]

    Supported transformations:
      - "translate=<translation vector>"
        Translational transformation by given vector
      - "rotate=(<n1 vector> <n2 vector>)"
        Rotational transformation from unit vector n1 to n2
      - "Rx=<angle [deg] about x-axis>"
        Rotational transformation by given angle about x-axis
      - "Ry=<angle [deg] about y-axis>"
        Rotational transformation by given angle about y-axis
      - "Rz=<angle [deg] about z-axis>"
        Rotational transformation by given angle about z-axis
      - "Ra=<axis vector> <angle [deg] about axis>"
        Rotational transformation by given angle about given axis
      - "scale=<x-y-z scaling vector>"
        Anisotropic scaling by the given vector in the x, y, z
        coordinate directions

    Example usage:
        transformPoints \
            "translate=(-0.05 -0.05 0), \
            Rz=45, \
            translate=(0.05 0.05 0)"
2021-05-11 10:06:45 +01:00
0d679d926a surfaceTransformPoints: Updated to use the new transformer class
Description
    Transform (translate, rotate, scale) a surface.

Usage
    \b surfaceTransformPoints "\<transformations\>" \<input\> \<output\>
    Supported transformations:
      - \par translate=<translation vector>
        Translational transformation by given vector
      - \par rotate=(\<n1 vector\> \<n2 vector\>)
        Rotational transformation from unit vector n1 to n2
      - \par Rx=\<angle [deg] about x-axis\>
        Rotational transformation by given angle about x-axis
      - \par Ry=\<angle [deg] about y-axis\>
        Rotational transformation by given angle about y-axis
      - \par Rz=\<angle [deg] about z-axis\>
        Rotational transformation by given angle about z-axis
      - \par Ra=\<axis vector\> \<angle [deg] about axis\>
        Rotational transformation by given angle about given axis
      - \par scale=\<x-y-z scaling vector\>
        Anisotropic scaling by the given vector in the x, y, z
        coordinate directions

    Example usage:
        surfaceTransformPoints \
            "translate=(-0.586 0 -0.156), \
            Ry=3.485, \
            translate=(0.586 0 0.156)" \
            constant/geometry/w3_orig.stl constant/geometry/w3.stl
2021-03-29 16:14:48 +01:00
45dca30c51 surfaceTransformPoints: Generalised to apply a sequence of transformations
The transformation sequence is specified like a substitution string used by

Description
    Transform (translate, rotate, scale) a surface.

    The rollPitchYaw option takes three angles (degrees):
    - roll (rotation about x) followed by
    - pitch (rotation about y) followed by
    - yaw (rotation about z)

    The yawPitchRoll does yaw followed by pitch followed by roll.

Usage
    \b surfaceTransformPoints "\<transformations\>" \<input\> \<output\>

    Example usage:
        surfaceTransformPoints \
            "translate=(-0.586 0 -0.156), \
            rollPitchYaw=(0 -3.485 0), \
            translate=(0.586 0 0.156)" \
            constant/geometry/w3_orig.stl constant/geometry/w3.stl
2021-03-28 13:36:50 +01:00
a0ca9a745e applications/utilities/surface: Updated handling of -dict option 2021-03-05 14:43:35 +00:00
0e13649996 surfaceFeatures: Consistent plane specification for subsetting
Specifying a plane with which to subset feature edges is now done using
the same dictionary syntax used elsewhere in OpenFOAM. For example, in
system/surfaceFeaturesDict:

    subsetFeatures
    {
        // Include only edges that intersect the plane
        plane
        {
            planeType       pointAndNormal;
            point           (0 0 0);
            normal          (1 0 0);
        }

        ...
    }
2021-02-18 09:09:53 +00:00
66c62e9296 searchableSurface: Renamed geometry directory triSurface -> geometry
Originally the only supported geometry specification were triangulated surfaces,
hence the name of the directory: constant/triSurface, however now that other
surface specifications are supported and provided it is much more logical that
the directory is named accordingly: constant/geometry.  All tutorial and
template cases have been updated.

Note that backward compatibility is provided such that if the constant/geometry
directory does not exist but constant/triSurface does then the geometry files
are read from there.
2021-02-04 13:51:48 +00:00
fe5e403cf9 surfaceMeshConvert,surfaceMeshConvert,surfaceMeshImport: Updated coordinateSystem support 2020-09-29 16:10:06 +01:00
fbe98c6e84 surfaceFeatures: Added optional input of maximum angle between opposite points considered close
To handle the additional optional specification for the closeness calculation
these settings are now is a sub-dictionary of surfaceFeaturesDict, e.g.

    closeness
    {
        // Output the closeness of surface elements to other surface elements.
        faceCloseness           no;

        // Output the closeness of surface points to other surface elements.
        pointCloseness          yes;

        // Optional maximum angle between opposite points considered close
        internalAngleTolerance  80;
        externalAngleTolerance  80;
    }
2020-03-16 19:29:28 +00:00
66397001c2 regionModels::kinematicSingleLayer: Rationalised and simplified the handling of the film surface and wall velocities 2020-03-06 15:49:59 +00:00
acdbf45534 Moved OBJstream into src/fileFormats/obj 2020-01-29 17:17:36 +00:00
84759ee0b8 sampledSurface: Added support for writing surfaces in binary format
by specifying

    writeFormat binary;

in the sampledSurface dictionary.
2020-01-29 12:42:05 +00:00
3631f13a98 sampledSurface/writers: Removed unnecessary "verbose" argument 2020-01-28 22:46:00 +00:00
c8a1c95b06 IOobject: Added localPath and localObjectPath member functions
For many information and diagnostic messages the absolute path of the object is
not required and the local path relative to the current case is sufficient; the
new localObjectPath() member function of IOobject provides a convenient way of
printing this.
2020-01-24 11:52:45 +00:00
d38a680dae surfaceFeatures: Separated "closness" option into "faceCloseness" and "pointCloseness"
For complex geometries the calculation of surface face and point "closeness" can
be quite time consuming and usually only one or other is required; the new
options allow the user to specify which should be calculated and written.
2020-01-18 23:04:49 +00:00
05966af49c surfaceFeatureExtract: Removed deprecated utility, replaced by surfaceFeatures 2020-01-18 23:04:00 +00:00
5eaf74c3a4 dictionary scalar lookup: simplified syntax using the type templated lookup function
Replaced
    readScalar(dict.lookup("name"))
with
    dict.lookup<scalar>("name")
2019-11-27 14:56:32 +00:00
30bea84fac C++11 conformance and consistency: Added "move" constructors and assignment operators to OpenFOAM containers
Replaced all uses of complex Xfer class with C++11 "move" constructors and
assignment operators.  Removed the now redundant Xfer class.

This substantial changes improves consistency between OpenFOAM and the C++11 STL
containers and algorithms, reduces memory allocation and copy overhead when
returning containers from functions and simplifies maintenance of the core
libraries significantly.
2019-05-25 17:40:39 +01:00
ba61e39119 surfaceFind: Report true distance to faces 2019-02-04 09:18:36 +00:00
e750f2555c src/OpenFOAM: Rationalised use of enumerations by using the C++11 scoped form
for Time, treeBoundBox, indexedOctree, dynamicIndexedOctree, CirculatorBase
2018-08-31 16:11:16 +01:00
8662f99ac1 Corrected typos in comments
Resolves bug-report https://bugs.openfoam.org/view.php?id=3017
2018-07-31 17:11:21 +01:00
fdbf3c134f Rationalized dictionary and configuration file headers 2018-07-09 15:40:05 +01:00
bf54ab67e1 Updated OpenFOAM Foundation web-link in headers 2018-07-06 21:42:54 +01:00
89f1053f82 Code style: Fixed formatting of banners 2018-06-19 12:01:50 +01:00
786318cabd utilities: Centralized annotated utility dictionaries to etc/caseDicts/annotated 2018-06-11 17:20:08 +01:00
2e1825a50f utilities: Remove unused case related options 2018-06-11 15:21:34 +01:00
88a218ce84 treeBoundBox: Removed unecessary randomisation
Tree bound boxes are expanded asymmetrically to reduce the liklihood of
octree faces aliging with mesh faces and edges. The asymmetry is now
generated using hard-coded irrational numbers, rather than using a
random generator.

The asymmetry was effectively already hard coded. The random numbers are
only pseudo random, so the same numbers were being applied to the bound
boxes every time. This change simply removes the overhead of creating
the generator, and also gets rid of some duplicated code.
2018-06-11 11:01:11 +01:00
7a0155f5a9 Added Description to surfaceFeatures and surfaceFeatureExtract 2018-05-31 09:03:52 +01:00
aea8dc0516 tutorials: Updated to use surfaceFeatures rather than the deprecated surfaceFeatureExtract 2018-05-29 19:18:53 +01:00
87e32ab499 Code style: Updated line comments to start with a space
//This is a comment   ->   // This is a comment
2018-05-01 11:57:50 +01:00
aaed6290d0 surfaceFeatures: New version of surfaceFeatureExtract with simplied controls
Surfaces are specified as a list and the controls applied to each, e.g. in the
rhoPimpleFoam/RAS/annularThermalMixer tutorial:

    surfaces
    (
        "AMI.obj"
        "shaft.obj"
        "wall.obj"
        "statorBlades.obj"
        "rotorBlades.obj"
    );

    includedAngle   150;  // Identifes a feature when angle
                      // between faces < includedAngle
    trimFeatures
    {
        minElem         10;   // minimum edges within a feature
    }

    writeObj        yes;  // writes out _edgeMesh.obj files to view features

If different controls are required for different surfaces multiple
sub-dictionaries can be used:

    AMIsurfaces
    {
        surfaces
        (
            "AMI.obj"
        );

        includedAngle   140;  // Identifes a feature when angle
                          // between faces < includedAngle
        trimFeatures
        {
            minElem         8;   // minimum edges within a feature
        }

        writeObj        yes;  // writes out _edgeMesh.obj files to view features
    }

    otherSurfaces
    {
        surfaces
        (
            "shaft.obj"
            "wall.obj"
            "statorBlades.obj"
            "rotorBlades.obj"
        );

        includedAngle   150;  // Identifes a feature when angle
                          // between faces < includedAngle
        trimFeatures
        {
            minElem         10;   // minimum edges within a feature
        }

        writeObj        yes;  // writes out _edgeMesh.obj files to view features
    }

Existing feature edge files corresponding to particular surfaces can be specified using
the "files" association list:

    surfaces
    (
        "AMI.obj"
        "shaft.obj"
        "wall.obj"
        "statorBlades.obj"
        "rotorBlades.obj"
    );

    files
    (
        "AMI.obj" "constant/triSurface/AMI.obj.eMesh";
    );

    includedAngle   150;  // Identifes a feature when angle
                      // between faces < includedAngle
    trimFeatures
    {
        minElem         10;   // minimum edges within a feature
    }

    writeObj        yes;  // writes out _edgeMesh.obj files to view features
2018-04-20 15:23:28 +01:00
1b0e09faf0 surfaceFeatureExtract: Moved feature edge editing functions to the surfaceFeatures class 2018-04-17 20:38:15 +01:00
ded92d5951 surfaceFeatureExtract: Updated included files 2018-04-17 00:22:03 +01:00
2730fbad5c surfaceFeatureExtract: Further refactoring to move the extract surface closeness functionality
to triSurfaceMesh
2018-04-17 00:16:12 +01:00
ed5f44e7e8 surfaceFeatureExtract: Refactoring surface closeness functions 2018-04-12 07:42:25 +01:00
3e1ab675f6 surfaceFeatureExtract: Refactored pointIndexHitList functionality into corresponding core classes 2018-04-10 23:08:56 +01:00
a908847b9c surfaceFeatureExtract: Refactored core line and edge functions corresponding classes 2018-04-10 21:52:44 +01:00
21d5267b6f surfaceFeatureExtract: Refactor core functionality into core classes and libraries 2018-04-06 20:15:28 +01:00
43b35a5173 triangle, triFace, face: Rationalized normal for consistency with the rest of OpenFOAM
For compatibility with all the mesh and related classes in OpenFOAM The 'normal'
function of the 'triangle', 'triFace' and 'face' classes now returns the unit
normal vector rather than the vector area which is now provided by the 'area'
function.
2018-04-06 13:57:36 +01:00
1073607cb0 Corrected spelling and typo's in comments
Resolves bug report https://bugs.openfoam.org/view.php?id=2845
2018-03-05 20:14:28 +00:00
fe1fade8cb Corrected spelling in comments
Resolves bug-report https://bugs.openfoam.org/view.php?id=2844
2018-02-13 20:39:56 +00:00
0248dd81e3 Corrected comments: inbetween -> in between 2018-02-13 16:38:41 +00:00