Skip to content
Snippets Groups Projects
meshOctreeCubeBasic.H 4.2 KiB
Newer Older
  • Learn to ignore specific revisions
  • Franjo's avatar
    Franjo committed
    /*---------------------------------------------------------------------------*\
      =========                 |
      \\      /  F ield         | cfMesh: A library for mesh generation
       \\    /   O peration     |
        \\  /    A nd           | Author: Franjo Juretic (franjo.juretic@c-fields.com)
         \\/     M anipulation  | Copyright (C) Creative Fields, Ltd.
    -------------------------------------------------------------------------------
    License
    
        This file is part of OpenFOAM.
    
    Franjo's avatar
    Franjo committed
    
    
        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 3 of the License, or
        (at your option) any later version.
    
    Franjo's avatar
    Franjo committed
    
    
        OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    
    Franjo's avatar
    Franjo committed
        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, see <http://www.gnu.org/licenses/>.
    
    Franjo's avatar
    Franjo committed
    
    Class
    
        Foam::Module::meshOctreeCubeBasic
    
    Franjo's avatar
    Franjo committed
    
    Description
        A cube stores information needed for mesh generation
    
    SourceFiles
        meshOctreeCubeBasic.C
    
    \*---------------------------------------------------------------------------*/
    
    #ifndef meshOctreeCubeBasic_H
    #define meshOctreeCubeBasic_H
    
    #include "meshOctreeCubeCoordinates.H"
    #include "contiguous.H"
    
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    namespace Foam
    {
    
    class meshOctreeCubeBasic;
    inline Ostream& operator<<(Ostream&, const meshOctreeCubeBasic&);
    inline Istream& operator>>(Istream&, meshOctreeCubeBasic&);
    
    Franjo's avatar
    Franjo committed
    
    /*---------------------------------------------------------------------------*\
                         Class meshOctreeCubeBasic Declaration
    \*---------------------------------------------------------------------------*/
    
    class meshOctreeCubeBasic
    
    :
        public meshOctreeCubeCoordinates
    
    Franjo's avatar
    Franjo committed
    {
        // Private data
    
    Franjo's avatar
    Franjo committed
            //- cube type
            direction cubeType_;
    
            //- processor to which the cube belongs to
            short procNo_;
    
    
    Franjo's avatar
    Franjo committed
    public:
    
        // Constructors
    
    Franjo's avatar
    Franjo committed
            //- Null constructor
            inline meshOctreeCubeBasic();
    
            //- Construct from coordinates
            explicit inline meshOctreeCubeBasic
            (
                const meshOctreeCubeCoordinates&
            );
    
            //- Construct from coordinates and cube type
            inline meshOctreeCubeBasic
            (
                const meshOctreeCubeCoordinates& cc,
                const direction cubeType,
                const short procNo = ALLPROCS
            );
    
    
    
        //- Destructor
    
        ~meshOctreeCubeBasic() = default;
    
    Franjo's avatar
    Franjo committed
    
        // Enumerators
    
            enum typesOfCubes
            {
                UNKNOWN = 1,
                OUTSIDE = 2,
                DATA = 4,
                INSIDE = 8,
                ALLPROCS = -2,
                OTHERPROC = -3
            };
    
    
    Franjo's avatar
    Franjo committed
        // Member functions
    
    Franjo's avatar
    Franjo committed
            //- return type
            inline direction cubeType() const;
    
            //- set cube type
            inline void setCubeType(const direction);
    
            //- return processor number
            inline short procNo() const;
    
            //- set processor number
            inline void setProcNo(const short);
    
            //- return coordinates in the octree
            inline const meshOctreeCubeCoordinates& coordinates() const;
    
    
    
        // Member operators
    
    Franjo's avatar
    Franjo committed
    
            inline void operator=(const meshOctreeCubeBasic&);
    
    
    
        // Friend operators
    
    Franjo's avatar
    Franjo committed
    
    
            inline friend Ostream& operator<<
    
    Franjo's avatar
    Franjo committed
            (
                Ostream&,
                const meshOctreeCubeBasic&
            );
    
    
            inline friend Istream& operator>>
    
    Franjo's avatar
    Franjo committed
            (
                Istream&,
                meshOctreeCubeBasic&
            );
    };
    
    
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    } // End namespace Module
    
    //- Data for meshOctreeCubeBasic are contiguous
    
    Franjo's avatar
    Franjo committed
    template<>
    
    inline bool contiguous<Module::meshOctreeCubeBasic>()
    
    Franjo's avatar
    Franjo committed
        return true;
    }
    
    } // End namespace Foam
    
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    #include "meshOctreeCubeBasicI.H"
    
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    #endif
    
    // ************************************************************************* //