Commit Graph

1424 Commits

Author SHA1 Message Date
Henry Weller
009203188f blockMesh: New experimental support for projecting block face point to geometric surfaces
For example, to mesh a sphere with a single block the geometry is defined in the
blockMeshDict as a searchableSurface:

    geometry
    {
        sphere
        {
            type searchableSphere;
            centre (0 0 0);
            radius 1;
        }
    }

The vertices, block topology and curved edges are defined in the usual
way, for example

    v 0.5773502;
    mv -0.5773502;

    a 0.7071067;
    ma -0.7071067;

    vertices
    (
        ($mv $mv $mv)
        ( $v $mv $mv)
        ( $v  $v $mv)
        ($mv  $v $mv)
        ($mv $mv  $v)
        ( $v $mv  $v)
        ( $v  $v  $v)
        ($mv  $v  $v)
    );

    blocks
    (
        hex (0 1 2 3 4 5 6 7) (10 10 10) simpleGrading (1 1 1)
    );

    edges
    (
        arc 0 1 (0 $ma $ma)
        arc 2 3 (0 $a $ma)
        arc 6 7 (0 $a $a)
        arc 4 5 (0 $ma $a)

        arc 0 3 ($ma 0 $ma)
        arc 1 2 ($a 0 $ma)
        arc 5 6 ($a 0 $a)
        arc 4 7 ($ma 0 $a)

        arc 0 4 ($ma $ma 0)
        arc 1 5 ($a $ma 0)
        arc 2 6 ($a $a 0)
        arc 3 7 ($ma $a 0)
    );

which will produce a mesh in which the block edges conform to the sphere
but the faces of the block lie somewhere between the original cube and
the spherical surface which is a consequence of the edge-based
transfinite interpolation.

Now the projection of the block faces to the geometry specified above
can also be specified:

    faces
    (
        project (0 4 7 3) sphere
        project (2 6 5 1) sphere
        project (1 5 4 0) sphere
        project (3 7 6 2) sphere
        project (0 3 2 1) sphere
        project (4 5 6 7) sphere
    );

which produces a mesh that actually conforms to the sphere.

See OpenFOAM-dev/tutorials/mesh/blockMesh/sphere

This functionality is experimental and will undergo further development
and generalization in the future to support more complex surfaces,
feature edge specification and extraction etc.  Please get involved if
you would like to see blockMesh become a more flexible block-structured
mesher.

Henry G. Weller, CFD Direct.
2016-10-13 15:05:24 +01:00
Henry Weller
eb5e2c923c snappyHexMesh: Added support for scotch redistribution
Requires scotch-6.?.?
2016-10-12 16:28:26 +01:00
Henry Weller
9c2892cd82 Removed #define __STDC_LIMIT_MACROS needed for C++ < 11
See http://bugs.openfoam.org/view.php?id=1474
2016-10-04 08:08:42 +01:00
Henry Weller
4bdf712b35 triangle storage: Return barycentric coordinates as FixedList instead of List
Patch contributed by Mattijs Janssens
Resolves bug-report http://bugs.openfoam.org/view.php?id=2278
2016-09-30 16:22:55 +01:00
Henry Weller
025791559d blockMesh: Added printing of the block description to the '-help' output
blockMesh -help

Usage: blockMesh [OPTIONS]
options:
  -blockTopology    write block edges and centres as .obj files
  -case <dir>       specify alternate case directory, default is the cwd
  -dict <file>      specify alternative dictionary for the blockMesh description
  -noFunctionObjects
                    do not execute functionObjects
  -region <name>    specify alternative mesh region
  -srcDoc           display source code in browser
  -doc              display application documentation in browser
  -help             print the usage

Block description

  For a given block, the correspondence between the ordering of
  vertex labels and face labels is shown below.
  For vertex numbering in the sequence 0 to 7 (block, centre):
    faces 0 (f0) and 1 are left and right, respectively;
    faces 2 and 3 are bottom and top;
    and faces 4 and 5 are front the back:

           4 ---- 5
      f3   |\     |\   f5
      |    | 7 ---- 6   \
      |    0 |--- 1 |    \
      |     \|     \|    f4
      f2     3 ---- 2

            f0 ----- f1

Using: OpenFOAM-dev (see www.OpenFOAM.org)
Build: dev-dc59c63351e7
2016-09-25 20:05:12 +01:00
Henry Weller
c5630e5cb1 Corrected nullptr collateral damage
Resolves bug-report http://bugs.openfoam.org/view.php?id=2181
2016-08-08 15:38:53 +01:00
Henry Weller
58f905ff70 C++11: Replaced the C NULL with the safer C++11 nullptr
Requires gcc version 4.7 or higher
2016-08-05 17:19:38 +01:00
Henry Weller
aa30d0e7d5 checkMesh: Added option to write sets
- the checking for point-connected multiple-regions now also writes the
    conflicting points to a pointSet
  - with the -writeSets option it now also reconstructs & writes pointSets
2016-07-22 16:53:49 +01:00
Henry Weller
ab84d6941f Updated template formatting to C++11 2016-07-12 20:03:29 +01:00
Henry Weller
08bd802b42 checkGeometry, moveDynamicMesh: Convert processor IDs to 'List<label>'
Resolves bug-report http://bugs.openfoam.org/view.php?id=2140
2016-07-09 20:47:06 +01:00
Henry Weller
9e1486fee5 checkMesh, moveDynamicMesh: option -checkAMI writes the reconstructed AMI weights
Patch contributed by Mattijs Janssens
2016-07-05 15:35:16 +01:00
Henry Weller
579f559aa7 Correct handling of the CGAL version variable for makeCGAL in ThirdParty 2016-07-01 16:22:28 +01:00
Henry Weller
f768402255 Simplified the handling of the CGAL installation 2016-07-01 14:53:28 +01:00
Henry Weller
dea6a3c6e8 wmake/Allwmake: Completed support for targetType 'objects'
Patch contributed by Mattijs Janssens
2016-06-24 15:25:11 +01:00
Henry Weller
6b6a73d9b2 applications/utilities/mesh/generation/Allwmake: Build foamyHexMesh if FOAMY_HEX_MESH is set 2016-06-24 08:48:29 +01:00
Henry Weller
96a038f281 foamyMesh: Simplify support for system CGAL installation 2016-06-21 19:47:46 +01:00
Henry Weller
3990302a54 Updated and simplified the Doxygen documentation 2016-06-20 21:20:28 +01:00
Henry Weller
d04ea965e2 Update headers 2016-06-20 09:39:47 +01:00
Henry Weller
b16756115a Remove/replace deprecated functions and classes 2016-06-20 09:39:02 +01:00
Henry Weller
6a53ed41ba Doxygen documentation: Standardized the 'See also' heading 2016-06-17 17:31:34 +01:00
Henry Weller
1319df48d9 Rationalized Doxygen documentation of command-line options 2016-06-17 09:11:58 +01:00
Henry Weller
e2336fefd3 checkMesh: Added writing of faceSets and cellSets containing errors
In parallel the sets are reconstructed. e.g.

mpirun -np 6 checkMesh -parallel -allGeometry -allTopology -writeSets vtk

will create a postProcessing/ folder with the vtk files of the
(reconstructed) faceSets and cellSets.

Also improved analysis of disconnected regions now also checks for point
connectivity with is useful for detecting if AMI regions have duplicate
points.

Patch contributed by Mattijs Janssens
2016-06-12 20:51:07 +01:00
Chris Greenshields
f5ed8e777a autoRefineMesh: corrected source file and executable names 2016-06-10 14:05:30 +01:00
Henry Weller
0aa4d70b9d applications/utilities: FOAM_USER_APPBIN -> FOAM_APPBIN 2016-06-10 10:35:57 +01:00
Henry Weller
1be96a546c Added forward declaration of friend functions 2016-05-30 13:21:29 +01:00
Henry Weller
d438da1eb7 ACMI: Corrected conservation issue
Patch contributed by Mattijs Janssens
Resolves bug-report http://bugs.openfoam.org/view.php?id=2057
2016-05-30 08:29:11 +01:00
Henry Weller
3f608e95e6 Added forward declaration of friend functions 2016-05-30 08:28:35 +01:00
Henry Weller
35dba48db1 createBaffles: filter zero-sized patches
Resolves patch request http://bugs.openfoam.org/view.php?id=2103
Patch contributed by Mattijs Janssens
2016-05-29 22:51:15 +01:00
Henry Weller
67de20df25 Further standardization of loop index naming: pointI -> pointi, patchI -> patchi 2016-05-18 21:20:42 +01:00
Henry Weller
ce0cd35185 Patches contributed by Mattijs Janssens:
splitMeshRegions: handle flipping of faces for surface fields

subsetMesh: subset dimensionedFields

decomposePar: use run-time selection of decomposition constraints. Used to
    keep cells on particular processors. See the decomposeParDict in

$FOAM_UTILITIES/parallel/decomposePar:
  - preserveBaffles: keep baffle faces on same processor
  - preserveFaceZones: keep faceZones owner and neighbour on same processor
  - preservePatches: keep owner and neighbour on same processor. Note: not
    suitable for cyclicAMI since these are not coupled on the patch level
  - singleProcessorFaceSets: keep complete faceSet on a single processor
  - refinementHistory: keep cells originating from a single cell on the
    same processor.

decomposePar: clean up decomposition of refinement data from snappyHexMesh

reconstructPar: reconstruct refinement data (refineHexMesh, snappyHexMesh)

reconstructParMesh: reconstruct refinement data (refineHexMesh, snappyHexMesh)

redistributePar:
  - corrected mapping surfaceFields
  - adding processor patches in order consistent with decomposePar

argList: check that slaves are running same version as master

fvMeshSubset: move to dynamicMesh library

fvMeshDistribute:
  - support for mapping dimensionedFields
  - corrected mapping of surfaceFields

parallel routines: allow parallel running on single processor

Field: support for
  - distributed mapping
  - mapping with flipping

mapDistribute: support for flipping

AMIInterpolation: avoid constructing localPoints
2016-05-15 16:36:48 +01:00
Henry Weller
274d1df8a4 snappyHexMesh: Automatically remove zero-sized patches
All patches are preserved if the 'keepPatches' option is set true.
Patch contributed by Mattijs Janssens
2016-05-13 17:47:38 +01:00
Henry Weller
bd52e35f77 checkMesh: Updated the closed-ness test for ACMI to use FV
Patch contributed by Mattijs Janssens
Resolves bug-report http://bugs.openfoam.org/view.php?id=2088
2016-05-13 16:23:02 +01:00
Henry Weller
6164c2f262 Standardized the naming of functions which control the writing of fields etc.
to have the prefix 'write' rather than 'output'

So outputTime() -> writeTime()

but 'outputTime()' is still supported for backward-compatibility.

Also removed the redundant secondary-writing functionality from Time
which has been superseded by the 'writeRegisteredObject' functionObject.
2016-05-12 17:38:01 +01:00
Henry Weller
81f31acbb3 Updated headers 2016-04-30 21:53:19 +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
5df2b96489 GeometricField::internalField() -> GeometricField::internalFieldRef()
Non-const access to the internal field now obtained from a specifically
named access function consistent with the new names for non-canst access
to the boundary field boundaryFieldRef() and dimensioned internal field
dimensionedInternalFieldRef().

See also commit 22f4ad32b1
2016-04-30 14:25:21 +01:00
Henry Weller
ea5401c770 GeometricField::GeometricBoundaryField -> GeometricField::Boundary
When the GeometricBoundaryField template class was originally written it
was a separate class in the Foam namespace rather than a sub-class of
GeometricField as it is now.  Without loss of clarity and simplifying
code which access the boundary field of GeometricFields it is better
that GeometricBoundaryField be renamed Boundary for consistency with the
new naming convention for the type of the dimensioned internal field:
Internal, see commit 4a57b9be2e

This is a very simple text substitution change which can be applied to
any code which compiles with the OpenFOAM-dev libraries.
2016-04-28 07:22:02 +01:00
Henry Weller
4a57b9be2e GeometricField: Rationalized and simplified access to the dimensioned internal field
Given that the type of the dimensioned internal field is encapsulated in
the GeometricField class the name need not include "Field"; the type
name is "Internal" so

volScalarField::DimensionedInternalField -> volScalarField::Internal

In addition to the ".dimensionedInternalField()" access function the
simpler "()" de-reference operator is also provided to greatly simplify
FV equation source term expressions which need not evaluate boundary
conditions.  To demonstrate this kEpsilon.C has been updated to use
dimensioned internal field expressions in the k and epsilon equation
source terms.
2016-04-27 21:32:45 +01:00
Henry Weller
450728ea84 Standardized cell, patch, face and processor loop index names 2016-04-25 12:00:53 +01:00
Henry Weller
43beb06018 Standardized cell, patch and face loop index names 2016-04-25 10:28:32 +01:00
Henry Weller
2d5ff31649 boundaryField() -> boundaryFieldRef() 2016-04-24 22:07:37 +01:00
Henry Weller
5f13806591 Updated headers 2016-04-21 21:07:28 +01:00
Henry Weller
0aaf154100 utilities/mesh/manipulation: Rationalized "End" message 2016-04-21 21:06:45 +01:00
Henry Weller
d57464a99d transformPoints: Added "End" message
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2059
2016-04-21 21:05:47 +01:00
Henry Weller
8c6fa81eba vector::zero -> Zero 2016-04-16 18:34:41 +01:00
Henry Weller
a9b8bb13e0 applications/.*/Allwmake: Updated to support "stop on 1st error"
Patch contributed by Bruno Santos
Resolved bug-report http://www.openfoam.org/mantisbt/view.php?id=2042
2016-04-04 09:03:40 +01:00
Henry Weller
88bd912374 Pstream: optimisation of data exchange
Contributed by Mattijs Janssens.

1. Any non-blocking data exchange needs to know in advance the sizes to
   receive so it can size the buffer.  For "halo" exchanges this is not
   a problem since the sizes are known in advance but or all other data
   exchanges these sizes need to be exchanged in advance.

   This was previously done by having all processors send the sizes of data to
   send to the master and send it back such that all processors
   - had the same information
   - all could work out who was sending what to where and hence what needed to
     be received.

   This is now changed such that we only send the size to the
   destination processor (instead of to all as previously). This means
   that
   - the list of sizes to send is now of size nProcs v.s. nProcs*nProcs before
   - we cut out the route to the master and back by using a native MPI
     call

   It causes a small change to the API of exchange and PstreamBuffers -
   they now return the sizes of the local buffers only (a labelList) and
   not the sizes of the buffers on all processors (labelListList)

2. Reversing the order of the way in which the sending is done when
   scattering information from the master processor to the other
   processors. This is done in a tree like fashion. Each processor has a
   set of processors to receive from/ send to. When receiving it will
   first receive from the processors with the least amount of
   sub-processors (i.e. the ones which return first). When sending it
   needs to do the opposite: start sending to the processor with the
   most amount of sub-tree since this is the critical path.
2016-04-02 18:32:11 +01:00
Henry Weller
730f89dc9d Use Zero rather than pTraits<Type>::zero unless a static typed '0' is required 2016-03-22 17:46:52 +00:00
Henry Weller
cb65ba71d7 Made all template declarations consistent using 'class' rather than 'typename' 2016-03-22 15:02:55 +00:00
Henry Weller
ea6eac35a6 etc/config.sh/CGAL: updated
Patch contributed by Bruno Santos:
 - "etc/config.sh/CGAL":
   - Indented the contents of the recently added if block.
   - Added comment about using system versions.
   - Library paths are now only added if the respective version is not "boost-system" and "cgal-system".

 - "src/renumber/Allwmake":
   It now relies on the previous file to get the version for
   Boost (the same way as in "makeCGAL"). This is so that it will also
   build "SloanRenumber" if "boost_version" is set to "boost-system".

 - "applications/utilities/mesh/generation/Allwmake":
   It now also relies on the script "config.sh/CGAL" to get the
   version for CGAL. If "cgal_version" is set to "cgal-system", it
   will now also build "foamy*Mesh" utilities and respective
   libraries.

Resolves report http://www.openfoam.org/mantisbt/view.php?id=1232
2016-03-22 07:58:38 +00:00