FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::rotatedBoxToCell
00026 
00027 Description
00028     A topoSetSource to select cells based on cell centres inside
00029     rotated/skewed box (parallelopiped?).
00030 
00031     Box defined as origin and i,j,k vectors.
00032     E.g. box rotated 45 degrees around z-axis with sizes sqrt(0.2^2+0.2^2)
00033     (and extra large, 200 in z direction):
00034     @verbatim
00035        origin   ( 0.4 0.4 -100);
00036        i        ( 0.2 0.2    0);
00037        j        (-0.2 0.2    0);
00038        k        ( 0.0 0.0  100);
00039     @endverbatim
00040 
00041 SourceFiles
00042     rotatedBoxToCell.C
00043 
00044 \*---------------------------------------------------------------------------*/
00045 
00046 #ifndef rotatedBoxToCell_H
00047 #define rotatedBoxToCell_H
00048 
00049 #include <meshTools/topoSetSource.H>
00050 #include <meshTools/treeBoundBox.H>
00051 
00052 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00053 
00054 namespace Foam
00055 {
00056 
00057 /*---------------------------------------------------------------------------*\
00058                      Class rotatedBoxToCell Declaration
00059 \*---------------------------------------------------------------------------*/
00060 
00061 class rotatedBoxToCell
00062 :
00063     public topoSetSource
00064 {
00065 
00066     // Private data
00067 
00068         //- Add usage string
00069         static addToUsageTable usage_;
00070 
00071 
00072         //- skewed box
00073         const vector origin_;
00074         const vector i_;
00075         const vector j_;
00076         const vector k_;
00077 
00078 
00079     // Private Member Functions
00080 
00081         void combine(topoSet& set, const bool add) const;
00082 
00083 
00084 public:
00085 
00086     //- Runtime type information
00087     TypeName("rotatedBoxToCell");
00088 
00089     // Constructors
00090 
00091         //- Construct from components
00092         rotatedBoxToCell
00093         (
00094             const polyMesh& mesh,
00095             const vector& origin,
00096             const vector& i,
00097             const vector& j,
00098             const vector& k
00099         );
00100 
00101         //- Construct from dictionary
00102         rotatedBoxToCell(const polyMesh& mesh, const dictionary& dict);
00103 
00104         //- Construct from Istream
00105         rotatedBoxToCell(const polyMesh& mesh, Istream&);
00106 
00107 
00108     // Destructor
00109 
00110         virtual ~rotatedBoxToCell();
00111 
00112 
00113     // Member Functions
00114 
00115         virtual void applyToSet
00116         (
00117             const topoSetSource::setAction action,
00118             topoSet&
00119         ) const;
00120 
00121 };
00122 
00123 
00124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00125 
00126 } // End namespace Foam
00127 
00128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00129 
00130 #endif
00131 
00132 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines