OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

rotatedBoxToCell.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::rotatedBoxToCell
00027 
00028 Description
00029     A topoSetSource to select cells based on cell centres inside
00030     rotated/skewed box (parallelopiped?).
00031 
00032     Box defined as origin and i,j,k vectors.
00033     E.g. box rotated 45 degrees around z-axis with sizes sqrt(0.2^2+0.2^2)
00034     (and extra large, 200 in z direction):
00035     @verbatim
00036        origin   ( 0.4 0.4 -100);
00037        i        ( 0.2 0.2    0);
00038        j        (-0.2 0.2    0);
00039        k        ( 0.0 0.0  100);
00040     @endverbatim
00041 
00042 SourceFiles
00043     rotatedBoxToCell.C
00044 
00045 \*---------------------------------------------------------------------------*/
00046 
00047 #ifndef rotatedBoxToCell_H
00048 #define rotatedBoxToCell_H
00049 
00050 #include "topoSetSource.H"
00051 #include "treeBoundBox.H"
00052 
00053 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00054 
00055 namespace Foam
00056 {
00057 
00058 /*---------------------------------------------------------------------------*\
00059                      Class rotatedBoxToCell Declaration
00060 \*---------------------------------------------------------------------------*/
00061 
00062 class rotatedBoxToCell
00063 :
00064     public topoSetSource
00065 {
00066 
00067     // Private data
00068 
00069         //- Add usage string
00070         static addToUsageTable usage_;
00071 
00072 
00073         //- skewed box
00074         const vector origin_;
00075         const vector i_;
00076         const vector j_;
00077         const vector k_;
00078 
00079 
00080     // Private Member Functions
00081 
00082         void combine(topoSet& set, const bool add) const;
00083 
00084 
00085 public:
00086 
00087     //- Runtime type information
00088     TypeName("rotatedBoxToCell");
00089 
00090     // Constructors
00091 
00092         //- Construct from components
00093         rotatedBoxToCell
00094         (
00095             const polyMesh& mesh,
00096             const vector& origin,
00097             const vector& i,
00098             const vector& j,
00099             const vector& k
00100         );
00101 
00102         //- Construct from dictionary
00103         rotatedBoxToCell(const polyMesh& mesh, const dictionary& dict);
00104 
00105         //- Construct from Istream
00106         rotatedBoxToCell(const polyMesh& mesh, Istream&);
00107 
00108 
00109     // Destructor
00110 
00111         virtual ~rotatedBoxToCell();
00112 
00113 
00114     // Member Functions
00115 
00116         virtual void applyToSet
00117         (
00118             const topoSetSource::setAction action,
00119             topoSet&
00120         ) const;
00121 
00122 };
00123 
00124 
00125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00126 
00127 } // End namespace Foam
00128 
00129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00130 
00131 #endif
00132 
00133 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd