OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

cellMatcher.H File Reference


Detailed Description

View cellMatcher.H
License
This file is part of OpenFOAM.

OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.

OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Base class for cellshape matchers (hexMatch, prismMatch, etc.). These are
classes which given a mesh and cell number find out the orientation of
the cellShape and construct cell-vertex to mesh-vertex mapping and
cell-face to mesh-face mapping.
E.g.
    hexMatcher hex(mesh);
    cellShape shape;
    ..
    bool isHex = hex.match(cellI, shape);

Now shape is set to the correct Hex cellShape (if isHex is true)

Alternatively there is direct access to the vertex and face mapping:

    const labelList& hexVertLabels = hex.vertLabels();
    const labelList& hexFaceLabels = hex.faceLabels();
    Now
        hexVertLabels[n] is vertex label of hex vertex n
        hexFaceLabels[n] ,, face    ,,                 n
        etc.

Process of cellShape recognition consists of following steps:
- renumber vertices of cell to local vertex numbers
- construct (local to cell) addressing edge-to-faces
- construct (local to cell) addressing vertex and face to index in face
- find most unique face shape (e.g. triangle for prism)
- walk (following either vertices in face or jumping from face to other
  face) to other faces and checking face sizes.
- if nessecary try other rotations of this face
  (only nessecary for wedge, tet-wedge)
- if nessecary try other faces which most unique face shape
  (never nessecary for hex degenerates)

The whole calculation is done such that no lists are allocated during
cell checking. E.g. localFaces_ are always sized to hold max. number
of possible face vertices and a separate list is filled which holds
the actusl face sizes.

For now all hex-degenerates implemented. Numbering taken from picture in
demoGuide.

Source files

Definition in file cellMatcher.H.

Go to the source code of this file.


Namespaces

namespace  Foam

Classes

class  cellMatcher
Copyright © 2000-2007 OpenCFD Ltd